1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-05 12:22:11 +03:00

r21777: As Stevef requested and the Apple guys agreed, make

mode_t in posix_open/posix_mkdir -> 8 bytes to match
the SET_UNIX_INFO_BASIC call. Steve is updating the
Wikki.
Jeremy.
(This used to be commit 2f1c95ac77)
This commit is contained in:
Jeremy Allison
2007-03-09 18:33:16 +00:00
committed by Gerald (Jerry) Carter
parent 10820162f1
commit 257d2e0d2a
3 changed files with 14 additions and 9 deletions

View File

@ -717,8 +717,8 @@ enum smb_whoami_flags {
/* Definition of request data block for SMB_POSIX_PATH_OPEN */ /* Definition of request data block for SMB_POSIX_PATH_OPEN */
/* /*
[4 bytes] flags (as smb_ntcreate_Flags). [4 bytes] flags (as smb_ntcreate_Flags).
[4 bytes] open_mode [4 bytes] open_mode - SMB_O_xxx flags above.
[4 bytes] mode_t - same encoding as "Standard UNIX permissions" above. [8 bytes] mode_t (permissions) - same encoding as "Standard UNIX permissions" above in SMB_SET_FILE_UNIX_BASIC.
[2 bytes] ret_info_level - optimization. Info level to be returned. [2 bytes] ret_info_level - optimization. Info level to be returned.
*/ */

View File

@ -1839,7 +1839,7 @@ static int cli_posix_open_internal(struct cli_state *cli, const char *fname, int
unsigned int param_len = 0; unsigned int param_len = 0;
uint16 setup = TRANSACT2_SETPATHINFO; uint16 setup = TRANSACT2_SETPATHINFO;
char param[sizeof(pstring)+6]; char param[sizeof(pstring)+6];
char data[14]; char data[18];
char *rparam=NULL, *rdata=NULL; char *rparam=NULL, *rdata=NULL;
char *p; char *p;
int fnum = -1; int fnum = -1;
@ -1861,9 +1861,10 @@ static int cli_posix_open_internal(struct cli_state *cli, const char *fname, int
SIVAL(p,0,0); /* No oplock. */ SIVAL(p,0,0); /* No oplock. */
SIVAL(p,4,wire_flags); SIVAL(p,4,wire_flags);
SIVAL(p,8,unix_perms_to_wire(mode)); SIVAL(p,8,unix_perms_to_wire(mode));
SSVAL(p,12,SMB_NO_INFO_LEVEL_RETURNED); /* No info level returned. */ SIVAL(p,12,0); /* Top bits of perms currently undefined. */
SSVAL(p,16,SMB_NO_INFO_LEVEL_RETURNED); /* No info level returned. */
data_len = 14; data_len = 18;
if (!cli_send_trans(cli, SMBtrans2, if (!cli_send_trans(cli, SMBtrans2,
NULL, /* name */ NULL, /* name */

View File

@ -5229,11 +5229,13 @@ static NTSTATUS smb_posix_mkdir(connection_struct *conn,
uint16 info_level_return = 0; uint16 info_level_return = 0;
char *pdata = *ppdata; char *pdata = *ppdata;
if (total_data < 10) { if (total_data < 18) {
return NT_STATUS_INVALID_PARAMETER; return NT_STATUS_INVALID_PARAMETER;
} }
raw_unixmode = IVAL(pdata,8); raw_unixmode = IVAL(pdata,8);
/* Next 4 bytes are not yet defined. */
status = unix_perms_from_wire(conn, psbuf, raw_unixmode, PERM_NEW_DIR, &unixmode); status = unix_perms_from_wire(conn, psbuf, raw_unixmode, PERM_NEW_DIR, &unixmode);
if (!NT_STATUS_IS_OK(status)) { if (!NT_STATUS_IS_OK(status)) {
return status; return status;
@ -5259,7 +5261,7 @@ static NTSTATUS smb_posix_mkdir(connection_struct *conn,
close_file(fsp, NORMAL_CLOSE); close_file(fsp, NORMAL_CLOSE);
} }
info_level_return = SVAL(pdata,12); info_level_return = SVAL(pdata,16);
if (info_level_return == SMB_QUERY_FILE_UNIX_BASIC) { if (info_level_return == SMB_QUERY_FILE_UNIX_BASIC) {
*pdata_return_size = 8 + SMB_FILE_UNIX_BASIC_SIZE; *pdata_return_size = 8 + SMB_FILE_UNIX_BASIC_SIZE;
@ -5321,7 +5323,7 @@ static NTSTATUS smb_posix_open(connection_struct *conn,
int info = 0; int info = 0;
uint16 info_level_return = 0; uint16 info_level_return = 0;
if (total_data < 14) { if (total_data < 18) {
return NT_STATUS_INVALID_PARAMETER; return NT_STATUS_INVALID_PARAMETER;
} }
@ -5373,6 +5375,8 @@ static NTSTATUS smb_posix_open(connection_struct *conn,
} }
raw_unixmode = IVAL(pdata,8); raw_unixmode = IVAL(pdata,8);
/* Next 4 bytes are not yet defined. */
status = unix_perms_from_wire(conn, status = unix_perms_from_wire(conn,
psbuf, psbuf,
raw_unixmode, raw_unixmode,
@ -5424,7 +5428,7 @@ static NTSTATUS smb_posix_open(connection_struct *conn,
extended_oplock_granted = True; extended_oplock_granted = True;
} }
info_level_return = SVAL(pdata,12); info_level_return = SVAL(pdata,16);
if (info_level_return == SMB_QUERY_FILE_UNIX_BASIC) { if (info_level_return == SMB_QUERY_FILE_UNIX_BASIC) {
*pdata_return_size = 8 + SMB_FILE_UNIX_BASIC_SIZE; *pdata_return_size = 8 + SMB_FILE_UNIX_BASIC_SIZE;