summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-11-17 03:19:17 +0000
committerJeremy Allison <jra@samba.org>2001-11-17 03:19:17 +0000
commit02eda2e251e6dcb6e0db5cd9c3cbcfa765f3d630 (patch)
tree6b0d7c4ae77b1673510672c49a0c68b844283f35 /source3/smbd
parent355124adaf512eeb04a0badfcfefbce63f31f023 (diff)
downloadsamba-02eda2e251e6dcb6e0db5cd9c3cbcfa765f3d630.tar.gz
samba-02eda2e251e6dcb6e0db5cd9c3cbcfa765f3d630.tar.bz2
samba-02eda2e251e6dcb6e0db5cd9c3cbcfa765f3d630.zip
Tidyups when I was doing the big merge...
Jeremy. (This used to be commit 9148bb9eaa67de60c3b0b4709a9c05a840c20c66)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/reply.c28
-rw-r--r--source3/smbd/trans2.c1
2 files changed, 17 insertions, 12 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index dce5873ba8..1412905cdf 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -1164,10 +1164,8 @@ int reply_ctemp(connection_struct *conn, char *inbuf,char *outbuf, int dum_size,
/* close fd from smb_mkstemp() */
close(tmpfd);
- if (!fsp)
- {
- if((errno == ENOENT) && bad_path)
- {
+ if (!fsp) {
+ if((errno == ENOENT) && bad_path) {
unix_ERR_class = ERRDOS;
unix_ERR_code = ERRbadpath;
}
@@ -1208,28 +1206,33 @@ int reply_ctemp(connection_struct *conn, char *inbuf,char *outbuf, int dum_size,
return(outsize);
}
-
/*******************************************************************
-check if a user is allowed to delete a file
+ Check if a user is allowed to delete a file.
********************************************************************/
+
static NTSTATUS can_delete(char *fname,connection_struct *conn, int dirtype)
{
SMB_STRUCT_STAT sbuf;
int fmode;
- if (!CAN_WRITE(conn)) return NT_STATUS_MEDIA_WRITE_PROTECTED;
+ if (!CAN_WRITE(conn))
+ return NT_STATUS_MEDIA_WRITE_PROTECTED;
- if (conn->vfs_ops.lstat(conn,fname,&sbuf) != 0) return NT_STATUS_OBJECT_NAME_NOT_FOUND;
+ if (conn->vfs_ops.lstat(conn,fname,&sbuf) != 0)
+ return NT_STATUS_OBJECT_NAME_NOT_FOUND;
fmode = dos_mode(conn,fname,&sbuf);
- if (fmode & aDIR) return NT_STATUS_FILE_IS_A_DIRECTORY;
+ if (fmode & aDIR)
+ return NT_STATUS_FILE_IS_A_DIRECTORY;
if (!lp_delete_readonly(SNUM(conn))) {
- if (fmode & aRONLY) return NT_STATUS_CANNOT_DELETE;
+ if (fmode & aRONLY)
+ return NT_STATUS_CANNOT_DELETE;
}
if ((fmode & ~dirtype) & (aHIDDEN | aSYSTEM))
return NT_STATUS_CANNOT_DELETE;
- if (!check_file_sharing(conn,fname,False)) return NT_STATUS_SHARING_VIOLATION;
+ if (!check_file_sharing(conn,fname,False))
+ return NT_STATUS_SHARING_VIOLATION;
return NT_STATUS_OK;
}
@@ -2685,7 +2688,8 @@ int reply_mkdir(connection_struct *conn, char *inbuf,char *outbuf, int dum_size,
srvstr_pull(inbuf, directory, smb_buf(inbuf) + 1, sizeof(directory), -1, STR_TERMINATE);
status = mkdir_internal(conn, directory);
- if (!NT_STATUS_IS_OK(status)) return ERROR_NT(status);
+ if (!NT_STATUS_IS_OK(status))
+ return ERROR_NT(status);
outsize = set_message(outbuf,0,0,True);
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index bf0be4c111..404d88260e 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -1913,6 +1913,7 @@ static int call_trans2setfilepathinfo(connection_struct *conn,
break;
}
+ case SMB_FILE_END_OF_FILE_INFORMATION:
case SMB_SET_FILE_END_OF_FILE_INFO:
{
size = IVAL(pdata,0);