From 8bc9c343c4fe4e6f6c0283fd15e86caf6b8c1085 Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=BCnther=20Deschner?= Date: Tue, 18 May 2010 02:56:17 +0200 Subject: [PATCH] s3-secdesc: remove "typedef struct sec_desc_buf SEC_DESC_BUF". Guenther --- source3/include/nt_printing.h | 2 +- source3/include/proto.h | 12 ++++++------ source3/include/rpc_secdes.h | 6 ------ source3/lib/secdesc.c | 18 +++++++++--------- source3/printing/nt_printing.c | 24 ++++++++++++------------ source3/rpc_server/srv_spoolss_nt.c | 4 ++-- source3/rpcclient/cmd_lsarpc.c | 2 +- source3/rpcclient/cmd_samr.c | 2 +- 8 files changed, 32 insertions(+), 38 deletions(-) diff --git a/source3/include/nt_printing.h b/source3/include/nt_printing.h index 713443a4fa6..0241a54b794 100644 --- a/source3/include/nt_printing.h +++ b/source3/include/nt_printing.h @@ -100,7 +100,7 @@ typedef struct nt_printer_info_level_2 fstring datatype; fstring parameters; NT_PRINTER_DATA *data; - SEC_DESC_BUF *secdesc_buf; + struct sec_desc_buf *secdesc_buf; uint32 changeid; uint32 c_setprinter; uint32 setuptime; diff --git a/source3/include/proto.h b/source3/include/proto.h index eb9c63c5ac4..69e64d71f0b 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -694,7 +694,7 @@ ssize_t drain_socket(int sockfd, size_t count); uint32_t get_sec_info(const SEC_DESC *sd); SEC_DESC *sec_desc_merge(TALLOC_CTX *ctx, SEC_DESC *new_sdb, SEC_DESC *old_sdb); -SEC_DESC_BUF *sec_desc_merge_buf(TALLOC_CTX *ctx, SEC_DESC_BUF *new_sdb, SEC_DESC_BUF *old_sdb); +struct sec_desc_buf *sec_desc_merge_buf(TALLOC_CTX *ctx, struct sec_desc_buf *new_sdb, struct sec_desc_buf *old_sdb); SEC_DESC *make_sec_desc(TALLOC_CTX *ctx, enum security_descriptor_revision revision, uint16 type, @@ -713,8 +713,8 @@ NTSTATUS unmarshall_sec_desc_buf(TALLOC_CTX *mem_ctx, uint8_t *data, size_t len, struct sec_desc_buf **psecdesc_buf); SEC_DESC *make_standard_sec_desc(TALLOC_CTX *ctx, const DOM_SID *owner_sid, const DOM_SID *grp_sid, SEC_ACL *dacl, size_t *sd_size); -SEC_DESC_BUF *make_sec_desc_buf(TALLOC_CTX *ctx, size_t len, SEC_DESC *sec_desc); -SEC_DESC_BUF *dup_sec_desc_buf(TALLOC_CTX *ctx, SEC_DESC_BUF *src); +struct sec_desc_buf *make_sec_desc_buf(TALLOC_CTX *ctx, size_t len, SEC_DESC *sec_desc); +struct sec_desc_buf *dup_sec_desc_buf(TALLOC_CTX *ctx, struct sec_desc_buf *src); NTSTATUS sec_desc_add_sid(TALLOC_CTX *ctx, SEC_DESC **psd, DOM_SID *sid, uint32 mask, size_t *sd_size); NTSTATUS sec_desc_mod_sid(SEC_DESC *sd, DOM_SID *sid, uint32 mask); NTSTATUS sec_desc_del_sid(TALLOC_CTX *ctx, SEC_DESC **psd, DOM_SID *sid, size_t *sd_size); @@ -727,7 +727,7 @@ NTSTATUS se_create_child_secdesc(TALLOC_CTX *ctx, const DOM_SID *group_sid, bool container); NTSTATUS se_create_child_secdesc_buf(TALLOC_CTX *ctx, - SEC_DESC_BUF **ppsdb, + struct sec_desc_buf **ppsdb, const SEC_DESC *parent_ctr, bool container); @@ -4793,8 +4793,8 @@ bool printer_driver_files_in_use(TALLOC_CTX *mem_ctx, WERROR delete_printer_driver(struct pipes_struct *rpc_pipe, const struct spoolss_DriverInfo8 *r, uint32 version, bool delete_files ); -WERROR nt_printing_setsec(const char *sharename, SEC_DESC_BUF *secdesc_ctr); -bool nt_printing_getsec(TALLOC_CTX *ctx, const char *sharename, SEC_DESC_BUF **secdesc_ctr); +WERROR nt_printing_setsec(const char *sharename, struct sec_desc_buf *secdesc_ctr); +bool nt_printing_getsec(TALLOC_CTX *ctx, const char *sharename, struct sec_desc_buf **secdesc_ctr); void map_printer_permissions(SEC_DESC *sd); void map_job_permissions(SEC_DESC *sd); bool print_access_check(struct auth_serversupplied_info *server_info, int snum, diff --git a/source3/include/rpc_secdes.h b/source3/include/rpc_secdes.h index 6db3f2d7c78..0d3db799f46 100644 --- a/source3/include/rpc_secdes.h +++ b/source3/include/rpc_secdes.h @@ -91,12 +91,6 @@ typedef struct security_descriptor SEC_DESC; #define _SEC_DESC #endif -#ifndef _SEC_DESC_BUF -/* SEC_DESC_BUF */ -typedef struct sec_desc_buf SEC_DESC_BUF; -#define _SEC_DESC_BUF -#endif - /* A type to describe the mapping of generic access rights to object specific access rights. */ diff --git a/source3/lib/secdesc.c b/source3/lib/secdesc.c index 7f28c878867..b3505e7e1ba 100644 --- a/source3/lib/secdesc.c +++ b/source3/lib/secdesc.c @@ -63,10 +63,10 @@ uint32_t get_sec_info(const SEC_DESC *sd) security descriptor new_sec. ********************************************************************/ -SEC_DESC_BUF *sec_desc_merge_buf(TALLOC_CTX *ctx, SEC_DESC_BUF *new_sdb, SEC_DESC_BUF *old_sdb) +struct sec_desc_buf *sec_desc_merge_buf(TALLOC_CTX *ctx, struct sec_desc_buf *new_sdb, struct sec_desc_buf *old_sdb) { DOM_SID *owner_sid, *group_sid; - SEC_DESC_BUF *return_sdb; + struct sec_desc_buf *return_sdb; SEC_ACL *dacl, *sacl; SEC_DESC *psd = NULL; uint16 secdesc_type; @@ -373,14 +373,14 @@ SEC_DESC *make_standard_sec_desc(TALLOC_CTX *ctx, const DOM_SID *owner_sid, cons } /******************************************************************* - Creates a SEC_DESC_BUF structure. + Creates a struct sec_desc_buf structure. ********************************************************************/ -SEC_DESC_BUF *make_sec_desc_buf(TALLOC_CTX *ctx, size_t len, SEC_DESC *sec_desc) +struct sec_desc_buf *make_sec_desc_buf(TALLOC_CTX *ctx, size_t len, SEC_DESC *sec_desc) { - SEC_DESC_BUF *dst; + struct sec_desc_buf *dst; - if((dst = TALLOC_ZERO_P(ctx, SEC_DESC_BUF)) == NULL) + if((dst = TALLOC_ZERO_P(ctx, struct sec_desc_buf)) == NULL) return NULL; /* max buffer size (allocated size) */ @@ -394,10 +394,10 @@ SEC_DESC_BUF *make_sec_desc_buf(TALLOC_CTX *ctx, size_t len, SEC_DESC *sec_desc) } /******************************************************************* - Duplicates a SEC_DESC_BUF structure. + Duplicates a struct sec_desc_buf structure. ********************************************************************/ -SEC_DESC_BUF *dup_sec_desc_buf(TALLOC_CTX *ctx, SEC_DESC_BUF *src) +struct sec_desc_buf *dup_sec_desc_buf(TALLOC_CTX *ctx, struct sec_desc_buf *src) { if(src == NULL) return NULL; @@ -673,7 +673,7 @@ NTSTATUS se_create_child_secdesc(TALLOC_CTX *ctx, } NTSTATUS se_create_child_secdesc_buf(TALLOC_CTX *ctx, - SEC_DESC_BUF **ppsdb, + struct sec_desc_buf **ppsdb, const SEC_DESC *parent_ctr, bool container) { diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index 1f8012767fa..141966ebdc3 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -333,8 +333,8 @@ static int sec_desc_upg_fn( TDB_CONTEXT *the_tdb, TDB_DATA key, TDB_DATA data, void *state ) { NTSTATUS status; - SEC_DESC_BUF *sd_orig = NULL; - SEC_DESC_BUF *sd_new, *sd_store; + struct sec_desc_buf *sd_orig = NULL; + struct sec_desc_buf *sd_new, *sd_store; SEC_DESC *sec, *new_sec; TALLOC_CTX *ctx = state; int result, i; @@ -413,7 +413,7 @@ static int sec_desc_upg_fn( TDB_CONTEXT *the_tdb, TDB_DATA key, /* store it back */ sd_size = ndr_size_security_descriptor(sd_store->sd, 0) - + sizeof(SEC_DESC_BUF); + + sizeof(struct sec_desc_buf); status = marshall_sec_desc_buf(ctx, sd_store, &data.dptr, &data.dsize); if (!NT_STATUS_IS_OK(status)) { @@ -5480,10 +5480,10 @@ WERROR delete_printer_driver(struct pipes_struct *rpc_pipe, Store a security desc for a printer. ****************************************************************************/ -WERROR nt_printing_setsec(const char *sharename, SEC_DESC_BUF *secdesc_ctr) +WERROR nt_printing_setsec(const char *sharename, struct sec_desc_buf *secdesc_ctr) { - SEC_DESC_BUF *new_secdesc_ctr = NULL; - SEC_DESC_BUF *old_secdesc_ctr = NULL; + struct sec_desc_buf *new_secdesc_ctr = NULL; + struct sec_desc_buf *old_secdesc_ctr = NULL; TALLOC_CTX *mem_ctx = NULL; TDB_DATA kbuf; TDB_DATA dbuf; @@ -5584,13 +5584,13 @@ WERROR nt_printing_setsec(const char *sharename, SEC_DESC_BUF *secdesc_ctr) Construct a default security descriptor buffer for a printer. ****************************************************************************/ -static SEC_DESC_BUF *construct_default_printer_sdb(TALLOC_CTX *ctx) +static struct sec_desc_buf *construct_default_printer_sdb(TALLOC_CTX *ctx) { SEC_ACE ace[5]; /* max number of ace entries */ int i = 0; uint32_t sa; SEC_ACL *psa = NULL; - SEC_DESC_BUF *sdb = NULL; + struct sec_desc_buf *sdb = NULL; SEC_DESC *psd = NULL; DOM_SID adm_sid; size_t sd_size; @@ -5668,7 +5668,7 @@ static SEC_DESC_BUF *construct_default_printer_sdb(TALLOC_CTX *ctx) Get a security desc for a printer. ****************************************************************************/ -bool nt_printing_getsec(TALLOC_CTX *ctx, const char *sharename, SEC_DESC_BUF **secdesc_ctr) +bool nt_printing_getsec(TALLOC_CTX *ctx, const char *sharename, struct sec_desc_buf **secdesc_ctr) { TDB_DATA kbuf; TDB_DATA dbuf; @@ -5720,7 +5720,7 @@ bool nt_printing_getsec(TALLOC_CTX *ctx, const char *sharename, SEC_DESC_BUF **s /* Change sd owner to workgroup administrator */ if (secrets_fetch_domain_sid(lp_workgroup(), &owner_sid)) { - SEC_DESC_BUF *new_secdesc_ctr = NULL; + struct sec_desc_buf *new_secdesc_ctr = NULL; SEC_DESC *psd = NULL; size_t size; @@ -5859,7 +5859,7 @@ void map_job_permissions(SEC_DESC *sd) bool print_access_check(struct auth_serversupplied_info *server_info, int snum, int access_type) { - SEC_DESC_BUF *secdesc = NULL; + struct sec_desc_buf *secdesc = NULL; uint32 access_granted; NTSTATUS status; const char *pname; @@ -5898,7 +5898,7 @@ bool print_access_check(struct auth_serversupplied_info *server_info, int snum, } if (access_type == JOB_ACCESS_ADMINISTER) { - SEC_DESC_BUF *parent_secdesc = secdesc; + struct sec_desc_buf *parent_secdesc = secdesc; /* Create a child security descriptor to check permissions against. This is because print jobs are child objects diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index 53d5e6f8a33..50d40e1dce4 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -5400,9 +5400,9 @@ WERROR _spoolss_AbortPrinter(pipes_struct *p, ********************************************************************/ static WERROR update_printer_sec(struct policy_handle *handle, - pipes_struct *p, SEC_DESC_BUF *secdesc_ctr) + pipes_struct *p, struct sec_desc_buf *secdesc_ctr) { - SEC_DESC_BUF *new_secdesc_ctr = NULL, *old_secdesc_ctr = NULL; + struct sec_desc_buf *new_secdesc_ctr = NULL, *old_secdesc_ctr = NULL; WERROR result; int snum; diff --git a/source3/rpcclient/cmd_lsarpc.c b/source3/rpcclient/cmd_lsarpc.c index 04aec66217b..bc9efcd21c9 100644 --- a/source3/rpcclient/cmd_lsarpc.c +++ b/source3/rpcclient/cmd_lsarpc.c @@ -1038,7 +1038,7 @@ static NTSTATUS cmd_lsa_query_secobj(struct rpc_pipe_client *cli, { struct policy_handle pol; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; - SEC_DESC_BUF *sdb; + struct sec_desc_buf *sdb; uint32 sec_info = DACL_SECURITY_INFORMATION; if (argc < 1 || argc > 2) { diff --git a/source3/rpcclient/cmd_samr.c b/source3/rpcclient/cmd_samr.c index e21a57fba7a..e61f5902716 100644 --- a/source3/rpcclient/cmd_samr.c +++ b/source3/rpcclient/cmd_samr.c @@ -2161,7 +2161,7 @@ static NTSTATUS cmd_samr_query_sec_obj(struct rpc_pipe_client *cli, uint32 sec_info = DACL_SECURITY_INFORMATION; uint32 user_rid = 0; TALLOC_CTX *ctx = NULL; - SEC_DESC_BUF *sec_desc_buf=NULL; + struct sec_desc_buf *sec_desc_buf=NULL; bool domain = False; ctx=talloc_init("cmd_samr_query_sec_obj"); -- 2.11.4.GIT