From 19c0588ea1613ae251e83c7064747fb4d0f61f04 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 7 Jun 2002 01:39:26 +0000 Subject: 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) --- source3/smbd/nttrans.c | 11 +++++++---- 1 file 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); -- cgit