diff options
author | Jeremy Allison <jra@samba.org> | 2002-06-07 01:39:26 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-06-07 01:39:26 +0000 |
commit | 19c0588ea1613ae251e83c7064747fb4d0f61f04 (patch) | |
tree | b7312ffa29d39d524971ee84b43826a29fb9c92a /source3 | |
parent | 651efe158a506b9dfe2af7ecd8db8034848abac0 (diff) | |
download | samba-19c0588ea1613ae251e83c7064747fb4d0f61f04.tar.gz samba-19c0588ea1613ae251e83c7064747fb4d0f61f04.tar.bz2 samba-19c0588ea1613ae251e83c7064747fb4d0f61f04.zip |
Allow sd_len to be zero on NT_TRANSACT_CREATE but not for set sd (helps
Novell client).
Jeremy.
(This used to be commit ac49fd297acf27384a5e133a5fd7a32c1ba27ca6)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/smbd/nttrans.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index 06d2b6d24e..1642de0fba 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -941,9 +941,9 @@ static BOOL set_sd(files_struct *fsp, char *data, uint32 sd_len, uint32 security BOOL ret; if (sd_len == 0) { - *pdef_class = ERRDOS; - *pdef_code = ERRbadaccess; - return False; + *pdef_class = 0; + *pdef_code = 0; + return True; } /* @@ -1256,7 +1256,7 @@ static int call_nt_transact_create(connection_struct *conn, * Now try and apply the desired SD. */ - if (!set_sd( fsp, data, sd_len, ALL_SECURITY_INFORMATION, &error_class, &error_code)) { + if (sd_len && !set_sd( fsp, data, sd_len, ALL_SECURITY_INFORMATION, &error_class, &error_code)) { close_file(fsp,False); restore_case_semantics(file_attributes); return ERROR_DOS(error_class, error_code); @@ -1591,6 +1591,9 @@ static int call_nt_transact_set_security_desc(connection_struct *conn, DEBUG(3,("call_nt_transact_set_security_desc: file = %s, sent 0x%x\n", fsp->fsp_name, (unsigned int)security_info_sent )); + if (total_data_count == 0) + return ERROR_DOS(ERRDOS, ERRbadaccess); + if (!set_sd( fsp, data, total_data_count, security_info_sent, &error_class, &error_code)) return ERROR_DOS(error_class, error_code); |