diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2009-02-24 01:02:45 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2009-02-24 01:02:45 +0100 |
commit | fff055f8e33a8f0bbb5e7cc5b77d6251bf37e0cf (patch) | |
tree | ba4bb09fa2c79955c247a637cdd20290a249d960 /source3 | |
parent | b9cf189404d5ef6b0a2440dc5f9670f0f6d0c131 (diff) | |
parent | 1a9bb33a7db393aff970619f20490e755f0d282b (diff) | |
download | samba-fff055f8e33a8f0bbb5e7cc5b77d6251bf37e0cf.tar.gz samba-fff055f8e33a8f0bbb5e7cc5b77d6251bf37e0cf.tar.bz2 samba-fff055f8e33a8f0bbb5e7cc5b77d6251bf37e0cf.zip |
Merge branch 'master' of ssh://git.samba.org/data/git/samba
Diffstat (limited to 'source3')
-rw-r--r-- | source3/Makefile.in | 2 | ||||
-rw-r--r-- | source3/include/libsmbclient.h | 8 | ||||
-rw-r--r-- | source3/include/proto.h | 27 | ||||
-rw-r--r-- | source3/include/rpc_spoolss.h | 121 | ||||
-rw-r--r-- | source3/libgpo/gpo_reg.c | 8 | ||||
-rw-r--r-- | source3/libsmb/libsmb_context.c | 22 | ||||
-rw-r--r-- | source3/modules/nfs4_acls.c | 84 | ||||
-rw-r--r-- | source3/modules/nfs4_acls.h | 10 | ||||
-rw-r--r-- | source3/modules/vfs_solarisacl.c | 9 | ||||
-rw-r--r-- | source3/registry/reg_dispatcher.c | 8 | ||||
-rw-r--r-- | source3/rpc_client/cli_spoolss_notify.c | 119 | ||||
-rw-r--r-- | source3/rpc_parse/parse_spoolss.c | 696 | ||||
-rw-r--r-- | source3/rpc_server/srv_svcctl_nt.c | 6 | ||||
-rw-r--r-- | source3/services/services_db.c | 6 | ||||
-rw-r--r-- | source3/utils/profiles.c | 30 | ||||
-rw-r--r-- | source3/utils/sharesec.c | 6 |
16 files changed, 95 insertions, 1067 deletions
diff --git a/source3/Makefile.in b/source3/Makefile.in index d4a849cbc7..7564659dd3 100644 --- a/source3/Makefile.in +++ b/source3/Makefile.in @@ -465,7 +465,7 @@ RPC_CLIENT_OBJ1 = rpc_client/cli_netlogon.o LIBMSRPC_OBJ = rpc_client/cli_lsarpc.o rpc_client/cli_samr.o \ $(RPC_CLIENT_OBJ1) rpc_client/cli_reg.o $(RPC_CLIENT_OBJ) \ - rpc_client/cli_spoolss.o rpc_client/cli_spoolss_notify.o \ + rpc_client/cli_spoolss.o \ rpc_client/init_spoolss.o \ rpc_client/init_samr.o \ librpc/rpc/dcerpc.o \ diff --git a/source3/include/libsmbclient.h b/source3/include/libsmbclient.h index 8c642b1794..869aeb6a03 100644 --- a/source3/include/libsmbclient.h +++ b/source3/include/libsmbclient.h @@ -2677,11 +2677,11 @@ smbc_version(void); */ void -smbc_set_credentials(char *workgroup, - char *user, - char *password, +smbc_set_credentials(const char *workgroup, + const char *user, + const char *password, smbc_bool use_kerberos, - char *signing_state); + const char *signing_state); /* * Wrapper around smbc_set_credentials. diff --git a/source3/include/proto.h b/source3/include/proto.h index 93b4ca8c7d..faf47d3844 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -5522,17 +5522,6 @@ WERROR rpccli_spoolss_enumprinterkey(struct rpc_pipe_client *cli, TALLOC_CTX *me POLICY_HND *hnd, const char *keyname, uint16 **keylist, uint32 *len); -/* The following definitions come from rpc_client/cli_spoolss_notify.c */ - -WERROR rpccli_spoolss_rrpcn(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, - POLICY_HND *pol, uint32 notify_data_len, - SPOOL_NOTIFY_INFO_DATA *notify_data, - uint32 change_low, uint32 change_high); -WERROR rpccli_spoolss_rffpcnex(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, - POLICY_HND *pol, uint32 flags, uint32 options, - const char *localmachine, uint32 printerlocal, - SPOOL_NOTIFY_OPTION *option); - /* The following definitions come from rpc_client/init_spoolss.c */ bool init_systemtime(struct spoolss_Time *r, @@ -5817,8 +5806,6 @@ bool sec_io_desc_buf(const char *desc, SEC_DESC_BUF **ppsdb, prs_struct *ps, int bool spoolss_io_system_time(const char *desc, prs_struct *ps, int depth, SYSTEMTIME *systime); bool make_systemtime(SYSTEMTIME *systime, struct tm *unixtime); -bool smb_io_notify_info_data_strings(const char *desc,SPOOL_NOTIFY_INFO_DATA *data, - prs_struct *ps, int depth); bool spool_io_user_level_1( const char *desc, prs_struct *ps, int depth, SPOOL_USER_1 *q_u ); bool spoolss_io_devmode(const char *desc, prs_struct *ps, int depth, DEVICEMODE *devmode); bool make_spoolss_q_addprinterex( TALLOC_CTX *mem_ctx, SPOOL_Q_ADDPRINTEREX *q_u, @@ -5835,10 +5822,6 @@ bool make_spoolss_q_getprinterdata(SPOOL_Q_GETPRINTERDATA *q_u, const char *valuename, uint32 size); bool spoolss_io_q_getprinterdata(const char *desc, SPOOL_Q_GETPRINTERDATA *q_u, prs_struct *ps, int depth); bool spoolss_io_r_getprinterdata(const char *desc, SPOOL_R_GETPRINTERDATA *r_u, prs_struct *ps, int depth); -bool spoolss_io_q_rffpcnex(const char *desc, SPOOL_Q_RFFPCNEX *q_u, prs_struct *ps, int depth); -bool spoolss_io_r_rffpcnex(const char *desc, SPOOL_R_RFFPCNEX *r_u, prs_struct *ps, int depth); -bool spoolss_io_q_rfnpcnex(const char *desc, SPOOL_Q_RFNPCNEX *q_u, prs_struct *ps, int depth); -bool spoolss_io_r_rfnpcnex(const char *desc, SPOOL_R_RFNPCNEX *r_u, prs_struct *ps, int depth); bool smb_io_printer_info_0(const char *desc, RPC_BUFFER *buffer, PRINTER_INFO_0 *info, int depth); bool smb_io_printer_info_1(const char *desc, RPC_BUFFER *buffer, PRINTER_INFO_1 *info, int depth); bool smb_io_printer_info_2(const char *desc, RPC_BUFFER *buffer, PRINTER_INFO_2 *info, int depth); @@ -5994,11 +5977,6 @@ void free_printer_info_5(PRINTER_INFO_5 *printer); void free_printer_info_6(PRINTER_INFO_6 *printer); void free_printer_info_7(PRINTER_INFO_7 *printer); void free_job_info_2(JOB_INFO_2 *job); -bool make_spoolss_q_reply_rrpcn(SPOOL_Q_REPLY_RRPCN *q_u, POLICY_HND *hnd, - uint32 change_low, uint32 change_high, - SPOOL_NOTIFY_INFO *info); -bool spoolss_io_q_reply_rrpcn(const char *desc, SPOOL_Q_REPLY_RRPCN *q_u, prs_struct *ps, int depth); -bool spoolss_io_r_reply_rrpcn(const char *desc, SPOOL_R_REPLY_RRPCN *r_u, prs_struct *ps, int depth); bool make_spoolss_q_enumprinterkey(SPOOL_Q_ENUMPRINTERKEY *q_u, POLICY_HND *hnd, const char *key, uint32 size); @@ -6012,9 +5990,6 @@ bool make_spoolss_q_enumforms(SPOOL_Q_ENUMFORMS *q_u, POLICY_HND *handle, bool make_spoolss_q_getjob(SPOOL_Q_GETJOB *q_u, POLICY_HND *handle, uint32 jobid, uint32 level, RPC_BUFFER *buffer, uint32 offered); -bool make_spoolss_q_rffpcnex(SPOOL_Q_RFFPCNEX *q_u, POLICY_HND *handle, - uint32 flags, uint32 options, const char *localmachine, - uint32 printerlocal, SPOOL_NOTIFY_OPTION *option); /* The following definitions come from rpc_server/srv_eventlog_lib.c */ @@ -6140,7 +6115,6 @@ bool convert_devicemode(const char *printername, const DEVICEMODE *devmode, WERROR set_printer_dataex( NT_PRINTER_INFO_LEVEL *printer, const char *key, const char *value, uint32 type, uint8 *data, int real_len ); WERROR _spoolss_getprinterdata(pipes_struct *p, SPOOL_Q_GETPRINTERDATA *q_u, SPOOL_R_GETPRINTERDATA *r_u); -WERROR _spoolss_rffpcnex(pipes_struct *p, SPOOL_Q_RFFPCNEX *q_u, SPOOL_R_RFFPCNEX *r_u); void spoolss_notify_server_name(int snum, struct spoolss_Notify *data, print_queue_struct *queue, @@ -6206,7 +6180,6 @@ void spoolss_notify_cjobs(int snum, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer, TALLOC_CTX *mem_ctx); -WERROR _spoolss_rfnpcnex( pipes_struct *p, SPOOL_Q_RFNPCNEX *q_u, SPOOL_R_RFNPCNEX *r_u); void construct_info_data(struct spoolss_Notify *info_data, enum spoolss_NotifyType type, enum spoolss_Field field, diff --git a/source3/include/rpc_spoolss.h b/source3/include/rpc_spoolss.h index 670eca4ca4..504cfea70b 100644 --- a/source3/include/rpc_spoolss.h +++ b/source3/include/rpc_spoolss.h @@ -343,28 +343,6 @@ PRINTER_DEFAULT; /********************************************/ -typedef struct spool_notify_option_type -{ - uint16 type; - uint16 reserved0; - uint32 reserved1; - uint32 reserved2; - uint32 count; - uint32 fields_ptr; - uint32 count2; - uint16 fields[MAX_NOTIFY_TYPE_FOR_NOW]; -} -SPOOL_NOTIFY_OPTION_TYPE; - -typedef struct spool_notify_option_type_ctr -{ - uint32 count; - SPOOL_NOTIFY_OPTION_TYPE *type; -} -SPOOL_NOTIFY_OPTION_TYPE_CTR; - - - typedef struct s_header_type { uint32 type; @@ -396,86 +374,6 @@ typedef struct spool_r_getprinterdata } SPOOL_R_GETPRINTERDATA; -typedef struct spool_notify_option -{ - uint32 version; - uint32 flags; - uint32 count; - uint32 option_type_ptr; - SPOOL_NOTIFY_OPTION_TYPE_CTR ctr; -} -SPOOL_NOTIFY_OPTION; - -typedef struct spool_notify_info_data -{ - uint16 type; - uint16 field; - uint32 reserved; - uint32 id; - union { - uint32 value[2]; - struct { - uint32 length; - uint16 *string; - } data; - struct { - uint32 size; - SEC_DESC *desc; - } sd; - } - notify_data; - uint32 size; - uint32 enc_type; -} SPOOL_NOTIFY_INFO_DATA; - -typedef struct spool_notify_info -{ - uint32 version; - uint32 flags; - uint32 count; - SPOOL_NOTIFY_INFO_DATA *data; -} -SPOOL_NOTIFY_INFO; - -/* If the struct name looks obscure, yes it is ! */ -/* RemoteFindFirstPrinterChangeNotificationEx query struct */ -typedef struct spoolss_q_rffpcnex -{ - POLICY_HND handle; - uint32 flags; - uint32 options; - uint32 localmachine_ptr; - UNISTR2 localmachine; - uint32 printerlocal; - uint32 option_ptr; - SPOOL_NOTIFY_OPTION *option; -} -SPOOL_Q_RFFPCNEX; - -typedef struct spool_r_rffpcnex -{ - WERROR status; -} -SPOOL_R_RFFPCNEX; - -/* Remote Find Next Printer Change Notify Ex */ -typedef struct spool_q_rfnpcnex -{ - POLICY_HND handle; - uint32 change; - uint32 option_ptr; - SPOOL_NOTIFY_OPTION *option; -} -SPOOL_Q_RFNPCNEX; - -typedef struct spool_r_rfnpcnex -{ - uint32 info_ptr; - SPOOL_NOTIFY_INFO info; - WERROR status; -} -SPOOL_R_RFNPCNEX; - typedef struct printer_info_0 { UNISTR printername; @@ -1349,25 +1247,6 @@ typedef struct spool_r_getjob } SPOOL_R_GETJOB; -typedef struct spool_q_rrpcn -{ - POLICY_HND handle; - uint32 change_low; - uint32 change_high; - uint32 unknown0; - uint32 unknown1; - uint32 info_ptr; - SPOOL_NOTIFY_INFO info; -} -SPOOL_Q_REPLY_RRPCN; - -typedef struct spool_r_rrpcn -{ - uint32 unknown0; - WERROR status; -} -SPOOL_R_REPLY_RRPCN; - typedef struct spool_q_enumprinterkey { POLICY_HND handle; diff --git a/source3/libgpo/gpo_reg.c b/source3/libgpo/gpo_reg.c index 3d385dec14..9367bcae9c 100644 --- a/source3/libgpo/gpo_reg.c +++ b/source3/libgpo/gpo_reg.c @@ -691,7 +691,7 @@ static WERROR gp_reg_generate_sd(TALLOC_CTX *mem_ctx, SEC_ACE ace[6]; uint32_t mask; - SEC_ACL *acl = NULL; + SEC_ACL *theacl = NULL; uint8_t inherit_flags; @@ -735,15 +735,15 @@ static WERROR gp_reg_generate_sd(TALLOC_CTX *mem_ctx, SEC_ACE_TYPE_ACCESS_ALLOWED, mask, inherit_flags); - acl = make_sec_acl(mem_ctx, NT4_ACL_REVISION, 6, ace); - W_ERROR_HAVE_NO_MEMORY(acl); + theacl = make_sec_acl(mem_ctx, NT4_ACL_REVISION, 6, ace); + W_ERROR_HAVE_NO_MEMORY(theacl); *sd = make_sec_desc(mem_ctx, SEC_DESC_REVISION, SEC_DESC_SELF_RELATIVE | SEC_DESC_DACL_AUTO_INHERITED | /* really ? */ SEC_DESC_DACL_AUTO_INHERIT_REQ, /* really ? */ NULL, NULL, NULL, - acl, sd_size); + theacl, sd_size); W_ERROR_HAVE_NO_MEMORY(*sd); return WERR_OK; diff --git a/source3/libsmb/libsmb_context.c b/source3/libsmb/libsmb_context.c index c7c9903b76..4c12d18ab7 100644 --- a/source3/libsmb/libsmb_context.c +++ b/source3/libsmb/libsmb_context.c @@ -630,11 +630,11 @@ smbc_version(void) * Set the credentials so DFS will work when following referrals. */ void -smbc_set_credentials(char *workgroup, - char *user, - char *password, +smbc_set_credentials(const char *workgroup, + const char *user, + const char *password, smbc_bool use_kerberos, - char *signing_state) + const char *signing_state) { struct user_auth_info *auth_info; @@ -681,18 +681,8 @@ void smbc_set_credentials_with_fallback(SMBCCTX *context, signing_state = "force"; } - /* Using CONST_DISCARD here is ugly, but - * we know that smbc_set_credentials() doesn't - * actually modify the strings, and should have - * been const from the start. We're constrained - * by the ABI here. - */ - - smbc_set_credentials(CONST_DISCARD(char *,workgroup), - CONST_DISCARD(char *,user), - CONST_DISCARD(char *,password), - use_kerberos, - CONST_DISCARD(char *,signing_state)); + smbc_set_credentials(workgroup, user, password, + use_kerberos, signing_state); if (smbc_getOptionFallbackAfterKerberos(context)) { cli_cm_set_fallback_after_kerberos(); diff --git a/source3/modules/nfs4_acls.c b/source3/modules/nfs4_acls.c index ba038479af..7756f8f3ab 100644 --- a/source3/modules/nfs4_acls.c +++ b/source3/modules/nfs4_acls.c @@ -44,10 +44,10 @@ typedef struct _SMB_ACL4_INT_T SMB_ACE4_INT_T *last; } SMB_ACL4_INT_T; -static SMB_ACL4_INT_T *get_validated_aclint(SMB4ACL_T *acl) +static SMB_ACL4_INT_T *get_validated_aclint(SMB4ACL_T *theacl) { - SMB_ACL4_INT_T *aclint = (SMB_ACL4_INT_T *)acl; - if (acl==NULL) + SMB_ACL4_INT_T *aclint = (SMB_ACL4_INT_T *)theacl; + if (theacl==NULL) { DEBUG(2, ("acl is NULL\n")); errno = EINVAL; @@ -83,21 +83,21 @@ static SMB_ACE4_INT_T *get_validated_aceint(SMB4ACE_T *ace) SMB4ACL_T *smb_create_smb4acl(void) { TALLOC_CTX *mem_ctx = talloc_tos(); - SMB_ACL4_INT_T *acl = (SMB_ACL4_INT_T *)TALLOC_ZERO_SIZE(mem_ctx, sizeof(SMB_ACL4_INT_T)); - if (acl==NULL) + SMB_ACL4_INT_T *theacl = (SMB_ACL4_INT_T *)TALLOC_ZERO_SIZE(mem_ctx, sizeof(SMB_ACL4_INT_T)); + if (theacl==NULL) { DEBUG(0, ("TALLOC_SIZE failed\n")); errno = ENOMEM; return NULL; } - acl->magic = SMB_ACL4_INT_MAGIC; - /* acl->first, last = NULL not needed */ - return (SMB4ACL_T *)acl; + theacl->magic = SMB_ACL4_INT_MAGIC; + /* theacl->first, last = NULL not needed */ + return (SMB4ACL_T *)theacl; } -SMB4ACE_T *smb_add_ace4(SMB4ACL_T *acl, SMB_ACE4PROP_T *prop) +SMB4ACE_T *smb_add_ace4(SMB4ACL_T *theacl, SMB_ACE4PROP_T *prop) { - SMB_ACL4_INT_T *aclint = get_validated_aclint(acl); + SMB_ACL4_INT_T *aclint = get_validated_aclint(theacl); TALLOC_CTX *mem_ctx = talloc_tos(); SMB_ACE4_INT_T *ace; @@ -143,18 +143,18 @@ SMB4ACE_T *smb_next_ace4(SMB4ACE_T *ace) return (SMB4ACE_T *)aceint->next; } -SMB4ACE_T *smb_first_ace4(SMB4ACL_T *acl) +SMB4ACE_T *smb_first_ace4(SMB4ACL_T *theacl) { - SMB_ACL4_INT_T *aclint = get_validated_aclint(acl); + SMB_ACL4_INT_T *aclint = get_validated_aclint(theacl); if (aclint==NULL) return NULL; return (SMB4ACE_T *)aclint->first; } -uint32 smb_get_naces(SMB4ACL_T *acl) +uint32 smb_get_naces(SMB4ACL_T *theacl) { - SMB_ACL4_INT_T *aclint = get_validated_aclint(acl); + SMB_ACL4_INT_T *aclint = get_validated_aclint(theacl); if (aclint==NULL) return 0; @@ -195,7 +195,7 @@ static int smbacl4_fGetFileOwner(files_struct *fsp, SMB_STRUCT_STAT *psbuf) return 0; } -static bool smbacl4_nfs42win(TALLOC_CTX *mem_ctx, SMB4ACL_T *acl, /* in */ +static bool smbacl4_nfs42win(TALLOC_CTX *mem_ctx, SMB4ACL_T *theacl, /* in */ DOM_SID *psid_owner, /* in */ DOM_SID *psid_group, /* in */ bool is_directory, /* in */ @@ -203,15 +203,15 @@ static bool smbacl4_nfs42win(TALLOC_CTX *mem_ctx, SMB4ACL_T *acl, /* in */ int *pgood_aces /* out */ ) { - SMB_ACL4_INT_T *aclint = (SMB_ACL4_INT_T *)acl; + SMB_ACL4_INT_T *aclint = (SMB_ACL4_INT_T *)theacl; SMB_ACE4_INT_T *aceint; SEC_ACE *nt_ace_list = NULL; int good_aces = 0; DEBUG(10, ("smbacl_nfs42win entered")); - aclint = get_validated_aclint(acl); - /* We do not check for naces being 0 or acl being NULL here because it is done upstream */ + aclint = get_validated_aclint(theacl); + /* We do not check for naces being 0 or theacl being NULL here because it is done upstream */ /* in smb_get_nt_acl_nfs4(). */ nt_ace_list = (SEC_ACE *)TALLOC_ZERO_SIZE(mem_ctx, aclint->naces * sizeof(SEC_ACE)); if (nt_ace_list==NULL) @@ -275,7 +275,7 @@ static bool smbacl4_nfs42win(TALLOC_CTX *mem_ctx, SMB4ACL_T *acl, /* in */ static NTSTATUS smb_get_nt_acl_nfs4_common(const SMB_STRUCT_STAT *sbuf, uint32 security_info, - SEC_DESC **ppdesc, SMB4ACL_T *acl) + SEC_DESC **ppdesc, SMB4ACL_T *theacl) { int good_aces = 0; DOM_SID sid_owner, sid_group; @@ -284,7 +284,7 @@ static NTSTATUS smb_get_nt_acl_nfs4_common(const SMB_STRUCT_STAT *sbuf, SEC_ACL *psa = NULL; TALLOC_CTX *mem_ctx = talloc_tos(); - if (acl==NULL || smb_get_naces(acl)==0) + if (theacl==NULL || smb_get_naces(theacl)==0) return NT_STATUS_ACCESS_DENIED; /* special because we * shouldn't alloc 0 for * win */ @@ -292,7 +292,7 @@ static NTSTATUS smb_get_nt_acl_nfs4_common(const SMB_STRUCT_STAT *sbuf, uid_to_sid(&sid_owner, sbuf->st_uid); gid_to_sid(&sid_group, sbuf->st_gid); - if (smbacl4_nfs42win(mem_ctx, acl, &sid_owner, &sid_group, S_ISDIR(sbuf->st_mode), + if (smbacl4_nfs42win(mem_ctx, theacl, &sid_owner, &sid_group, S_ISDIR(sbuf->st_mode), &nt_ace_list, &good_aces)==False) { DEBUG(8,("smbacl4_nfs42win failed\n")); return map_nt_error_from_unix(errno); @@ -322,7 +322,7 @@ static NTSTATUS smb_get_nt_acl_nfs4_common(const SMB_STRUCT_STAT *sbuf, NTSTATUS smb_fget_nt_acl_nfs4(files_struct *fsp, uint32 security_info, - SEC_DESC **ppdesc, SMB4ACL_T *acl) + SEC_DESC **ppdesc, SMB4ACL_T *theacl) { SMB_STRUCT_STAT sbuf; @@ -332,13 +332,13 @@ NTSTATUS smb_fget_nt_acl_nfs4(files_struct *fsp, return map_nt_error_from_unix(errno); } - return smb_get_nt_acl_nfs4_common(&sbuf, security_info, ppdesc, acl); + return smb_get_nt_acl_nfs4_common(&sbuf, security_info, ppdesc, theacl); } NTSTATUS smb_get_nt_acl_nfs4(struct connection_struct *conn, const char *name, uint32 security_info, - SEC_DESC **ppdesc, SMB4ACL_T *acl) + SEC_DESC **ppdesc, SMB4ACL_T *theacl) { SMB_STRUCT_STAT sbuf; @@ -348,7 +348,7 @@ NTSTATUS smb_get_nt_acl_nfs4(struct connection_struct *conn, return map_nt_error_from_unix(errno); } - return smb_get_nt_acl_nfs4_common(&sbuf, security_info, ppdesc, acl); + return smb_get_nt_acl_nfs4_common(&sbuf, security_info, ppdesc, theacl); } enum smbacl4_mode_enum {e_simple=0, e_special=1}; @@ -399,9 +399,9 @@ static int smbacl4_get_vfs_params( return 0; } -static void smbacl4_dump_nfs4acl(int level, SMB4ACL_T *acl) +static void smbacl4_dump_nfs4acl(int level, SMB4ACL_T *theacl) { - SMB_ACL4_INT_T *aclint = get_validated_aclint(acl); + SMB_ACL4_INT_T *aclint = get_validated_aclint(theacl); SMB_ACE4_INT_T *aceint; DEBUG(level, ("NFS4ACL: size=%d\n", aclint->naces)); @@ -423,10 +423,10 @@ static void smbacl4_dump_nfs4acl(int level, SMB4ACL_T *acl) * return ace if found matching; otherwise NULL */ static SMB_ACE4PROP_T *smbacl4_find_equal_special( - SMB4ACL_T *acl, + SMB4ACL_T *theacl, SMB_ACE4PROP_T *aceNew) { - SMB_ACL4_INT_T *aclint = get_validated_aclint(acl); + SMB_ACL4_INT_T *aclint = get_validated_aclint(theacl); SMB_ACE4_INT_T *aceint; for(aceint = aclint->first; aceint!=NULL; aceint=(SMB_ACE4_INT_T *)aceint->next) { @@ -618,14 +618,14 @@ static bool smbacl4_fill_ace4( static int smbacl4_MergeIgnoreReject( enum smbacl4_acedup_enum acedup, - SMB4ACL_T *acl, /* may modify it */ + SMB4ACL_T *theacl, /* may modify it */ SMB_ACE4PROP_T *ace, /* the "new" ACE */ bool *paddNewACE, int i ) { int result = 0; - SMB_ACE4PROP_T *ace4found = smbacl4_find_equal_special(acl, ace); + SMB_ACE4PROP_T *ace4found = smbacl4_find_equal_special(theacl, ace); if (ace4found) { switch(acedup) @@ -658,14 +658,14 @@ static SMB4ACL_T *smbacl4_win2nfs4( gid_t ownerGID ) { - SMB4ACL_T *acl; + SMB4ACL_T *theacl; uint32 i; TALLOC_CTX *mem_ctx = talloc_tos(); DEBUG(10, ("smbacl4_win2nfs4 invoked\n")); - acl = smb_create_smb4acl(); - if (acl==NULL) + theacl = smb_create_smb4acl(); + if (theacl==NULL) return NULL; for(i=0; i<dacl->num_aces; i++) { @@ -682,16 +682,16 @@ static SMB4ACL_T *smbacl4_win2nfs4( } if (pparams->acedup!=e_dontcare) { - if (smbacl4_MergeIgnoreReject(pparams->acedup, acl, + if (smbacl4_MergeIgnoreReject(pparams->acedup, theacl, &ace_v4, &addNewACE, i)) return NULL; } if (addNewACE) - smb_add_ace4(acl, &ace_v4); + smb_add_ace4(theacl, &ace_v4); } - return acl; + return theacl; } NTSTATUS smb_set_nt_acl_nfs4(files_struct *fsp, @@ -700,7 +700,7 @@ NTSTATUS smb_set_nt_acl_nfs4(files_struct *fsp, set_nfs4acl_native_fn_t set_nfs4_native) { smbacl4_vfs_params params; - SMB4ACL_T *acl = NULL; + SMB4ACL_T *theacl = NULL; bool result; SMB_STRUCT_STAT sbuf; @@ -759,16 +759,16 @@ NTSTATUS smb_set_nt_acl_nfs4(files_struct *fsp, return NT_STATUS_OK; } - acl = smbacl4_win2nfs4(fsp->fsp_name, psd->dacl, ¶ms, sbuf.st_uid, sbuf.st_gid); - if (!acl) + theacl = smbacl4_win2nfs4(fsp->fsp_name, psd->dacl, ¶ms, sbuf.st_uid, sbuf.st_gid); + if (!theacl) return map_nt_error_from_unix(errno); - smbacl4_dump_nfs4acl(10, acl); + smbacl4_dump_nfs4acl(10, theacl); if (set_acl_as_root) { become_root(); } - result = set_nfs4_native(fsp, acl); + result = set_nfs4_native(fsp, theacl); saved_errno = errno; if (set_acl_as_root) { unbecome_root(); diff --git a/source3/modules/nfs4_acls.h b/source3/modules/nfs4_acls.h index a227c6e0fc..b2d1196b26 100644 --- a/source3/modules/nfs4_acls.h +++ b/source3/modules/nfs4_acls.h @@ -117,26 +117,26 @@ SMB4ACL_T *smb_create_smb4acl(void); /* prop's contents are copied */ /* it doesn't change the order, appends */ -SMB4ACE_T *smb_add_ace4(SMB4ACL_T *acl, SMB_ACE4PROP_T *prop); +SMB4ACE_T *smb_add_ace4(SMB4ACL_T *theacl, SMB_ACE4PROP_T *prop); SMB_ACE4PROP_T *smb_get_ace4(SMB4ACE_T *ace); /* Returns NULL if none - or error */ -SMB4ACE_T *smb_first_ace4(SMB4ACL_T *acl); +SMB4ACE_T *smb_first_ace4(SMB4ACL_T *theacl); /* Returns NULL in the end - or error */ SMB4ACE_T *smb_next_ace4(SMB4ACE_T *ace); -uint32 smb_get_naces(SMB4ACL_T *acl); +uint32 smb_get_naces(SMB4ACL_T *theacl); NTSTATUS smb_fget_nt_acl_nfs4(files_struct *fsp, uint32 security_info, - SEC_DESC **ppdesc, SMB4ACL_T *acl); + SEC_DESC **ppdesc, SMB4ACL_T *theacl); NTSTATUS smb_get_nt_acl_nfs4(connection_struct *conn, const char *name, uint32 security_info, - SEC_DESC **ppdesc, SMB4ACL_T *acl); + SEC_DESC **ppdesc, SMB4ACL_T *theacl); /* Callback function needed to set the native acl * when applicable */ diff --git a/source3/modules/vfs_solarisacl.c b/source3/modules/vfs_solarisacl.c index 7bdfe8465b..cafb077555 100644 --- a/source3/modules/vfs_solarisacl.c +++ b/source3/modules/vfs_solarisacl.c @@ -51,11 +51,12 @@ static bool solaris_add_to_acl(SOLARIS_ACL_T *solaris_acl, int *count, static bool solaris_acl_get_file(const char *name, SOLARIS_ACL_T *solarisacl, int *count); static bool solaris_acl_get_fd(int fd, SOLARIS_ACL_T *solarisacl, int *count); -static bool solaris_acl_sort(SOLARIS_ACL_T acl, int count); +static bool solaris_acl_sort(SOLARIS_ACL_T theacl, int count); static SMB_ACL_PERM_T solaris_perm_to_smb_perm(const SOLARIS_PERM_T perm); static SOLARIS_PERM_T smb_perm_to_solaris_perm(const SMB_ACL_PERM_T perm); +#if 0 static bool solaris_acl_check(SOLARIS_ACL_T solaris_acl, int count); - +#endif /* public functions - the api */ @@ -347,7 +348,6 @@ static bool smb_acl_to_solaris_acl(SMB_ACL_T smb_acl, { bool ret = False; int i; - int check_which, check_rc; DEBUG(10, ("entering smb_acl_to_solaris_acl\n")); @@ -717,6 +717,7 @@ static bool solaris_acl_sort(SOLARIS_ACL_T solaris_acl, int count) return True; } +#if 0 /* * acl check function: * unused at the moment but could be used to get more @@ -746,7 +747,7 @@ static bool solaris_acl_check(SOLARIS_ACL_T solaris_acl, int count) } return True; } - +#endif /* VFS operations structure */ diff --git a/source3/registry/reg_dispatcher.c b/source3/registry/reg_dispatcher.c index 7d950c3c4e..c160622054 100644 --- a/source3/registry/reg_dispatcher.c +++ b/source3/registry/reg_dispatcher.c @@ -39,7 +39,7 @@ static WERROR construct_registry_sd(TALLOC_CTX *ctx, SEC_DESC **psd) SEC_ACE ace[3]; size_t i = 0; SEC_DESC *sd; - SEC_ACL *acl; + SEC_ACL *theacl; size_t sd_size; /* basic access for Everyone */ @@ -59,14 +59,14 @@ static WERROR construct_registry_sd(TALLOC_CTX *ctx, SEC_DESC **psd) /* create the security descriptor */ - acl = make_sec_acl(ctx, NT4_ACL_REVISION, i, ace); - if (acl == NULL) { + theacl = make_sec_acl(ctx, NT4_ACL_REVISION, i, ace); + if (theacl == NULL) { return WERR_NOMEM; } sd = make_sec_desc(ctx, SEC_DESC_REVISION, SEC_DESC_SELF_RELATIVE, &global_sid_Builtin_Administrators, - &global_sid_System, NULL, acl, + &global_sid_System, NULL, theacl, &sd_size); if (sd == NULL) { return WERR_NOMEM; diff --git a/source3/rpc_client/cli_spoolss_notify.c b/source3/rpc_client/cli_spoolss_notify.c deleted file mode 100644 index 8ae7835c4e..0000000000 --- a/source3/rpc_client/cli_spoolss_notify.c +++ /dev/null @@ -1,119 +0,0 @@ -/* - Unix SMB/CIFS implementation. - RPC pipe client - - Copyright (C) Gerald Carter 2001-2002, - Copyright (C) Tim Potter 2000-2002, - Copyright (C) Andrew Tridgell 1994-2000, - Copyright (C) Jean-Francois Micouleau 1999-2000. - Copyright (C) Jeremy Allison 2005. - - 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 3 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, see <http://www.gnu.org/licenses/>. -*/ - -#include "includes.h" - -/* - * SPOOLSS Client RPC's used by servers as the notification - * back channel. - */ - -/********************************************************************* - This SPOOLSS_REPLY_RRPCN function is used to send a change - notification event when the registration **did** use - SPOOL_NOTIFY_OPTION_TYPE structure to specify the events to monitor - Also see cli_spoolss_routereplyprinter() - *********************************************************************/ - -WERROR rpccli_spoolss_rrpcn(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, - POLICY_HND *pol, uint32 notify_data_len, - SPOOL_NOTIFY_INFO_DATA *notify_data, - uint32 change_low, uint32 change_high) -{ - prs_struct qbuf, rbuf; - SPOOL_Q_REPLY_RRPCN q; - SPOOL_R_REPLY_RRPCN r; - WERROR result = W_ERROR(ERRgeneral); - SPOOL_NOTIFY_INFO notify_info; - - ZERO_STRUCT(q); - ZERO_STRUCT(r); - - ZERO_STRUCT(notify_info); - - /* Initialise input parameters */ - - notify_info.version = 0x2; - notify_info.flags = 0x00020000; /* ?? */ - notify_info.count = notify_data_len; - notify_info.data = notify_data; - - /* create and send a MSRPC command with api */ - /* store the parameters */ - - make_spoolss_q_reply_rrpcn(&q, pol, change_low, change_high, - ¬ify_info); - - /* Marshall data and send request */ - - CLI_DO_RPC_WERR( cli, mem_ctx, &syntax_spoolss, SPOOLSS_RRPCN, - q, r, - qbuf, rbuf, - spoolss_io_q_reply_rrpcn, - spoolss_io_r_reply_rrpcn, - WERR_GENERAL_FAILURE ); - - if (r.unknown0 == 0x00080000) - DEBUG(8,("cli_spoolss_reply_rrpcn: I think the spooler resonded that the notification was ignored.\n")); - else if ( r.unknown0 != 0x0 ) - DEBUG(8,("cli_spoolss_reply_rrpcn: unknown0 is non-zero [0x%x]\n", r.unknown0)); - - result = r.status; - return result; -} - -/********************************************************************* - *********************************************************************/ - -WERROR rpccli_spoolss_rffpcnex(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, - POLICY_HND *pol, uint32 flags, uint32 options, - const char *localmachine, uint32 printerlocal, - SPOOL_NOTIFY_OPTION *option) -{ - prs_struct qbuf, rbuf; - SPOOL_Q_RFFPCNEX q; - SPOOL_R_RFFPCNEX r; - WERROR result = W_ERROR(ERRgeneral); - - ZERO_STRUCT(q); - ZERO_STRUCT(r); - - /* Initialise input parameters */ - - make_spoolss_q_rffpcnex( - &q, pol, flags, options, localmachine, printerlocal, - option); - - /* Marshall data and send request */ - - CLI_DO_RPC_WERR( cli, mem_ctx, &syntax_spoolss, SPOOLSS_RFFPCNEX, - q, r, - qbuf, rbuf, - spoolss_io_q_rffpcnex, - spoolss_io_r_rffpcnex, - WERR_GENERAL_FAILURE ); - - result = r.status; - return result; -} diff --git a/source3/rpc_parse/parse_spoolss.c b/source3/rpc_parse/parse_spoolss.c index 577ba73a42..435bb1bd80 100644 --- a/source3/rpc_parse/parse_spoolss.c +++ b/source3/rpc_parse/parse_spoolss.c @@ -71,387 +71,6 @@ bool make_systemtime(SYSTEMTIME *systime, struct tm *unixtime) } /******************************************************************* -reads or writes an NOTIFY OPTION TYPE structure. -********************************************************************/ - -/* NOTIFY_OPTION_TYPE and NOTIFY_OPTION_TYPE_DATA are really one - structure. The _TYPE structure is really the deferred referrants (i.e - the notify fields array) of the _TYPE structure. -tpot */ - -static bool smb_io_notify_option_type(const char *desc, SPOOL_NOTIFY_OPTION_TYPE *type, prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "smb_io_notify_option_type"); - depth++; - - if (!prs_align(ps)) - return False; - - if(!prs_uint16("type", ps, depth, &type->type)) - return False; - if(!prs_uint16("reserved0", ps, depth, &type->reserved0)) - return False; - if(!prs_uint32("reserved1", ps, depth, &type->reserved1)) - return False; - if(!prs_uint32("reserved2", ps, depth, &type->reserved2)) - return False; - if(!prs_uint32("count", ps, depth, &type->count)) - return False; - if(!prs_uint32("fields_ptr", ps, depth, &type->fields_ptr)) - return False; - - return True; -} - -/******************************************************************* -reads or writes an NOTIFY OPTION TYPE DATA. -********************************************************************/ - -static bool smb_io_notify_option_type_data(const char *desc, SPOOL_NOTIFY_OPTION_TYPE *type, prs_struct *ps, int depth) -{ - int i; - - prs_debug(ps, depth, desc, "smb_io_notify_option_type_data"); - depth++; - - /* if there are no fields just return */ - if (type->fields_ptr==0) - return True; - - if(!prs_align(ps)) - return False; - - if(!prs_uint32("count2", ps, depth, &type->count2)) - return False; - - if (type->count2 != type->count) - DEBUG(4,("What a mess, count was %x now is %x !\n", type->count, type->count2)); - - if (type->count2 > MAX_NOTIFY_TYPE_FOR_NOW) { - return False; - } - - /* parse the option type data */ - for(i=0;i<type->count2;i++) - if(!prs_uint16("fields",ps,depth,&type->fields[i])) - return False; - return True; -} - -/******************************************************************* -reads or writes an NOTIFY OPTION structure. -********************************************************************/ - -static bool smb_io_notify_option_type_ctr(const char *desc, SPOOL_NOTIFY_OPTION_TYPE_CTR *ctr , prs_struct *ps, int depth) -{ - int i; - - prs_debug(ps, depth, desc, "smb_io_notify_option_type_ctr"); - depth++; - - if(!prs_uint32("count", ps, depth, &ctr->count)) - return False; - - /* reading */ - if (UNMARSHALLING(ps) && ctr->count) - if((ctr->type=PRS_ALLOC_MEM(ps,SPOOL_NOTIFY_OPTION_TYPE,ctr->count)) == NULL) - return False; - - /* the option type struct */ - for(i=0;i<ctr->count;i++) - if(!smb_io_notify_option_type("", &ctr->type[i] , ps, depth)) - return False; - - /* the type associated with the option type struct */ - for(i=0;i<ctr->count;i++) - if(!smb_io_notify_option_type_data("", &ctr->type[i] , ps, depth)) - return False; - - return True; -} - -/******************************************************************* -reads or writes an NOTIFY OPTION structure. -********************************************************************/ - -static bool smb_io_notify_option(const char *desc, SPOOL_NOTIFY_OPTION *option, prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "smb_io_notify_option"); - depth++; - - if(!prs_uint32("version", ps, depth, &option->version)) - return False; - if(!prs_uint32("flags", ps, depth, &option->flags)) - return False; - if(!prs_uint32("count", ps, depth, &option->count)) - return False; - if(!prs_uint32("option_type_ptr", ps, depth, &option->option_type_ptr)) - return False; - - /* marshalling or unmarshalling, that would work */ - if (option->option_type_ptr!=0) { - if(!smb_io_notify_option_type_ctr("", &option->ctr ,ps, depth)) - return False; - } - else { - option->ctr.type=NULL; - option->ctr.count=0; - } - - return True; -} - -/******************************************************************* -reads or writes an NOTIFY INFO DATA structure. -********************************************************************/ - -static bool smb_io_notify_info_data(const char *desc,SPOOL_NOTIFY_INFO_DATA *data, prs_struct *ps, int depth) -{ - uint32 useless_ptr=0x0FF0ADDE; - - prs_debug(ps, depth, desc, "smb_io_notify_info_data"); - depth++; - - if(!prs_align(ps)) - return False; - if(!prs_uint16("type", ps, depth, &data->type)) - return False; - if(!prs_uint16("field", ps, depth, &data->field)) - return False; - - if(!prs_uint32("how many words", ps, depth, &data->size)) - return False; - if(!prs_uint32("id", ps, depth, &data->id)) - return False; - if(!prs_uint32("how many words", ps, depth, &data->size)) - return False; - - switch (data->enc_type) { - - /* One and two value data has two uint32 values */ - - case NOTIFY_ONE_VALUE: - case NOTIFY_TWO_VALUE: - - if(!prs_uint32("value[0]", ps, depth, &data->notify_data.value[0])) - return False; - if(!prs_uint32("value[1]", ps, depth, &data->notify_data.value[1])) - return False; - break; - - /* Pointers and strings have a string length and a - pointer. For a string the length is expressed as - the number of uint16 characters plus a trailing - \0\0. */ - - case NOTIFY_POINTER: - - if(!prs_uint32("string length", ps, depth, &data->notify_data.data.length )) - return False; - if(!prs_uint32("pointer", ps, depth, &useless_ptr)) - return False; - - break; - - case NOTIFY_STRING: - - if(!prs_uint32("string length", ps, depth, &data->notify_data.data.length)) - return False; - - if(!prs_uint32("pointer", ps, depth, &useless_ptr)) - return False; - - break; - - case NOTIFY_SECDESC: - if( !prs_uint32( "sd size", ps, depth, &data->notify_data.sd.size ) ) - return False; - if( !prs_uint32( "pointer", ps, depth, &useless_ptr ) ) - return False; - - break; - - default: - DEBUG(3, ("invalid enc_type %d for smb_io_notify_info_data\n", - data->enc_type)); - break; - } - - return True; -} - -/******************************************************************* -reads or writes an NOTIFY INFO DATA structure. -********************************************************************/ - -bool smb_io_notify_info_data_strings(const char *desc,SPOOL_NOTIFY_INFO_DATA *data, - prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "smb_io_notify_info_data_strings"); - depth++; - - if(!prs_align(ps)) - return False; - - switch(data->enc_type) { - - /* No data for values */ - - case NOTIFY_ONE_VALUE: - case NOTIFY_TWO_VALUE: - - break; - - /* Strings start with a length in uint16s */ - - case NOTIFY_STRING: - - if (MARSHALLING(ps)) - data->notify_data.data.length /= 2; - - if(!prs_uint32("string length", ps, depth, &data->notify_data.data.length)) - return False; - - if (UNMARSHALLING(ps) && data->notify_data.data.length) { - data->notify_data.data.string = PRS_ALLOC_MEM(ps, uint16, - data->notify_data.data.length); - - if (!data->notify_data.data.string) - return False; - } - - if (!prs_uint16uni(True, "string", ps, depth, data->notify_data.data.string, - data->notify_data.data.length)) - return False; - - if (MARSHALLING(ps)) - data->notify_data.data.length *= 2; - - break; - - case NOTIFY_POINTER: - - if (UNMARSHALLING(ps) && data->notify_data.data.length) { - data->notify_data.data.string = PRS_ALLOC_MEM(ps, uint16, - data->notify_data.data.length); - - if (!data->notify_data.data.string) - return False; - } - - if(!prs_uint8s(True,"buffer",ps,depth,(uint8*)data->notify_data.data.string,data->notify_data.data.length)) - return False; - - break; - - case NOTIFY_SECDESC: - if( !prs_uint32("secdesc size ", ps, depth, &data->notify_data.sd.size ) ) - return False; - if ( !sec_io_desc( "sec_desc", &data->notify_data.sd.desc, ps, depth ) ) - return False; - break; - - default: - DEBUG(3, ("invalid enc_type %d for smb_io_notify_info_data_strings\n", - data->enc_type)); - break; - } - -#if 0 - if (isvalue==False) { - - /* length of string in unicode include \0 */ - x=data->notify_data.data.length+1; - - if (data->field != 16) - if(!prs_uint32("string length", ps, depth, &x )) - return False; - - if (MARSHALLING(ps)) { - /* These are already in little endian format. Don't byte swap. */ - if (x == 1) { - - /* No memory allocated for this string - therefore following the data.string - pointer is a bad idea. Use a pointer to - the uint32 length union member to - provide a source for a unicode NULL */ - - if(!prs_uint8s(True,"string",ps,depth, (uint8 *)&data->notify_data.data.length,x*2)) - return False; - } else { - - if (data->field == 16) - x /= 2; - - if(!prs_uint16uni(True,"string",ps,depth,data->notify_data.data.string,x)) - return False; - } - } else { - - /* Tallocate memory for string */ - - if (x) { - data->notify_data.data.string = PRS_ALLOC_MEM(ps, uint16, x * 2); - if (!data->notify_data.data.string) - return False; - } else { - data->notify_data.data.string = NULL; - } - - if(!prs_uint16uni(True,"string",ps,depth,data->notify_data.data.string,x)) - return False; - } - } - -#endif - -#if 0 /* JERRY */ - /* Win2k does not seem to put this parse align here */ - if(!prs_align(ps)) - return False; -#endif - - return True; -} - -/******************************************************************* -reads or writes an NOTIFY INFO structure. -********************************************************************/ - -static bool smb_io_notify_info(const char *desc, SPOOL_NOTIFY_INFO *info, prs_struct *ps, int depth) -{ - int i; - - prs_debug(ps, depth, desc, "smb_io_notify_info"); - depth++; - - if(!prs_align(ps)) - return False; - - if(!prs_uint32("count", ps, depth, &info->count)) - return False; - if(!prs_uint32("version", ps, depth, &info->version)) - return False; - if(!prs_uint32("flags", ps, depth, &info->flags)) - return False; - if(!prs_uint32("count", ps, depth, &info->count)) - return False; - - for (i=0;i<info->count;i++) { - if(!smb_io_notify_info_data(desc, &info->data[i], ps, depth)) - return False; - } - - /* now do the strings at the end of the stream */ - for (i=0;i<info->count;i++) { - if(!smb_io_notify_info_data_strings(desc, &info->data[i], ps, depth)) - return False; - } - - return True; -} - -/******************************************************************* ********************************************************************/ bool spool_io_user_level_1( const char *desc, prs_struct *ps, int depth, SPOOL_USER_1 *q_u ) @@ -1014,130 +633,6 @@ bool spoolss_io_r_getprinterdata(const char *desc, SPOOL_R_GETPRINTERDATA *r_u, } /******************************************************************* - * read a structure. - * called from spoolss_q_rffpcnex (srv_spoolss.c) - ********************************************************************/ - -bool spoolss_io_q_rffpcnex(const char *desc, SPOOL_Q_RFFPCNEX *q_u, prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "spoolss_io_q_rffpcnex"); - depth++; - - if(!prs_align(ps)) - return False; - - if(!smb_io_pol_hnd("printer handle", &q_u->handle, ps, depth)) - return False; - if(!prs_uint32("flags", ps, depth, &q_u->flags)) - return False; - if(!prs_uint32("options", ps, depth, &q_u->options)) - return False; - if(!prs_uint32("localmachine_ptr", ps, depth, &q_u->localmachine_ptr)) - return False; - if(!smb_io_unistr2("localmachine", &q_u->localmachine, q_u->localmachine_ptr, ps, depth)) - return False; - - if(!prs_align(ps)) - return False; - - if(!prs_uint32("printerlocal", ps, depth, &q_u->printerlocal)) - return False; - - if(!prs_uint32("option_ptr", ps, depth, &q_u->option_ptr)) - return False; - - if (q_u->option_ptr!=0) { - - if (UNMARSHALLING(ps)) - if((q_u->option=PRS_ALLOC_MEM(ps,SPOOL_NOTIFY_OPTION,1)) == NULL) - return False; - - if(!smb_io_notify_option("notify option", q_u->option, ps, depth)) - return False; - } - - return True; -} - -/******************************************************************* - * write a structure. - * called from spoolss_r_rffpcnex (srv_spoolss.c) - ********************************************************************/ - -bool spoolss_io_r_rffpcnex(const char *desc, SPOOL_R_RFFPCNEX *r_u, prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "spoolss_io_r_rffpcnex"); - depth++; - - if(!prs_werror("status", ps, depth, &r_u->status)) - return False; - - return True; -} - -/******************************************************************* - * read a structure. - * called from spoolss_q_rfnpcnex (srv_spoolss.c) - ********************************************************************/ - -bool spoolss_io_q_rfnpcnex(const char *desc, SPOOL_Q_RFNPCNEX *q_u, prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "spoolss_io_q_rfnpcnex"); - depth++; - - if(!prs_align(ps)) - return False; - - if(!smb_io_pol_hnd("printer handle",&q_u->handle,ps,depth)) - return False; - - if(!prs_uint32("change", ps, depth, &q_u->change)) - return False; - - if(!prs_uint32("option_ptr", ps, depth, &q_u->option_ptr)) - return False; - - if (q_u->option_ptr!=0) { - - if (UNMARSHALLING(ps)) - if((q_u->option=PRS_ALLOC_MEM(ps,SPOOL_NOTIFY_OPTION,1)) == NULL) - return False; - - if(!smb_io_notify_option("notify option", q_u->option, ps, depth)) - return False; - } - - return True; -} - -/******************************************************************* - * write a structure. - * called from spoolss_r_rfnpcnex (srv_spoolss.c) - ********************************************************************/ - -bool spoolss_io_r_rfnpcnex(const char *desc, SPOOL_R_RFNPCNEX *r_u, prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "spoolss_io_r_rfnpcnex"); - depth++; - - if(!prs_align(ps)) - return False; - - if (!prs_uint32("info_ptr", ps, depth, &r_u->info_ptr)) - return False; - - if(!smb_io_notify_info("notify info", &r_u->info ,ps,depth)) - return False; - - if(!prs_align(ps)) - return False; - if(!prs_werror("status", ps, depth, &r_u->status)) - return False; - - return True; -} - -/******************************************************************* * return the length of a uint16 (obvious, but the code is clean) ********************************************************************/ @@ -4619,170 +4114,6 @@ void free_job_info_2(JOB_INFO_2 *job) free_devmode(job->devmode); } -#if 0 /* JERRY - not currently used but could be :-) */ - -/******************************************************************* - Deep copy a SPOOL_NOTIFY_INFO_DATA structure - ******************************************************************/ -static bool copy_spool_notify_info_data(SPOOL_NOTIFY_INFO_DATA *dst, - SPOOL_NOTIFY_INFO_DATA *src, int n) -{ - int i; - - memcpy(dst, src, sizeof(SPOOL_NOTIFY_INFO_DATA)*n); - - for (i=0; i<n; i++) { - int len; - uint16 *s = NULL; - - if (src->size != POINTER) - continue; - len = src->notify_data.data.length; - s = SMB_MALLOC_ARRAY(uint16, len); - if (s == NULL) { - DEBUG(0,("copy_spool_notify_info_data: malloc() failed!\n")); - return False; - } - - memcpy(s, src->notify_data.data.string, len*2); - dst->notify_data.data.string = s; - } - - return True; -} - -/******************************************************************* - Deep copy a SPOOL_NOTIFY_INFO structure - ******************************************************************/ -static bool copy_spool_notify_info(SPOOL_NOTIFY_INFO *dst, SPOOL_NOTIFY_INFO *src) -{ - if (!dst) { - DEBUG(0,("copy_spool_notify_info: NULL destination pointer!\n")); - return False; - } - - dst->version = src->version; - dst->flags = src->flags; - dst->count = src->count; - - if (dst->count) - { - dst->data = SMB_MALLOC_ARRAY(SPOOL_NOTIFY_INFO_DATA, dst->count); - - DEBUG(10,("copy_spool_notify_info: allocating space for [%d] PRINTER_NOTIFY_INFO_DATA entries\n", - dst->count)); - - if (dst->data == NULL) { - DEBUG(0,("copy_spool_notify_info: malloc() failed for [%d] entries!\n", - dst->count)); - return False; - } - - return (copy_spool_notify_info_data(dst->data, src->data, src->count)); - } - - return True; -} -#endif /* JERRY */ - -/******************************************************************* - * init a structure. - ********************************************************************/ - -bool make_spoolss_q_reply_rrpcn(SPOOL_Q_REPLY_RRPCN *q_u, POLICY_HND *hnd, - uint32 change_low, uint32 change_high, - SPOOL_NOTIFY_INFO *info) -{ - if (q_u == NULL) - return False; - - memcpy(&q_u->handle, hnd, sizeof(q_u->handle)); - - q_u->change_low=change_low; - q_u->change_high=change_high; - - q_u->unknown0=0x0; - q_u->unknown1=0x0; - - q_u->info_ptr=0x0FF0ADDE; - - q_u->info.version=2; - - if (info->count) { - DEBUG(10,("make_spoolss_q_reply_rrpcn: [%d] PRINTER_NOTIFY_INFO_DATA\n", - info->count)); - q_u->info.version = info->version; - q_u->info.flags = info->flags; - q_u->info.count = info->count; - /* pointer field - be careful! */ - q_u->info.data = info->data; - } - else { - q_u->info.flags=PRINTER_NOTIFY_INFO_DISCARDED; - q_u->info.count=0; - } - - return True; -} - -/******************************************************************* - Parse a SPOOL_Q_REPLY_RRPCN structure. -********************************************************************/ - -bool spoolss_io_q_reply_rrpcn(const char *desc, SPOOL_Q_REPLY_RRPCN *q_u, prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "spoolss_io_q_reply_rrpcn"); - depth++; - - if(!prs_align(ps)) - return False; - - if(!smb_io_pol_hnd("printer handle",&q_u->handle,ps,depth)) - return False; - - if (!prs_uint32("change_low", ps, depth, &q_u->change_low)) - return False; - - if (!prs_uint32("change_high", ps, depth, &q_u->change_high)) - return False; - - if (!prs_uint32("unknown0", ps, depth, &q_u->unknown0)) - return False; - - if (!prs_uint32("unknown1", ps, depth, &q_u->unknown1)) - return False; - - if (!prs_uint32("info_ptr", ps, depth, &q_u->info_ptr)) - return False; - - if(q_u->info_ptr!=0) - if(!smb_io_notify_info(desc, &q_u->info, ps, depth)) - return False; - - return True; -} - -/******************************************************************* - Parse a SPOOL_R_REPLY_RRPCN structure. -********************************************************************/ - -bool spoolss_io_r_reply_rrpcn(const char *desc, SPOOL_R_REPLY_RRPCN *r_u, prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "spoolss_io_r_reply_rrpcn"); - depth++; - - if (!prs_align(ps)) - return False; - - if (!prs_uint32("unknown0", ps, depth, &r_u->unknown0)) - return False; - - if (!prs_werror("status", ps, depth, &r_u->status)) - return False; - - return True; -} - /******************************************************************* * read a structure. ********************************************************************/ @@ -5071,30 +4402,3 @@ bool make_spoolss_q_getjob(SPOOL_Q_GETJOB *q_u, POLICY_HND *handle, return True; } - -/******************************************************************* - * init a structure. - ********************************************************************/ - -bool make_spoolss_q_rffpcnex(SPOOL_Q_RFFPCNEX *q_u, POLICY_HND *handle, - uint32 flags, uint32 options, const char *localmachine, - uint32 printerlocal, SPOOL_NOTIFY_OPTION *option) -{ - memcpy(&q_u->handle, handle, sizeof(POLICY_HND)); - - q_u->flags = flags; - q_u->options = options; - - q_u->localmachine_ptr = 1; - - init_unistr2(&q_u->localmachine, localmachine, UNI_STR_TERMINATE); - - q_u->printerlocal = printerlocal; - - if (option) - q_u->option_ptr = 1; - - q_u->option = option; - - return True; -} diff --git a/source3/rpc_server/srv_svcctl_nt.c b/source3/rpc_server/srv_svcctl_nt.c index 33bf3d0098..b90a189f7e 100644 --- a/source3/rpc_server/srv_svcctl_nt.c +++ b/source3/rpc_server/srv_svcctl_nt.c @@ -139,7 +139,7 @@ static SEC_DESC* construct_scm_sd( TALLOC_CTX *ctx ) SEC_ACE ace[2]; size_t i = 0; SEC_DESC *sd; - SEC_ACL *acl; + SEC_ACL *theacl; size_t sd_size; /* basic access for Everyone */ @@ -155,12 +155,12 @@ static SEC_DESC* construct_scm_sd( TALLOC_CTX *ctx ) /* create the security descriptor */ - if ( !(acl = make_sec_acl(ctx, NT4_ACL_REVISION, i, ace)) ) + if ( !(theacl = make_sec_acl(ctx, NT4_ACL_REVISION, i, ace)) ) return NULL; if ( !(sd = make_sec_desc(ctx, SECURITY_DESCRIPTOR_REVISION_1, SEC_DESC_SELF_RELATIVE, NULL, NULL, NULL, - acl, &sd_size)) ) + theacl, &sd_size)) ) return NULL; return sd; diff --git a/source3/services/services_db.c b/source3/services/services_db.c index 6d1b5d5b95..ef975cfbc4 100644 --- a/source3/services/services_db.c +++ b/source3/services/services_db.c @@ -91,7 +91,7 @@ static SEC_DESC* construct_service_sd( TALLOC_CTX *ctx ) SEC_ACE ace[4]; size_t i = 0; SEC_DESC *sd = NULL; - SEC_ACL *acl = NULL; + SEC_ACL *theacl = NULL; size_t sd_size; /* basic access for Everyone */ @@ -109,12 +109,12 @@ static SEC_DESC* construct_service_sd( TALLOC_CTX *ctx ) /* create the security descriptor */ - if ( !(acl = make_sec_acl(ctx, NT4_ACL_REVISION, i, ace)) ) + if ( !(theacl = make_sec_acl(ctx, NT4_ACL_REVISION, i, ace)) ) return NULL; if ( !(sd = make_sec_desc(ctx, SECURITY_DESCRIPTOR_REVISION_1, SEC_DESC_SELF_RELATIVE, NULL, NULL, NULL, - acl, &sd_size)) ) + theacl, &sd_size)) ) return NULL; return sd; diff --git a/source3/utils/profiles.c b/source3/utils/profiles.c index 5dd788ad5f..bbbaaf089f 100644 --- a/source3/utils/profiles.c +++ b/source3/utils/profiles.c @@ -57,7 +57,7 @@ static void verbose_output(const char *format, ...) static bool swap_sid_in_acl( SEC_DESC *sd, DOM_SID *s1, DOM_SID *s2 ) { - SEC_ACL *acl; + SEC_ACL *theacl; int i; bool update = False; @@ -78,30 +78,30 @@ static bool swap_sid_in_acl( SEC_DESC *sd, DOM_SID *s1, DOM_SID *s2 ) sid_string_tos(sd->group_sid)); } - acl = sd->dacl; - verbose_output(" DACL: %d entries:\n", acl->num_aces); - for ( i=0; i<acl->num_aces; i++ ) { + theacl = sd->dacl; + verbose_output(" DACL: %d entries:\n", theacl->num_aces); + for ( i=0; i<theacl->num_aces; i++ ) { verbose_output(" Trustee SID: %s\n", - sid_string_tos(&acl->aces[i].trustee)); - if ( sid_equal( &acl->aces[i].trustee, s1 ) ) { - sid_copy( &acl->aces[i].trustee, s2 ); + sid_string_tos(&theacl->aces[i].trustee)); + if ( sid_equal( &theacl->aces[i].trustee, s1 ) ) { + sid_copy( &theacl->aces[i].trustee, s2 ); update = True; verbose_output(" New Trustee SID: %s\n", - sid_string_tos(&acl->aces[i].trustee)); + sid_string_tos(&theacl->aces[i].trustee)); } } #if 0 - acl = sd->sacl; - verbose_output(" SACL: %d entries: \n", acl->num_aces); - for ( i=0; i<acl->num_aces; i++ ) { + theacl = sd->sacl; + verbose_output(" SACL: %d entries: \n", theacl->num_aces); + for ( i=0; i<theacl->num_aces; i++ ) { verbose_output(" Trustee SID: %s\n", - sid_string_tos(&acl->aces[i].trustee)); - if ( sid_equal( &acl->aces[i].trustee, s1 ) ) { - sid_copy( &acl->aces[i].trustee, s2 ); + sid_string_tos(&theacl->aces[i].trustee)); + if ( sid_equal( &theacl->aces[i].trustee, s1 ) ) { + sid_copy( &theacl->aces[i].trustee, s2 ); update = True; verbose_output(" New Trustee SID: %s\n", - sid_string_tos(&acl->aces[i].trustee)); + sid_string_tos(&theacl->aces[i].trustee)); } } #endif diff --git a/source3/utils/sharesec.c b/source3/utils/sharesec.c index ae2a9adf64..4be77ecadd 100644 --- a/source3/utils/sharesec.c +++ b/source3/utils/sharesec.c @@ -298,7 +298,7 @@ static SEC_DESC* parse_acl_string(TALLOC_CTX *mem_ctx, const char *szACL, size_t { SEC_DESC *sd = NULL; SEC_ACE *ace; - SEC_ACL *acl; + SEC_ACL *theacl; int num_ace; const char *pacl; int i; @@ -326,11 +326,11 @@ static SEC_DESC* parse_acl_string(TALLOC_CTX *mem_ctx, const char *szACL, size_t pacl++; } - if ( !(acl = make_sec_acl( mem_ctx, NT4_ACL_REVISION, num_ace, ace )) ) + if ( !(theacl = make_sec_acl( mem_ctx, NT4_ACL_REVISION, num_ace, ace )) ) return NULL; sd = make_sec_desc( mem_ctx, SEC_DESC_REVISION, SEC_DESC_SELF_RELATIVE, - NULL, NULL, NULL, acl, sd_size); + NULL, NULL, NULL, theacl, sd_size); return sd; } |