diff options
author | Andrew Tridgell <tridge@samba.org> | 2002-04-20 07:28:46 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2002-04-20 07:28:46 +0000 |
commit | 86cf3b9f11a7ca756079ed2f9248415e13adb7f7 (patch) | |
tree | 66d593395a7cf464c883c9242bd1569af07aa415 /source3/smbd/open.c | |
parent | 5c261ce93d369d8c3901117777c3bb421178a186 (diff) | |
download | samba-86cf3b9f11a7ca756079ed2f9248415e13adb7f7.tar.gz samba-86cf3b9f11a7ca756079ed2f9248415e13adb7f7.tar.bz2 samba-86cf3b9f11a7ca756079ed2f9248415e13adb7f7.zip |
try to cope better with the take ownership operation for foreign SIDs
what we do is map to the authenticated user when the sid is unmappable
and dos filemodes are enabled
(This used to be commit b6c2ef4f54e7b42125f8c89ee5a62b0ba6b52f59)
Diffstat (limited to 'source3/smbd/open.c')
-rw-r--r-- | source3/smbd/open.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 29a854a397..f8ba1ca8d8 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -1046,7 +1046,7 @@ flags=0x%X flags2=0x%X mode=0%o returned %d\n", Open a file for for write to ensure that we can fchmod it. ****************************************************************************/ -files_struct *open_file_fchmod(connection_struct *conn, char *fname, SMB_STRUCT_STAT *psbuf) +files_struct *open_file_fchmod(connection_struct *conn, const char *fname, SMB_STRUCT_STAT *psbuf) { files_struct *fsp = NULL; BOOL fsp_open; @@ -1058,7 +1058,9 @@ files_struct *open_file_fchmod(connection_struct *conn, char *fname, SMB_STRUCT_ if(!fsp) return NULL; - fsp_open = open_file(fsp,conn,fname,psbuf,O_WRONLY,0,0); + /* note! we must use a non-zero desired access or we don't get + a real file descriptor. Oh what a twisted web we weave. */ + fsp_open = open_file(fsp,conn,fname,psbuf,O_WRONLY,0,FILE_WRITE_DATA); /* * This is not a user visible file open. |