r9240: - move struct security_token to the idl file, with this we can
authorStefan Metzmacher <metze@samba.org>
Thu, 11 Aug 2005 13:12:45 +0000 (13:12 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:31:37 +0000 (13:31 -0500)
  the ndr_pull/push/print functions for it in the ntacl-lsm module

- fix compiler warnings in the ldap_encode_ndr_* code

metze
(This used to be commit 83d65d0d7ed9c240ad44aa2c881c1f07212bfda4)

13 files changed:
source4/auth/auth_util.c
source4/dsdb/samdb/samdb_privilege.c
source4/libcli/ldap/ldap_ndr.c
source4/libcli/security/access_check.c
source4/libcli/security/dom_sid.c
source4/libcli/security/privilege.c
source4/libcli/security/security.h [deleted file]
source4/libcli/security/security_descriptor.c
source4/libcli/security/security_token.c
source4/librpc/idl/security.idl
source4/ntvfs/unixuid/vfs_unixuid.c
source4/utils/getntacl.c
source4/utils/ntlm_auth.c

index 433041348ec29abbc91288b68db313e490b2dbb1..a56a32d9343a01aec3ecd927364395ca493ad983 100644 (file)
@@ -25,7 +25,7 @@
 #include "includes.h"
 #include "librpc/gen_ndr/ndr_samr.h"
 #include "librpc/gen_ndr/ndr_netlogon.h"
-#include "libcli/security/security.h"
+#include "librpc/gen_ndr/ndr_security.h"
 #include "auth/auth.h"
 
 /* this default function can be used by mostly all backends
index 7560d21db519ecbae671aeecbf8462ace6ef4c0b..059d612225e290621dbb1d8ebf38f18a01239fe5 100644 (file)
@@ -21,7 +21,7 @@
 */
 
 #include "includes.h"
-#include "libcli/security/security.h"
+#include "librpc/gen_ndr/security.h"
 #include "lib/ldb/include/ldb.h"
 
 /*
@@ -35,7 +35,7 @@ static NTSTATUS samdb_privilege_setup_sid(void *samctx, TALLOC_CTX *mem_ctx,
        struct ldb_message **res = NULL;
        struct ldb_message_element *el;
        int ret, i;
-       const char *sidstr;
+       char *sidstr;
        
        *mask = 0;
 
@@ -55,7 +55,7 @@ static NTSTATUS samdb_privilege_setup_sid(void *samctx, TALLOC_CTX *mem_ctx,
        }
 
        for (i=0;i<el->num_values;i++) {
-               const char *priv_str = el->values[i].data;
+               const char *priv_str = (const char *)el->values[i].data;
                int privilege = sec_privilege_id(priv_str);
                if (privilege == -1) {
                        DEBUG(1,("Unknown privilege '%s' in samdb\n",
index bc19e49535c8395f7ef9365f70f4ee96073e68e2..0cccdbe9719ae5185a5e54be2084b3acc1307ff2 100644 (file)
@@ -29,7 +29,7 @@
 /*
   encode a NDR uint32 as a ldap filter element
 */
-const char *ldap_encode_ndr_uint32(TALLOC_CTX *mem_ctx, uint32_t value)
+char *ldap_encode_ndr_uint32(TALLOC_CTX *mem_ctx, uint32_t value)
 {
        uint8_t buf[4];
        struct ldb_val val;
@@ -42,11 +42,11 @@ const char *ldap_encode_ndr_uint32(TALLOC_CTX *mem_ctx, uint32_t value)
 /*
   encode a NDR dom_sid as a ldap filter element
 */
-const char *ldap_encode_ndr_dom_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid)
+char *ldap_encode_ndr_dom_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid)
 {
        DATA_BLOB blob;
        NTSTATUS status;
-       const char *ret;
+       char *ret;
        status = ndr_push_struct_blob(&blob, mem_ctx, sid, 
                                      (ndr_push_flags_fn_t)ndr_push_dom_sid);
        if (!NT_STATUS_IS_OK(status)) {
@@ -61,11 +61,11 @@ const char *ldap_encode_ndr_dom_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *s
 /*
   encode a NDR GUID as a ldap filter element
 */
-const char *ldap_encode_ndr_GUID(TALLOC_CTX *mem_ctx, struct GUID *guid)
+char *ldap_encode_ndr_GUID(TALLOC_CTX *mem_ctx, struct GUID *guid)
 {
        DATA_BLOB blob;
        NTSTATUS status;
-       const char *ret;
+       char *ret;
        status = ndr_push_struct_blob(&blob, mem_ctx, guid, 
                                      (ndr_push_flags_fn_t)ndr_push_GUID);
        if (!NT_STATUS_IS_OK(status)) {
index 632b9bdf325fc3755c84a93c36975bacf7157af1..c10751abce8a7ca4fdad45c2d4be624318a90f56 100644 (file)
@@ -21,7 +21,7 @@
 */
 
 #include "includes.h"
-#include "libcli/security/security.h"
+#include "librpc/gen_ndr/ndr_security.h"
 
 
 /*
index 80e481c3e4487905dfa51a96459aeb6316f883bf..f457900efc04a6c4717865ca5390ccb78de92f53 100644 (file)
@@ -22,7 +22,7 @@
 */
 
 #include "includes.h"
-#include "libcli/security/security.h"
+#include "librpc/gen_ndr/ndr_security.h"
 
 /*****************************************************************
  Compare the auth portion of two sids.
index ed98e9ce325ffc6eb48db0f38ac0c999994435d1..aa01dc2c65712a49b68a7913c1dbeb035b12547a 100644 (file)
@@ -21,7 +21,7 @@
 */
 
 #include "includes.h"
-#include "libcli/security/security.h"
+#include "librpc/gen_ndr/ndr_security.h"
 
 
 static const struct {
diff --git a/source4/libcli/security/security.h b/source4/libcli/security/security.h
deleted file mode 100644 (file)
index b11d10f..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/* 
-   Unix SMB/CIFS implementation.
-
-   security utility functions
-
-   Copyright (C) Andrew Tridgell               2004
-      
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
-   
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-   
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*/
-
-#ifndef _SAMBA_SECURITY_H
-#define _SAMBA_SECURITY_H
-
-#include "librpc/gen_ndr/ndr_security.h"
-
-struct security_token {
-       struct dom_sid *user_sid;
-       struct dom_sid *group_sid;
-       uint32_t num_sids;
-       struct dom_sid **sids;
-       uint64_t privilege_mask;
-};
-
-#endif /* _SAMBA_SECURITY_H */
index d1978fd795c7b4f83fbdafc3362d111c9897a531..703abf7970159b3c83df7d4f7846f84c5dc94134 100644 (file)
@@ -21,7 +21,7 @@
 */
 
 #include "includes.h"
-#include "libcli/security/security.h"
+#include "librpc/gen_ndr/ndr_security.h"
 
 /*
   return a blank security descriptor (no owners, dacl or sacl)
index 663c4f28bce1cbc1d9bef55f7691299df8e35b7d..ea1fae0c33e3dee56236444260481eb1255533f6 100644 (file)
@@ -22,7 +22,7 @@
 */
 
 #include "includes.h"
-#include "libcli/security/security.h"
+#include "librpc/gen_ndr/ndr_security.h"
 
 /*
   return a blank security token
index c183f8872489209dd2536445c0e277b142bfb250..dd502b178f3ba103ffb0fcc9f4dac448c89e0ad1 100644 (file)
@@ -317,4 +317,12 @@ interface security
                [range(0,0x40000),value(ndr_size_security_descriptor(sd))] uint32 sd_size;
                [subcontext(4)] security_descriptor *sd;
        } sec_desc_buf;
+
+       typedef [public] struct {
+               dom_sid *user_sid;
+               dom_sid *group_sid;
+               uint32 num_sids;
+               [size_is(num_sids)] dom_sid *sids[*];
+               udlong privilege_mask;
+       } security_token;
 }
index d724e7ceb2be9ec64bf4947206bc52875bd3d22c..41b1d7965df2eb0a7cdb1f4ad8b6cb8e2b8fa277 100644 (file)
@@ -25,7 +25,7 @@
 #include "system/filesys.h"
 #include "system/passwd.h"
 #include "auth/auth.h"
-#include "libcli/security/security.h"
+#include "librpc/gen_ndr/ndr_security.h"
 #include "smb_server/smb_server.h"
 
 struct unixuid_private {
index c3b704d85e198385c021736e4aa6f3d61ede8730..942183de3ef1f29f2df089ad5b120a0660ba44b1 100644 (file)
@@ -22,7 +22,6 @@
 
 #include "includes.h"
 #include "system/filesys.h"
-#include "libcli/security/security.h"
 #include "librpc/gen_ndr/ndr_xattr.h"
 
 #if HAVE_XATTR_SUPPORT 
index 1431f7f415265e3b7197619e2a23ecdc59be79ab..61d6ff3b85c24f5aaada920f3ecf7a223e9d05b2 100644 (file)
@@ -28,7 +28,7 @@
 #include "system/passwd.h"
 #include "lib/cmdline/popt_common.h"
 #include "auth/auth.h"
-#include "libcli/security/security.h"
+#include "librpc/gen_ndr/ndr_security.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_WINBIND