diff options
author | Volker Lendecke <vlendec@samba.org> | 2007-01-05 11:31:28 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:16:55 -0500 |
commit | 84da72860e3912cfd8be45919360c0931b8bbbda (patch) | |
tree | 890563bb376b479ec805586f19ddefc14f198ccc /source3 | |
parent | f933a9abc2ea9d2dc417b9ba500bbe730be3c1aa (diff) | |
download | samba-84da72860e3912cfd8be45919360c0931b8bbbda.tar.gz samba-84da72860e3912cfd8be45919360c0931b8bbbda.tar.bz2 samba-84da72860e3912cfd8be45919360c0931b8bbbda.zip |
r20542: Make close_remove_share_mode retun NTSTATUS. Not that anybody cares yet...
(This used to be commit c8995771531caa4ec9bcaef2c29b11ee7d8e49e6)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/smbd/close.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/source3/smbd/close.c b/source3/smbd/close.c index 7e91208313..fe5e5eccf2 100644 --- a/source3/smbd/close.c +++ b/source3/smbd/close.c @@ -144,12 +144,14 @@ static void notify_deferred_opens(struct share_mode_lock *lck) Deal with removing a share mode on last close. ****************************************************************************/ -static int close_remove_share_mode(files_struct *fsp, enum file_close_type close_type) +static NTSTATUS close_remove_share_mode(files_struct *fsp, + enum file_close_type close_type) { connection_struct *conn = fsp->conn; BOOL delete_file = False; struct share_mode_lock *lck; SMB_STRUCT_STAT sbuf; + NTSTATUS status = NT_STATUS_OK; /* * Lock the share entries, and determine if we should delete @@ -162,7 +164,7 @@ static int close_remove_share_mode(files_struct *fsp, enum file_close_type close if (lck == NULL) { DEBUG(0, ("close_remove_share_mode: Could not get share mode " "lock for file %s\n", fsp->fsp_name)); - return EINVAL; + return NT_STATUS_INVALID_PARAMETER; } if (!del_share_mode(lck, fsp)) { @@ -197,7 +199,7 @@ static int close_remove_share_mode(files_struct *fsp, enum file_close_type close || !delete_file || (lck->delete_token == NULL)) { TALLOC_FREE(lck); - return 0; + return NT_STATUS_OK; } /* @@ -227,6 +229,9 @@ static int close_remove_share_mode(files_struct *fsp, enum file_close_type close DEBUG(5,("close_remove_share_mode: file %s. Delete on close " "was set and stat failed with error %s\n", fsp->fsp_name, strerror(errno) )); + /* + * Don't save the errno here, we ignore this error + */ goto done; } @@ -239,6 +244,9 @@ static int close_remove_share_mode(files_struct *fsp, enum file_close_type close fsp->fsp_name, (unsigned int)fsp->dev, (double)fsp->inode, (unsigned int)sbuf.st_dev, (double)sbuf.st_ino )); + /* + * Don't save the errno here, we ignore this error + */ goto done; } @@ -254,9 +262,13 @@ static int close_remove_share_mode(files_struct *fsp, enum file_close_type close DEBUG(5,("close_remove_share_mode: file %s. Delete on close " "was set and unlink failed with error %s\n", fsp->fsp_name, strerror(errno) )); + + status = map_nt_error_from_unix(errno); goto done; } + status = NT_STATUS_FILE_DELETED; + done: /* unbecome user. */ pop_sec_ctx(); @@ -264,7 +276,7 @@ static int close_remove_share_mode(files_struct *fsp, enum file_close_type close process_pending_change_notify_queue((time_t)0); TALLOC_FREE(lck); - return 0; + return status; } /**************************************************************************** |