svn commit: samba r16667 - in branches/SAMBA_4_0/source/libcli/raw:
.
metze at samba.org
metze at samba.org
Thu Jun 29 07:02:14 GMT 2006
Author: metze
Date: 2006-06-29 07:02:14 +0000 (Thu, 29 Jun 2006)
New Revision: 16667
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=16667
Log:
- use ndr_pull_struct_blob() to make the RAW_FILEINFO_SEC_DESC pull code
simpler
- use ndr_push_struct_blob() for RAW_SFILEINFO_SEC_DESC
metze
Modified:
branches/SAMBA_4_0/source/libcli/raw/rawfileinfo.c
branches/SAMBA_4_0/source/libcli/raw/rawsetfileinfo.c
Changeset:
Modified: branches/SAMBA_4_0/source/libcli/raw/rawfileinfo.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/raw/rawfileinfo.c 2006-06-29 06:53:44 UTC (rev 16666)
+++ branches/SAMBA_4_0/source/libcli/raw/rawfileinfo.c 2006-06-29 07:02:14 UTC (rev 16667)
@@ -244,20 +244,17 @@
return NT_STATUS_OK;
case RAW_FILEINFO_SEC_DESC: {
- struct ndr_pull *ndr;
NTSTATUS status;
- ndr = ndr_pull_init_blob(blob, mem_ctx);
- if (!ndr) {
- return NT_STATUS_NO_MEMORY;
- }
+
parms->query_secdesc.out.sd = talloc(mem_ctx, struct security_descriptor);
- if (parms->query_secdesc.out.sd == NULL) {
- return NT_STATUS_NO_MEMORY;
- }
- status = ndr_pull_security_descriptor(ndr, NDR_SCALARS|NDR_BUFFERS,
- parms->query_secdesc.out.sd);
- talloc_free(ndr);
- return status;
+ NT_STATUS_HAVE_NO_MEMORY(parms->query_secdesc.out.sd);
+
+ status = ndr_pull_struct_blob(blob, mem_ctx,
+ parms->query_secdesc.out.sd,
+ (ndr_pull_flags_fn_t)ndr_pull_security_descriptor);
+ NT_STATUS_NOT_OK_RETURN(status);
+
+ return NT_STATUS_OK;
}
default:
Modified: branches/SAMBA_4_0/source/libcli/raw/rawsetfileinfo.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/raw/rawsetfileinfo.c 2006-06-29 06:53:44 UTC (rev 16666)
+++ branches/SAMBA_4_0/source/libcli/raw/rawsetfileinfo.c 2006-06-29 07:02:14 UTC (rev 16667)
@@ -21,6 +21,7 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
+#include "librpc/gen_ndr/ndr_security.h"
/*
@@ -83,7 +84,18 @@
NEED_BLOB(4);
SIVAL(blob->data, 0, parms->mode_information.in.mode);
return True;
-
+
+ case RAW_FILEINFO_SEC_DESC: {
+ NTSTATUS status;
+
+ status = ndr_push_struct_blob(blob, mem_ctx,
+ parms->set_secdesc.in.sd,
+ (ndr_push_flags_fn_t)ndr_push_security_descriptor);
+ if (!NT_STATUS_IS_OK(status)) return False;
+
+ return True;
+ }
+
/* Unhandled levels */
case RAW_SFILEINFO_1023:
case RAW_SFILEINFO_1025:
More information about the samba-cvs
mailing list