Merge branch 'master' of ssh://git.samba.org/data/git/samba
authorJelmer Vernooij <jelmer@samba.org>
Tue, 24 Feb 2009 00:02:45 +0000 (01:02 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Tue, 24 Feb 2009 00:02:45 +0000 (01:02 +0100)
50 files changed:
libcli/util/doserr.c
libcli/util/werror.h
librpc/ndr/ndr_sec_helper.c
selftest/target/Samba4.pm
source3/Makefile.in
source3/include/libsmbclient.h
source3/include/proto.h
source3/include/rpc_spoolss.h
source3/libgpo/gpo_reg.c
source3/libsmb/libsmb_context.c
source3/modules/nfs4_acls.c
source3/modules/nfs4_acls.h
source3/modules/vfs_solarisacl.c
source3/registry/reg_dispatcher.c
source3/rpc_client/cli_spoolss_notify.c [deleted file]
source3/rpc_parse/parse_spoolss.c
source3/rpc_server/srv_svcctl_nt.c
source3/services/services_db.c
source3/utils/profiles.c
source3/utils/sharesec.c
source4/dsdb/samdb/ldb_modules/config.mk
source4/dsdb/samdb/ldb_modules/linked_attributes.c
source4/dsdb/samdb/ldb_modules/objectclass.c
source4/dsdb/samdb/ldb_modules/ranged_results.c
source4/dsdb/samdb/ldb_modules/samba3sam.c
source4/dsdb/samdb/ldb_modules/update_keytab.c
source4/dsdb/schema/schema_set.c
source4/lib/ldb/Makefile.in
source4/lib/ldb/common/ldb.c
source4/lib/ldb/common/ldb_modules.c
source4/lib/ldb/include/ldb.h
source4/lib/ldb/include/ldb_includes.h
source4/lib/ldb/include/ldb_private.h
source4/lib/ldb/ldb_ildap/ldb_ildap.c
source4/lib/ldb/ldb_ldap/ldb_ldap.c
source4/lib/ldb/ldb_map/ldb_map.c
source4/lib/ldb/ldb_map/ldb_map.h
source4/lib/ldb/ldb_map/ldb_map_inbound.c
source4/lib/ldb/ldb_map/ldb_map_outbound.c
source4/lib/ldb/ldb_map/ldb_map_private.h
source4/lib/ldb/ldb_tdb/ldb_index.c
source4/lib/ldb/ldb_tdb/ldb_tdb.c
source4/lib/ldb/ldb_tdb/ldb_tdb.h
source4/lib/ldb/modules/operational.c
source4/lib/ldb/modules/paged_results.c
source4/lib/ldb/modules/rdn_name.c
source4/lib/ldb/tools/cmdline.c
source4/lib/ldb/tools/ldbedit.c
source4/lib/ldb/tools/ldbsearch.c
source4/lib/ldb/tools/ldbtest.c

index 160e7bc3e0bb7ca7014beccbd9eb9f0dbb70b89a..226c2f950d50b9e595a4f633d563d532fae1eaf3 100644 (file)
@@ -135,6 +135,7 @@ static const struct werror_code_struct dos_errs[] =
        { "WERR_INVALID_FLAGS", WERR_INVALID_FLAGS },
        { "WERR_NOT_FOUND", WERR_NOT_FOUND },
        { "WERR_SERVER_UNAVAILABLE", WERR_SERVER_UNAVAILABLE },
+       { "WERR_INVALID_USER_BUFFER", WERR_INVALID_USER_BUFFER },
        { "WERR_NO_TRUST_SAM_ACCOUNT", WERR_NO_TRUST_SAM_ACCOUNT },
        { "WERR_CLASS_NOT_REGISTERED", WERR_CLASS_NOT_REGISTERED },
        { "WERR_NO_SHUTDOWN_IN_PROGRESS", WERR_NO_SHUTDOWN_IN_PROGRESS },
index d22516ae5c4aecebe46cffff80974e5be1453be3..4b34b14243808542829f06af4de20b4524ab291b 100644 (file)
@@ -136,6 +136,7 @@ typedef uint32_t WERROR;
 #define WERR_TIME_SKEW W_ERROR(1398)
 #define WERR_EVENTLOG_FILE_CORRUPT W_ERROR(1500)
 #define WERR_SERVER_UNAVAILABLE W_ERROR(1722)
+#define WERR_INVALID_USER_BUFFER W_ERROR(1784)
 #define WERR_NO_TRUST_SAM_ACCOUNT W_ERROR(1787)
 #define WERR_INVALID_FORM_NAME W_ERROR(1902)
 #define WERR_INVALID_FORM_SIZE W_ERROR(1903)
index 8f84c02f911724a66a79d424dd020e5d35e31af3..62194707c20314a259bffce8dd4013e4a6baa43e 100644 (file)
@@ -91,14 +91,14 @@ enum ndr_err_code ndr_pull_security_ace(struct ndr_pull *ndr, int ndr_flags, str
 /*
   return the wire size of a security_acl
 */
-size_t ndr_size_security_acl(const struct security_acl *acl, struct smb_iconv_convenience *ic, int flags)
+size_t ndr_size_security_acl(const struct security_acl *theacl, struct smb_iconv_convenience *ic, int flags)
 {
        size_t ret;
        int i;
-       if (!acl) return 0;
+       if (!theacl) return 0;
        ret = 8;
-       for (i=0;i<acl->num_aces;i++) {
-               ret += ndr_size_security_ace(&acl->aces[i], ic, flags);
+       for (i=0;i<theacl->num_aces;i++) {
+               ret += ndr_size_security_ace(&theacl->aces[i], ic, flags);
        }
        return ret;
 }
index 7264ddbcb952bd91ddd11b9861704d22fc89fd1f..09138cf0aa7541e52cd7943439febe8fec33f7c2 100644 (file)
@@ -578,7 +578,7 @@ sub provision_raw_prepare($$$$$$$)
        push (@provision_options, "NSS_WRAPPER_PASSWD=\"$ctx->{nsswrap_passwd}\"");
        push (@provision_options, "NSS_WRAPPER_GROUP=\"$ctx->{nsswrap_group}\"");
        if (defined($ENV{GDB_PROVISION})) {
-               push (@provision_options, "gdb --args python");
+               push (@provision_options, "gdb --args");
        }
        if (defined($ENV{VALGRIND_PROVISION})) {
                push (@provision_options, "valgrind");
index d4a849cbc7342a23dd954120f1012294057d731d..7564659dd3f277f1e3774b92dc1447b187d7ac04 100644 (file)
@@ -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 \
index 8c642b1794cd6354a86016c8be1300253c2c9bfa..869aeb6a032336512c101f528e61f07041cc95c5 100644 (file)
@@ -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.
index 93b4ca8c7d114a4d567d53e78ad2f7019d6bb6eb..faf47d38441ef1ee95de8905f8d8d9cf2ddd6d99 100644 (file)
@@ -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,
index 670eca4ca4c37da82afd4ca2a23e6b2a9839c305..504cfea70b17ebbf3b40a0a52569913a00911d43 100644 (file)
@@ -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;
index 3d385dec1407cde1bb09e5496c7f38f15cd55015..9367bcae9c24b644d737dd169c32b25476fe5830 100644 (file)
@@ -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;
index c7c9903b7611e83ed9264c3a60cde59b567a1ec0..4c12d18ab7b62a7dca92a2f22e671f6a9e27ab61 100644 (file)
@@ -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();
index ba038479af4b3356f2af92aad06e2a74c98bd8bc..7756f8f3abff372a3992dcc88794abec0e9d6c02 100644 (file)
@@ -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, &params, sbuf.st_uid, sbuf.st_gid);
-       if (!acl)
+       theacl = smbacl4_win2nfs4(fsp->fsp_name, psd->dacl, &params, 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();
index a227c6e0fcaac486ec0e210e338fb688dc65e819..b2d1196b26050f16f1a030b66240a3b05187eed9 100644 (file)
@@ -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 */
index 7bdfe8465b1bbdba5380c6bc68ef17cf49980ef8..cafb077555d3e677e907eb91c6744e5301d74640 100644 (file)
@@ -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 */
 
index 7d950c3c4e85c7f3bcc04db8cefe161d8d502039..c16062205409193eb16d3663bba331813772f0a5 100644 (file)
@@ -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 (file)
index 8ae7835..0000000
+++ /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, 
-                                  &notify_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;
-}
index 577ba73a42c516fbee922c76880acf874dfc974d..435bb1bd80a382b650de5f9793f836b4a0872aac 100644 (file)
@@ -70,387 +70,6 @@ bool make_systemtime(SYSTEMTIME *systime, struct tm *unixtime)
        return True;
 }
 
-/*******************************************************************
-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;
-}
-
 /*******************************************************************
 ********************************************************************/  
 
@@ -1013,130 +632,6 @@ bool spoolss_io_r_getprinterdata(const char *desc, SPOOL_R_GETPRINTERDATA *r_u,
        return True;
 }
 
-/*******************************************************************
- * 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;
-}
index 33bf3d0098af555a15f7607c834cc199ea6a33a9..b90a189f7e3fcb14361af9caedcc2f9d0b7197a7 100644 (file)
@@ -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;
index 6d1b5d5b952dde365c0c0d73ba0a8b052311755b..ef975cfbc4ef294ef080e1f5cc704daa7286f6de 100644 (file)
@@ -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;
index 5dd788ad5ff937eac2c7d13d40422083ab280c2f..bbbaaf089f81672923b1ea327452d98588657d60 100644 (file)
@@ -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
index ae2a9adf6497ae0bab8bd13ef7da85694e6e0428..4be77ecadd633f888ad79ea18506a1bfc03a2fe0 100644 (file)
@@ -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;
 }
index 01f5188b6f45c25512b7fd8a1c0d603e0f092784..583d1dcf042e1a2a7bfc7dfa006132e4d5729386 100644 (file)
@@ -89,7 +89,7 @@ ldb_samldb_OBJ_FILES = \
 [MODULE::ldb_samba3sam]
 SUBSYSTEM = LIBLDB
 INIT_FUNCTION = LDB_MODULE(samba3sam)
-PRIVATE_DEPENDENCIES = LIBTALLOC LIBEVENTS SMBPASSWD \
+PRIVATE_DEPENDENCIES = LIBTALLOC LIBEVENTS LIBLDB SMBPASSWD \
                        NSS_WRAPPER LIBSECURITY NDR_SECURITY
 # End MODULE ldb_samldb
 ################################################
@@ -102,7 +102,7 @@ ldb_samba3sam_OBJ_FILES = \
 [MODULE::ldb_simple_ldap_map]
 SUBSYSTEM = LIBLDB
 INIT_FUNCTION = LDB_MODULE(entryuuid),LDB_MODULE(nsuniqueid)
-PRIVATE_DEPENDENCIES = LIBTALLOC LIBEVENTS LIBNDR
+PRIVATE_DEPENDENCIES = LIBTALLOC LIBEVENTS LIBLDB LIBNDR
 ENABLE = YES
 ALIASES = entryuuid nsuniqueid
 # End MODULE ldb_entryuuid
index 2365a58f78ac3f88dc38bebf22d1b58420d12eb8..4e28c8a1496b8d85846ffdcd67412caba845bda5 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "includes.h"
 #include "ldb_module.h"
+#include "dlinklist.h"
 #include "dsdb/samdb/samdb.h"
 
 struct la_op_store {
index 0261bb32e9274d6026f2234cdb1373d8c3a3f370..898d9139659598745acebe4ebb554e23aa4bdb7f 100644 (file)
@@ -35,6 +35,7 @@
 
 #include "includes.h"
 #include "ldb_module.h"
+#include "dlinklist.h"
 #include "dsdb/samdb/samdb.h"
 #include "librpc/ndr/libndr.h"
 #include "librpc/gen_ndr/ndr_security.h"
index 8f36baa7d6382e654a75c0c26c26748c6c6dc94b..5ce69a26a2f1958c80ceae7e09105eed388b7af5 100644 (file)
@@ -29,6 +29,7 @@
  *  Author: Andrew Bartlett
  */
 
+#include "includes.h"
 #include "ldb_module.h"
 
 struct rr_context {
index 3f10748085305a202501aaf0edb578cd1b979f7a..59cb9de71701fc1ae70970a0dd58c122fcc47613 100644 (file)
@@ -6,7 +6,7 @@
 */
 
 #include "includes.h"
-#include "ldb/include/ldb_module.h"
+#include "ldb_module.h"
 #include "ldb/ldb_map/ldb_map.h"
 #include "system/passwd.h"
 
index 8920afee71a439641649666559ef9ca6c58221bc..f1b6863cdbe0ea6ecb269930b331b0bb9ec6f044 100644 (file)
@@ -29,6 +29,7 @@
 
 #include "includes.h"
 #include "ldb_module.h"
+#include "dlinklist.h"
 #include "auth/credentials/credentials.h"
 #include "auth/credentials/credentials_krb5.h"
 #include "system/kerberos.h"
index d6b3e40e1afbf40739f1f3c2d0e14a86bbe20e70..6abd8a8f883e3f0e49097eeb91b2892b6735c047 100644 (file)
@@ -21,6 +21,7 @@
 */
 
 #include "includes.h"
+#include "dlinklist.h"
 #include "dsdb/samdb/samdb.h"
 #include "lib/ldb/include/ldb_module.h"
 #include "param/param.h"
index 7f00e8ebee4f8f3aa3d5b8eca840249e3ba08753..663dea9f807d5481692d229c0b15628fa180619c 100644 (file)
@@ -67,7 +67,7 @@ MDLD_FLAGS = @MDLD_FLAGS@
 
 OBJS = $(MODULES_OBJ) $(COMMON_OBJ) $(LDB_TDB_OBJ) $(TDB_OBJ) $(TEVENT_OBJ) $(TALLOC_OBJ) $(POPT_OBJ) $(LDB_MAP_OBJ) @LIBREPLACEOBJ@ $(EXTRA_OBJ) 
 
-headers = $(srcdir)/include/ldb.h $(srcdir)/include/ldb_errors.h $(srcdir)/include/ldb_handlers.h $(srcdir)/include/ldb_includes.h $(srcdir)/include/ldb_module.h
+headers = $(srcdir)/include/ldb.h $(srcdir)/include/ldb_errors.h $(srcdir)/include/ldb_handlers.h $(srcdir)/include/ldb_module.h
 
 BINS = bin/ldbadd bin/ldbsearch bin/ldbdel bin/ldbmodify bin/ldbedit bin/ldbrename bin/ldbtest
 
index 2fb5a8f9be6868b359398592760c5964668a91ba..f1b28b6819b7cb20152d44a232b5d4c3d2d1ea79 100644 (file)
 
 #include "ldb_private.h"
 
+static int ldb_context_destructor(void *ptr)
+{
+       struct ldb_context *ldb = talloc_get_type(ptr, struct ldb_context);
+
+       if (ldb->transaction_active) {
+               ldb_debug(ldb, LDB_DEBUG_FATAL,
+                         "A transaction is still active in ldb context [%p]",
+                         ldb);
+       }
+
+       return 0;
+}
+
 /*
    initialise a ldb context
    The mem_ctx is required
@@ -65,6 +78,8 @@ struct ldb_context *ldb_init(TALLOC_CTX *mem_ctx, struct tevent_context *ev_ctx)
        /* TODO: get timeout from options if available there */
        ldb->default_timeout = 300; /* set default to 5 minutes */
 
+       talloc_set_destructor((TALLOC_CTX *)ldb, ldb_context_destructor);
+
        return ldb;
 }
 
@@ -242,10 +257,24 @@ void ldb_reset_err_string(struct ldb_context *ldb)
 /*
   start a transaction
 */
-static int ldb_transaction_start_internal(struct ldb_context *ldb)
+int ldb_transaction_start(struct ldb_context *ldb)
 {
        struct ldb_module *module;
        int status;
+
+       ldb_debug(ldb, LDB_DEBUG_TRACE,
+                 "start ldb transaction (nesting: %d)",
+                 ldb->transaction_active);
+
+       /* explicit transaction active, count nested requests */
+       if (ldb->transaction_active) {
+               ldb->transaction_active++;
+               return LDB_SUCCESS;
+       }
+
+       /* start a new transaction */
+       ldb->transaction_active++;
+
        FIRST_OP(ldb, start_transaction);
 
        ldb_reset_err_string(ldb);
@@ -266,10 +295,29 @@ static int ldb_transaction_start_internal(struct ldb_context *ldb)
 /*
   commit a transaction
 */
-static int ldb_transaction_commit_internal(struct ldb_context *ldb)
+int ldb_transaction_commit(struct ldb_context *ldb)
 {
        struct ldb_module *module;
        int status;
+
+       ldb->transaction_active--;
+
+       ldb_debug(ldb, LDB_DEBUG_TRACE,
+                 "commit ldb transaction (nesting: %d)",
+                 ldb->transaction_active);
+
+       /* commit only when all nested transactions are complete */
+       if (ldb->transaction_active > 0) {
+               return LDB_SUCCESS;
+       }
+
+       if (ldb->transaction_active < 0) {
+               ldb_debug(ldb, LDB_DEBUG_FATAL,
+                         "commit called but no ldb transactions are active!");
+               ldb->transaction_active = 0;
+               return LDB_ERR_OPERATIONS_ERROR;
+       }
+
        FIRST_OP(ldb, end_transaction);
 
        ldb_reset_err_string(ldb);
@@ -290,10 +338,29 @@ static int ldb_transaction_commit_internal(struct ldb_context *ldb)
 /*
   cancel a transaction
 */
-static int ldb_transaction_cancel_internal(struct ldb_context *ldb)
+int ldb_transaction_cancel(struct ldb_context *ldb)
 {
        struct ldb_module *module;
        int status;
+
+       ldb->transaction_active--;
+
+       ldb_debug(ldb, LDB_DEBUG_TRACE,
+                 "cancel ldb transaction (nesting: %d)",
+                 ldb->transaction_active);
+
+       /* really cancel only if all nested transactions are complete */
+       if (ldb->transaction_active > 0) {
+               return LDB_SUCCESS;
+       }
+
+       if (ldb->transaction_active < 0) {
+               ldb_debug(ldb, LDB_DEBUG_FATAL,
+                         "commit called but no ldb transactions are active!");
+               ldb->transaction_active = 0;
+               return LDB_ERR_OPERATIONS_ERROR;
+       }
+
        FIRST_OP(ldb, del_transaction);
 
        status = module->ops->del_transaction(module);
@@ -309,66 +376,13 @@ static int ldb_transaction_cancel_internal(struct ldb_context *ldb)
        return status;
 }
 
-int ldb_transaction_start(struct ldb_context *ldb)
-{
-       /* disable autotransactions */
-       ldb->transaction_active++;
-
-       return ldb_transaction_start_internal(ldb);
-}
-
-int ldb_transaction_commit(struct ldb_context *ldb)
-{
-       /* renable autotransactions (when we reach 0) */
-       if (ldb->transaction_active > 0)
-               ldb->transaction_active--;
-
-       return ldb_transaction_commit_internal(ldb);
-}
-
-int ldb_transaction_cancel(struct ldb_context *ldb)
-{
-       /* renable autotransactions (when we reach 0) */
-       if (ldb->transaction_active > 0)
-               ldb->transaction_active--;
-
-       return ldb_transaction_cancel_internal(ldb);
-}
-
-static int ldb_autotransaction_start(struct ldb_context *ldb)
-{
-       /* explicit transaction active, ignore autotransaction request */
-       if (ldb->transaction_active)
-               return LDB_SUCCESS;
-
-       return ldb_transaction_start_internal(ldb);
-}
-
-static int ldb_autotransaction_commit(struct ldb_context *ldb)
-{
-       /* explicit transaction active, ignore autotransaction request */
-       if (ldb->transaction_active)
-               return LDB_SUCCESS;
-
-       return ldb_transaction_commit_internal(ldb);
-}
-
-static int ldb_autotransaction_cancel(struct ldb_context *ldb)
-{
-       /* explicit transaction active, ignore autotransaction request */
-       if (ldb->transaction_active)
-               return LDB_SUCCESS;
-
-       return ldb_transaction_cancel_internal(ldb);
-}
-
 /* autostarts a transacion if none active */
 static int ldb_autotransaction_request(struct ldb_context *ldb,
                                       struct ldb_request *req)
 {
        int ret;
 
-       ret = ldb_autotransaction_start(ldb);
+       ret = ldb_transaction_start(ldb);
        if (ret != LDB_SUCCESS) {
                return ret;
        }
@@ -379,9 +393,9 @@ static int ldb_autotransaction_request(struct ldb_context *ldb,
        }
 
        if (ret == LDB_SUCCESS) {
-               return ldb_autotransaction_commit(ldb);
+               return ldb_transaction_commit(ldb);
        }
-       ldb_autotransaction_cancel(ldb);
+       ldb_transaction_cancel(ldb);
 
        if (ldb->err_string == NULL) {
                /* no error string was setup by the backend */
index 99a47767e12a7f65a14b62c3330c36573b43c4cd..ae97ef4cced4db84ed7490aee01167165f32abb4 100644 (file)
  */
 
 #include "ldb_private.h"
-
-#if (_SAMBA_BUILD_ >= 4)
-#include "includes.h"
-#endif
+#include "dlinklist.h"
 
 #define LDB_MODULE_PREFIX      "modules:"
 #define LDB_MODULE_PREFIX_LEN  8
index 6990397a741caa5ad58bd97deb95e40cef582b49..eb8e0ed11e4309a28f7728b0a492be0377a2b1fc 100644 (file)
 #define _LDB_H_ 1
 /*! \endcond */
 
-#include "ldb_includes.h"
+#ifndef bool
+typedef int bool;
+#endif
+#ifndef true
+#define true 1
+#endif
+#ifndef false
+#define false 0
+#endif
+
+#include "talloc.h"
+#include "tevent.h"
+#include "ldb_errors.h"
 
 /*
   major restrictions as compared to normal LDAP:
index a2927139c877855ef496e5254b814fc02f07f238..602bbec32cc25b0ace09cde7dc533370940f3f02 100644 (file)
@@ -4,11 +4,6 @@
   a temporary includes file until I work on the ldb build system
 */
 
-#if (_SAMBA_BUILD_ >= 4)
-/* tell ldb we have the internal ldap code */
-#define HAVE_ILDAP 1
-#endif
-
 #if (_SAMBA_BUILD_ <= 3)
 /* allow forbidden string functions - should be replaced with _m functions */
 #undef strcasecmp
@@ -19,9 +14,5 @@
 #include "replace.h"
 #include "system/filesys.h"
 #include "system/time.h"
-#include <talloc.h>
-#include <tevent.h>
-#include "ldb_errors.h"
-#include "dlinklist.h"
 
 #endif /*_LDB_PRIVATE_INCLUDES_H_*/
index 1ce9e9ecfd51dbb039f061216611e16bbc0ccf26..2e8da9941ca8e38a713969216f9b81bc5d51f6c9 100644 (file)
@@ -37,6 +37,7 @@
 #ifndef _LDB_PRIVATE_H_
 #define _LDB_PRIVATE_H_ 1
 
+#include "ldb_includes.h"
 #include "ldb.h"
 #include "ldb_module.h"
 
@@ -109,10 +110,6 @@ struct ldb_context {
        struct tevent_context *ev_ctx;
 };
 
-#ifndef ARRAY_SIZE
-#define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0]))
-#endif
-
 /* The following definitions come from lib/ldb/common/ldb.c  */
 
 int ldb_connect_backend(struct ldb_context *ldb, const char *url, const char *options[],
index b13440504893946ebbc79663006ae3fb6f4f2d69..4447d0e09a473b8af1ca6983d73ff8d5f3394f0a 100644 (file)
  *    author: Simo Sorce
  */
 
-
 #include "includes.h"
 #include "ldb_module.h"
+#include "dlinklist.h"
 
-#include "tevent.h"
 #include "libcli/ldap/ldap.h"
 #include "libcli/ldap/ldap_client.h"
 #include "auth/auth.h"
index e1fcdb13531ec13d481f4da5f09faa930d992af6..43a01f75a73baa5f7c3805c745bd6c0ddac07bdb 100644 (file)
@@ -38,6 +38,7 @@
  *    author: Simo Sorce
  */
 
+#include "ldb_includes.h"
 #include "ldb_module.h"
 
 #define LDAP_DEPRECATED 1
index ea2bfd1dc14c3bbaeb1fa03c83c91aacc5435633..959540374cc566a275b6b25983b6a79a332a1d30 100644 (file)
@@ -35,8 +35,6 @@
  *  Author: Jelmer Vernooij, Martin Kuehl
  */
 
-#include "ldb_module.h"
-
 #include "ldb_map.h"
 #include "ldb_map_private.h"
 
index 872208174ea9c13eb614727e351f82b6e32efb53..3c1fe808957d435f87333e3944fe4616ac4a978b 100644 (file)
@@ -26,6 +26,8 @@
 #ifndef __LDB_MAP_H__
 #define __LDB_MAP_H__
 
+#include "ldb_module.h"
+
 /* ldb_map is a skeleton LDB module that can be used for any other modules
  * that need to map attributes.
  *
index e915a5f46a38fe073c51f37010ca8dddd896917b..822dea654ec2bff6d8bb0f3bc0004c55c9fea6c0 100644 (file)
@@ -24,8 +24,6 @@
 
 */
 
-#include "ldb_module.h"
-
 #include "ldb_map.h"
 #include "ldb_map_private.h"
 
index 327fa92f8d206e868a9d47d194bec2ec1eb420e1..eb7b4590baf80a28144bd6d3e8debba1c0a88f5e 100644 (file)
@@ -25,8 +25,6 @@
 
 */
 
-#include "ldb_module.h"
-
 #include "ldb_map.h"
 #include "ldb_map_private.h"
 
index 0c46443253738870a605d2309e84259e45050010..612d215ae95b6965a09844b70155f34e8930f25c 100644 (file)
@@ -1,3 +1,4 @@
+#include "ldb_includes.h"
 
 /* A handy macro to report Out of Memory conditions */
 #define map_oom(module) ldb_set_errstring(ldb_module_get_ctx(module), talloc_asprintf(module, "Out of Memory"));
index cdbef3944b531fa70922d43e5cc9970d69f4e93d..ad27c9a9a9a9d77f7b8a9b397f30451731852ca5 100644 (file)
@@ -32,6 +32,7 @@
  */
 
 #include "ldb_tdb.h"
+#include "dlinklist.h"
 
 /*
   the idxptr code is a bit unusual. The way it works is to replace
index d6276c4b8600c5c75cd546aed949096b933b08df..24ec06ea32056cfe1d9ef2a9b5cbc34097bff326 100644 (file)
@@ -865,6 +865,7 @@ static int ltdb_end_trans(struct ldb_module *module)
        ltdb->in_transaction--;
 
        if (ltdb_index_transaction_commit(module) != 0) {
+               tdb_transaction_cancel(ltdb->tdb);
                return ltdb_err_map(tdb_error(ltdb->tdb));
        }
 
@@ -883,6 +884,7 @@ static int ltdb_del_trans(struct ldb_module *module)
        ltdb->in_transaction--;
 
        if (ltdb_index_transaction_cancel(module) != 0) {
+               tdb_transaction_cancel(ltdb->tdb);
                return ltdb_err_map(tdb_error(ltdb->tdb));
        }
 
index 7ebf199f6f5c3a64a418ef81229d50cc809f272d..0a06cdb1b0816583b5bf74f3266227948bdc7146 100644 (file)
@@ -1,11 +1,5 @@
-#if (_SAMBA_BUILD_ == 3)
-#include "tdb/include/tdb.h"
-#else
-#include "replace.h"
-#include "system/wait.h"
+#include "ldb_includes.h"
 #include "tdb.h"
-#endif
-
 #include "ldb_module.h"
 
 /* this private structure is used by the ltdb backend in the
index d862638389ca6302f8c7d4fd4afda52976a336cc..43b223b52e19f078a5adaf483a5123d8352a3e32 100644 (file)
   modifiersName: not supported by w2k3?
 */
 
+#include "ldb_includes.h"
 #include "ldb_module.h"
 
+#ifndef ARRAY_SIZE
+#define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0]))
+#endif
+
 /*
   construct a canonical name from a message
 */
index 7d7cdf66a059e7f439f2d1c5febf443765f5245f..2a06c5e6c5d62a89124bfb3f755a7da073843255 100644 (file)
@@ -32,6 +32,7 @@
  *  Author: Simo Sorce
  */
 
+#include "ldb_includes.h"
 #include "ldb_module.h"
 
 struct message_store {
index a5ffcc034a092a2e807a44c755ab9e893b7249ef..880678d89de4f576dd808573babdffca2e456724 100644 (file)
@@ -36,6 +36,7 @@
  *      Simo Sorce Mar 2006
  */
 
+#include "ldb_includes.h"
 #include "ldb_module.h"
 
 struct rename_context {
index 3dce9b187bab72471aeb82651c1bf1eaed3ba692..2701de5a481dcf7cca4dc757053c2dc0e3b059b4 100644 (file)
@@ -21,6 +21,7 @@
    License along with this library; if not, see <http://www.gnu.org/licenses/>.
 */
 
+#include "ldb_includes.h"
 #include "ldb.h"
 #include "tools/cmdline.h"
 
index 3a915f8bea9ecca9af8d7427138bc4471322d979..9d3bd27983a11af5a449195bcb0d2a0a68a4384c 100644 (file)
@@ -30,7 +30,7 @@
  *
  *  Author: Andrew Tridgell
  */
-
+#include "ldb_includes.h"
 #include "ldb.h"
 #include "tools/cmdline.h"
 
index 35d4ac70021bea0aea60dbfd05a869ba04b0f41e..ba0a2a892711dd3ee7889c28237c77dcbc4e2304 100644 (file)
@@ -31,6 +31,7 @@
  *  Author: Andrew Tridgell
  */
 
+#include "ldb_includes.h"
 #include "ldb.h"
 #include "tools/cmdline.h"
 
index edaa9fb85c0cbff2dd0fcdcafffab8acdd5e4f98..6af0ee933633c9283d4c61a18a532bdc985f12b0 100644 (file)
@@ -31,6 +31,7 @@
  *  Author: Andrew Tridgell
  */
 
+#include "ldb_includes.h"
 #include "ldb.h"
 #include "tools/cmdline.h"