Merge branch 'master' of ssh://jht@git.samba.org/data/git/samba
authorJohn H Terpstra <jht@samba.org>
Thu, 23 Jul 2009 14:33:06 +0000 (09:33 -0500)
committerJohn H Terpstra <jht@samba.org>
Thu, 23 Jul 2009 14:33:06 +0000 (09:33 -0500)
388 files changed:
Roadmap
WHATSNEW.txt
client/cifs.upcall.c
examples/LDAP/samba-schema-FDS.ldif
examples/VFS/config.guess
examples/VFS/config.sub
lib/replace/libreplace.m4
lib/replace/replace.h
lib/tdb/common/lock.c
lib/tdb/common/tdb_private.h
lib/tdb/common/traverse.c
lib/tevent/testsuite.c
lib/tevent/tevent_req.c
lib/torture/torture.c
lib/torture/torture.h
lib/tsocket/tsocket_bsd.c
lib/util/genrand.c
lib/util/tests/genrand.c
lib/util/util_file.c
libcli/security/secacl.c
libds/common/flag_mapping.c [moved from source4/dsdb/common/flag_mapping.c with 89% similarity]
libds/common/flags.h [moved from source4/dsdb/common/flags.h with 62% similarity]
librpc/gen_ndr/cli_lsa.c
librpc/gen_ndr/cli_lsa.h
librpc/gen_ndr/cli_spoolss.c
librpc/gen_ndr/cli_spoolss.h
librpc/gen_ndr/lsa.h
librpc/gen_ndr/ndr_lsa.c
librpc/gen_ndr/ndr_samr.c
librpc/gen_ndr/ndr_spoolss.c
librpc/gen_ndr/samr.h
librpc/gen_ndr/spoolss.h
librpc/gen_ndr/srv_lsa.c
librpc/gen_ndr/srv_spoolss.c
librpc/idl/frsapi.idl
librpc/idl/frsrpc.idl
librpc/idl/frstrans.idl [new file with mode: 0644]
librpc/idl/lsa.idl
librpc/idl/samr.idl
librpc/idl/spoolss.idl
librpc/ndr/ndr_frsrpc.c [new file with mode: 0644]
librpc/ndr/ndr_frsrpc.h [new file with mode: 0644]
librpc/ndr_standard.pc.in [new file with mode: 0644]
nsswitch/pam_winbind.c
pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm
pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm
pidl/lib/Parse/Pidl/Samba4/Python.pm
pidl/lib/Parse/Pidl/Typelist.pm
source3/Makefile.in
source3/auth/auth.c
source3/auth/auth_sam.c
source3/client/client.c
source3/include/ads.h
source3/include/passdb.h
source3/include/proto.h
source3/include/smb.h
source3/include/smb_macros.h
source3/include/util_tdb.h
source3/lib/account_pol.c
source3/lib/ads_flags.c [deleted file]
source3/lib/charcnv.c
source3/lib/ctdbd_conn.c
source3/lib/dbwrap_tdb.c
source3/lib/dbwrap_util.c
source3/lib/errmap_unix.c
source3/lib/events.c
source3/lib/gencache.c
source3/lib/ldap_escape.c
source3/lib/netapi/netapi.c
source3/lib/netapi/user.c
source3/lib/smbldap_util.c
source3/lib/system.c
source3/lib/tldap.c
source3/lib/util_sock.c
source3/lib/util_str.c
source3/lib/util_tdb.c
source3/libads/dns.c
source3/libads/ldap_user.c
source3/libnet/libnet_samsync_passdb.c
source3/libsmb/clidgram.c
source3/libsmb/clifile.c
source3/libsmb/clikrb5.c
source3/libsmb/clispnego.c
source3/libsmb/dsgetdcname.c
source3/libsmb/libsmb_context.c
source3/libsmb/libsmb_thread_posix.c
source3/libsmb/namecache.c
source3/libsmb/namequery.c
source3/libsmb/spnego.c
source3/libsmb/trustdom_cache.c
source3/locking/brlock.c
source3/locking/locking.c
source3/locking/posix.c
source3/modules/nfs4_acls.c
source3/modules/onefs_acl.c
source3/modules/onefs_open.c
source3/modules/onefs_streams.c
source3/modules/vfs_acl_tdb.c
source3/modules/vfs_acl_xattr.c
source3/modules/vfs_afsacl.c
source3/modules/vfs_aixacl2.c
source3/modules/vfs_audit.c
source3/modules/vfs_cacheprime.c
source3/modules/vfs_cap.c
source3/modules/vfs_catia.c
source3/modules/vfs_default.c
source3/modules/vfs_dirsort.c
source3/modules/vfs_extd_audit.c
source3/modules/vfs_full_audit.c
source3/modules/vfs_gpfs.c
source3/modules/vfs_hpuxacl.c
source3/modules/vfs_hpuxacl.h
source3/modules/vfs_shadow_copy2.c
source3/modules/vfs_smb_traffic_analyzer.c
source3/modules/vfs_streams_xattr.c
source3/modules/vfs_tsmsm.c
source3/modules/vfs_zfsacl.c
source3/nmbd/nmbd.c
source3/param/loadparm.c
source3/passdb/passdb.c
source3/passdb/pdb_ads.c
source3/passdb/pdb_get_set.c
source3/passdb/pdb_interface.c
source3/passdb/pdb_ldap.c
source3/passdb/pdb_wbc_sam.c
source3/printing/printfsp.c
source3/registry/reg_backend_db.c
source3/registry/reg_backend_netlogon_params.c
source3/registry/reg_objects.c
source3/rpc_parse/parse_prs.c
source3/rpc_server/srv_lsa_nt.c
source3/rpc_server/srv_samr_nt.c
source3/rpc_server/srv_samr_util.c
source3/rpc_server/srv_spoolss_nt.c
source3/rpc_server/srv_srvsvc_nt.c
source3/rpcclient/cmd_lsarpc.c
source3/rpcclient/cmd_spoolss.c
source3/script/tests/test_smbtorture_s3.sh
source3/smbd/aio.c
source3/smbd/blocking.c
source3/smbd/chgpasswd.c
source3/smbd/close.c
source3/smbd/dosmode.c
source3/smbd/error.c
source3/smbd/fake_file.c
source3/smbd/file_access.c
source3/smbd/fileio.c
source3/smbd/filename.c
source3/smbd/filename_util.c [new file with mode: 0644]
source3/smbd/files.c
source3/smbd/globals.c
source3/smbd/globals.h
source3/smbd/ipc.c
source3/smbd/msdfs.c
source3/smbd/notify.c
source3/smbd/nttrans.c
source3/smbd/open.c
source3/smbd/oplock.c
source3/smbd/oplock_irix.c
source3/smbd/oplock_linux.c
source3/smbd/oplock_onefs.c
source3/smbd/password.c
source3/smbd/pipes.c
source3/smbd/posix_acls.c
source3/smbd/process.c
source3/smbd/reply.c
source3/smbd/server.c
source3/smbd/service.c
source3/smbd/sesssetup.c
source3/smbd/smb2_close.c
source3/smbd/smb2_create.c
source3/smbd/smb2_flush.c
source3/smbd/smb2_getinfo.c
source3/smbd/smb2_lock.c
source3/smbd/smb2_notify.c
source3/smbd/smb2_read.c
source3/smbd/smb2_server.c
source3/smbd/smb2_setinfo.c
source3/smbd/smb2_write.c
source3/smbd/statcache.c
source3/smbd/trans2.c
source3/smbd/vfs.c
source3/torture/cmd_vfs.c
source3/torture/locktest.c
source3/torture/locktest2.c
source3/torture/pdbtest.c
source3/torture/torture.c
source3/utils/net.c
source3/utils/net.h
source3/utils/net_ads.c
source3/utils/net_cache.c
source3/utils/net_dom.c
source3/utils/net_help.c
source3/utils/net_proto.h
source3/utils/net_rpc.c
source3/utils/net_rpc_join.c
source3/utils/net_rpc_samsync.c
source3/utils/net_rpc_shell.c
source3/utils/net_sam.c
source3/utils/net_usershare.c
source3/utils/net_util.c
source3/utils/pdbedit.c
source3/winbindd/winbindd.c
source3/winbindd/winbindd_ads.c
source3/winbindd/winbindd_dual.c
source3/winbindd/winbindd_passdb.c
source3/winbindd/winbindd_sid.c
source3/winbindd/winbindd_util.c
source4/auth/auth.h
source4/auth/gensec/gensec_krb5.c
source4/auth/sam.c
source4/cldap_server/netlogon.c
source4/configure.ac
source4/dsdb/common/sidmap.c
source4/dsdb/common/util.c
source4/dsdb/config.mk
source4/dsdb/samdb/ldb_modules/instancetype.c
source4/dsdb/samdb/ldb_modules/linked_attributes.c
source4/dsdb/samdb/ldb_modules/password_hash.c
source4/dsdb/samdb/ldb_modules/repl_meta_data.c
source4/dsdb/samdb/ldb_modules/rootdse.c
source4/dsdb/samdb/ldb_modules/samldb.c
source4/dsdb/samdb/samdb.c
source4/dsdb/samdb/samdb.h
source4/heimdal/kdc/kaserver.c
source4/heimdal/kdc/kerberos5.c
source4/heimdal/kdc/krb5tgs.c
source4/heimdal/lib/gssapi/gssapi/gssapi.h
source4/heimdal/lib/gssapi/krb5/8003.c
source4/heimdal/lib/gssapi/krb5/accept_sec_context.c
source4/heimdal/lib/gssapi/krb5/acquire_cred.c
source4/heimdal/lib/gssapi/krb5/add_cred.c
source4/heimdal/lib/gssapi/krb5/aeap.c
source4/heimdal/lib/gssapi/krb5/arcfour.c
source4/heimdal/lib/gssapi/krb5/canonicalize_name.c
source4/heimdal/lib/gssapi/krb5/cfx.c
source4/heimdal/lib/gssapi/krb5/compare_name.c
source4/heimdal/lib/gssapi/krb5/compat.c
source4/heimdal/lib/gssapi/krb5/context_time.c
source4/heimdal/lib/gssapi/krb5/copy_ccache.c
source4/heimdal/lib/gssapi/krb5/decapsulate.c
source4/heimdal/lib/gssapi/krb5/delete_sec_context.c
source4/heimdal/lib/gssapi/krb5/display_name.c
source4/heimdal/lib/gssapi/krb5/display_status.c
source4/heimdal/lib/gssapi/krb5/duplicate_name.c
source4/heimdal/lib/gssapi/krb5/encapsulate.c
source4/heimdal/lib/gssapi/krb5/export_name.c
source4/heimdal/lib/gssapi/krb5/export_sec_context.c
source4/heimdal/lib/gssapi/krb5/external.c
source4/heimdal/lib/gssapi/krb5/get_mic.c
source4/heimdal/lib/gssapi/krb5/import_name.c
source4/heimdal/lib/gssapi/krb5/import_sec_context.c
source4/heimdal/lib/gssapi/krb5/indicate_mechs.c
source4/heimdal/lib/gssapi/krb5/init.c
source4/heimdal/lib/gssapi/krb5/init_sec_context.c
source4/heimdal/lib/gssapi/krb5/inquire_context.c
source4/heimdal/lib/gssapi/krb5/inquire_cred.c
source4/heimdal/lib/gssapi/krb5/inquire_cred_by_mech.c
source4/heimdal/lib/gssapi/krb5/inquire_cred_by_oid.c
source4/heimdal/lib/gssapi/krb5/inquire_mechs_for_name.c
source4/heimdal/lib/gssapi/krb5/inquire_names_for_mech.c
source4/heimdal/lib/gssapi/krb5/inquire_sec_context_by_oid.c
source4/heimdal/lib/gssapi/krb5/prf.c
source4/heimdal/lib/gssapi/krb5/process_context_token.c
source4/heimdal/lib/gssapi/krb5/release_buffer.c
source4/heimdal/lib/gssapi/krb5/release_cred.c
source4/heimdal/lib/gssapi/krb5/release_name.c
source4/heimdal/lib/gssapi/krb5/sequence.c
source4/heimdal/lib/gssapi/krb5/set_cred_option.c
source4/heimdal/lib/gssapi/krb5/set_sec_context_option.c
source4/heimdal/lib/gssapi/krb5/unwrap.c
source4/heimdal/lib/gssapi/krb5/verify_mic.c
source4/heimdal/lib/gssapi/krb5/wrap.c
source4/heimdal/lib/gssapi/mech/gss_acquire_cred.c
source4/heimdal/lib/gssapi/mech/gss_aeap.c
source4/heimdal/lib/gssapi/spnego/accept_sec_context.c
source4/heimdal/lib/hcrypto/des.h
source4/heimdal/lib/hcrypto/evp.h
source4/heimdal/lib/hdb/db.c
source4/heimdal/lib/hdb/dbinfo.c
source4/heimdal/lib/hdb/ext.c
source4/heimdal/lib/hdb/hdb.asn1
source4/heimdal/lib/hdb/hdb.c
source4/heimdal/lib/hdb/hdb.h
source4/heimdal/lib/hdb/keys.c
source4/heimdal/lib/hdb/keytab.c
source4/heimdal/lib/hdb/mkey.c
source4/heimdal/lib/hdb/ndbm.c
source4/heimdal/lib/hx509/crypto.c
source4/heimdal/lib/krb5/crypto.c
source4/heimdal/lib/krb5/get_addrs.c
source4/heimdal/lib/krb5/init_creds_pw.c
source4/heimdal/lib/krb5/krb5.h
source4/heimdal/lib/krb5/log.c
source4/heimdal/lib/krb5/store_emem.c
source4/heimdal_build/ifaddrs.hin [new file with mode: 0644]
source4/heimdal_build/internal.m4
source4/heimdal_build/replace.c
source4/heimdal_build/roken.h
source4/kdc/hdb-samba4.c
source4/kdc/pac-glue.c
source4/lib/ldb/common/ldb.c
source4/lib/ldb/common/ldb_debug.c
source4/lib/ldb/common/ldb_ldif.c
source4/lib/ldb/common/ldb_match.c
source4/lib/ldb/common/ldb_modules.c
source4/lib/ldb/ldb.mk
source4/lib/ldb/ldb.pc.in
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_inbound.c
source4/lib/ldb/ldb_map/ldb_map_outbound.c
source4/lib/ldb/ldb_tdb/ldb_cache.c
source4/lib/ldb/ldb_tdb/ldb_index.c
source4/lib/ldb/ldb_tdb/ldb_pack.c
source4/lib/ldb/ldb_tdb/ldb_tdb.c
source4/lib/ldb/modules/asq.c
source4/lib/ldb/modules/operational.c
source4/lib/ldb/modules/paged_results.c
source4/lib/ldb/modules/rdn_name.c
source4/lib/ldb/modules/sort.c
source4/lib/ldb/pyldb.c
source4/lib/ldb/pyldb.h
source4/lib/ldb/pyldb_util.c [deleted file]
source4/lib/ldb/python.mk
source4/lib/ldb/rules.mk
source4/lib/registry/patchfile.c
source4/lib/samba3/README
source4/lib/samba3/STATUS [deleted file]
source4/lib/samba3/samba3.h
source4/libcli/security/security_token.c
source4/libcli/smb2/request.c
source4/libcli/smb2/smb2.h
source4/libcli/smb2/transport.c
source4/libnet/libnet_become_dc.c
source4/libnet/libnet_group.c
source4/libnet/libnet_group.h
source4/libnet/libnet_samdump.c
source4/libnet/libnet_unbecome_dc.c
source4/libnet/libnet_user.c
source4/libnet/libnet_user.h
source4/librpc/config.mk
source4/ntptr/simple_ldb/ntptr_simple_ldb.c
source4/ntvfs/ipc/vfs_ipc.c
source4/ntvfs/posix/pvfs_resolve.c
source4/ntvfs/unixuid/vfs_unixuid.c
source4/rpc_server/config.mk
source4/rpc_server/lsa/dcesrv_lsa.c
source4/rpc_server/lsa/lsa_lookup.c
source4/rpc_server/netlogon/dcerpc_netlogon.c
source4/rpc_server/samr/dcesrv_samr.c
source4/rpc_server/samr/samr_password.c
source4/script/installmisc.sh
source4/scripting/python/pyglue.c
source4/scripting/python/samba/__init__.py
source4/scripting/python/samba/getopt.py
source4/scripting/python/samba/idmap.py
source4/scripting/python/samba/ms_schema.py
source4/scripting/python/samba/provision.py
source4/scripting/python/samba/samba3.py
source4/scripting/python/samba/samdb.py
source4/scripting/python/samba/tests/shares.py [new file with mode: 0644]
source4/scripting/python/samba/upgrade.py
source4/selftest/knownfail
source4/setup/provision
source4/setup/provision.ldif
source4/setup/provision_basedn_modify.ldif
source4/setup/provision_computers_modify.ldif
source4/setup/provision_configuration.ldif
source4/setup/provision_group_policy.ldif
source4/setup/provision_rootdse_add.ldif
source4/setup/provision_self_join.ldif
source4/setup/provision_users.ldif
source4/setup/provision_users_modify.ldif
source4/setup/schema_samba4.ldif
source4/torture/auth/pac.c
source4/torture/rpc/frsapi.c
source4/torture/rpc/lsa.c
source4/torture/rpc/object_uuid.c
source4/torture/rpc/rpc.c
source4/torture/rpc/spoolss.c
source4/torture/smb2/config.mk
source4/torture/smb2/connect.c
source4/torture/smb2/dir.c
source4/torture/smb2/getinfo.c
source4/torture/smb2/smb2.c
source4/winbind/wb_cmd_list_users.c

diff --git a/Roadmap b/Roadmap
index 1132f6391c7bccac2f6583133bf0100ce2411627..c5b8a4d115e361cae7077f11bcf8a6f8dc2f88f0 100644 (file)
--- a/Roadmap
+++ b/Roadmap
@@ -12,7 +12,7 @@ are in progress:
 Samba-3.0.x            This release turned into maintenance mode since we
                        released 3.2.
 
-Samba-3.2.x            This is the current stable Samba 3 release intended
+Samba-3.4.x            This is the current stable Samba 3 release intended
                        for all Samba production server.
 
 Samba-4                        Danger Will Robinson, a big code clean up with major
index fe8d541de82138c3fdc2ccc2ba199971743d144a..066f7189992c8ac01c054c3fe2205ab1180cfa45 100644 (file)
@@ -14,9 +14,6 @@ Authentication Changes:
 o Changed the way smbd handles untrusted domain names given during user
   authentication
 
-net Command Changes:
-o parameter syntax made more consistent
-
 Authentication Changes
 ======================
 
@@ -35,38 +32,6 @@ on smbd to always pass through bogus names to the DC for verification.  A new
 parameter "map untrusted to domain" can be enabled to revert to the legacy
 behavior.
 
-net Command Changes
-===================
-
-The net command now accepts the common command line parameters most other Samba
-command line utilities use, with a couple of remaining differences:
-
--l still gives long output for net commands supporting the --long flag. This was
-more useful than the common --log-base parameter.
-
--i still tells net to read data from stdin (like --stdin) instead of toggling
-the common --scope flag.
-
--S still tells net the server to connect to (like --server) instead of
-negotiating the common --signing flag. As -S is probably used by most scripts
-doing net rpc commands, this would have been a high-impact change for little
-gain.
-
-This change was mainly done to unify the authentification options. Here, one
-flag changed it's meaning and one useful flag was added.
-
--N used to be the short version of --ntname. It now matches the Samba default of
---no-pass. Use this to stop net from prompting for a password if you want
-anonymous authentication.
-
--A --authentication-file now takes an authentication file with the username and
-password you want net to use, avoiding a password prompt as with plain -U user
-or having to give a password on the command line as in -U user%pass.
-
-Last but not least net now always falls back to your local unix username if no
--U is specified and a username is needed. net rpc commands will now prompt for a
-password unless one is specified using either -U user%pass or -A auth_file.
-
 ######################################################################
 Reporting bugs & Development Discussion
 #######################################
index 4110de35fde43dacc0eaa6300bd08922fb90223a..82b9f7b91ba46fd36798bc91b4475d39177e0b02 100644 (file)
@@ -1,6 +1,7 @@
 /*
 * CIFS user-space helper.
 * Copyright (C) Igor Mammedov (niallain@gmail.com) 2007
+* Copyright (C) Jeff Layton (jlayton@redhat.com) 2009
 *
 * Used by /sbin/request-key for handling
 * cifs upcall for kerberos authorization of access to share and
@@ -37,6 +38,54 @@ typedef enum _secType {
        MS_KRB5
 } secType_t;
 
+/*
+ * given a process ID, get the value of the KRB5CCNAME environment variable
+ * in the context of that process. On error, just return NULL.
+ */
+static char *
+get_krb5_ccname(pid_t pid)
+{
+       int fd;
+       ssize_t len, left;
+
+       /*
+        * FIXME: sysconf for ARG_MAX instead? Kernel seems to be limited to a
+        * page however, so it may not matter.
+        */
+       char buf[4096];
+       char *p, *value = NULL;
+       
+       buf[4095] = '\0';
+       snprintf(buf, 4095, "/proc/%d/environ", pid);
+       fd = open(buf, O_RDONLY);
+       if (fd < 0)
+               return NULL;
+
+       /* FIXME: don't assume that we get it all in the first read? */
+       len = read(fd, buf, 4096);
+       close(fd);
+       if (len < 0)
+               return NULL;
+
+       left = len;
+       p = buf;
+
+       /* can't have valid KRB5CCNAME if there are < 13 bytes left */
+       while (left > 12) {
+               if (strncmp("KRB5CCNAME=", p, 11)) {
+                       p += strnlen(p, left);
+                       ++p;
+                       left = buf + len - p;
+                       continue;
+               }
+               p += 11;
+               left -= 11;
+               value = SMB_STRNDUP(p, left);
+               break;
+       }
+       return value;
+}
+
 /*
  * Prepares AP-REQ data for mechToken and gets session key
  * Uses credentials from cache. It will not ask for password
@@ -58,15 +107,15 @@ typedef enum _secType {
  * ret: 0 - success, others - failure
 */
 static int
-handle_krb5_mech(const char *oid, const char *principal,
-                    DATA_BLOB * secblob, DATA_BLOB * sess_key)
+handle_krb5_mech(const char *oid, const char *principal, DATA_BLOB *secblob,
+                DATA_BLOB *sess_key, const char *ccname)
 {
        int retval;
        DATA_BLOB tkt, tkt_wrapped;
 
        /* get a kerberos ticket for the service and extract the session key */
-       retval = cli_krb5_get_ticket(principal, 0,
-                                    &tkt, sess_key, 0, NULL, NULL);
+       retval = cli_krb5_get_ticket(principal, 0, &tkt, sess_key, 0, ccname,
+                                    NULL);
 
        if (retval)
                return retval;
@@ -88,11 +137,12 @@ handle_krb5_mech(const char *oid, const char *principal,
 #define DKD_HAVE_IPV4          8
 #define DKD_HAVE_IPV6          16
 #define DKD_HAVE_UID           32
+#define DKD_HAVE_PID           64
 #define DKD_MUSTHAVE_SET (DKD_HAVE_HOSTNAME|DKD_HAVE_VERSION|DKD_HAVE_SEC)
 
 static int
-decode_key_description(const char *desc, int *ver, secType_t * sec,
-                          char **hostname, uid_t * uid)
+decode_key_description(const char *desc, int *ver, secType_t *sec,
+                          char **hostname, uid_t *uid, pid_t *pid)
 {
        int retval = 0;
        char *pos;
@@ -117,6 +167,16 @@ decode_key_description(const char *desc, int *ver, secType_t * sec,
                        /* BB: do we need it if we have hostname already? */
                } else if (strncmp(tkn, "ipv6=", 5) == 0) {
                        /* BB: do we need it if we have hostname already? */
+               } else if (strncmp(tkn, "pid=", 4) == 0) {
+                       errno = 0;
+                       *pid = strtol(tkn + 4, NULL, 0);
+                       if (errno != 0) {
+                               syslog(LOG_WARNING, "Invalid pid format: %s",
+                                      strerror(errno));
+                               return 1;
+                       } else {
+                               retval |= DKD_HAVE_PID;
+                       }
                } else if (strncmp(tkn, "sec=", 4) == 0) {
                        if (strncmp(tkn + 4, "krb5", 4) == 0) {
                                retval |= DKD_HAVE_SEC;
@@ -224,9 +284,10 @@ int main(const int argc, char *const argv[])
        size_t datalen;
        long rc = 1;
        uid_t uid = 0;
+       pid_t pid = 0;
        int kernel_upcall_version = 0;
        int c, use_cifs_service_prefix = 0;
-       char *buf, *hostname = NULL;
+       char *buf, *ccname = NULL, *hostname = NULL;
        const char *oid;
 
        openlog(prog, 0, LOG_DAEMON);
@@ -278,7 +339,7 @@ int main(const int argc, char *const argv[])
        }
 
        rc = decode_key_description(buf, &kernel_upcall_version, &sectype,
-                                   &hostname, &uid);
+                                   &hostname, &uid, &pid);
        if ((rc & DKD_MUSTHAVE_SET) != DKD_MUSTHAVE_SET) {
                syslog(LOG_WARNING,
                       "unable to get from description necessary params");
@@ -296,6 +357,9 @@ int main(const int argc, char *const argv[])
                goto out;
        }
 
+       if (rc & DKD_HAVE_PID)
+               ccname = get_krb5_ccname(pid);
+
        if (rc & DKD_HAVE_UID) {
                rc = setuid(uid);
                if (rc == -1) {
@@ -304,9 +368,6 @@ int main(const int argc, char *const argv[])
                }
        }
 
-       /* BB: someday upcall SPNEGO blob could be checked here to decide
-        * what mech to use */
-
        // do mech specific authorization
        switch (sectype) {
        case MS_KRB5:
@@ -333,7 +394,8 @@ int main(const int argc, char *const argv[])
                        else
                                oid = OID_KERBEROS5;
 
-                       rc = handle_krb5_mech(oid, princ, &secblob, &sess_key);
+                       rc = handle_krb5_mech(oid, princ, &secblob, &sess_key,
+                                             ccname);
                        SAFE_FREE(princ);
                        break;
                }
@@ -385,6 +447,7 @@ out:
                keyctl_negate(key, 1, KEY_REQKEY_DEFL_DEFAULT);
        data_blob_free(&secblob);
        data_blob_free(&sess_key);
+       SAFE_FREE(ccname);
        SAFE_FREE(hostname);
        SAFE_FREE(keydata);
        return rc;
index e88559fc8aa3b0c2d63f37b453b0812f7306b94d..fb16486374468016ebe9325934d3d01f2d509a6a 100644 (file)
@@ -115,6 +115,10 @@ attributeTypes: ( 1.3.6.1.4.1.7165.2.1.65 NAME 'sambaLockoutThreshold' DESC 'Loc
 attributeTypes: ( 1.3.6.1.4.1.7165.2.1.66 NAME 'sambaForceLogoff' DESC 'Disconnect Users outside logon hours (default: -1 => off, 0 => on)' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
 # "refuse machine password change"
 attributeTypes: ( 1.3.6.1.4.1.7165.2.1.67 NAME 'sambaRefuseMachinePwdChange' DESC 'Allow Machine Password changes (default: 0 => off)' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
+#
+attributeTypes: ( 1.3.6.1.4.1.7165.2.1.68 NAME 'sambaClearTextPassword' DESC 'Clear text password (used for trusted domain passwords)' EQUALITY octetStringMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 )
+#
+attributeTypes: ( 1.3.6.1.4.1.7165.2.1.69 NAME 'sambaPreviousClearTextPassword' DESC 'Previous clear text password (used for trusted domain passwords)' EQUALITY octetStringMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 )
 ##
 #######################################################################
 ##              objectClasses: used by Samba 3.0 schema               ##
@@ -154,3 +158,7 @@ objectClasses: ( 1.3.6.1.4.1.7165.2.2.12 NAME 'sambaConfigOption' SUP top STRUCT
 ##     DESC 'Samba Privilege'
 ##     MUST ( sambaSID )
 ##     MAY ( sambaPrivilegeList ) )
+##
+## Trusted Domain Relationships
+##
+objectClasses: ( 1.3.6.1.4.1.7165.2.2.15 NAME 'sambaTrustedDomainPassword' SUP top STRUCTURAL DESC 'Samba Trusted Domain Password' MUST ( sambaDomainName $ sambaSID $ sambaClearTextPassword $ sambaPwdLastSet ) MAY ( sambaPreviousClearTextPassword ) )
index 600580b1aadc5a023f3449a372e088151304eca3..da8331460888af3b367e2a9df88cb52022866c73 100755 (executable)
@@ -1,13 +1,14 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+#   Free Software Foundation, Inc.
 
-timestamp='2005-09-19'
+timestamp='2009-04-27'
 
 # This file 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
+# the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful, but
@@ -16,7 +17,9 @@ timestamp='2005-09-19'
 # 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/>.
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -53,8 +56,8 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -104,7 +107,7 @@ set_cc_for_build='
 trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
 trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
 : ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
  { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
  { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
  { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
@@ -158,6 +161,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
            arm*) machine=arm-unknown ;;
            sh3el) machine=shl-unknown ;;
            sh3eb) machine=sh-unknown ;;
+           sh5el) machine=sh5le-unknown ;;
            *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
        esac
        # The Operating System including object format, if it has switched
@@ -204,8 +208,11 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     *:ekkoBSD:*:*)
        echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
        exit ;;
+    *:SolidBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+       exit ;;
     macppc:MirBSD:*:*)
-       echo powerppc-unknown-mirbsd${UNAME_RELEASE}
+       echo powerpc-unknown-mirbsd${UNAME_RELEASE}
        exit ;;
     *:MirBSD:*:*)
        echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
@@ -317,14 +324,30 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        case `/usr/bin/uname -p` in
            sparc) echo sparc-icl-nx7; exit ;;
        esac ;;
+    s390x:SunOS:*:*)
+       echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit ;;
     sun4H:SunOS:5.*:*)
        echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
        exit ;;
     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
        echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
        exit ;;
-    i86pc:SunOS:5.*:*)
-       echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+       eval $set_cc_for_build
+       SUN_ARCH="i386"
+       # If there is a compiler, see if it is configured for 64-bit objects.
+       # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+       # This test works for both compilers.
+       if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+           if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+               (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+               grep IS_64BIT_ARCH >/dev/null
+           then
+               SUN_ARCH="x86_64"
+           fi
+       fi
+       echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
        exit ;;
     sun4*:SunOS:6*:*)
        # According to config.sub, this is the proper way to canonicalize
@@ -525,7 +548,7 @@ EOF
                echo rs6000-ibm-aix3.2
        fi
        exit ;;
-    *:AIX:*:[45])
+    *:AIX:*:[456])
        IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
        if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
                IBM_ARCH=rs6000
@@ -762,12 +785,19 @@ EOF
        echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
        exit ;;
     *:FreeBSD:*:*)
-       echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+       case ${UNAME_MACHINE} in
+           pc98)
+               echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           amd64)
+               echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           *)
+               echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+       esac
        exit ;;
     i*:CYGWIN*:*)
        echo ${UNAME_MACHINE}-pc-cygwin
        exit ;;
-    i*:MINGW*:*)
+    *:MINGW*:*)
        echo ${UNAME_MACHINE}-pc-mingw32
        exit ;;
     i*:windows32*:*)
@@ -777,9 +807,18 @@ EOF
     i*:PW*:*)
        echo ${UNAME_MACHINE}-pc-pw32
        exit ;;
-    x86:Interix*:[34]*)
-       echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
-       exit ;;
+    *:Interix*:[3456]*)
+       case ${UNAME_MACHINE} in
+           x86)
+               echo i586-pc-interix${UNAME_RELEASE}
+               exit ;;
+           EM64T | authenticamd | genuineintel)
+               echo x86_64-unknown-interix${UNAME_RELEASE}
+               exit ;;
+           IA64)
+               echo ia64-unknown-interix${UNAME_RELEASE}
+               exit ;;
+       esac ;;
     [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
        echo i${UNAME_MACHINE}-pc-mks
        exit ;;
@@ -813,6 +852,16 @@ EOF
        echo ${UNAME_MACHINE}-pc-minix
        exit ;;
     arm*:Linux:*:*)
+       eval $set_cc_for_build
+       if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+           | grep -q __ARM_EABI__
+       then
+           echo ${UNAME_MACHINE}-unknown-linux-gnu
+       else
+           echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+       fi
+       exit ;;
+    avr32*:Linux:*:*)
        echo ${UNAME_MACHINE}-unknown-linux-gnu
        exit ;;
     cris:Linux:*:*)
@@ -849,7 +898,11 @@ EOF
        #endif
        #endif
 EOF
-       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+       eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+           /^CPU/{
+               s: ::g
+               p
+           }'`"
        test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
        ;;
     mips64:Linux:*:*)
@@ -868,7 +921,11 @@ EOF
        #endif
        #endif
 EOF
-       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+       eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+           /^CPU/{
+               s: ::g
+               p
+           }'`"
        test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
        ;;
     or32:Linux:*:*)
@@ -894,6 +951,9 @@ EOF
        if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
        echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
        exit ;;
+    padre:Linux:*:*)
+       echo sparc-unknown-linux-gnu
+       exit ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
        # Look for CPU level
        case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
@@ -917,9 +977,15 @@ EOF
     sparc:Linux:*:* | sparc64:Linux:*:*)
        echo ${UNAME_MACHINE}-unknown-linux-gnu
        exit ;;
+    vax:Linux:*:*)
+       echo ${UNAME_MACHINE}-dec-linux-gnu
+       exit ;;
     x86_64:Linux:*:*)
        echo x86_64-unknown-linux-gnu
        exit ;;
+    xtensa*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       exit ;;
     i*86:Linux:*:*)
        # The BFD linker knows what the default object file format is, so
        # first see if it will tell us. cd to the root directory to prevent
@@ -938,9 +1004,6 @@ EOF
          a.out-i386-linux)
                echo "${UNAME_MACHINE}-pc-linux-gnuaout"
                exit ;;
-         coff-i386)
-               echo "${UNAME_MACHINE}-pc-linux-gnucoff"
-               exit ;;
          "")
                # Either a pre-BFD a.out linker (linux-gnuoldld) or
                # one that does not give us useful --help.
@@ -962,7 +1025,7 @@ EOF
        LIBC=gnulibc1
        # endif
        #else
-       #ifdef __INTEL_COMPILER
+       #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
        LIBC=gnu
        #else
        LIBC=gnuaout
@@ -972,7 +1035,11 @@ EOF
        LIBC=dietlibc
        #endif
 EOF
-       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+       eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+           /^LIBC/{
+               s: ::g
+               p
+           }'`"
        test x"${LIBC}" != x && {
                echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
                exit
@@ -1051,8 +1118,11 @@ EOF
     pc:*:*:*)
        # Left here for compatibility:
         # uname -m prints for DJGPP always 'pc', but it prints nothing about
-        # the processor, so we play safe by assuming i386.
-       echo i386-pc-msdosdjgpp
+        # the processor, so we play safe by assuming i586.
+       # Note: whatever this is, it MUST be the same as what config.sub
+       # prints for the "djgpp" host, or else GDB configury will decide that
+       # this is a cross-build.
+       echo i586-pc-msdosdjgpp
         exit ;;
     Intel:Mach:3*:*)
        echo i386-pc-mach3
@@ -1090,6 +1160,16 @@ EOF
     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
         /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
           && { echo i486-ncr-sysv4; exit; } ;;
+    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+       OS_REL='.3'
+       test -r /etc/.relid \
+           && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+       /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+           && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+       /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+           && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+       /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+           && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
     m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
        echo m68k-unknown-lynxos${UNAME_RELEASE}
        exit ;;
@@ -1165,6 +1245,9 @@ EOF
     BePC:BeOS:*:*)     # BeOS running on Intel PC compatible.
        echo i586-pc-beos
        exit ;;
+    BePC:Haiku:*:*)    # Haiku running on Intel PC compatible.
+       echo i586-pc-haiku
+       exit ;;
     SX-4:SUPER-UX:*:*)
        echo sx4-nec-superux${UNAME_RELEASE}
        exit ;;
@@ -1174,6 +1257,15 @@ EOF
     SX-6:SUPER-UX:*:*)
        echo sx6-nec-superux${UNAME_RELEASE}
        exit ;;
+    SX-7:SUPER-UX:*:*)
+       echo sx7-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-8:SUPER-UX:*:*)
+       echo sx8-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-8R:SUPER-UX:*:*)
+       echo sx8r-nec-superux${UNAME_RELEASE}
+       exit ;;
     Power*:Rhapsody:*:*)
        echo powerpc-apple-rhapsody${UNAME_RELEASE}
        exit ;;
@@ -1261,6 +1353,12 @@ EOF
     i*86:skyos:*:*)
        echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
        exit ;;
+    i*86:rdos:*:*)
+       echo ${UNAME_MACHINE}-pc-rdos
+       exit ;;
+    i*86:AROS:*:*)
+       echo ${UNAME_MACHINE}-pc-aros
+       exit ;;
 esac
 
 #echo '(No uname command or uname output not recognized.)' 1>&2
@@ -1421,9 +1519,9 @@ This script, last modified $timestamp, has failed to recognize
 the operating system you are using. It is advised that you
 download the most up to date version of the config scripts from
 
-  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
 and
-  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
 
 If the version you run ($0) is already up to date, please
 send the following data and any information you think might be
index 23cd6fd75c85db36a7d824b2cf8b857374edbdbc..a39437d0158ed7058a189617db490472252a70ae 100755 (executable)
@@ -1,9 +1,10 @@
 #! /bin/sh
 # Configuration validation subroutine script.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+#   Free Software Foundation, Inc.
 
-timestamp='2005-07-08'
+timestamp='2009-04-17'
 
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
@@ -11,7 +12,7 @@ timestamp='2005-07-08'
 #
 # This file 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
+# the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful,
@@ -20,7 +21,9 @@ timestamp='2005-07-08'
 # 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/>.
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -69,8 +72,8 @@ Report bugs and patches to <config-patches@gnu.org>."
 version="\
 GNU config.sub ($timestamp)
 
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -117,8 +120,10 @@ esac
 # Here we must recognize all the valid KERNEL-OS combinations.
 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
-  nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
-  kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
+  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+  kopensolaris*-gnu* | \
+  storm-chaos* | os2-emx* | rtmk-nova*)
     os=-$maybe_os
     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
     ;;
@@ -169,6 +174,10 @@ case $os in
        -hiux*)
                os=-hiuxwe2
                ;;
+       -sco6)
+               os=-sco5v6
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
        -sco5)
                os=-sco3.2v5
                basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@@ -185,6 +194,10 @@ case $os in
                # Don't forget version if it is 3.2v4 or newer.
                basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
                ;;
+       -sco5v6*)
+               # Don't forget version if it is 3.2v4 or newer.
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
        -sco*)
                os=-sco3.2v2
                basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@@ -229,20 +242,24 @@ case $basic_machine in
        | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
        | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
        | am33_2.0 \
-       | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
+       | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
        | bfin \
        | c4x | clipper \
        | d10v | d30v | dlx | dsp16xx \
-       | fr30 | frv \
+       | fido | fr30 | frv \
        | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
        | i370 | i860 | i960 | ia64 \
        | ip2k | iq2000 \
-       | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \
+       | lm32 \
+       | m32c | m32r | m32rle | m68000 | m68k | m88k \
+       | maxq | mb | microblaze | mcore | mep | metag \
        | mips | mipsbe | mipseb | mipsel | mipsle \
        | mips16 \
        | mips64 | mips64el \
-       | mips64vr | mips64vrel \
+       | mips64octeon | mips64octeonel \
        | mips64orion | mips64orionel \
+       | mips64r5900 | mips64r5900el \
+       | mips64vr | mips64vrel \
        | mips64vr4100 | mips64vr4100el \
        | mips64vr4300 | mips64vr4300el \
        | mips64vr5000 | mips64vr5000el \
@@ -255,26 +272,26 @@ case $basic_machine in
        | mipsisa64sr71k | mipsisa64sr71kel \
        | mipstx39 | mipstx39el \
        | mn10200 | mn10300 \
-       | ms1 \
+       | moxie \
+       | mt \
        | msp430 \
+       | nios | nios2 \
        | ns16k | ns32k \
        | or32 \
        | pdp10 | pdp11 | pj | pjl \
        | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
        | pyramid \
-       | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
+       | score \
+       | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
        | sh64 | sh64le \
-       | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \
-       | sparcv8 | sparcv9 | sparcv9b \
-       | strongarm \
+       | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+       | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+       | spu | strongarm \
        | tahoe | thumb | tic4x | tic80 | tron \
        | v850 | v850e \
        | we32k \
-       | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \
-       | z8k)
-               basic_machine=$basic_machine-unknown
-               ;;
-       m32c)
+       | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+       | z8k | z80)
                basic_machine=$basic_machine-unknown
                ;;
        m6811 | m68hc11 | m6812 | m68hc12)
@@ -284,6 +301,9 @@ case $basic_machine in
                ;;
        m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
                ;;
+       ms1)
+               basic_machine=mt-unknown
+               ;;
 
        # We use `pc' rather than `unknown'
        # because (1) that's what they normally are, and
@@ -303,25 +323,28 @@ case $basic_machine in
        | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
        | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
        | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
-       | avr-* \
+       | avr-* | avr32-* \
        | bfin-* | bs2000-* \
        | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
        | clipper-* | craynv-* | cydra-* \
        | d10v-* | d30v-* | dlx-* \
        | elxsi-* \
-       | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
+       | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
        | h8300-* | h8500-* \
        | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
        | i*86-* | i860-* | i960-* | ia64-* \
        | ip2k-* | iq2000-* \
-       | m32r-* | m32rle-* \
+       | lm32-* \
+       | m32c-* | m32r-* | m32rle-* \
        | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
-       | m88110-* | m88k-* | maxq-* | mcore-* \
+       | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
        | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
        | mips16-* \
        | mips64-* | mips64el-* \
-       | mips64vr-* | mips64vrel-* \
+       | mips64octeon-* | mips64octeonel-* \
        | mips64orion-* | mips64orionel-* \
+       | mips64r5900-* | mips64r5900el-* \
+       | mips64vr-* | mips64vrel-* \
        | mips64vr4100-* | mips64vr4100el-* \
        | mips64vr4300-* | mips64vr4300el-* \
        | mips64vr5000-* | mips64vr5000el-* \
@@ -334,30 +357,33 @@ case $basic_machine in
        | mipsisa64sr71k-* | mipsisa64sr71kel-* \
        | mipstx39-* | mipstx39el-* \
        | mmix-* \
-       | ms1-* \
+       | mt-* \
        | msp430-* \
+       | nios-* | nios2-* \
        | none-* | np1-* | ns16k-* | ns32k-* \
        | orion-* \
        | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
        | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
        | pyramid-* \
        | romp-* | rs6000-* \
-       | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \
+       | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
        | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
-       | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \
+       | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
        | sparclite-* \
-       | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
+       | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
        | tahoe-* | thumb-* \
-       | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+       | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
        | tron-* \
        | v850-* | v850e-* | vax-* \
        | we32k-* \
-       | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \
-       | xstormy16-* | xtensa-* \
+       | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+       | xstormy16-* | xtensa*-* \
        | ymp-* \
-       | z8k-*)
+       | z8k-* | z80-*)
                ;;
-       m32c-*)
+       # Recognize the basic CPU types without company name, with glob match.
+       xtensa*)
+               basic_machine=$basic_machine-unknown
                ;;
        # Recognize the various machine names and aliases which stand
        # for a CPU type and a company and sometimes even an OS.
@@ -421,6 +447,10 @@ case $basic_machine in
                basic_machine=m68k-apollo
                os=-bsd
                ;;
+       aros)
+               basic_machine=i386-pc
+               os=-aros
+               ;;
        aux)
                basic_machine=m68k-apple
                os=-aux
@@ -429,10 +459,22 @@ case $basic_machine in
                basic_machine=ns32k-sequent
                os=-dynix
                ;;
+       blackfin)
+               basic_machine=bfin-unknown
+               os=-linux
+               ;;
+       blackfin-*)
+               basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
        c90)
                basic_machine=c90-cray
                os=-unicos
                ;;
+        cegcc)
+               basic_machine=arm-unknown
+               os=-cegcc
+               ;;
        convex-c1)
                basic_machine=c1-convex
                os=-bsd
@@ -461,8 +503,8 @@ case $basic_machine in
                basic_machine=craynv-cray
                os=-unicosmp
                ;;
-       cr16c)
-               basic_machine=cr16c-unknown
+       cr16)
+               basic_machine=cr16-unknown
                os=-elf
                ;;
        crds | unos)
@@ -500,6 +542,10 @@ case $basic_machine in
                basic_machine=m88k-motorola
                os=-sysv3
                ;;
+       dicos)
+               basic_machine=i686-pc
+               os=-dicos
+               ;;
        djgpp)
                basic_machine=i586-pc
                os=-msdosdjgpp
@@ -654,6 +700,14 @@ case $basic_machine in
                basic_machine=m68k-isi
                os=-sysv
                ;;
+       m68knommu)
+               basic_machine=m68k-unknown
+               os=-linux
+               ;;
+       m68knommu-*)
+               basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
        m88k-omron*)
                basic_machine=m88k-omron
                ;;
@@ -669,6 +723,10 @@ case $basic_machine in
                basic_machine=i386-pc
                os=-mingw32
                ;;
+       mingw32ce)
+               basic_machine=arm-unknown
+               os=-mingw32ce
+               ;;
        miniframe)
                basic_machine=m68000-convergent
                ;;
@@ -694,6 +752,9 @@ case $basic_machine in
                basic_machine=i386-pc
                os=-msdos
                ;;
+       ms1-*)
+               basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+               ;;
        mvs)
                basic_machine=i370-ibm
                os=-mvs
@@ -792,6 +853,14 @@ case $basic_machine in
                basic_machine=i860-intel
                os=-osf
                ;;
+       parisc)
+               basic_machine=hppa-unknown
+               os=-linux
+               ;;
+       parisc-*)
+               basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
        pbd)
                basic_machine=sparc-tti
                ;;
@@ -801,6 +870,12 @@ case $basic_machine in
        pc532 | pc532-*)
                basic_machine=ns32k-pc532
                ;;
+       pc98)
+               basic_machine=i386-pc
+               ;;
+       pc98-*)
+               basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
        pentium | p5 | k5 | k6 | nexgen | viac3)
                basic_machine=i586-pc
                ;;
@@ -857,6 +932,10 @@ case $basic_machine in
                basic_machine=i586-unknown
                os=-pw32
                ;;
+       rdos)
+               basic_machine=i386-pc
+               os=-rdos
+               ;;
        rom68k)
                basic_machine=m68k-rom68k
                os=-coff
@@ -883,6 +962,10 @@ case $basic_machine in
        sb1el)
                basic_machine=mipsisa64sb1el-unknown
                ;;
+       sde)
+               basic_machine=mipsisa32-sde
+               os=-elf
+               ;;
        sei)
                basic_machine=mips-sei
                os=-seiux
@@ -894,6 +977,9 @@ case $basic_machine in
                basic_machine=sh-hitachi
                os=-hms
                ;;
+       sh5el)
+               basic_machine=sh5le-unknown
+               ;;
        sh64)
                basic_machine=sh64-unknown
                ;;
@@ -983,6 +1069,10 @@ case $basic_machine in
                basic_machine=tic6x-unknown
                os=-coff
                ;;
+       tile*)
+               basic_machine=tile-unknown
+               os=-linux-gnu
+               ;;
        tx39)
                basic_machine=mipstx39-unknown
                ;;
@@ -1058,6 +1148,10 @@ case $basic_machine in
                basic_machine=z8k-unknown
                os=-sim
                ;;
+       z80-*-coff)
+               basic_machine=z80-unknown
+               os=-sim
+               ;;
        none)
                basic_machine=none-none
                os=-none
@@ -1096,10 +1190,10 @@ case $basic_machine in
        we32k)
                basic_machine=we32k-att
                ;;
-       sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
+       sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
                basic_machine=sh-unknown
                ;;
-       sparc | sparcv8 | sparcv9 | sparcv9b)
+       sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
                basic_machine=sparc-sun
                ;;
        cydra)
@@ -1168,25 +1262,28 @@ case $os in
        -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
              | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
              | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+             | -kopensolaris* \
              | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
-             | -aos* \
+             | -aos* | -aros* \
              | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
              | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
-             | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
+             | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+             | -openbsd* | -solidbsd* \
              | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
              | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
              | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
              | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
-             | -chorusos* | -chorusrdb* \
+             | -chorusos* | -chorusrdb* | -cegcc* \
              | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-             | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
+             | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+             | -uxpv* | -beos* | -mpeix* | -udk* \
              | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
              | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
              | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
              | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
              | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
              | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
-             | -skyos* | -haiku*)
+             | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
        # Remember, each alternative MUST END IN *, to match a version number.
                ;;
        -qnx*)
@@ -1316,6 +1413,9 @@ case $os in
        -zvmoe)
                os=-zvmoe
                ;;
+       -dicos*)
+               os=-dicos
+               ;;
        -none)
                ;;
        *)
@@ -1338,6 +1438,12 @@ else
 # system, and we'll never get to this point.
 
 case $basic_machine in
+        score-*)
+               os=-elf
+               ;;
+        spu-*)
+               os=-elf
+               ;;
        *-acorn)
                os=-riscix1.2
                ;;
@@ -1347,9 +1453,9 @@ case $basic_machine in
        arm*-semi)
                os=-aout
                ;;
-    c4x-* | tic4x-*)
-        os=-coff
-        ;;
+        c4x-* | tic4x-*)
+               os=-coff
+               ;;
        # This must come before the *-dec entry.
        pdp10-*)
                os=-tops20
@@ -1375,6 +1481,9 @@ case $basic_machine in
        m68*-cisco)
                os=-aout
                ;;
+        mep-*)
+               os=-elf
+               ;;
        mips*-cisco)
                os=-elf
                ;;
index 2d90d9c7e859cce0294182eb21c6b549188c953e..a3a26ef43e48280ef4075b147649632bf7891e41 100644 (file)
@@ -103,6 +103,7 @@ AC_CHECK_HEADERS(sys/time.h time.h)
 AC_CHECK_HEADERS(stdarg.h vararg.h)
 AC_CHECK_HEADERS(sys/mount.h mntent.h)
 AC_CHECK_HEADERS(stropts.h)
+AC_CHECK_HEADERS(unix.h)
 
 AC_CHECK_FUNCS(seteuid setresuid setegid setresgid chroot bzero strerror)
 AC_CHECK_FUNCS(vsyslog setlinebuf mktime ftruncate chsize rename)
index fe1f732acb275434ffdbab15ae48d768ecda15f5..2db6aa1226cbe796666371151dc89d7656bac78e 100644 (file)
@@ -258,6 +258,10 @@ char *rep_realpath(const char *path, char *resolved_path);
 int rep_lchown(const char *fname,uid_t uid,gid_t gid);
 #endif
 
+#ifdef HAVE_UNIX_H
+#include <unix.h>
+#endif
+
 #ifndef HAVE_SETLINEBUF
 #define setlinebuf rep_setlinebuf
 void rep_setlinebuf(FILE *);
index f156c0fa7b2e548640d47db23df71c9427ec73ce..2c72ae1f0de1c5097afe8f54d27a04d7816e432a 100644 (file)
@@ -301,16 +301,21 @@ int tdb_unlock(struct tdb_context *tdb, int list, int ltype)
  */
 int tdb_transaction_lock(struct tdb_context *tdb, int ltype)
 {
-       if (tdb->have_transaction_lock || tdb->global_lock.count) {
+       if (tdb->global_lock.count) {
+               return 0;
+       }
+       if (tdb->transaction_lock_count > 0) {
+               tdb->transaction_lock_count++;
                return 0;
        }
+
        if (tdb->methods->tdb_brlock(tdb, TRANSACTION_LOCK, ltype, 
                                     F_SETLKW, 0, 1) == -1) {
                TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_transaction_lock: failed to get transaction lock\n"));
                tdb->ecode = TDB_ERR_LOCK;
                return -1;
        }
-       tdb->have_transaction_lock = 1;
+       tdb->transaction_lock_count++;
        return 0;
 }
 
@@ -320,12 +325,16 @@ int tdb_transaction_lock(struct tdb_context *tdb, int ltype)
 int tdb_transaction_unlock(struct tdb_context *tdb)
 {
        int ret;
-       if (!tdb->have_transaction_lock) {
+       if (tdb->global_lock.count) {
+               return 0;
+       }
+       if (tdb->transaction_lock_count > 1) {
+               tdb->transaction_lock_count--;
                return 0;
        }
        ret = tdb->methods->tdb_brlock(tdb, TRANSACTION_LOCK, F_UNLCK, F_SETLKW, 0, 1);
        if (ret == 0) {
-               tdb->have_transaction_lock = 0;
+               tdb->transaction_lock_count = 0;
        }
        return ret;
 }
index ffac89ff0e315195b3defdebc35184ef7ab6a038..45b85f4c9334b91084e80141937ea029f443c037 100644 (file)
@@ -166,7 +166,7 @@ struct tdb_context {
        struct tdb_transaction *transaction;
        int page_size;
        int max_dead_records;
-       bool have_transaction_lock;
+       int transaction_lock_count;
        volatile sig_atomic_t *interrupt_sig_ptr;
 };
 
index 69c81e6e98fd27b7a4d8d86c7c6f620e64cd552a..07b0c238587eb85fe3945b61b71dbd9dd0729d58 100644 (file)
@@ -204,23 +204,18 @@ int tdb_traverse_read(struct tdb_context *tdb,
 {
        struct tdb_traverse_lock tl = { NULL, 0, 0, F_RDLCK };
        int ret;
-       bool in_transaction = (tdb->transaction != NULL);
 
        /* we need to get a read lock on the transaction lock here to
           cope with the lock ordering semantics of solaris10 */
-       if (!in_transaction) {
-               if (tdb_transaction_lock(tdb, F_RDLCK)) {
-                       return -1;
-               }
+       if (tdb_transaction_lock(tdb, F_RDLCK)) {
+               return -1;
        }
 
        tdb->traverse_read++;
        ret = tdb_traverse_internal(tdb, fn, private_data, &tl);
        tdb->traverse_read--;
 
-       if (!in_transaction) {
-               tdb_transaction_unlock(tdb);
-       }
+       tdb_transaction_unlock(tdb);
 
        return ret;
 }
@@ -237,25 +232,20 @@ int tdb_traverse(struct tdb_context *tdb,
 {
        struct tdb_traverse_lock tl = { NULL, 0, 0, F_WRLCK };
        int ret;
-       bool in_transaction = (tdb->transaction != NULL);
 
        if (tdb->read_only || tdb->traverse_read) {
                return tdb_traverse_read(tdb, fn, private_data);
        }
        
-       if (!in_transaction) {
-               if (tdb_transaction_lock(tdb, F_WRLCK)) {
-                       return -1;
-               }
+       if (tdb_transaction_lock(tdb, F_WRLCK)) {
+               return -1;
        }
 
        tdb->traverse_write++;
        ret = tdb_traverse_internal(tdb, fn, private_data, &tl);
        tdb->traverse_write--;
 
-       if (!in_transaction) {
-               tdb_transaction_unlock(tdb);
-       }
+       tdb_transaction_unlock(tdb);
 
        return ret;
 }
index d964fb33d390fa495ff98a429ba206e4c63d1626..f9aca91aa1c39f2b6e3edc37115fac141ef4cc7a 100644 (file)
@@ -66,7 +66,13 @@ static bool test_event_context(struct torture_context *test,
        const char *backend = (const char *)test_data;
        int alarm_count=0, info_count=0;
        struct tevent_fd *fde;
-       struct signal_event *se1, *se2, *se3;
+#ifdef SA_RESTART
+       struct tevent_signal *se1 = NULL;
+#endif
+       struct tevent_signal *se2 = NULL;
+#ifdef SA_SIGINFO
+       struct tevent_signal *se3 = NULL;
+#endif
        int finished=0;
        struct timeval t;
        char c = 0;
@@ -92,7 +98,9 @@ static bool test_event_context(struct torture_context *test,
        event_add_timed(ev_ctx, ev_ctx, timeval_current_ofs(2,0), 
                        finished_handler, &finished);
 
+#ifdef SA_RESTART
        se1 = event_add_signal(ev_ctx, ev_ctx, SIGALRM, SA_RESTART, count_handler, &alarm_count);
+#endif
        se2 = event_add_signal(ev_ctx, ev_ctx, SIGALRM, SA_RESETHAND, count_handler, &alarm_count);
 #ifdef SA_SIGINFO
        se3 = event_add_signal(ev_ctx, ev_ctx, SIGUSR1, SA_SIGINFO, count_handler, &info_count);
@@ -120,7 +128,9 @@ static bool test_event_context(struct torture_context *test,
 
        torture_comment(test, "Got %.2f pipe events/sec\n", fde_count/timeval_elapsed(&t));
 
+#ifdef SA_RESTART
        talloc_free(se1);
+#endif
 
        torture_assert_int_equal(test, alarm_count, 1+fde_count, "alarm count mismatch");
 
index 541f93f99c3e36fe77d4f18823484edfc503656b..0feabb5f1f9d7bd2674fdf81cf4ad6146b8da520 100644 (file)
@@ -104,7 +104,7 @@ struct tevent_req *_tevent_req_create(TALLOC_CTX *mem_ctx,
                return NULL;
        }
 
-       data = talloc_size(req, data_size);
+       data = talloc_zero_size(req, data_size);
        if (data == NULL) {
                talloc_free(req);
                return NULL;
index 99447e7e5355bd93b62e8fc0e65bdcea6dcddf37..392cb0ad4c0ccebbdd12aa87c50c413a9890e241 100644 (file)
@@ -65,7 +65,6 @@ struct torture_context *torture_context_child(struct torture_context *parent)
        if (subtorture == NULL)
                return NULL;
 
-       subtorture->level = parent->level+1;
        subtorture->ev = talloc_reference(subtorture, parent->ev);
        subtorture->lp_ctx = talloc_reference(subtorture, parent->lp_ctx);
        subtorture->outputdir = talloc_reference(subtorture, parent->outputdir);
@@ -257,7 +256,6 @@ bool torture_run_suite(struct torture_context *context,
        struct torture_suite *tsuite;
        char *old_testname;
 
-       context->level++;
        if (context->results->ui_ops->suite_start)
                context->results->ui_ops->suite_start(context, suite);
 
@@ -282,8 +280,6 @@ bool torture_run_suite(struct torture_context *context,
        if (context->results->ui_ops->suite_finish)
                context->results->ui_ops->suite_finish(context, suite);
 
-       context->level--;
-       
        return ret;
 }
 
@@ -378,8 +374,6 @@ bool torture_run_tcase(struct torture_context *context,
        char *old_testname;
        struct torture_test *test;
 
-       context->level++;
-
        context->active_tcase = tcase;
        if (context->results->ui_ops->tcase_start) 
                context->results->ui_ops->tcase_start(context, tcase);
@@ -415,8 +409,6 @@ done:
        if (context->results->ui_ops->tcase_finish)
                context->results->ui_ops->tcase_finish(context, tcase);
 
-       context->level--;
-
        return ret;
 }
 
index bc6365351e3ab15f8568301d430b98d7fa7d4177..e28801e2692fc7528416cadc912d6f221c0af624 100644 (file)
@@ -86,9 +86,6 @@ struct torture_context
        /** Directory used for temporary test data */
        const char *outputdir;
        
-       /** Indentation level */
-       int level;
-
        /** Event context */
        struct tevent_context *ev;
 
index 78bca4b0b568d547785a6af55fa53adf34b6ba44..8f1ccbeb432251b048636494cc2e18e4a3ba9305 100644 (file)
@@ -203,7 +203,7 @@ struct tsocket_address_bsd {
 
 static int _tsocket_address_bsd_from_sockaddr(TALLOC_CTX *mem_ctx,
                                              struct sockaddr *sa,
-                                             socklen_t sa_len,
+                                             socklen_t sa_socklen,
                                              struct tsocket_address **_addr,
                                              const char *location)
 {
@@ -212,20 +212,20 @@ static int _tsocket_address_bsd_from_sockaddr(TALLOC_CTX *mem_ctx,
 
        switch (sa->sa_family) {
        case AF_UNIX:
-               if (sa_len < sizeof(struct sockaddr_un)) {
+               if (sa_socklen < sizeof(struct sockaddr_un)) {
                        errno = EINVAL;
                        return -1;
                }
                break;
        case AF_INET:
-               if (sa_len < sizeof(struct sockaddr_in)) {
+               if (sa_socklen < sizeof(struct sockaddr_in)) {
                        errno = EINVAL;
                        return -1;
                }
                break;
 #ifdef HAVE_IPV6
        case AF_INET6:
-               if (sa_len < sizeof(struct sockaddr_in6)) {
+               if (sa_socklen < sizeof(struct sockaddr_in6)) {
                        errno = EINVAL;
                        return -1;
                }
@@ -236,7 +236,7 @@ static int _tsocket_address_bsd_from_sockaddr(TALLOC_CTX *mem_ctx,
                return -1;
        }
 
-       if (sa_len > sizeof(struct sockaddr_storage)) {
+       if (sa_socklen > sizeof(struct sockaddr_storage)) {
                errno = EINVAL;
                return -1;
        }
@@ -253,7 +253,7 @@ static int _tsocket_address_bsd_from_sockaddr(TALLOC_CTX *mem_ctx,
 
        ZERO_STRUCTP(bsda);
 
-       memcpy(&bsda->u.ss, sa, sa_len);
+       memcpy(&bsda->u.ss, sa, sa_socklen);
 
        *_addr = addr;
        return 0;
@@ -773,7 +773,7 @@ static void tdgram_bsd_recvfrom_handler(void *private_data)
        struct tsocket_address_bsd *bsda;
        ssize_t ret;
        struct sockaddr *sa = NULL;
-       socklen_t sa_len = 0;
+       socklen_t sa_socklen = 0;
        int err;
        bool retry;
 
@@ -809,16 +809,16 @@ static void tdgram_bsd_recvfrom_handler(void *private_data)
        ZERO_STRUCTP(bsda);
 
        sa = &bsda->u.sa;
-       sa_len = sizeof(bsda->u.ss);
+       sa_socklen = sizeof(bsda->u.ss);
        /*
         * for unix sockets we can't use the size of sockaddr_storage
         * we would get EINVAL
         */
        if (bsda->u.sa.sa_family == AF_UNIX) {
-               sa_len = sizeof(bsda->u.un);
+               sa_socklen = sizeof(bsda->u.un);
        }
 
-       ret = recvfrom(bsds->fd, state->buf, state->len, 0, sa, &sa_len);
+       ret = recvfrom(bsds->fd, state->buf, state->len, 0, sa, &sa_socklen);
        err = tsocket_bsd_error_from_errno(ret, errno, &retry);
        if (retry) {
                /* retry later */
@@ -946,7 +946,7 @@ static void tdgram_bsd_sendto_handler(void *private_data)
        struct tdgram_context *dgram = state->dgram;
        struct tdgram_bsd *bsds = tdgram_context_data(dgram, struct tdgram_bsd);
        struct sockaddr *sa = NULL;
-       socklen_t sa_len = 0;
+       socklen_t sa_socklen = 0;
        ssize_t ret;
        int err;
        bool retry;
@@ -957,17 +957,17 @@ static void tdgram_bsd_sendto_handler(void *private_data)
                        struct tsocket_address_bsd);
 
                sa = &bsda->u.sa;
-               sa_len = sizeof(bsda->u.ss);
+               sa_socklen = sizeof(bsda->u.ss);
                /*
                 * for unix sockets we can't use the size of sockaddr_storage
                 * we would get EINVAL
                 */
                if (bsda->u.sa.sa_family == AF_UNIX) {
-                       sa_len = sizeof(bsda->u.un);
+                       sa_socklen = sizeof(bsda->u.un);
                }
        }
 
-       ret = sendto(bsds->fd, state->buf, state->len, 0, sa, sa_len);
+       ret = sendto(bsds->fd, state->buf, state->len, 0, sa, sa_socklen);
        err = tsocket_bsd_error_from_errno(ret, errno, &retry);
        if (retry) {
                /* retry later */
@@ -1087,7 +1087,7 @@ static int tdgram_bsd_dgram_socket(const struct tsocket_address *local,
        int ret;
        bool do_bind = false;
        bool do_reuseaddr = false;
-       socklen_t sa_len = sizeof(lbsda->u.ss);
+       socklen_t sa_socklen = sizeof(lbsda->u.ss);
 
        if (remote) {
                rbsda = talloc_get_type_abort(remote->private_data,
@@ -1108,7 +1108,7 @@ static int tdgram_bsd_dgram_socket(const struct tsocket_address *local,
                 * for unix sockets we can't use the size of sockaddr_storage
                 * we would get EINVAL
                 */
-               sa_len = sizeof(lbsda->u.un);
+               sa_socklen = sizeof(lbsda->u.un);
                break;
        case AF_INET:
                if (lbsda->u.in.sin_port != 0) {
@@ -1189,7 +1189,7 @@ static int tdgram_bsd_dgram_socket(const struct tsocket_address *local,
        }
 
        if (do_bind) {
-               ret = bind(fd, &lbsda->u.sa, sa_len);
+               ret = bind(fd, &lbsda->u.sa, sa_socklen);
                if (ret == -1) {
                        int saved_errno = errno;
                        talloc_free(dgram);
@@ -1199,7 +1199,7 @@ static int tdgram_bsd_dgram_socket(const struct tsocket_address *local,
        }
 
        if (rbsda) {
-               ret = connect(fd, &rbsda->u.sa, sa_len);
+               ret = connect(fd, &rbsda->u.sa, sa_socklen);
                if (ret == -1) {
                        int saved_errno = errno;
                        talloc_free(dgram);
@@ -1889,7 +1889,7 @@ static struct tevent_req * tstream_bsd_connect_send(TALLOC_CTX *mem_ctx,
        bool retry;
        bool do_bind = false;
        bool do_reuseaddr = false;
-       socklen_t sa_len = sizeof(rbsda->u.ss);
+       socklen_t sa_socklen = sizeof(rbsda->u.ss);
 
        req = tevent_req_create(mem_ctx, &state,
                                struct tstream_bsd_connect_state);
@@ -1917,7 +1917,7 @@ static struct tevent_req * tstream_bsd_connect_send(TALLOC_CTX *mem_ctx,
                 * for unix sockets we can't use the size of sockaddr_storage
                 * we would get EINVAL
                 */
-               sa_len = sizeof(rbsda->u.un);
+               sa_socklen = sizeof(rbsda->u.un);
                break;
        case AF_INET:
                if (lbsda->u.in.sin_port != 0) {
@@ -1977,7 +1977,7 @@ static struct tevent_req * tstream_bsd_connect_send(TALLOC_CTX *mem_ctx,
                }
        }
 
-       ret = connect(state->fd, &rbsda->u.sa, sa_len);
+       ret = connect(state->fd, &rbsda->u.sa, sa_socklen);
        err = tsocket_bsd_error_from_errno(ret, errno, &retry);
        if (retry) {
                /* retry later */
index cd1823a9a07bcacc2063713b22c3d772398ddca6..5b8456547ac9fc5ca1f8615a69297be96240f9c7 100644 (file)
@@ -294,6 +294,7 @@ _PUBLIC_ uint32_t generate_random(void)
 _PUBLIC_ bool check_password_quality(const char *s)
 {
        int has_digit=0, has_capital=0, has_lower=0, has_special=0, has_high=0;
+       const char* reals = s;
        while (*s) {
                if (isdigit((unsigned char)*s)) {
                        has_digit |= 1;
@@ -310,7 +311,7 @@ _PUBLIC_ bool check_password_quality(const char *s)
        }
 
        return ((has_digit + has_lower + has_capital + has_special) >= 3
-               || (has_high > strlen(s)/2));
+               || (has_high > strlen(reals)/2));
 }
 
 /**
index 5fe229c089e3e8f23e05a3070fc8e8bfd03d6cfa..20a20ac7fa1f0a3225d39cfac0eedf0137b1b572 100644 (file)
@@ -40,6 +40,8 @@ static bool test_check_password_quality(struct torture_context *tctx)
        torture_assert(tctx, !check_password_quality("aaaaaaaaaaaa"), "same char password");
        torture_assert(tctx, !check_password_quality("BLA"), "multiple upcases password");
        torture_assert(tctx, !check_password_quality("123"), "digits only");
+       torture_assert(tctx, !check_password_quality("matthiéu"), "not enough high symbols");
+       torture_assert(tctx, check_password_quality("abcdééàçè"), "valid");
        torture_assert(tctx, check_password_quality("A2e"), "valid");
        torture_assert(tctx, check_password_quality("BA2eLi443"), "valid");
        return true;
index 0275e78c54fc89f3a69d2539c82874ea1ce10878..7466004e5ce07f175608202d797d23d94f2f2274 100644 (file)
@@ -380,6 +380,7 @@ _PUBLIC_ bool file_save(const char *fname, const void *packet, size_t length)
                return false;
        }
        if (write(fd, packet, length) != (size_t)length) {
+               close(fd);
                return false;
        }
        close(fd);
index 9373ef581266877ee0253235e02500fa09afcfa7..29afe460b16485a17b7796f4c04b60ca4b6b3ddd 100644 (file)
@@ -51,7 +51,7 @@ struct security_acl *make_sec_acl(TALLOC_CTX *ctx,
           positive number. */
 
        if ((num_aces) && 
-            ((dst->aces = talloc_array(ctx, struct security_ace, num_aces)) 
+            ((dst->aces = talloc_array(dst, struct security_ace, num_aces))
              == NULL)) {
                return NULL;
        }
similarity index 89%
rename from source4/dsdb/common/flag_mapping.c
rename to libds/common/flag_mapping.c
index dceb41be672309420ea79f8d2db888ed74fcf587..dc7d80185a2b9662c7fda092416eab198ca2d129 100644 (file)
@@ -1,33 +1,31 @@
-/* 
+/*
    Unix SMB/CIFS implementation.
-   helper mapping functions for the SAMDB server
-   
+   helper mapping functions for the UF and ACB flags
+
    Copyright (C) Stefan (metze) Metzmacher 2002
    Copyright (C) Andrew Tridgell 2004
-  
+
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 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"
 #include "librpc/gen_ndr/samr.h"
-#include "dsdb/common/flags.h"
-#include "lib/ldb/include/ldb.h"
-#include "dsdb/common/proto.h"
+#include "../libds/common/flags.h"
 
-/* 
-translated the ACB_CTRL Flags to UserFlags (userAccountControl) 
-*/ 
+/*
+translated the ACB_CTRL Flags to UserFlags (userAccountControl)
+*/
 /* mapping between ADS userAccountControl and SAMR acct_flags */
 static const struct {
        uint32_t uf;
@@ -54,7 +52,7 @@ static const struct {
        { UF_NO_AUTH_DATA_REQUIRED, ACB_NO_AUTH_DATA_REQD }
 };
 
-uint32_t samdb_acb2uf(uint32_t acb)
+uint32_t ds_acb2uf(uint32_t acb)
 {
        uint32_t i, ret = 0;
        for (i=0;i<ARRAY_SIZE(acct_flags_map);i++) {
@@ -68,7 +66,7 @@ uint32_t samdb_acb2uf(uint32_t acb)
 /*
 translated the UserFlags (userAccountControl) to ACB_CTRL Flags
 */
-uint32_t samdb_uf2acb(uint32_t uf)
+uint32_t ds_uf2acb(uint32_t uf)
 {
        uint32_t i;
        uint32_t ret = 0;
@@ -80,13 +78,13 @@ uint32_t samdb_uf2acb(uint32_t uf)
        return ret;
 }
 
-/* 
+/*
 get the accountType from the UserFlags
 */
-uint32_t samdb_uf2atype(uint32_t uf)
+uint32_t ds_uf2atype(uint32_t uf)
 {
        uint32_t atype = 0x00000000;
-               
+
        if (uf & UF_NORMAL_ACCOUNT)                     atype = ATYPE_NORMAL_ACCOUNT;
        else if (uf & UF_TEMP_DUPLICATE_ACCOUNT)        atype = ATYPE_NORMAL_ACCOUNT;
        else if (uf & UF_SERVER_TRUST_ACCOUNT)          atype = ATYPE_WORKSTATION_TRUST;
@@ -94,15 +92,15 @@ uint32_t samdb_uf2atype(uint32_t uf)
        else if (uf & UF_INTERDOMAIN_TRUST_ACCOUNT)     atype = ATYPE_INTERDOMAIN_TRUST;
 
        return atype;
-} 
+}
 
-/* 
+/*
 get the accountType from the groupType
 */
-uint32_t samdb_gtype2atype(uint32_t gtype)
+uint32_t ds_gtype2atype(uint32_t gtype)
 {
        uint32_t atype = 0x00000000;
-       
+
        switch(gtype) {
                case GTYPE_SECURITY_BUILTIN_LOCAL_GROUP:
                        atype = ATYPE_SECURITY_LOCAL_GROUP;
@@ -113,7 +111,7 @@ uint32_t samdb_gtype2atype(uint32_t gtype)
                case GTYPE_SECURITY_GLOBAL_GROUP:
                        atype = ATYPE_SECURITY_GLOBAL_GROUP;
                        break;
-       
+
                case GTYPE_DISTRIBUTION_GLOBAL_GROUP:
                        atype = ATYPE_DISTRIBUTION_GLOBAL_GROUP;
                        break;
@@ -129,7 +127,7 @@ uint32_t samdb_gtype2atype(uint32_t gtype)
 }
 
 /* turn a sAMAccountType into a SID_NAME_USE */
-enum lsa_SidType samdb_atype_map(uint32_t atype)
+enum lsa_SidType ds_atype_map(uint32_t atype)
 {
        switch (atype & 0xF0000000) {
        case ATYPE_GLOBAL_GROUP:
similarity index 62%
rename from source4/dsdb/common/flags.h
rename to libds/common/flags.h
index dd8081732c11c4f2468cd95f53fba2d14ca97d9d..2b342af8d6a1e137ae2e9e5514888f11cb5b2d8d 100644 (file)
 /* UserFlags for userAccountControl */
 #define UF_SCRIPT                              0x00000001  /* NT or Lan Manager Login script must be executed */
 #define UF_ACCOUNTDISABLE                      0x00000002
-#define UF_00000004                            0x00000004
+#define UF_00000004                            0x00000004
 #define UF_HOMEDIR_REQUIRED                    0x00000008
 
-#define UF_LOCKOUT                             0x00000010
-#define UF_PASSWD_NOTREQD                      0x00000020
-#define UF_PASSWD_CANT_CHANGE                  0x00000040
+#define UF_LOCKOUT                             0x00000010
+#define UF_PASSWD_NOTREQD                      0x00000020
+#define UF_PASSWD_CANT_CHANGE                  0x00000040
 #define UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED     0x00000080
 
-#define UF_TEMP_DUPLICATE_ACCOUNT              0x00000100 /* Local user account in usrmgr */
-#define UF_NORMAL_ACCOUNT                      0x00000200
-#define UF_00000400                            0x00000400
-#define UF_INTERDOMAIN_TRUST_ACCOUNT           0x00000800
+#define UF_TEMP_DUPLICATE_ACCOUNT              0x00000100 /* Local user account in usrmgr */
+#define UF_NORMAL_ACCOUNT                      0x00000200
+#define UF_00000400                            0x00000400
+#define UF_INTERDOMAIN_TRUST_ACCOUNT           0x00000800
 
-#define UF_WORKSTATION_TRUST_ACCOUNT           0x00001000
-#define UF_SERVER_TRUST_ACCOUNT                0x00002000
-#define UF_00004000                            0x00004000
-#define UF_00008000                            0x00008000
+#define UF_WORKSTATION_TRUST_ACCOUNT           0x00001000
+#define UF_SERVER_TRUST_ACCOUNT                        0x00002000
+#define UF_00004000                            0x00004000
+#define UF_00008000                            0x00008000
 
 #define UF_DONT_EXPIRE_PASSWD                  0x00010000
 #define UF_MNS_LOGON_ACCOUNT                   0x00020000
 #define UF_PASSWORD_EXPIRED                    0x00800000
 
 #define UF_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION 0x01000000
-#define UF_NO_AUTH_DATA_REQUIRED                0x02000000
+#define UF_NO_AUTH_DATA_REQUIRED               0x02000000
+
+#define UF_MACHINE_ACCOUNT_MASK (\
+               UF_INTERDOMAIN_TRUST_ACCOUNT |\
+               UF_WORKSTATION_TRUST_ACCOUNT |\
+               UF_SERVER_TRUST_ACCOUNT \
+               )
+
+#define UF_ACCOUNT_TYPE_MASK (\
+               UF_TEMP_DUPLICATE_ACCOUNT |\
+               UF_NORMAL_ACCOUNT |\
+               UF_INTERDOMAIN_TRUST_ACCOUNT |\
+               UF_WORKSTATION_TRUST_ACCOUNT |\
+               UF_SERVER_TRUST_ACCOUNT \
+                )
+
+#define UF_SETTABLE_BITS (\
+               UF_SCRIPT |\
+               UF_ACCOUNTDISABLE |\
+               UF_HOMEDIR_REQUIRED  |\
+               UF_LOCKOUT |\
+               UF_PASSWD_NOTREQD |\
+               UF_PASSWD_CANT_CHANGE |\
+               UF_ACCOUNT_TYPE_MASK | \
+               UF_DONT_EXPIRE_PASSWD | \
+               UF_MNS_LOGON_ACCOUNT |\
+               UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED |\
+               UF_SMARTCARD_REQUIRED |\
+               UF_TRUSTED_FOR_DELEGATION |\
+               UF_NOT_DELEGATED |\
+               UF_USE_DES_KEY_ONLY  |\
+               UF_DONT_REQUIRE_PREAUTH \
+               )
 
 /* sAMAccountType */
 #define ATYPE_NORMAL_ACCOUNT                   0x30000000 /* 805306368 */
 #define ATYPE_WORKSTATION_TRUST                        0x30000001 /* 805306369 */
-#define ATYPE_INTERDOMAIN_TRUST                        0x30000002 /* 805306370 */ 
+#define ATYPE_INTERDOMAIN_TRUST                        0x30000002 /* 805306370 */
 #define ATYPE_SECURITY_GLOBAL_GROUP            0x10000000 /* 268435456 */
 #define ATYPE_DISTRIBUTION_GLOBAL_GROUP                0x10000001 /* 268435457 */
-#define ATYPE_DISTRIBUTION_UNIVERSAL_GROUP     ATYPE_DISTRIBUTION_GLOBAL_GROUP
+#define ATYPE_DISTRIBUTION_UNIVERSAL_GROUP     ATYPE_DISTRIBUTION_GLOBAL_GROUP
 #define ATYPE_SECURITY_LOCAL_GROUP             0x20000000 /* 536870912 */
 #define ATYPE_DISTRIBUTION_LOCAL_GROUP         0x20000001 /* 536870913 */
 
-#define ATYPE_ACCOUNT          ATYPE_NORMAL_ACCOUNT            /* 0x30000000 805306368 */
-#define ATYPE_GLOBAL_GROUP     ATYPE_SECURITY_GLOBAL_GROUP     /* 0x10000000 268435456 */
-#define ATYPE_LOCAL_GROUP      ATYPE_SECURITY_LOCAL_GROUP      /* 0x20000000 536870912 */
+#define ATYPE_ACCOUNT          ATYPE_NORMAL_ACCOUNT            /* 0x30000000 805306368 */
+#define ATYPE_GLOBAL_GROUP     ATYPE_SECURITY_GLOBAL_GROUP     /* 0x10000000 268435456 */
+#define ATYPE_LOCAL_GROUP      ATYPE_SECURITY_LOCAL_GROUP      /* 0x20000000 536870912 */
 
 /* groupType */
 #define GROUP_TYPE_BUILTIN_LOCAL_GROUP         0x00000001
 #define SYSTEM_FLAG_CR_NTDS_DOMAIN             0x00000002
 #define SYSTEM_FLAG_CR_NTDS_NOT_GC_REPLICATED  0x00000004
 #define SYSTEM_FLAG_SCHEMA_BASE_OBJECT         0x00000010
-#define SYSTEM_FLAG_ATTR_IS_RDN                        0x00000020
+#define SYSTEM_FLAG_ATTR_IS_RDN                        0x00000020
 #define SYSTEM_FLAG_DISALLOW_MOVE_ON_DELETE    0x02000000
 #define SYSTEM_FLAG_DOMAIN_DISALLOW_MOVE       0x04000000
 #define SYSTEM_FLAG_DOMAIN_DISALLOW_RENAME     0x08000000
 #define SYSTEM_FLAG_CONFIG_ALLOW_RENAME                0x40000000
 #define SYSTEM_FLAG_DISALLOW_DELTE             0x80000000
 
-#define SEARCH_FLAG_ATTINDEX            0x0000001
-#define SEARCH_FLAG_PDNTATTINDEX        0x0000002
-#define SEARCH_FLAG_ANR                 0x0000004
-#define SEARCH_FLAG_PRESERVEONDELETE    0x0000008
-#define SEARCH_FLAG_COPY                0x0000010
-#define SEARCH_FLAG_TUPLEINDEX          0x0000020
-#define SEARCH_FLAG_SUBTREEATTRINDEX    0x0000040
-#define SEARCH_FLAG_CONFIDENTIAL        0x0000080
-#define SEARCH_FLAG_NEVERVALUEAUDIT     0x0000100
-#define SEARCH_FLAG_RODC_ATTRIBUTE      0x0000200
+#define SEARCH_FLAG_ATTINDEX           0x0000001
+#define SEARCH_FLAG_PDNTATTINDEX       0x0000002
+#define SEARCH_FLAG_ANR                        0x0000004
+#define SEARCH_FLAG_PRESERVEONDELETE   0x0000008
+#define SEARCH_FLAG_COPY               0x0000010
+#define SEARCH_FLAG_TUPLEINDEX         0x0000020
+#define SEARCH_FLAG_SUBTREEATTRINDEX   0x0000040
+#define SEARCH_FLAG_CONFIDENTIAL       0x0000080
+#define SEARCH_FLAG_NEVERVALUEAUDIT    0x0000100
+#define SEARCH_FLAG_RODC_ATTRIBUTE     0x0000200
 
 #define DS_BEHAVIOR_WIN2000            0
 #define DS_BEHAVIOR_WIN2003_INTERIM    1
 #define DS_BEHAVIOR_WIN2003            2
 #define DS_BEHAVIOR_WIN2008            3
+
+/* Settings for the domainFunctionality attribute in the rootDSE */
+
+#define DS_DOMAIN_FUNCTION_2000                0
+#define DS_DOMAIN_FUCNTION_2003_MIXED  1
+#define DS_DOMAIN_FUNCTION_2003                2
+#define DS_DOMAIN_FUNCTION_2008                3
+
index 93362537b47526ff89ddbed06051966050ddb971..04cf38aaf3811d1ec55d3aff3146ac4604ae4a03 100644 (file)
@@ -1796,12 +1796,18 @@ NTSTATUS rpccli_lsa_DeleteTrustedDomain(struct rpc_pipe_client *cli,
 }
 
 NTSTATUS rpccli_lsa_StorePrivateData(struct rpc_pipe_client *cli,
-                                    TALLOC_CTX *mem_ctx)
+                                    TALLOC_CTX *mem_ctx,
+                                    struct policy_handle *handle /* [in] [ref] */,
+                                    struct lsa_String *name /* [in] [ref] */,
+                                    struct lsa_DATA_BUF *val /* [in] [unique] */)
 {
        struct lsa_StorePrivateData r;
        NTSTATUS status;
 
        /* In parameters */
+       r.in.handle = handle;
+       r.in.name = name;
+       r.in.val = val;
 
        if (DEBUGLEVEL >= 10) {
                NDR_PRINT_IN_DEBUG(lsa_StorePrivateData, &r);
@@ -1832,12 +1838,18 @@ NTSTATUS rpccli_lsa_StorePrivateData(struct rpc_pipe_client *cli,
 }
 
 NTSTATUS rpccli_lsa_RetrievePrivateData(struct rpc_pipe_client *cli,
-                                       TALLOC_CTX *mem_ctx)
+                                       TALLOC_CTX *mem_ctx,
+                                       struct policy_handle *handle /* [in] [ref] */,
+                                       struct lsa_String *name /* [in] [ref] */,
+                                       struct lsa_DATA_BUF **val /* [in,out] [ref] */)
 {
        struct lsa_RetrievePrivateData r;
        NTSTATUS status;
 
        /* In parameters */
+       r.in.handle = handle;
+       r.in.name = name;
+       r.in.val = val;
 
        if (DEBUGLEVEL >= 10) {
                NDR_PRINT_IN_DEBUG(lsa_RetrievePrivateData, &r);
@@ -1862,6 +1874,7 @@ NTSTATUS rpccli_lsa_RetrievePrivateData(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
+       *val = *r.out.val;
 
        /* Return result */
        return r.out.result;
index 8dbd7330b43daca38835937c5495570c3f4d1064..10c408528f8d7c5d934fc3ef0df1ff4a21b5c495 100644 (file)
@@ -214,9 +214,15 @@ NTSTATUS rpccli_lsa_DeleteTrustedDomain(struct rpc_pipe_client *cli,
                                        struct policy_handle *handle /* [in] [ref] */,
                                        struct dom_sid2 *dom_sid /* [in] [ref] */);
 NTSTATUS rpccli_lsa_StorePrivateData(struct rpc_pipe_client *cli,
-                                    TALLOC_CTX *mem_ctx);
+                                    TALLOC_CTX *mem_ctx,
+                                    struct policy_handle *handle /* [in] [ref] */,
+                                    struct lsa_String *name /* [in] [ref] */,
+                                    struct lsa_DATA_BUF *val /* [in] [unique] */);
 NTSTATUS rpccli_lsa_RetrievePrivateData(struct rpc_pipe_client *cli,
-                                       TALLOC_CTX *mem_ctx);
+                                       TALLOC_CTX *mem_ctx,
+                                       struct policy_handle *handle /* [in] [ref] */,
+                                       struct lsa_String *name /* [in] [ref] */,
+                                       struct lsa_DATA_BUF **val /* [in,out] [ref] */);
 NTSTATUS rpccli_lsa_OpenPolicy2(struct rpc_pipe_client *cli,
                                TALLOC_CTX *mem_ctx,
                                const char *system_name /* [in] [unique,charset(UTF16)] */,
index 66083e6856740292a3a929666ed99b1e61f8ade5..38031b615de118b0435d11cb2d30551e986578ba 100644 (file)
@@ -2006,12 +2006,17 @@ NTSTATUS rpccli_spoolss_DeletePort(struct rpc_pipe_client *cli,
 
 NTSTATUS rpccli_spoolss_CreatePrinterIC(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
+                                       struct policy_handle *handle /* [in] [ref] */,
+                                       struct policy_handle *gdi_handle /* [out] [ref] */,
+                                       struct spoolss_DevmodeContainer *devmode_ctr /* [in] [ref] */,
                                        WERROR *werror)
 {
        struct spoolss_CreatePrinterIC r;
        NTSTATUS status;
 
        /* In parameters */
+       r.in.handle = handle;
+       r.in.devmode_ctr = devmode_ctr;
 
        if (DEBUGLEVEL >= 10) {
                NDR_PRINT_IN_DEBUG(spoolss_CreatePrinterIC, &r);
@@ -2036,6 +2041,7 @@ NTSTATUS rpccli_spoolss_CreatePrinterIC(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
+       *gdi_handle = *r.out.gdi_handle;
 
        /* Return result */
        if (werror) {
@@ -2088,12 +2094,14 @@ NTSTATUS rpccli_spoolss_PlayGDIScriptOnPrinterIC(struct rpc_pipe_client *cli,
 
 NTSTATUS rpccli_spoolss_DeletePrinterIC(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
+                                       struct policy_handle *gdi_handle /* [in,out] [ref] */,
                                        WERROR *werror)
 {
        struct spoolss_DeletePrinterIC r;
        NTSTATUS status;
 
        /* In parameters */
+       r.in.gdi_handle = gdi_handle;
 
        if (DEBUGLEVEL >= 10) {
                NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterIC, &r);
@@ -2118,6 +2126,7 @@ NTSTATUS rpccli_spoolss_DeletePrinterIC(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
+       *gdi_handle = *r.out.gdi_handle;
 
        /* Return result */
        if (werror) {
index baf5d61e2a8dc9015e36bc56a14794cdb1f9e27a..b171c69fbd8aa1c4745b5ef8615d3ac2a2059015 100644 (file)
@@ -294,12 +294,16 @@ NTSTATUS rpccli_spoolss_DeletePort(struct rpc_pipe_client *cli,
                                   WERROR *werror);
 NTSTATUS rpccli_spoolss_CreatePrinterIC(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
+                                       struct policy_handle *handle /* [in] [ref] */,
+                                       struct policy_handle *gdi_handle /* [out] [ref] */,
+                                       struct spoolss_DevmodeContainer *devmode_ctr /* [in] [ref] */,
                                        WERROR *werror);
 NTSTATUS rpccli_spoolss_PlayGDIScriptOnPrinterIC(struct rpc_pipe_client *cli,
                                                 TALLOC_CTX *mem_ctx,
                                                 WERROR *werror);
 NTSTATUS rpccli_spoolss_DeletePrinterIC(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
+                                       struct policy_handle *gdi_handle /* [in,out] [ref] */,
                                        WERROR *werror);
 NTSTATUS rpccli_spoolss_AddPrinterConnection(struct rpc_pipe_client *cli,
                                             TALLOC_CTX *mem_ctx,
index 3c9a5d80a61502623230a8543a6388416ac4bbd2..9ee5fab4c80dad1ee375fe0ef62842fcb4bd0c0d 100644 (file)
@@ -445,7 +445,7 @@ enum lsa_TrustDomInfoEnum
        LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL=10,
        LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL=11,
        LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL=12,
-       LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES=13
+       LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRYPTION_TYPES=13
 }
 #else
  { __donnot_use_enum_lsa_TrustDomInfoEnum=0x7FFFFFFF}
@@ -461,7 +461,7 @@ enum lsa_TrustDomInfoEnum
 #define LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL ( 10 )
 #define LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL ( 11 )
 #define LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL ( 12 )
-#define LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES ( 13 )
+#define LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRYPTION_TYPES ( 13 )
 #endif
 ;
 
@@ -603,7 +603,7 @@ union lsa_TrustedDomainInfo {
        struct lsa_TrustDomainInfoFullInfoInternal full_info_internal;/* [case(LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL)] */
        struct lsa_TrustDomainInfoInfoEx2Internal info_ex2_internal;/* [case(LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL)] */
        struct lsa_TrustDomainInfoFullInfo2Internal full_info2_internal;/* [case(LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL)] */
-       struct lsa_TrustDomainInfoSupportedEncTypes enc_types;/* [case(LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES)] */
+       struct lsa_TrustDomainInfoSupportedEncTypes enc_types;/* [case(LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRYPTION_TYPES)] */
 }/* [switch_type(lsa_TrustDomInfoEnum)] */;
 
 struct lsa_DATA_BUF_PTR {
@@ -1332,6 +1332,12 @@ struct lsa_DeleteTrustedDomain {
 
 
 struct lsa_StorePrivateData {
+       struct {
+               struct policy_handle *handle;/* [ref] */
+               struct lsa_String *name;/* [ref] */
+               struct lsa_DATA_BUF *val;/* [unique] */
+       } in;
+
        struct {
                NTSTATUS result;
        } out;
@@ -1341,6 +1347,13 @@ struct lsa_StorePrivateData {
 
 struct lsa_RetrievePrivateData {
        struct {
+               struct policy_handle *handle;/* [ref] */
+               struct lsa_String *name;/* [ref] */
+               struct lsa_DATA_BUF **val;/* [ref] */
+       } in;
+
+       struct {
+               struct lsa_DATA_BUF **val;/* [ref] */
                NTSTATUS result;
        } out;
 
index 3ad9c41fd77498750d507709e3a8c60507ba69be..b8ba67937870a0769b31224acc4b206977e1fa28 100644 (file)
@@ -2735,7 +2735,7 @@ _PUBLIC_ void ndr_print_lsa_TrustDomInfoEnum(struct ndr_print *ndr, const char *
                case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL: val = "LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL"; break;
                case LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL: val = "LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL"; break;
                case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL: val = "LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL"; break;
-               case LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES: val = "LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES"; break;
+               case LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRYPTION_TYPES: val = "LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRYPTION_TYPES"; break;
        }
        ndr_print_enum(ndr, name, "ENUM", val, r);
 }
@@ -3662,7 +3662,7 @@ static enum ndr_err_code ndr_push_lsa_TrustedDomainInfo(struct ndr_push *ndr, in
                                NDR_CHECK(ndr_push_lsa_TrustDomainInfoFullInfo2Internal(ndr, NDR_SCALARS, &r->full_info2_internal));
                        break; }
 
-                       case LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES: {
+                       case LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRYPTION_TYPES: {
                                NDR_CHECK(ndr_push_lsa_TrustDomainInfoSupportedEncTypes(ndr, NDR_SCALARS, &r->enc_types));
                        break; }
 
@@ -3720,7 +3720,7 @@ static enum ndr_err_code ndr_push_lsa_TrustedDomainInfo(struct ndr_push *ndr, in
                                NDR_CHECK(ndr_push_lsa_TrustDomainInfoFullInfo2Internal(ndr, NDR_BUFFERS, &r->full_info2_internal));
                        break;
 
-                       case LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES:
+                       case LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRYPTION_TYPES:
                        break;
 
                        default:
@@ -3789,7 +3789,7 @@ static enum ndr_err_code ndr_pull_lsa_TrustedDomainInfo(struct ndr_pull *ndr, in
                                NDR_CHECK(ndr_pull_lsa_TrustDomainInfoFullInfo2Internal(ndr, NDR_SCALARS, &r->full_info2_internal));
                        break; }
 
-                       case LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES: {
+                       case LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRYPTION_TYPES: {
                                NDR_CHECK(ndr_pull_lsa_TrustDomainInfoSupportedEncTypes(ndr, NDR_SCALARS, &r->enc_types));
                        break; }
 
@@ -3846,7 +3846,7 @@ static enum ndr_err_code ndr_pull_lsa_TrustedDomainInfo(struct ndr_pull *ndr, in
                                NDR_CHECK(ndr_pull_lsa_TrustDomainInfoFullInfo2Internal(ndr, NDR_BUFFERS, &r->full_info2_internal));
                        break;
 
-                       case LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES:
+                       case LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRYPTION_TYPES:
                        break;
 
                        default:
@@ -3910,7 +3910,7 @@ _PUBLIC_ void ndr_print_lsa_TrustedDomainInfo(struct ndr_print *ndr, const char
                        ndr_print_lsa_TrustDomainInfoFullInfo2Internal(ndr, "full_info2_internal", &r->full_info2_internal);
                break;
 
-               case LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES:
+               case LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRYPTION_TYPES:
                        ndr_print_lsa_TrustDomainInfoSupportedEncTypes(ndr, "enc_types", &r->enc_types);
                break;
 
@@ -9225,6 +9225,18 @@ _PUBLIC_ void ndr_print_lsa_DeleteTrustedDomain(struct ndr_print *ndr, const cha
 static enum ndr_err_code ndr_push_lsa_StorePrivateData(struct ndr_push *ndr, int flags, const struct lsa_StorePrivateData *r)
 {
        if (flags & NDR_IN) {
+               if (r->in.handle == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
+               if (r->in.name == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name));
+               NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.val));
+               if (r->in.val) {
+                       NDR_CHECK(ndr_push_lsa_DATA_BUF(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.val));
+               }
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
@@ -9234,7 +9246,37 @@ static enum ndr_err_code ndr_push_lsa_StorePrivateData(struct ndr_push *ndr, int
 
 static enum ndr_err_code ndr_pull_lsa_StorePrivateData(struct ndr_pull *ndr, int flags, struct lsa_StorePrivateData *r)
 {
+       uint32_t _ptr_val;
+       TALLOC_CTX *_mem_save_handle_0;
+       TALLOC_CTX *_mem_save_name_0;
+       TALLOC_CTX *_mem_save_val_0;
        if (flags & NDR_IN) {
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->in.handle);
+               }
+               _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->in.name);
+               }
+               _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->in.name, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_val));
+               if (_ptr_val) {
+                       NDR_PULL_ALLOC(ndr, r->in.val);
+               } else {
+                       r->in.val = NULL;
+               }
+               if (r->in.val) {
+                       _mem_save_val_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->in.val, 0);
+                       NDR_CHECK(ndr_pull_lsa_DATA_BUF(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.val));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_val_0, 0);
+               }
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
@@ -9252,6 +9294,20 @@ _PUBLIC_ void ndr_print_lsa_StorePrivateData(struct ndr_print *ndr, const char *
        if (flags & NDR_IN) {
                ndr_print_struct(ndr, "in", "lsa_StorePrivateData");
                ndr->depth++;
+               ndr_print_ptr(ndr, "handle", r->in.handle);
+               ndr->depth++;
+               ndr_print_policy_handle(ndr, "handle", r->in.handle);
+               ndr->depth--;
+               ndr_print_ptr(ndr, "name", r->in.name);
+               ndr->depth++;
+               ndr_print_lsa_String(ndr, "name", r->in.name);
+               ndr->depth--;
+               ndr_print_ptr(ndr, "val", r->in.val);
+               ndr->depth++;
+               if (r->in.val) {
+                       ndr_print_lsa_DATA_BUF(ndr, "val", r->in.val);
+               }
+               ndr->depth--;
                ndr->depth--;
        }
        if (flags & NDR_OUT) {
@@ -9266,8 +9322,30 @@ _PUBLIC_ void ndr_print_lsa_StorePrivateData(struct ndr_print *ndr, const char *
 static enum ndr_err_code ndr_push_lsa_RetrievePrivateData(struct ndr_push *ndr, int flags, const struct lsa_RetrievePrivateData *r)
 {
        if (flags & NDR_IN) {
+               if (r->in.handle == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
+               if (r->in.name == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name));
+               if (r->in.val == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_unique_ptr(ndr, *r->in.val));
+               if (*r->in.val) {
+                       NDR_CHECK(ndr_push_lsa_DATA_BUF(ndr, NDR_SCALARS|NDR_BUFFERS, *r->in.val));
+               }
        }
        if (flags & NDR_OUT) {
+               if (r->out.val == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.val));
+               if (*r->out.val) {
+                       NDR_CHECK(ndr_push_lsa_DATA_BUF(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.val));
+               }
                NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
        }
        return NDR_ERR_SUCCESS;
@@ -9275,9 +9353,68 @@ static enum ndr_err_code ndr_push_lsa_RetrievePrivateData(struct ndr_push *ndr,
 
 static enum ndr_err_code ndr_pull_lsa_RetrievePrivateData(struct ndr_pull *ndr, int flags, struct lsa_RetrievePrivateData *r)
 {
+       uint32_t _ptr_val;
+       TALLOC_CTX *_mem_save_handle_0;
+       TALLOC_CTX *_mem_save_name_0;
+       TALLOC_CTX *_mem_save_val_0;
+       TALLOC_CTX *_mem_save_val_1;
        if (flags & NDR_IN) {
+               ZERO_STRUCT(r->out);
+
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->in.handle);
+               }
+               _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->in.name);
+               }
+               _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->in.name, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, LIBNDR_FLAG_REF_ALLOC);
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->in.val);
+               }
+               _mem_save_val_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->in.val, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_val));
+               if (_ptr_val) {
+                       NDR_PULL_ALLOC(ndr, *r->in.val);
+               } else {
+                       *r->in.val = NULL;
+               }
+               if (*r->in.val) {
+                       _mem_save_val_1 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, *r->in.val, 0);
+                       NDR_CHECK(ndr_pull_lsa_DATA_BUF(ndr, NDR_SCALARS|NDR_BUFFERS, *r->in.val));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_val_1, 0);
+               }
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_val_0, LIBNDR_FLAG_REF_ALLOC);
+               NDR_PULL_ALLOC(ndr, r->out.val);
+               *r->out.val = *r->in.val;
        }
        if (flags & NDR_OUT) {
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.val);
+               }
+               _mem_save_val_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.val, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_val));
+               if (_ptr_val) {
+                       NDR_PULL_ALLOC(ndr, *r->out.val);
+               } else {
+                       *r->out.val = NULL;
+               }
+               if (*r->out.val) {
+                       _mem_save_val_1 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, *r->out.val, 0);
+                       NDR_CHECK(ndr_pull_lsa_DATA_BUF(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.val));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_val_1, 0);
+               }
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_val_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
        }
        return NDR_ERR_SUCCESS;
@@ -9293,11 +9430,37 @@ _PUBLIC_ void ndr_print_lsa_RetrievePrivateData(struct ndr_print *ndr, const cha
        if (flags & NDR_IN) {
                ndr_print_struct(ndr, "in", "lsa_RetrievePrivateData");
                ndr->depth++;
+               ndr_print_ptr(ndr, "handle", r->in.handle);
+               ndr->depth++;
+               ndr_print_policy_handle(ndr, "handle", r->in.handle);
+               ndr->depth--;
+               ndr_print_ptr(ndr, "name", r->in.name);
+               ndr->depth++;
+               ndr_print_lsa_String(ndr, "name", r->in.name);
+               ndr->depth--;
+               ndr_print_ptr(ndr, "val", r->in.val);
+               ndr->depth++;
+               ndr_print_ptr(ndr, "val", *r->in.val);
+               ndr->depth++;
+               if (*r->in.val) {
+                       ndr_print_lsa_DATA_BUF(ndr, "val", *r->in.val);
+               }
+               ndr->depth--;
+               ndr->depth--;
                ndr->depth--;
        }
        if (flags & NDR_OUT) {
                ndr_print_struct(ndr, "out", "lsa_RetrievePrivateData");
                ndr->depth++;
+               ndr_print_ptr(ndr, "val", r->out.val);
+               ndr->depth++;
+               ndr_print_ptr(ndr, "val", *r->out.val);
+               ndr->depth++;
+               if (*r->out.val) {
+                       ndr_print_lsa_DATA_BUF(ndr, "val", *r->out.val);
+               }
+               ndr->depth--;
+               ndr->depth--;
                ndr_print_NTSTATUS(ndr, "result", r->out.result);
                ndr->depth--;
        }
index 58b7ae2413f4f1269d487bd23802304ee032bd97..258aba9bb6d623c0510d90cef5edd0eec70c0c63 100644 (file)
@@ -4831,12 +4831,14 @@ _PUBLIC_ void ndr_print_samr_ValidationStatus(struct ndr_print *ndr, const char
                case SAMR_VALIDATION_STATUS_SUCCESS: val = "SAMR_VALIDATION_STATUS_SUCCESS"; break;
                case SAMR_VALIDATION_STATUS_PASSWORD_MUST_CHANGE: val = "SAMR_VALIDATION_STATUS_PASSWORD_MUST_CHANGE"; break;
                case SAMR_VALIDATION_STATUS_ACCOUNT_LOCKED_OUT: val = "SAMR_VALIDATION_STATUS_ACCOUNT_LOCKED_OUT"; break;
+               case SAMR_VALIDATION_STATUS_PASSWORD_EXPIRED: val = "SAMR_VALIDATION_STATUS_PASSWORD_EXPIRED"; break;
                case SAMR_VALIDATION_STATUS_BAD_PASSWORD: val = "SAMR_VALIDATION_STATUS_BAD_PASSWORD"; break;
                case SAMR_VALIDATION_STATUS_PWD_HISTORY_CONFLICT: val = "SAMR_VALIDATION_STATUS_PWD_HISTORY_CONFLICT"; break;
                case SAMR_VALIDATION_STATUS_PWD_TOO_SHORT: val = "SAMR_VALIDATION_STATUS_PWD_TOO_SHORT"; break;
                case SAMR_VALIDATION_STATUS_PWD_TOO_LONG: val = "SAMR_VALIDATION_STATUS_PWD_TOO_LONG"; break;
                case SAMR_VALIDATION_STATUS_NOT_COMPLEX_ENOUGH: val = "SAMR_VALIDATION_STATUS_NOT_COMPLEX_ENOUGH"; break;
                case SAMR_VALIDATION_STATUS_PASSWORD_TOO_RECENT: val = "SAMR_VALIDATION_STATUS_PASSWORD_TOO_RECENT"; break;
+               case SAMR_VALIDATION_STATUS_PASSWORD_FILTER_ERROR: val = "SAMR_VALIDATION_STATUS_PASSWORD_FILTER_ERROR"; break;
        }
        ndr_print_enum(ndr, name, "ENUM", val, r);
 }
index a1be2fd92c594d2ace4e98a292c696601f2d4267..fedebb2d56149aeda1fbc3f419f1a44e9956d59c 100644 (file)
@@ -14464,7 +14464,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_OSVersion(struct ndr_pull *ndr, int
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->major));
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->minor));
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->build));
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown));
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->platform_id));
                {
                        uint32_t _flags_save_string = ndr->flags;
                        ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
@@ -14490,7 +14490,7 @@ _PUBLIC_ void ndr_print_spoolss_OSVersion(struct ndr_print *ndr, const char *nam
        ndr_print_uint32(ndr, "major", r->major);
        ndr_print_uint32(ndr, "minor", r->minor);
        ndr_print_uint32(ndr, "build", r->build);
-       ndr_print_uint32(ndr, "unknown", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?2:r->unknown);
+       ndr_print_uint32(ndr, "platform_id", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?2:r->platform_id);
        ndr_print_string(ndr, "extra_string", r->extra_string);
        ndr->depth--;
 }
@@ -14520,8 +14520,11 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_OSVersionEx(struct ndr_push *ndr, in
                        }
                        ndr->flags = _flags_save_string;
                }
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2));
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown3));
+               NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->service_pack_major));
+               NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->service_pack_minor));
+               NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->suite_mask));
+               NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->product_type));
+               NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->reserved));
        }
        if (ndr_flags & NDR_BUFFERS) {
        }
@@ -14536,7 +14539,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_OSVersionEx(struct ndr_pull *ndr, in
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->major));
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->minor));
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->build));
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1));
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->platform_id));
                {
                        uint32_t _flags_save_string = ndr->flags;
                        ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
@@ -14548,8 +14551,11 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_OSVersionEx(struct ndr_pull *ndr, in
                        }
                        ndr->flags = _flags_save_string;
                }
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2));
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown3));
+               NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->service_pack_major));
+               NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->service_pack_minor));
+               NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->suite_mask));
+               NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->product_type));
+               NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->reserved));
        }
        if (ndr_flags & NDR_BUFFERS) {
        }
@@ -14564,10 +14570,13 @@ _PUBLIC_ void ndr_print_spoolss_OSVersionEx(struct ndr_print *ndr, const char *n
        ndr_print_uint32(ndr, "major", r->major);
        ndr_print_uint32(ndr, "minor", r->minor);
        ndr_print_uint32(ndr, "build", r->build);
-       ndr_print_uint32(ndr, "unknown1", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?2:r->unknown1);
+       ndr_print_uint32(ndr, "platform_id", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?2:r->platform_id);
        ndr_print_string(ndr, "extra_string", r->extra_string);
-       ndr_print_uint32(ndr, "unknown2", r->unknown2);
-       ndr_print_uint32(ndr, "unknown3", r->unknown3);
+       ndr_print_uint16(ndr, "service_pack_major", r->service_pack_major);
+       ndr_print_uint16(ndr, "service_pack_minor", r->service_pack_minor);
+       ndr_print_uint16(ndr, "suite_mask", r->suite_mask);
+       ndr_print_uint8(ndr, "product_type", r->product_type);
+       ndr_print_uint8(ndr, "reserved", r->reserved);
        ndr->depth--;
 }
 
@@ -23702,8 +23711,20 @@ _PUBLIC_ void ndr_print_spoolss_DeletePort(struct ndr_print *ndr, const char *na
 static enum ndr_err_code ndr_push_spoolss_CreatePrinterIC(struct ndr_push *ndr, int flags, const struct spoolss_CreatePrinterIC *r)
 {
        if (flags & NDR_IN) {
+               if (r->in.handle == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
+               if (r->in.devmode_ctr == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_spoolss_DevmodeContainer(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.devmode_ctr));
        }
        if (flags & NDR_OUT) {
+               if (r->out.gdi_handle == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.gdi_handle));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
        return NDR_ERR_SUCCESS;
@@ -23711,9 +23732,37 @@ static enum ndr_err_code ndr_push_spoolss_CreatePrinterIC(struct ndr_push *ndr,
 
 static enum ndr_err_code ndr_pull_spoolss_CreatePrinterIC(struct ndr_pull *ndr, int flags, struct spoolss_CreatePrinterIC *r)
 {
+       TALLOC_CTX *_mem_save_handle_0;
+       TALLOC_CTX *_mem_save_gdi_handle_0;
+       TALLOC_CTX *_mem_save_devmode_ctr_0;
        if (flags & NDR_IN) {
+               ZERO_STRUCT(r->out);
+
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->in.handle);
+               }
+               _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->in.devmode_ctr);
+               }
+               _mem_save_devmode_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->in.devmode_ctr, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_spoolss_DevmodeContainer(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.devmode_ctr));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_devmode_ctr_0, LIBNDR_FLAG_REF_ALLOC);
+               NDR_PULL_ALLOC(ndr, r->out.gdi_handle);
+               ZERO_STRUCTP(r->out.gdi_handle);
        }
        if (flags & NDR_OUT) {
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.gdi_handle);
+               }
+               _mem_save_gdi_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.gdi_handle, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.gdi_handle));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_gdi_handle_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
        return NDR_ERR_SUCCESS;
@@ -23729,11 +23778,23 @@ _PUBLIC_ void ndr_print_spoolss_CreatePrinterIC(struct ndr_print *ndr, const cha
        if (flags & NDR_IN) {
                ndr_print_struct(ndr, "in", "spoolss_CreatePrinterIC");
                ndr->depth++;
+               ndr_print_ptr(ndr, "handle", r->in.handle);
+               ndr->depth++;
+               ndr_print_policy_handle(ndr, "handle", r->in.handle);
+               ndr->depth--;
+               ndr_print_ptr(ndr, "devmode_ctr", r->in.devmode_ctr);
+               ndr->depth++;
+               ndr_print_spoolss_DevmodeContainer(ndr, "devmode_ctr", r->in.devmode_ctr);
+               ndr->depth--;
                ndr->depth--;
        }
        if (flags & NDR_OUT) {
                ndr_print_struct(ndr, "out", "spoolss_CreatePrinterIC");
                ndr->depth++;
+               ndr_print_ptr(ndr, "gdi_handle", r->out.gdi_handle);
+               ndr->depth++;
+               ndr_print_policy_handle(ndr, "gdi_handle", r->out.gdi_handle);
+               ndr->depth--;
                ndr_print_WERROR(ndr, "result", r->out.result);
                ndr->depth--;
        }
@@ -23784,8 +23845,16 @@ _PUBLIC_ void ndr_print_spoolss_PlayGDIScriptOnPrinterIC(struct ndr_print *ndr,
 static enum ndr_err_code ndr_push_spoolss_DeletePrinterIC(struct ndr_push *ndr, int flags, const struct spoolss_DeletePrinterIC *r)
 {
        if (flags & NDR_IN) {
+               if (r->in.gdi_handle == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.gdi_handle));
        }
        if (flags & NDR_OUT) {
+               if (r->out.gdi_handle == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.gdi_handle));
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
        }
        return NDR_ERR_SUCCESS;
@@ -23793,9 +23862,28 @@ static enum ndr_err_code ndr_push_spoolss_DeletePrinterIC(struct ndr_push *ndr,
 
 static enum ndr_err_code ndr_pull_spoolss_DeletePrinterIC(struct ndr_pull *ndr, int flags, struct spoolss_DeletePrinterIC *r)
 {
+       TALLOC_CTX *_mem_save_gdi_handle_0;
        if (flags & NDR_IN) {
+               ZERO_STRUCT(r->out);
+
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->in.gdi_handle);
+               }
+               _mem_save_gdi_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->in.gdi_handle, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.gdi_handle));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_gdi_handle_0, LIBNDR_FLAG_REF_ALLOC);
+               NDR_PULL_ALLOC(ndr, r->out.gdi_handle);
+               *r->out.gdi_handle = *r->in.gdi_handle;
        }
        if (flags & NDR_OUT) {
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.gdi_handle);
+               }
+               _mem_save_gdi_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.gdi_handle, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.gdi_handle));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_gdi_handle_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
        }
        return NDR_ERR_SUCCESS;
@@ -23811,11 +23899,19 @@ _PUBLIC_ void ndr_print_spoolss_DeletePrinterIC(struct ndr_print *ndr, const cha
        if (flags & NDR_IN) {
                ndr_print_struct(ndr, "in", "spoolss_DeletePrinterIC");
                ndr->depth++;
+               ndr_print_ptr(ndr, "gdi_handle", r->in.gdi_handle);
+               ndr->depth++;
+               ndr_print_policy_handle(ndr, "gdi_handle", r->in.gdi_handle);
+               ndr->depth--;
                ndr->depth--;
        }
        if (flags & NDR_OUT) {
                ndr_print_struct(ndr, "out", "spoolss_DeletePrinterIC");
                ndr->depth++;
+               ndr_print_ptr(ndr, "gdi_handle", r->out.gdi_handle);
+               ndr->depth++;
+               ndr_print_policy_handle(ndr, "gdi_handle", r->out.gdi_handle);
+               ndr->depth--;
                ndr_print_WERROR(ndr, "result", r->out.result);
                ndr->depth--;
        }
index e44de1b037c69728bcfaad8c16757ab349da10ef..ce84b45a9e237bb0927c939521434da303379491 100644 (file)
@@ -834,24 +834,28 @@ enum samr_ValidationStatus
        SAMR_VALIDATION_STATUS_SUCCESS=0,
        SAMR_VALIDATION_STATUS_PASSWORD_MUST_CHANGE=1,
        SAMR_VALIDATION_STATUS_ACCOUNT_LOCKED_OUT=2,
+       SAMR_VALIDATION_STATUS_PASSWORD_EXPIRED=3,
        SAMR_VALIDATION_STATUS_BAD_PASSWORD=4,
        SAMR_VALIDATION_STATUS_PWD_HISTORY_CONFLICT=5,
        SAMR_VALIDATION_STATUS_PWD_TOO_SHORT=6,
        SAMR_VALIDATION_STATUS_PWD_TOO_LONG=7,
        SAMR_VALIDATION_STATUS_NOT_COMPLEX_ENOUGH=8,
-       SAMR_VALIDATION_STATUS_PASSWORD_TOO_RECENT=9
+       SAMR_VALIDATION_STATUS_PASSWORD_TOO_RECENT=9,
+       SAMR_VALIDATION_STATUS_PASSWORD_FILTER_ERROR=10
 }
 #else
  { __donnot_use_enum_samr_ValidationStatus=0x7FFFFFFF}
 #define SAMR_VALIDATION_STATUS_SUCCESS ( 0 )
 #define SAMR_VALIDATION_STATUS_PASSWORD_MUST_CHANGE ( 1 )
 #define SAMR_VALIDATION_STATUS_ACCOUNT_LOCKED_OUT ( 2 )
+#define SAMR_VALIDATION_STATUS_PASSWORD_EXPIRED ( 3 )
 #define SAMR_VALIDATION_STATUS_BAD_PASSWORD ( 4 )
 #define SAMR_VALIDATION_STATUS_PWD_HISTORY_CONFLICT ( 5 )
 #define SAMR_VALIDATION_STATUS_PWD_TOO_SHORT ( 6 )
 #define SAMR_VALIDATION_STATUS_PWD_TOO_LONG ( 7 )
 #define SAMR_VALIDATION_STATUS_NOT_COMPLEX_ENOUGH ( 8 )
 #define SAMR_VALIDATION_STATUS_PASSWORD_TOO_RECENT ( 9 )
+#define SAMR_VALIDATION_STATUS_PASSWORD_FILTER_ERROR ( 10 )
 #endif
 ;
 
index 9446193863ada05caa378aa63029335c49c1eaa0..1a9d393e093b635e980d8cae2d870b8d20fbd5bb 100644 (file)
@@ -1058,7 +1058,7 @@ struct spoolss_OSVersion {
        uint32_t major;
        uint32_t minor;
        uint32_t build;
-       uint32_t unknown;/* [value(2)] */
+       uint32_t platform_id;/* [value(2)] */
        const char * extra_string;/* [subcontext_size(256),subcontext(0),flag(LIBNDR_FLAG_STR_NULLTERM)] */
 }/* [gensize,public] */;
 
@@ -1067,10 +1067,13 @@ struct spoolss_OSVersionEx {
        uint32_t major;
        uint32_t minor;
        uint32_t build;
-       uint32_t unknown1;/* [value(2)] */
+       uint32_t platform_id;/* [value(2)] */
        const char * extra_string;/* [subcontext_size(256),subcontext(0),flag(LIBNDR_FLAG_STR_NULLTERM)] */
-       uint32_t unknown2;
-       uint32_t unknown3;
+       uint16_t service_pack_major;
+       uint16_t service_pack_minor;
+       uint16_t suite_mask;
+       uint8_t product_type;
+       uint8_t reserved;
 }/* [gensize,public] */;
 
 union spoolss_PrinterData {
@@ -2516,6 +2519,12 @@ struct spoolss_DeletePort {
 
 struct spoolss_CreatePrinterIC {
        struct {
+               struct policy_handle *handle;/* [ref] */
+               struct spoolss_DevmodeContainer *devmode_ctr;/* [ref] */
+       } in;
+
+       struct {
+               struct policy_handle *gdi_handle;/* [ref] */
                WERROR result;
        } out;
 
@@ -2532,6 +2541,11 @@ struct spoolss_PlayGDIScriptOnPrinterIC {
 
 struct spoolss_DeletePrinterIC {
        struct {
+               struct policy_handle *gdi_handle;/* [ref] */
+       } in;
+
+       struct {
+               struct policy_handle *gdi_handle;/* [ref] */
                WERROR result;
        } out;
 
index c86d0857f845a59ba0c300d1b0bfd0a14ac55003..f1b4a06d0d403b80bc22c35c835e08dd2a683161 100644 (file)
@@ -3366,6 +3366,8 @@ static bool api_lsa_RetrievePrivateData(pipes_struct *p)
                NDR_PRINT_IN_DEBUG(lsa_RetrievePrivateData, r);
        }
 
+       ZERO_STRUCT(r->out);
+       r->out.val = r->in.val;
        r->out.result = _lsa_RetrievePrivateData(p, r);
 
        if (p->rng_fault_state) {
@@ -6810,6 +6812,8 @@ NTSTATUS rpc_lsarpc_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, c
 
                case NDR_LSA_RETRIEVEPRIVATEDATA: {
                        struct lsa_RetrievePrivateData *r = (struct lsa_RetrievePrivateData *)_r;
+                       ZERO_STRUCT(r->out);
+                       r->out.val = r->in.val;
                        r->out.result = _lsa_RetrievePrivateData(cli->pipes_struct, r);
                        return NT_STATUS_OK;
                }
index 41a79b4a79d137f05ee89dfcccbe3f2ff47bb0a1..ae99f098a617349a80e05d6606076d724eb174cf 100644 (file)
@@ -3245,6 +3245,13 @@ static bool api_spoolss_CreatePrinterIC(pipes_struct *p)
                NDR_PRINT_IN_DEBUG(spoolss_CreatePrinterIC, r);
        }
 
+       ZERO_STRUCT(r->out);
+       r->out.gdi_handle = talloc_zero(r, struct policy_handle);
+       if (r->out.gdi_handle == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
        r->out.result = _spoolss_CreatePrinterIC(p, r);
 
        if (p->rng_fault_state) {
@@ -3391,6 +3398,8 @@ static bool api_spoolss_DeletePrinterIC(pipes_struct *p)
                NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterIC, r);
        }
 
+       ZERO_STRUCT(r->out);
+       r->out.gdi_handle = r->in.gdi_handle;
        r->out.result = _spoolss_DeletePrinterIC(p, r);
 
        if (p->rng_fault_state) {
@@ -8068,6 +8077,12 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
 
                case NDR_SPOOLSS_CREATEPRINTERIC: {
                        struct spoolss_CreatePrinterIC *r = (struct spoolss_CreatePrinterIC *)_r;
+                       ZERO_STRUCT(r->out);
+                       r->out.gdi_handle = talloc_zero(mem_ctx, struct policy_handle);
+                       if (r->out.gdi_handle == NULL) {
+                       return NT_STATUS_NO_MEMORY;
+                       }
+
                        r->out.result = _spoolss_CreatePrinterIC(cli->pipes_struct, r);
                        return NT_STATUS_OK;
                }
@@ -8080,6 +8095,8 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
 
                case NDR_SPOOLSS_DELETEPRINTERIC: {
                        struct spoolss_DeletePrinterIC *r = (struct spoolss_DeletePrinterIC *)_r;
+                       ZERO_STRUCT(r->out);
+                       r->out.gdi_handle = r->in.gdi_handle;
                        r->out.result = _spoolss_DeletePrinterIC(cli->pipes_struct, r);
                        return NT_STATUS_OK;
                }
index 11593f479a6faf40ca1f5d12ff7582bd31cbcece..ea7880c9f8ab327eea5d43b8c35674fb67da033c 100644 (file)
@@ -98,24 +98,31 @@ interface frsapi
        WERROR frsapi_IsPathReplicated(
                [in,unique] [string,charset(UTF16)] uint16 *path,
                [in] frsapi_ReplicaSetType replica_set_type,
-               [out] uint32 *unknown1,
-               [out] uint32 *unknown2,
-               [out] uint32 *unknown3,
+               [out] uint32 *replicated,
+               [out] uint32 *primary,
+               [out] uint32 *root,
                [out] GUID *replica_set_guid
        );
 
        /****************/
        /* Function 0x09 */
-       [todo] void FRSAPI_WRITER_COMMAND();
+       typedef [v1_enum] enum {
+               FRSAPI_WRITER_COMMAND_FREEZE    = 0x00000001,
+               FRSAPI_WRITER_COMMAND_THAW      = 0x00000002
+       } frsapi_WriterCommandsValues;
+
+       WERROR frsapi_WriterCommand(
+               [in] frsapi_WriterCommandsValues command
+       );
 
        /****************/
        /* Function 0x0a */
        /* not supported before w2k3 sp2 */
        WERROR frsapi_ForceReplication(
-               [in,unique] GUID *guid1,
-               [in,unique] GUID *guid2,
-               [in,unique] [charset(UTF16),string] uint16 *replica_set,
-               [in,unique] [charset(UTF16),string] uint16 *partner_name
+               [in,unique] GUID *replica_set_guid,
+               [in,unique] GUID *connection_guid,
+               [in,unique] [charset(UTF16),string] uint16 *replica_set_name,
+               [in,unique] [charset(UTF16),string] uint16 *partner_dns_name
        );
 
 }
index 1019a25b28a9c2bc649b5b7f7e18234d2d16b062..cab155295d2d3f5adea34ecf8167f9d84306cf27 100644 (file)
@@ -7,6 +7,7 @@ import "misc.idl";
   version(1.1),
   endpoint("ncacn_ip_tcp:", "ncalrpc:"),
   helpstring("File Replication Service"),
+  helper("../librpc/ndr/ndr_frsrpc.h"),
   pointer_default(unique)
 ] 
 interface frsrpc
@@ -14,112 +15,337 @@ interface frsrpc
        /*****************/
        /* Function 0x00 */
 
-       /* TAG:3 this TLV contains a GUID and the name of the server sending
-        * the call
-        */
        typedef struct {
-               [subcontext(4)] GUID unknown1;
-               [subcontext(4)] nstring source_server;
-       } frsrpc_FrsSendCommPktChunkDataSSRV;
+               [subcontext(4)] GUID guid;
+               [subcontext(4)] nstring name;
+       } frsrpc_CommPktChunkGuidName;
 
-       /* TAG:4 this TLV contains a GUID and the name of the destination
-        * server the PDU is sent to
-        */
        typedef struct {
-               [subcontext(4)] GUID unknown1;
-               [subcontext(4)] nstring dest_server;
-       } frsrpc_FrsSendCommPktChunkDataDSRV;
+               hyper vsn;
+               GUID guid;
+       } frsrpc_CommPktGSVN;
+
+       typedef [bitmap32bit,flag(NDR_PAHEX)] bitmap {
+               FRSRPC_CO_FLAG_ABORT_CO = 0x00000001,
+               FRSRPC_CO_FLAG_VV_ACTIVATED     = 0x00000002,
+               FRSRPC_CO_FLAG_CONTENT_CMD      = 0x00000004,
+               FRSRPC_CO_FLAG_LOCATION_CMD     = 0x00000008,
+               FRSRPC_CO_FLAG_ONLIST           = 0x00000010,
+               FRSRPC_CO_FLAG_LOCALCO          = 0x00000020,
+               FRSRPC_CO_FLAG_RETRY            = 0x00000040,
+               FRSRPC_CO_FLAG_OUT_OF_ORDER     = 0x00000200,
+               FRSRPC_CO_FLAG_NEW_FILE         = 0x00000400,
+               FRSRPC_CO_FLAG_CONTROL          = 0x00001000,
+               FRSRPC_CO_FLAG_DIRECTED_CO      = 0x00002000,
+               FRSRPC_CO_FLAG_VVJOIN_TO_ORIG   = 0x00040000,
+               FRSRPC_CO_FLAG_SKIP_ORIG_REC_C  = 0x00100000,
+               FRSRPC_CO_FLAG_MOVEIN_GEN       = 0x00200000,
+               FRSRPC_CO_FLAG_MORPH_GEN_HEAD   = 0x00400000,
+               FRSRPC_CO_FLAG_JUST_OID_RESET   = 0x00800000,
+               FRSRPC_CO_FLAG_COMPRESSED_STAGE = 0x01000000,
+               FRSRPC_CO_FLAG_COMPRESSED_STAGE = 0x01000000,
+               FRSRPC_CO_FLAG_SKIP_VV_UPDATE   = 0x02000000
+       } frsrpc_CommPktCoCmdFlags;
+
+       const uint32 FRSRPC_CO_IFLAG_NONE = 0x0000000;
+
+       typedef [bitmap32bit,flag(NDR_PAHEX)] bitmap {
+               FRSRPC_CO_IFLAG_VVRETIRE_EXEC   = 0x00000001,
+               FRSRPC_CO_IFLAG_CO_ABORT        = 0x00000002,
+               FRSRPC_CO_IFLAG_DIR_ENUM_PENDING= 0x00000004
+       } frsrpc_CommPktCoCmdIFlags;
+
+       typedef [v1_enum,flag(NDR_PAHEX)] enum {
+               FRSRPC_CO_STATUS_CO_ENTERED_LOG                 = 0x00000000,
+               FRSRPC_CO_STATUS_ALLOC_STAGING_LOCAL_CO         = 0x00000001,
+               FRSRPC_CO_STATUS_LOCAL_CO_STAGING_STARTED       = 0x00000002,
+               FRSRPC_CO_STATUS_LOCAL_CO_STAGING_COMPLETED     = 0x00000003,
+               FRSRPC_CO_STATUS_WAIT_RETRY_LOCAL_CO_STAGING    = 0x00000004,
+               FRSRPC_CO_STATUS_ALLOC_STAGING_REMOTE_CO        = 0x00000005,
+               FRSRPC_CO_STATUS_REMOTE_CO_STAGING_STARTED      = 0x00000006,
+               FRSRPC_CO_STATUS_REMOTE_CO_STAGING_COMPLETED    = 0x00000007,
+               FRSRPC_CO_STATUS_WAIT_RETRY_REMOTE_CO_STAGING   = 0x00000008,
+               FRSRPC_CO_STATUS_FILE_INSTALL_REQUESTED         = 0x00000009,
+               FRSRPC_CO_STATUS_FILE_INSTALL_STARTED           = 0x0000000A,
+               FRSRPC_CO_STATUS_FILE_INSTALL_COMPLETED         = 0x0000000B,
+               FRSRPC_CO_STATUS_FILE_INSTALL_WAIT_RETRY        = 0x0000000C,
+               FRSRPC_CO_STATUS_FILE_INSTALL_RETRYING          = 0x0000000D,
+               FRSRPC_CO_STATUS_FILE_INSTALL_RENAME_RETRYING   = 0x0000000E,
+               FRSRPC_CO_STATUS_FILE_INSTALL_DELETE_RETRYING   = 0x0000000F,
+               FRSRPC_CO_STATUS_CO_RECYCLED_FOR_ENUM           = 0x00000013,
+               FRSRPC_CO_STATUS_REQUEST_OUTBOUND_PROPAGATION   = 0x00000014,
+               FRSRPC_CO_STATUS_REQUEST_ACCEPTED_OUTBOUND_LOG  = 0x00000015,
+               FRSRPC_CO_STATUS_DB_STATE_UPDATE_STARTED        = 0x00000016,
+               FRSRPC_CO_STATUS_DB_STATE_UPDATE_COMPLETED      = 0x00000017,
+               FRSRPC_CO_STATUS_CO_ABORTED                     = 0x00000018
+       } frsrpc_CommPktCoCmdStatus;
+
+       typedef [bitmap32bit,flag(NDR_PAHEX)] bitmap {
+               FRSRPC_CONTENT_REASON_DATA_OVERWRITE            = 0x00000001,
+               FRSRPC_CONTENT_REASON_DATA_EXTEND               = 0x00000002,
+               FRSRPC_CONTENT_REASON_DATA_TRUNCATION           = 0x00000004,
+               FRSRPC_CONTENT_REASON_NAMED_DATA_OVERWRITE      = 0x00000010,
+               FRSRPC_CONTENT_REASON_NAMED_DATA_EXTEND         = 0x00000020,
+               FRSRPC_CONTENT_REASON_NAMED_DATA_TRUNCATION     = 0x00000040,
+               FRSRPC_CONTENT_REASON_FILE_CREATE               = 0x00000100,
+               FRSRPC_CONTENT_REASON_FILE_DELETE               = 0x00000200,
+               FRSRPC_CONTENT_REASON_EA_CHANGE                 = 0x00000400,
+               FRSRPC_CONTENT_REASON_SECURITY_CHANGE           = 0x00000800,
+               FRSRPC_CONTENT_REASON_OLD_NAME                  = 0x00001000,
+               FRSRPC_CONTENT_REASON_NEW_NAME                  = 0x00002000,
+               FRSRPC_CONTENT_REASON_BASIC_INFO_CHANGE         = 0x00004000,
+               FRSRPC_CONTENT_REASON_COMPRESSION_CHANGE        = 0x00020000
+       } frsrpc_CommPktCoCmdContentCmd;
+
+       typedef [v1_enum,flag(NDR_PAHEX)] enum {
+               FRSRPC_CO_LOCATION_FILE_CREATE  = 0x00000000,
+               FRSRPC_CO_LOCATION_DIR_CREATE   = 0x00000000 | 0x00000001,
+               FRSRPC_CO_LOCATION_FILE_DELETE  = 0x00000002,
+               FRSRPC_CO_LOCATION_DIR_DELETE   = 0x00000002 | 0x00000001,
+               FRSRPC_CO_LOCATION_FILE_MOVEIN  = 0x00000004,
+               FRSRPC_CO_LOCATION_DIR_MOVEIN   = 0x00000004 | 0x00000001,
+               FRSRPC_CO_LOCATION_FILE_MOVEIN2 = 0x00000006,
+               FRSRPC_CO_LOCATION_DIR_MOVEIN2  = 0x00000006 | 0x00000001,
+               FRSRPC_CO_LOCATION_FILE_MOVEOUT = 0x00000008,
+               FRSRPC_CO_LOCATION_DIR_MOVEOUT  = 0x00000008 | 0x00000001,
+               FRSRPC_CO_LOCATION_FILE_MOVERS  = 0x0000000a,
+               FRSRPC_CO_LOCATION_DIR_MOVERS   = 0x0000000a | 0x00000001,
+               FRSRPC_CO_LOCATION_FILE_MOVEDIR = 0x0000000c,
+               FRSRPC_CO_LOCATION_DIR_MOVEDIR  = 0x0000000c | 0x00000001,
+               FRSRPC_CO_LOCATION_FILE_NO_CMD  = 0x0000000e,
+               FRSRPC_CO_LOCATION_DIR_NO_CMD   = 0x0000000e | 0x00000001
+       } frsrpc_CommPktCoCmdLocationCmd;
 
-       /* TAG:18 this TLV contains a  timestamp 
-       */
        typedef struct {
-               [subcontext(4)] NTTIME time;
-       } frsrpc_FrsSendCommPktChunkDataTS;
+               uint32 sequence_number;
+               frsrpc_CommPktCoCmdFlags flags;
+               frsrpc_CommPktCoCmdIFlags iflags;
+               frsrpc_CommPktCoCmdStatus status;
+               frsrpc_CommPktCoCmdContentCmd content_cmd;
+               frsrpc_CommPktCoCmdLocationCmd location_cmd;
+               uint32 file_attributes;
+               uint32 file_version_number;
+               uint32 partern_ack_sequence_number;
+               [value(0)] uint32 not_used;
+               hyper file_size;
+               hyper file_offset;
+               hyper frs_vsn;
+               hyper file_usn;
+               hyper jrnl_usn;
+               hyper jrnl_first_usn;
+               uint32 original_replica_num;
+               uint32 new_replica_num;
+               GUID change_order_guid;
+               GUID originator_guid;
+               GUID file_guid;
+               GUID old_parent_guid;
+               GUID new_parent_guid;
+               GUID connection_guid;
+               hyper ack_version;
+               [value(0)] hyper spare2ul1;
+               [value(0)] hyper spare1guid_p1;
+               [value(0)] hyper spare1guid_p2;
+               [value(0)] hyper spare2guid_p1;
+               [value(0)] hyper spare3guid_p2;
+               [value(0)] uint32 spare1wcs;
+               [value(0)] uint32 spare2wcs;
+               [value(0)] uint32 extension;
+               [value(0)] uint32 spare2bin;
+               NTTIME event_time;
+               [value(2*strlen_m(file_name))] uint16 file_name_length;
+#define FRSRPC_MAX_PATH 260
+               [charset(UTF16)] uint16 file_name[FRSRPC_MAX_PATH+1];
+               [value(0)] uint8 padding1;
+               [value(0)] uint8 padding2;
+               [value(0)] uint8 padding3;
+               [value(0)] uint8 padding4;
+       } frsrpc_CommPktChangeOrderCommand;
+
+       typedef [v1_enum,flag(NDR_PAHEX)] enum {
+               FRSRPC_DATA_EXTENSION_TERMINATOR        = 0x00000000,
+               FRSRPC_DATA_EXTENSION_MD5_CHECKSUM      = 0x00000001,
+               FRSRPC_DATA_EXTENSION_RETRY_TIMEOUT     = 0x00000002
+       } frsrpc_CommPktDataExtensionType;
 
+       typedef [flag(NDR_PAHEX)] struct {
+               [value(0x00000018)] uint32 prefix_size;
+               [value(FRSRPC_DATA_EXTENSION_MD5_CHECKSUM)]
+                       frsrpc_CommPktDataExtensionType prefix_type;
+               uint8 data[16];
+       } frsrpc_CommPktDataExtensionChecksum;
 
        typedef struct {
-               uint32 unknown1;
-       } frsrpc_FrsSendCommPktChunkDataA;
+               [value(0x00000018)] uint32 prefix_size;
+               [value(FRSRPC_DATA_EXTENSION_RETRY_TIMEOUT)]
+                       frsrpc_CommPktDataExtensionType prefix_type;
+               uint32 count;
+               [value(0)] uint32 not_used;
+               NTTIME first_try_time;
+       } frsrpc_CommPktDataExtensionRetryTimeout;
+
+       typedef [flag(NDR_PAHEX)] enum {
+               FRSRPC_CO_RECORD_EXTENSION_VERSION_WIN2K        = 0x0000,
+               FRSRPC_CO_RECORD_EXTENSION_VERSION_1            = 0x0001
+       } frsrpc_CommPktCoRecordExtensionMajor;
 
        typedef struct {
-               uint32 unknown1;
-               GUID unknown2;
-               [subcontext(4)] nstring unknown3;
-       } frsrpc_FrsSendCommPktChunkDataB;
+               [value(0x00000028)] uint32 field_size;
+               [value(FRSRPC_CO_RECORD_EXTENSION_VERSION_WIN2K)]
+                       frsrpc_CommPktCoRecordExtensionMajor major;
+               [value(0x0001)] uint16 offset_count;
+               [value(0x00000010)] uint32 offset;
+               [value(0)] uint32 offset_last;
+               frsrpc_CommPktDataExtensionChecksum data_checksum;
+       } frsrpc_CommPktCoRecordExtensionWin2k;
 
        typedef struct {
-               uint32 unknown1;
-               GUID unknown2;
-       } frsrpc_FrsSendCommPktChunkDataC;
+               [value(0x00000048)] uint32 field_size;
+               frsrpc_CommPktCoRecordExtensionMajor major;
+               [value(0x0002)] uint16 offset_count;
+               [value(0x00000018)] uint32 offset0;
+               [value(0x00000030)] uint32 offset1;/*TODO: is this correct??? */
+               [value(0)] uint32 offset_last;
+               [value(0)] uint32 not_used;
+               frsrpc_CommPktDataExtensionChecksum data_checksum;
+               frsrpc_CommPktDataExtensionRetryTimeout data_retry_timeout;
+       } frsrpc_CommPktChangeOrderRecordExtension;
+
+       typedef [v1_enum,flag(NDR_PAHEX)] enum {
+               FRSRPC_COMMAND_REMOTE_CO                = 0x00000218,
+               FRSRPC_COMMAND_RECEIVING_STATE          = 0x00000238,
+               FRSRPC_COMMAND_REMOTE_CO_DONE           = 0x00000250,
+               FRSRPC_COMMAND_ABORT_FETCH              = 0x00000246,
+               FRSRPC_COMMAND_RETRY_FETCH              = 0x00000244,
+               FRSRPC_COMMAND_NEED_JOIN                = 0x00000121,
+               FRSRPC_COMMAND_START_JOIN               = 0x00000122,
+               FRSRPC_COMMAND_JOINING                  = 0x00000130,
+               FRSRPC_COMMAND_JOINED                   = 0x00000128,
+               FRSRPC_COMMAND_UNJOIN_REMOTE            = 0x00000148,
+               FRSRPC_COMMAND_WJOIN_DONE               = 0x00000136,
+               FRSRPC_COMMAND_SEND_STAGE               = 0x00000228
+       } frsrpc_CommPktCommand;
+
+       typedef [flag(NDR_PAHEX)] enum {
+               FRSRPC_COMM_PKT_CHUNK_BOP                       = 0x0001,
+               FRSRPC_COMM_PKT_CHUNK_COMMAND                   = 0x0002,
+               FRSRPC_COMM_PKT_CHUNK_TO                        = 0x0003,
+               FRSRPC_COMM_PKT_CHUNK_FROM                      = 0x0004,
+               FRSRPC_COMM_PKT_CHUNK_REPLICA                   = 0x0005,
+               FRSRPC_COMM_PKT_CHUNK_CONNECTION                = 0x0008,
+               FRSRPC_COMM_PKT_CHUNK_JOIN_GUID                 = 0x0006,
+               FRSRPC_COMM_PKT_CHUNK_LAST_JOIN_TIME            = 0x0012,
+
+               FRSRPC_COMM_PKT_CHUNK_VVECTOR                   = 0x0007,
+               FRSRPC_COMM_PKT_CHUNK_JOIN_TIME                 = 0x0011,
+               FRSRPC_COMM_PKT_CHUNK_REPLICA_VERSION_GUID      = 0x0014,
+               FRSRPC_COMM_PKT_CHUNK_COMPRESSION_GUID          = 0x0018,
+
+               FRSRPC_COMM_PKT_CHUNK_BLOCK                     = 0x0009,
+               FRSRPC_COMM_PKT_CHUNK_BLOCK_SIZE                = 0x000A,
+               FRSRPC_COMM_PKT_CHUNK_FILE_SIZE                 = 0x000B,
+               FRSRPC_COMM_PKT_CHUNK_FILE_OFFSET               = 0x000C,
+               FRSRPC_COMM_PKT_CHUNK_GVSN                      = 0x000E,
+               FRSRPC_COMM_PKT_CHUNK_CO_GUID                   = 0x000F,
+               FRSRPC_COMM_PKT_CHUNK_CO_SEQUENCE_NUMBER        = 0x0010,
+
+               FRSRPC_COMM_PKT_CHUNK_REMOTE_CO                 = 0x000D,
+               FRSRPC_COMM_PKT_CHUNK_CO_EXT_WIN2K              = 0x0016,
+               FRSRPC_COMM_PKT_CHUNK_CO_EXTENTION_2            = 0x0017,
+
+               FRSRPC_COMM_PKT_CHUNK_EOP                       = 0x0013
+       } frsrpc_CommPktChunkType;
 
        typedef [nodiscriminant] union {
                [default,flag(NDR_REMAINING)] DATA_BLOB blob;
-               [case(1)] frsrpc_FrsSendCommPktChunkDataA A;
-               [case(2)] frsrpc_FrsSendCommPktChunkDataA A;
-               [case(3)] frsrpc_FrsSendCommPktChunkDataSSRV SSRV;
-               [case(4)] frsrpc_FrsSendCommPktChunkDataDSRV DSRV;
-               [case(5)] frsrpc_FrsSendCommPktChunkDataB B;
-               [case(8)] frsrpc_FrsSendCommPktChunkDataB B;
-               [case(6)] frsrpc_FrsSendCommPktChunkDataC C;
-               [case(18)] frsrpc_FrsSendCommPktChunkDataTS TS;
-               [case(19)] frsrpc_FrsSendCommPktChunkDataA A;
-       } frsrpc_FrsSendCommPktChunkData;
+               [case(FRSRPC_COMM_PKT_CHUNK_BOP)]
+                       [value(0)] uint32 bop;
+               [case(FRSRPC_COMM_PKT_CHUNK_COMMAND)]
+                       frsrpc_CommPktCommand command;
+               [case(FRSRPC_COMM_PKT_CHUNK_TO)]
+                       frsrpc_CommPktChunkGuidName to;
+               [case(FRSRPC_COMM_PKT_CHUNK_FROM)]
+                       frsrpc_CommPktChunkGuidName from;
+               [case(FRSRPC_COMM_PKT_CHUNK_REPLICA)]
+                       frsrpc_CommPktChunkGuidName replica;
+               [case(FRSRPC_COMM_PKT_CHUNK_CONNECTION)]
+                       frsrpc_CommPktChunkGuidName connection;
+               [case(FRSRPC_COMM_PKT_CHUNK_JOIN_GUID)][subcontext(4)]
+                       GUID join_guid;
+               [case(FRSRPC_COMM_PKT_CHUNK_LAST_JOIN_TIME)]
+                       NTTIME last_join_time;
+               [case(FRSRPC_COMM_PKT_CHUNK_VVECTOR)][subcontext(4)]
+                       frsrpc_CommPktGSVN vvector;
+               [case(FRSRPC_COMM_PKT_CHUNK_JOIN_TIME)][subcontext(4)]
+                       NTTIME join_time;
+               [case(FRSRPC_COMM_PKT_CHUNK_REPLICA_VERSION_GUID)][subcontext(4)]
+                       GUID replica_version_guid;
+               [case(FRSRPC_COMM_PKT_CHUNK_COMPRESSION_GUID)]
+                       GUID compression_guid;
+               [case(FRSRPC_COMM_PKT_CHUNK_BLOCK)]
+                       [flag(NDR_REMAINING)] DATA_BLOB block;
+               [case(FRSRPC_COMM_PKT_CHUNK_BLOCK_SIZE)]
+                       hyper block_size;
+               [case(FRSRPC_COMM_PKT_CHUNK_FILE_SIZE)]
+                       hyper file_size;
+               [case(FRSRPC_COMM_PKT_CHUNK_FILE_OFFSET)]
+                       hyper file_offset;
+               [case(FRSRPC_COMM_PKT_CHUNK_GVSN)][subcontext(4)]
+                       frsrpc_CommPktGSVN gvsn;
+               [case(FRSRPC_COMM_PKT_CHUNK_CO_GUID)][subcontext(4)]
+                       GUID co_guid;
+               [case(FRSRPC_COMM_PKT_CHUNK_CO_SEQUENCE_NUMBER)]
+                       uint32 co_sequnence_number;
+               [case(FRSRPC_COMM_PKT_CHUNK_REMOTE_CO)][subcontext(4)]
+                       frsrpc_CommPktChangeOrderCommand remote_co;
+               [case(FRSRPC_COMM_PKT_CHUNK_CO_EXT_WIN2K)][subcontext(4)]
+                       frsrpc_CommPktCoRecordExtensionWin2k co_ext_win2k;
+               [case(FRSRPC_COMM_PKT_CHUNK_CO_EXTENTION_2)][subcontext(4)]
+                       frsrpc_CommPktChangeOrderRecordExtension co_extension2;
+               [case(FRSRPC_COMM_PKT_CHUNK_EOP)]
+                       [value(0xFFFFFFFF)] uint32 bop;
+       } frsrpc_CommPktChunkData;
 
-       typedef struct {
-               uint16 type;
-               [subcontext(4),switch_is(type)] frsrpc_FrsSendCommPktChunkData data;
-       } frsrpc_FrsSendCommPktChunk;
-
-       typedef [flag(NDR_NOALIGN)] struct {
-               frsrpc_FrsSendCommPktChunk chunk1;
-               frsrpc_FrsSendCommPktChunk chunk2;
-               frsrpc_FrsSendCommPktChunk chunk3;
-               frsrpc_FrsSendCommPktChunk chunk4;
-               frsrpc_FrsSendCommPktChunk chunk5;
-               frsrpc_FrsSendCommPktChunk chunk6;
-               frsrpc_FrsSendCommPktChunk chunk7;
-               frsrpc_FrsSendCommPktChunk chunk8;
-               frsrpc_FrsSendCommPktChunk chunk9;
-       } frsrpc_FrsSendCommPktChunkCtr;
+       typedef [public,flag(NDR_NOALIGN)] struct {
+               frsrpc_CommPktChunkType type;
+               [subcontext(4),switch_is(type)] frsrpc_CommPktChunkData data;
+       } frsrpc_CommPktChunk;
+
+       typedef [nopull,nopush,flag(NDR_NOALIGN)] struct {
+               uint32 num_chunks; /* this doesn't appear on the wire */
+               frsrpc_CommPktChunk chunks[num_chunks];
+       } frsrpc_CommPktChunkCtr;
+
+       typedef [v1_enum] enum {
+               FRSRPC_COMM_PKT_MAJOR_0 = 0x00000000
+       } frsrpc_CommPktMajor;
+
+       typedef [v1_enum] enum {
+               FRSRPC_COMM_PKT_MINOR_0 = 0x00000000,
+               FRSRPC_COMM_PKT_MINOR_1 = 0x00000001,
+               FRSRPC_COMM_PKT_MINOR_2 = 0x00000002,
+               FRSRPC_COMM_PKT_MINOR_3 = 0x00000003,
+               FRSRPC_COMM_PKT_MINOR_4 = 0x00000004,
+               FRSRPC_COMM_PKT_MINOR_5 = 0x00000005,
+               FRSRPC_COMM_PKT_MINOR_6 = 0x00000006,
+               FRSRPC_COMM_PKT_MINOR_7 = 0x00000007,
+               FRSRPC_COMM_PKT_MINOR_8 = 0x00000008,
+               FRSRPC_COMM_PKT_MINOR_9 = 0x00000009
+       } frsrpc_CommPktMinor;
 
        typedef struct {
-               uint32 unknown1;
-               uint32 unknown2;
-               uint32 unknown3;
-               uint32 unknown4;
-               uint32 tlv_size;
-               uint32 unknown6;
-               uint32 unknown7; /* This may be a UNIQUE pointer? */
-               uint32 unknown8;
-               uint32 unknown9;
-               /*
-                * The format of this blob is this a concatenation
-                * of TLVs which are not really NDR encoded.
-                *
-                * The individual TLVs are encoded as :
-                * struct {
-                *      uint16 type;
-                *      [subcontext(4),switch_is(type)] chunk_data data;
-                * } chunk;
-                * 
-                * some of the chunk are like this:
-                *
-                * struct {
-                *      uint32 unknown; // 0x00000010
-                *      struct GUID guid;
-                *      lstring string;
-                * } ...;
-                *
-                *
-                * The tags are (might be) :
-                *  3: Source server sending the PDU
-                *  4: Destination server the PDU is sent to
-                * 18: Timestamp
-                *
-                */
-               [subcontext(4)/*,size_is(tlv_size)*/] frsrpc_FrsSendCommPktChunkCtr *chunks;
-               uint32 unknown10;
-               uint32 unknown11;
+               frsrpc_CommPktMajor major;
+               frsrpc_CommPktMinor minor;
+               [value(1)] uint32 cs_id;
+               [value(pkt_len+12)] uint32 memory_len;
+               [value(ndr_size_frsrpc_CommPktChunkCtr(r->ctr,
+                       ndr->iconv_convenience, ndr->flags))]
+               [range(0, 262144)]
+                       uint32 pkt_len;
+               [value(0)] uint32 upk_len;
+               [subcontext(4),subcontext_size(pkt_len)]
+                       frsrpc_CommPktChunkCtr *ctr;
+               [value(0)] uint32 data_name;
+               [value(0)] uint32 data_handle;
        } frsrpc_FrsSendCommPktReq;
 
        WERROR frsrpc_FrsSendCommPkt(
@@ -132,7 +358,28 @@ interface frsrpc
 
        /*****************/
        /* Function 0x02 */
-       [todo] void FRSRPC_START_PROMOTION_PARENT();
+       typedef [v1_enum,flag(NDR_PAHEX)] enum {
+               FRSRPC_PARENT_AUTH_LEVEL_ENCRYPTED_KERBEROS     = 0x00000000,
+               FRSRPC_PARENT_AUTH_LEVEL_NO_AUTHENTICATION      = 0x00000001
+       } frsrpc_PartnerAuthLevel;
+
+       WERROR frsrpc_FrsStartPromotionParent(
+               [in,unique,string,charset(UTF16)] uint16 *parent_account,
+               [in,unique,string,charset(UTF16)] uint16 *parent_password,
+               [in,unique,string,charset(UTF16)] uint16 *replica_set_name,
+               [in,unique,string,charset(UTF16)] uint16 *replica_set_type,
+               [in,unique,string,charset(UTF16)] uint16 *connection_name,
+               [in,unique,string,charset(UTF16)] uint16 *partner_name,
+               [in,unique,string,charset(UTF16)] uint16 *partner_princ_name,
+               [in] frsrpc_PartnerAuthLevel partner_auth_level,
+               [in,value(16),range(16,16)] uint32 __ndr_guid_size,
+               [in,unique,subcontext(4),subcontext_size(16)]
+                       GUID *connection_guid,
+               [in,unique,subcontext(4),subcontext_size(16)]
+                       GUID *partner_guid,
+               [in,out,unique,subcontext(4),subcontext_size(16)]
+                       GUID *parent_guid
+       );
 
        /*****************/
        /* Function 0x03 */
diff --git a/librpc/idl/frstrans.idl b/librpc/idl/frstrans.idl
new file mode 100644 (file)
index 0000000..c79aabf
--- /dev/null
@@ -0,0 +1,83 @@
+#include "idl_types.h"
+
+import "misc.idl";
+
+[
+  uuid("897e2e5f-93f3-4376-9c9c-fd2277495c27"),
+  version(1.0),
+  endpoint("ncacn_ip_tcp:", "ncalrpc:"),
+  helpstring("File Replication Service DFS-R"),
+  pointer_default(unique)
+]
+interface frstrans
+{
+       /*****************/
+       /* Function 0x00 */
+       [todo] void FRSTRANS_CHECK_CONNECTIVITY();
+
+       /*****************/
+       /* Function 0x01 */
+       [todo] void FRSTRANS_ESTABLISH_CONNECTION();
+
+       /*****************/
+       /* Function 0x02 */
+       [todo] void FRSTRANS_ESTABLISH_SESSION();
+
+       /*****************/
+       /* Function 0x03 */
+       [todo] void FRSTRANS_REQUEST_UPDATES();
+
+       /*****************/
+       /* Function 0x04 */
+       [todo] void FRSTRANS_REQUEST_VERSION_VECTOR();
+
+       /*****************/
+       /* Function 0x05 */
+       [todo] void FRSTRANS_ASYNC_POLL();
+
+       /*****************/
+       /* Function 0x06 */
+       [todo] void FRSTRANS_REQUEST_RECORDS();
+
+       /*****************/
+       /* Function 0x07 */
+       [todo] void FRSTRANS_UPDATE_CANCEL();
+
+       /*****************/
+       /* Function 0x08 */
+       [todo] void FRSTRANS_RAW_GET_FILE_DATA();
+
+       /*****************/
+       /* Function 0x09 */
+       [todo] void FRSTRANS_RDC_GET_SIGNATURES();
+
+       /*****************/
+       /* Function 0x0a */
+       [todo] void FRSTRANS_RDC_PUSH_SOURCE_NEEDS();
+
+       /*****************/
+       /* Function 0x0b */
+       [todo] void FRSTRANS_RDC_GET_FILE_DATA();
+
+       /*****************/
+       /* Function 0x0c */
+       [todo] void FRSTRANS_RDC_CLOSE();
+
+       /*****************/
+       /* Function 0x0d */
+       [todo] void FRSTRANS_INITIALIZE_FILE_TRANSFER_ASYNC();
+
+       /*****************/
+       /* Function 0x0e */
+       [todo] void FRSTRANS_OPNUM_0E_NOT_USED_ON_THE_WIRE();
+
+       /* The following functions are new in Windows 2008 */
+
+       /*****************/
+       /* Function 0x0f */
+       [todo] void FRSTRANS_RAW_GET_FILE_DATA_ASYNC();
+
+       /*****************/
+       /* Function 0x10 */
+       [todo] void FRSTRANS_RDC_GET_FILE_DATA_ASYNC();
+}
index 9e3b7d604830c192055d5a4323422a495fe1d2d8..7f8ed4afe30d057907bab8638e47aa6737c90cfc 100644 (file)
@@ -651,7 +651,7 @@ import "misc.idl", "security.idl";
                LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL    = 10,
                LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL     = 11,
                LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL  = 12,
-               LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES = 13
+               LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRYPTION_TYPES = 13
        } lsa_TrustDomInfoEnum;
 
        typedef [public,bitmap32bit] bitmap {
@@ -788,7 +788,7 @@ import "misc.idl", "security.idl";
                        lsa_TrustDomainInfoInfoEx2Internal   info_ex2_internal;
                [case(LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL)]
                        lsa_TrustDomainInfoFullInfo2Internal     full_info2_internal;
-               [case(LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES)]
+               [case(LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRYPTION_TYPES)]
                        lsa_TrustDomainInfoSupportedEncTypes enc_types;
        } lsa_TrustedDomainInfo;
 
@@ -935,10 +935,18 @@ import "misc.idl", "security.idl";
        );
 
        /* Function:       0x2a */
-       [todo] NTSTATUS lsa_StorePrivateData();
-       /* Function:        0x2b */
-       [todo] NTSTATUS lsa_RetrievePrivateData();
+       NTSTATUS lsa_StorePrivateData(
+               [in]            policy_handle   *handle,
+               [in,ref]        lsa_String      *name,
+               [in,unique]     lsa_DATA_BUF    *val
+       );
 
+       /* Function:        0x2b */
+       NTSTATUS lsa_RetrievePrivateData(
+               [in]            policy_handle   *handle,
+               [in,ref]        lsa_String      *name,
+               [in,out,ref]    lsa_DATA_BUF    **val
+       );
 
        /**********************/
        /* Function:     0x2c */
index b7c151d413afaafdf7950c0c25f0f2d4a4f47cfa..8a5692fe17d48f36fec27ff0e29d7e8c84b5620b 100644 (file)
@@ -1544,12 +1544,14 @@ import "misc.idl", "lsa.idl", "security.idl";
                SAMR_VALIDATION_STATUS_SUCCESS = 0,
                SAMR_VALIDATION_STATUS_PASSWORD_MUST_CHANGE = 1,
                SAMR_VALIDATION_STATUS_ACCOUNT_LOCKED_OUT = 2,
+               SAMR_VALIDATION_STATUS_PASSWORD_EXPIRED = 3,
                SAMR_VALIDATION_STATUS_BAD_PASSWORD = 4,
                SAMR_VALIDATION_STATUS_PWD_HISTORY_CONFLICT = 5,
                SAMR_VALIDATION_STATUS_PWD_TOO_SHORT = 6,
                SAMR_VALIDATION_STATUS_PWD_TOO_LONG = 7,
                SAMR_VALIDATION_STATUS_NOT_COMPLEX_ENOUGH = 8,
-               SAMR_VALIDATION_STATUS_PASSWORD_TOO_RECENT = 9
+               SAMR_VALIDATION_STATUS_PASSWORD_TOO_RECENT = 9,
+               SAMR_VALIDATION_STATUS_PASSWORD_FILTER_ERROR = 10
        } samr_ValidationStatus;
 
        typedef struct {
index f37424634d08c90e9bb3ccf04916b07befdd9fa9..0c68dffcd19d28ef795187a242a0cc44621975a3 100644 (file)
@@ -1311,7 +1311,7 @@ import "misc.idl", "security.idl", "winreg.idl";
                uint32 major;
                uint32 minor;
                uint32 build;
-               [value(2)] uint32 unknown;
+               [value(2)] uint32 platform_id;
                [subcontext(0),subcontext_size(256)] nstring extra_string;
        } spoolss_OSVersion;
 
@@ -1320,10 +1320,13 @@ import "misc.idl", "security.idl", "winreg.idl";
                uint32 major;
                uint32 minor;
                uint32 build;
-               [value(2)] uint32 unknown1;
+               [value(2)] uint32 platform_id;
                [subcontext(0),subcontext_size(256)] nstring extra_string;
-               uint32 unknown2;/* service pack number? I saw 0 from w2k3 and 1 from winxp sp1*/
-               uint32 unknown3;/* hmm? w2k3: 131346(0x20112) winxp sp1: 503382272 0x1E010100 */
+               uint16 service_pack_major;
+               uint16 service_pack_minor;
+               uint16 suite_mask;
+               uint8 product_type;
+               uint8 reserved;
        } spoolss_OSVersionEx;
 
        typedef [nodiscriminant,public,gensize] union {
@@ -1683,7 +1686,10 @@ import "misc.idl", "security.idl", "winreg.idl";
 
        /******************/
        /* Function: 0x28 */
-       [todo] WERROR spoolss_CreatePrinterIC(
+       WERROR spoolss_CreatePrinterIC(
+               [in,ref] policy_handle *handle,
+               [out,ref] policy_handle *gdi_handle,
+               [in,ref] spoolss_DevmodeContainer *devmode_ctr
        );
 
        /******************/
@@ -1693,7 +1699,8 @@ import "misc.idl", "security.idl", "winreg.idl";
 
        /******************/
        /* Function: 0x2a */
-       [todo] WERROR spoolss_DeletePrinterIC(
+       WERROR spoolss_DeletePrinterIC(
+               [in,out,ref] policy_handle *gdi_handle
        );
 
        /******************/
diff --git a/librpc/ndr/ndr_frsrpc.c b/librpc/ndr/ndr_frsrpc.c
new file mode 100644 (file)
index 0000000..e0c7f1c
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+   Unix SMB/CIFS implementation.
+
+   helper routines for FRSRPC marshalling
+
+   Copyright (C) Stefan (metze) Metzmacher 2009
+
+   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"
+#include "librpc/gen_ndr/ndr_frsrpc.h"
+
+enum ndr_err_code ndr_push_frsrpc_CommPktChunkCtr(struct ndr_push *ndr,
+                                       int ndr_flags,
+                                       const struct frsrpc_CommPktChunkCtr *r)
+{
+       uint32_t cntr_chunks_0;
+       {
+               uint32_t _flags_save_STRUCT = ndr->flags;
+               ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
+               if (ndr_flags & NDR_SCALARS) {
+                       NDR_CHECK(ndr_push_align(ndr, 2));
+                       for (cntr_chunks_0 = 0; cntr_chunks_0 < r->num_chunks; cntr_chunks_0++) {
+                               NDR_CHECK(ndr_push_frsrpc_CommPktChunk(ndr, NDR_SCALARS, &r->chunks[cntr_chunks_0]));
+                       }
+               }
+               if (ndr_flags & NDR_BUFFERS) {
+               }
+               ndr->flags = _flags_save_STRUCT;
+       }
+       return NDR_ERR_SUCCESS;
+}
+
+#define _TMP_PULL_REALLOC_N(ndr, s, t, n) do { \
+       _NDR_PULL_FIX_CURRENT_MEM_CTX(ndr);\
+       (s) = talloc_realloc(ndr->current_mem_ctx, (s), t, n); \
+       if (!(s)) { \
+               return ndr_pull_error(ndr, NDR_ERR_ALLOC, \
+                                     "Alloc %u * %s failed: %s\n", \
+                                     (unsigned)n, # s, __location__); \
+       } \
+} while (0)
+
+enum ndr_err_code ndr_pull_frsrpc_CommPktChunkCtr(struct ndr_pull *ndr,
+                                       int ndr_flags,
+                                       struct frsrpc_CommPktChunkCtr *r)
+{
+       uint32_t cntr_chunks_0;
+       {
+               uint32_t _flags_save_STRUCT = ndr->flags;
+               ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
+               if (ndr_flags & NDR_SCALARS) {
+                       uint32_t remaining = ndr->data_size - ndr->offset;
+                       r->num_chunks = 0;
+                       r->chunks = NULL;
+                       for (cntr_chunks_0 = 0; remaining > 0; cntr_chunks_0++) {
+                               r->num_chunks += 1;
+                               _TMP_PULL_REALLOC_N(ndr, r->chunks,
+                                                   struct frsrpc_CommPktChunk,
+                                                   r->num_chunks);
+                               NDR_CHECK(ndr_pull_frsrpc_CommPktChunk(ndr,
+                                               NDR_SCALARS,
+                                               &r->chunks[cntr_chunks_0]));
+                               remaining = ndr->data_size - ndr->offset;
+                       }
+               }
+               if (ndr_flags & NDR_BUFFERS) {
+               }
+               ndr->flags = _flags_save_STRUCT;
+       }
+       return NDR_ERR_SUCCESS;
+}
+
+size_t ndr_size_frsrpc_CommPktChunkCtr(const struct frsrpc_CommPktChunkCtr *r,
+                                      struct smb_iconv_convenience *ic,
+                                      int flags)
+{
+       flags |= LIBNDR_FLAG_NOALIGN;
+       return ndr_size_struct(r, flags,
+                       (ndr_push_flags_fn_t)ndr_push_frsrpc_CommPktChunkCtr,
+                       ic);
+}
diff --git a/librpc/ndr/ndr_frsrpc.h b/librpc/ndr/ndr_frsrpc.h
new file mode 100644 (file)
index 0000000..e8dc769
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+   Unix SMB/CIFS implementation.
+
+   helper routines for FRSRPC marshalling
+
+   Copyright (C) Stefan (metze) Metzmacher 2009
+
+   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/>.
+*/
+
+#ifndef _LIBRPC_NDR_NDR_FRSRPC_H
+#define _LIBRPC_NDR_NDR_FRSRPC_H
+
+enum ndr_err_code ndr_push_frsrpc_CommPktChunkCtr(struct ndr_push *ndr,
+                                       int ndr_flags,
+                                       const struct frsrpc_CommPktChunkCtr *r);
+enum ndr_err_code ndr_pull_frsrpc_CommPktChunkCtr(struct ndr_pull *ndr,
+                                       int ndr_flags,
+                                       struct frsrpc_CommPktChunkCtr *r);
+size_t ndr_size_frsrpc_CommPktChunkCtr(const struct frsrpc_CommPktChunkCtr *r,
+                                      struct smb_iconv_convenience *ic,
+                                      int flags);
+
+#endif /* _LIBRPC_NDR_NDR_FRSRPC_H */
diff --git a/librpc/ndr_standard.pc.in b/librpc/ndr_standard.pc.in
new file mode 100644 (file)
index 0000000..80eace1
--- /dev/null
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: ndr-standard
+Description: NDR marshallers for the standard set of DCE/RPC interfaces
+Requires: ndr
+Version: 0.0.1
+Libs: -L${libdir} -lndr-standard
+Cflags: -I${includedir}  -DHAVE_IMMEDIATE_STRUCTURES=1 -D_GNU_SOURCE=1
index e90f1b75ad63973e1dcca996ef97b30cc78f5727..4e84574d258b3a9db57fc4efcf2b108265810e3d 100644 (file)
@@ -11,6 +11,8 @@
 */
 
 #include "pam_winbind.h"
+#define CONST_DISCARD(type,ptr) ((type)(void *)ptr)
+
 
 static int wbc_error_to_pam_error(wbcErr status)
 {
@@ -410,49 +412,51 @@ static int _pam_parse(const pam_handle_t *pamh,
                config_file = PAM_WINBIND_CONFIG_FILE;
        }
 
-       d = iniparser_load(config_file);
+       d = iniparser_load(CONST_DISCARD(char *, config_file));
        if (d == NULL) {
                goto config_from_pam;
        }
 
-       if (iniparser_getboolean(d, "global:debug", false)) {
+       if (iniparser_getboolean(d, CONST_DISCARD(char *, "global:debug"), false)) {
                ctrl |= WINBIND_DEBUG_ARG;
        }
 
-       if (iniparser_getboolean(d, "global:debug_state", false)) {
+       if (iniparser_getboolean(d, CONST_DISCARD(char *, "global:debug_state"), false)) {
                ctrl |= WINBIND_DEBUG_STATE;
        }
 
-       if (iniparser_getboolean(d, "global:cached_login", false)) {
+       if (iniparser_getboolean(d, CONST_DISCARD(char *, "global:cached_login"), false)) {
                ctrl |= WINBIND_CACHED_LOGIN;
        }
 
-       if (iniparser_getboolean(d, "global:krb5_auth", false)) {
+       if (iniparser_getboolean(d, CONST_DISCARD(char *, "global:krb5_auth"), false)) {
                ctrl |= WINBIND_KRB5_AUTH;
        }
 
-       if (iniparser_getboolean(d, "global:silent", false)) {
+       if (iniparser_getboolean(d, CONST_DISCARD(char *, "global:silent"), false)) {
                ctrl |= WINBIND_SILENT;
        }
 
-       if (iniparser_getstr(d, "global:krb5_ccache_type") != NULL) {
+       if (iniparser_getstr(d, CONST_DISCARD(char *, "global:krb5_ccache_type")) != NULL) {
                ctrl |= WINBIND_KRB5_CCACHE_TYPE;
        }
 
-       if ((iniparser_getstr(d, "global:require-membership-of") != NULL) ||
-           (iniparser_getstr(d, "global:require_membership_of") != NULL)) {
+       if ((iniparser_getstr(d, CONST_DISCARD(char *, "global:require-membership-of"))
+            != NULL) ||
+           (iniparser_getstr(d, CONST_DISCARD(char *, "global:require_membership_of"))
+            != NULL)) {
                ctrl |= WINBIND_REQUIRED_MEMBERSHIP;
        }
 
-       if (iniparser_getboolean(d, "global:try_first_pass", false)) {
+       if (iniparser_getboolean(d, CONST_DISCARD(char *, "global:try_first_pass"), false)) {
                ctrl |= WINBIND_TRY_FIRST_PASS_ARG;
        }
 
-       if (iniparser_getint(d, "global:warn_pwd_expire", 0)) {
+       if (iniparser_getint(d, CONST_DISCARD(char *, "global:warn_pwd_expire"), 0)) {
                ctrl |= WINBIND_WARN_PWD_EXPIRE;
        }
 
-       if (iniparser_getboolean(d, "global:mkhomedir", false)) {
+       if (iniparser_getboolean(d, CONST_DISCARD(char *, "global:mkhomedir"), false)) {
                ctrl |= WINBIND_MKHOMEDIR;
        }
 
@@ -2284,6 +2288,7 @@ static char* winbind_upn_to_username(struct pwb_context *ctx,
        enum wbcSidType type;
        char *domain;
        char *name;
+       char *p;
 
        /* This cannot work when the winbind separator = @ */
 
@@ -2292,9 +2297,18 @@ static char* winbind_upn_to_username(struct pwb_context *ctx,
                return NULL;
        }
 
+       name = talloc_strdup(ctx, upn);
+       if (!name) {
+               return NULL;
+       }
+       if ((p = strchr(name, '@')) != NULL) {
+               *p = 0;
+               domain = p + 1;
+       }
+
        /* Convert the UPN to a SID */
 
-       wbc_status = wbcLookupName("", upn, &sid, &type);
+       wbc_status = wbcLookupName(domain, name, &sid, &type);
        if (!WBC_ERROR_IS_OK(wbc_status)) {
                return NULL;
        }
index ed1b71a236f7767405900d99099af5ecf573ef13..a2a61d87d07319546e54ea1b6988304bea577282 100644 (file)
@@ -96,11 +96,17 @@ sub ParseOutputArgument($$$)
                # structure, the user should be able to know the size beforehand 
                # to allocate a structure of the right size.
                my $env = GenerateFunctionInEnv($fn, "r.");
-               my $size_is = ParseExpr($e->{LEVELS}[$level]->{SIZE_IS}, $env, $e->{ORIGINAL});
-               if (has_property($e, "charset")) {
-                   $self->pidl("memcpy(CONST_DISCARD(char *, $e->{NAME}), r.out.$e->{NAME}, $size_is * sizeof(*$e->{NAME}));");
+               my $l = $e->{LEVELS}[$level];
+               unless (defined($l->{SIZE_IS})) {
+                       error($e->{ORIGINAL}, "no size known for [out] array `$e->{NAME}'");
+                       $self->pidl('#error No size known for [out] array `$e->{NAME}');
                } else {
-                   $self->pidl("memcpy($e->{NAME}, r.out.$e->{NAME}, $size_is * sizeof(*$e->{NAME}));");
+                       my $size_is = ParseExpr($l->{SIZE_IS}, $env, $e->{ORIGINAL});
+                       if (has_property($e, "charset")) {
+                               $self->pidl("memcpy(CONST_DISCARD(char *, $e->{NAME}), r.out.$e->{NAME}, $size_is * sizeof(*$e->{NAME}));");
+                       } else {
+                               $self->pidl("memcpy($e->{NAME}, r.out.$e->{NAME}, $size_is * sizeof(*$e->{NAME}));");
+                       }
                }
        } else {
                $self->pidl("*$e->{NAME} = *r.out.$e->{NAME};");
index c9a8eea59fd146f17192da43a68e4b3b9440383d..5599de9d790904692ee2b215859f8957f603e584 100644 (file)
@@ -11,7 +11,7 @@ use Exporter;
 @EXPORT_OK = qw(DeclLevel);
 
 use strict;
-use Parse::Pidl qw(warning fatal);
+use Parse::Pidl qw(warning error fatal);
 use Parse::Pidl::Typelist qw(mapTypeName scalar_is_reference);
 use Parse::Pidl::Util qw(ParseExpr has_property is_constant);
 use Parse::Pidl::NDR qw(GetNextLevel);
@@ -72,8 +72,13 @@ sub AllocOutVar($$$$$)
        }
 
        if ($l->{TYPE} eq "ARRAY") {
-               my $size = ParseExpr($l->{SIZE_IS}, $env, $e);
-               pidl "$name = talloc_zero_array($mem_ctx, " . DeclLevel($e, 1) . ", $size);";
+               unless(defined($l->{SIZE_IS})) {
+                       error($e->{ORIGINAL}, "No size known for array `$e->{NAME}'");
+                       pidl "#error No size known for array `$e->{NAME}'";
+               } else {
+                       my $size = ParseExpr($l->{SIZE_IS}, $env, $e);
+                       pidl "$name = talloc_zero_array($mem_ctx, " . DeclLevel($e, 1) . ", $size);";
+               }
        } else {
                pidl "$name = talloc_zero($mem_ctx, " . DeclLevel($e, 1) . ");";
        }
index 81869b0da5c93d652c1bba734914557da95106b6..d27192d6ddb76e31399606ed3eec5c67c51604f3 100644 (file)
@@ -431,7 +431,7 @@ sub PythonFunctionUnpackOut($$$)
        } elsif (defined($fn->{RETURN_TYPE}) and $fn->{RETURN_TYPE} eq "WERROR") {
                $self->handle_werror("r->out.result", "NULL", undef);
        } elsif (defined($fn->{RETURN_TYPE})) {
-               my $conv = $self->ConvertObjectToPythonData("r", $fn->{RETURN_TYPE}, "r->out.result");
+               my $conv = $self->ConvertObjectToPythonData("r", $fn->{RETURN_TYPE}, "r->out.result", $fn);
                if ($result_size > 1) {
                        $self->pidl("PyTuple_SetItem(result, $i, $conv);");
                } else {
@@ -815,11 +815,11 @@ sub assign($$$)
        }
 }
 
-sub ConvertObjectFromPythonData($$$$$$)
+sub ConvertObjectFromPythonData($$$$$$;$)
 {
-       my ($self, $mem_ctx, $cvar, $ctype, $target, $fail) = @_;
+       my ($self, $mem_ctx, $cvar, $ctype, $target, $fail, $location) = @_;
 
-       die("undef type for $cvar") unless(defined($ctype));
+       fatal($location, "undef type for $cvar") unless(defined($ctype));
 
        $ctype = resolveType($ctype);
 
@@ -839,7 +839,7 @@ sub ConvertObjectFromPythonData($$$$$$)
        if ($actual_ctype->{TYPE} eq "STRUCT" or $actual_ctype->{TYPE} eq "INTERFACE") {
                my $ctype_name = $self->use_type_variable($ctype);
                unless (defined ($ctype_name)) {
-                       error(undef, "Unable to determine origin of type " . mapTypeName($ctype));
+                       error($location, "Unable to determine origin of type `" . mapTypeName($ctype) . "'");
                        $self->assign($target, "NULL");
                        # FIXME:
                        return;
@@ -886,7 +886,7 @@ sub ConvertObjectFromPythonData($$$$$$)
                return;
        }
 
-       fatal($ctype, "unknown type $actual_ctype->{TYPE} for ".mapTypeName($ctype) . ": $cvar");
+       fatal($location, "unknown type `$actual_ctype->{TYPE}' for ".mapTypeName($ctype) . ": $cvar");
 
 }
 
@@ -946,7 +946,7 @@ sub ConvertObjectFromPythonLevel($$$$$$$$)
                if (not Parse::Pidl::Typelist::is_scalar($l->{DATA_TYPE})) {
                        $var_name = get_pointer_to($var_name);
                }
-               $self->ConvertObjectFromPythonData($mem_ctx, $py_var, $l->{DATA_TYPE}, $var_name, $fail);
+               $self->ConvertObjectFromPythonData($mem_ctx, $py_var, $l->{DATA_TYPE}, $var_name, $fail, $e->{ORIGINAL});
        } elsif ($l->{TYPE} eq "SWITCH") {
                $var_name = get_pointer_to($var_name);
                my $switch = ParseExpr($l->{SWITCH_IS}, $env, $e);
@@ -954,7 +954,7 @@ sub ConvertObjectFromPythonLevel($$$$$$$$)
        } elsif ($l->{TYPE} eq "SUBCONTEXT") {
                $self->ConvertObjectFromPythonLevel($env, $mem_ctx, $py_var, $e, GetNextLevel($e, $l), $var_name, $fail);
        } else {
-               die("unknown level type $l->{TYPE}");
+               fatal($e->{ORIGINAL}, "unknown level type $l->{TYPE}");
        }
 }
 
@@ -1003,9 +1003,9 @@ sub ConvertScalarToPython($$$)
        die("Unknown scalar type $ctypename");
 }
 
-sub ConvertObjectToPythonData($$$$$)
+sub ConvertObjectToPythonData($$$$$;$)
 {
-       my ($self, $mem_ctx, $ctype, $cvar) = @_;
+       my ($self, $mem_ctx, $ctype, $cvar, $location) = @_;
 
        die("undef type for $cvar") unless(defined($ctype));
 
@@ -1027,13 +1027,13 @@ sub ConvertObjectToPythonData($$$$$)
        } elsif ($actual_ctype->{TYPE} eq "STRUCT" or $actual_ctype->{TYPE} eq "INTERFACE") {
                my $ctype_name = $self->use_type_variable($ctype);
                unless (defined($ctype_name)) {
-                       error(undef, "Unable to determine origin of type " . mapTypeName($ctype));
+                       error($location, "Unable to determine origin of type `" . mapTypeName($ctype) . "'");
                        return "NULL"; # FIXME!
                }
                return "py_talloc_import_ex($ctype_name, $mem_ctx, $cvar)";
        }
 
-       fatal($ctype, "unknown type $actual_ctype->{TYPE} for ".mapTypeName($ctype) . ": $cvar");
+       fatal($location, "unknown type $actual_ctype->{TYPE} for ".mapTypeName($ctype) . ": $cvar");
 }
 
 sub fail_on_null($$$)
@@ -1113,12 +1113,12 @@ sub ConvertObjectToPythonLevel($$$$$$)
                if (not Parse::Pidl::Typelist::is_scalar($l->{DATA_TYPE})) {
                        $var_name = get_pointer_to($var_name);
                }
-               my $conv = $self->ConvertObjectToPythonData($mem_ctx, $l->{DATA_TYPE}, $var_name);
+               my $conv = $self->ConvertObjectToPythonData($mem_ctx, $l->{DATA_TYPE}, $var_name, $e->{ORIGINAL});
                $self->pidl("$py_var = $conv;");
        } elsif ($l->{TYPE} eq "SUBCONTEXT") {
                $self->ConvertObjectToPythonLevel($mem_ctx, $env, $e, GetNextLevel($e, $l), $var_name, $py_var, $fail);
        } else {
-               die("Unknown level type $l->{TYPE} $var_name");
+               fatal($e->{ORIGINAL}, "Unknown level type $l->{TYPE} $var_name");
        }
 }
 
@@ -1223,7 +1223,7 @@ sub Parse($$$$$)
                } elsif ($cvar =~ /^".*"$/) {
                        $py_obj = "PyString_FromString($cvar)";
                } else {
-                       $py_obj = $self->ConvertObjectToPythonData("NULL", expandAlias($ctype), $cvar);
+                       $py_obj = $self->ConvertObjectToPythonData("NULL", expandAlias($ctype), $cvar, undef);
                }
 
                $self->pidl("PyModule_AddObject(m, \"$name\", $py_obj);");
index e63b3c990f302271ccdcf78473243212d00f1207..12ffa92bf6ff795d61701455f7e75dd76baa47e6 100644 (file)
@@ -273,12 +273,15 @@ sub mapTypeName($)
        my $dt;
        $t = expandAlias($t);
 
-       unless ($dt or ($dt = getType($t))) {
+       if ($dt = getType($t)) {
+               return mapType($dt, $dt->{NAME});
+       } elsif (ref($t) eq "HASH" and defined($t->{NAME})) {
+               return mapType($t, $t->{NAME});
+       } else {
                # Best guess
                return "struct $t";
        }
 
-       return mapType($dt, $dt->{NAME});
 }
 
 sub LoadIdl($;$)
index 4c927e7346b87c2d934f6a70ac64bc3630761193..e6d0cf00ddd0069f6a60e2bba5961c8f3a42c54d 100644 (file)
@@ -381,7 +381,7 @@ LIB_OBJ = $(LIBSAMBAUTIL_OBJ) $(UTIL_OBJ) $(CRYPTO_OBJ) \
          lib/interface.o lib/pidfile.o \
          lib/system.o lib/sendfile.o lib/recvfile.o lib/time.o \
          lib/username.o \
-         lib/ads_flags.o \
+         ../libds/common/flag_mapping.o \
          lib/util_pw.o lib/access.o lib/smbrun.o \
          lib/bitmap.o lib/dprintf.o $(UTIL_REG_OBJ) \
          lib/wins_srv.o \
@@ -667,6 +667,8 @@ OPLOCK_OBJ = smbd/oplock.o smbd/oplock_irix.o smbd/oplock_linux.o \
 
 NOTIFY_OBJ = smbd/notify.o smbd/notify_inotify.o smbd/notify_internal.o
 
+FNAME_UTIL_OBJ = smbd/filename_util.o
+
 VFS_DEFAULT_OBJ = modules/vfs_default.o
 VFS_AUDIT_OBJ = modules/vfs_audit.o
 VFS_EXTD_AUDIT_OBJ = modules/vfs_extd_audit.o
@@ -786,7 +788,7 @@ SMBD_OBJ_BASE = $(PARAM_WITHOUT_REG_OBJ) $(SMBD_OBJ_SRV) $(LIBSMB_OBJ) \
                $(RPC_SERVER_OBJ) $(RPC_PARSE_OBJ) \
                $(LOCKING_OBJ) $(PASSDB_OBJ) $(PRINTING_OBJ) $(PROFILE_OBJ) \
                $(LIB_OBJ) $(PRINTBACKEND_OBJ) $(OPLOCK_OBJ) \
-               $(NOTIFY_OBJ) $(GROUPDB_OBJ) $(AUTH_OBJ) \
+               $(NOTIFY_OBJ) $(FNAME_UTIL_OBJ) $(GROUPDB_OBJ) $(AUTH_OBJ) \
                $(LIBMSRPC_OBJ) $(LIBMSRPC_GEN_OBJ) $(AVAHI_OBJ) \
                $(LIBADS_OBJ) $(KRBCLIENT_OBJ) $(LIBADS_SERVER_OBJ) \
                $(REG_FULL_OBJ) $(POPT_LIB_OBJ) $(BUILDOPT_OBJ) \
@@ -828,16 +830,16 @@ SWAT_OBJ = $(SWAT_OBJ1) $(PARAM_OBJ) $(PRINTING_OBJ) $(PRINTBASE_OBJ) $(LIBSMB_O
           $(LOCKING_OBJ) $(PASSDB_OBJ) $(KRBCLIENT_OBJ) \
           $(LIB_NONSMBD_OBJ) $(GROUPDB_OBJ) $(PLAINTEXT_AUTH_OBJ) \
           $(POPT_LIB_OBJ) $(SMBLDAP_OBJ) $(RPC_PARSE_OBJ) $(LIBMSRPC_GEN_OBJ) $(LIBMSRPC_OBJ) \
-           $(PASSCHANGE_OBJ) $(LDB_OBJ)
+           $(PASSCHANGE_OBJ) $(LDB_OBJ) $(FNAME_UTIL_OBJ)
 
 STATUS_OBJ = utils/status.o utils/status_profile.o \
             $(LOCKING_OBJ) $(PARAM_OBJ) \
              $(PROFILE_OBJ) $(LIB_NONSMBD_OBJ) $(POPT_LIB_OBJ) \
-            $(LIBSAMBA_OBJ)
+            $(LIBSAMBA_OBJ) $(FNAME_UTIL_OBJ)
 
 SMBCONTROL_OBJ = utils/smbcontrol.o $(LOCKING_OBJ) $(PARAM_OBJ) \
        $(PROFILE_OBJ) $(LIB_NONSMBD_OBJ) $(POPT_LIB_OBJ) \
-       $(LIBSAMBA_OBJ) \
+       $(LIBSAMBA_OBJ) $(FNAME_UTIL_OBJ) \
        $(PRINTBASE_OBJ)
 
 SMBTREE_OBJ = utils/smbtree.o $(PARAM_OBJ) \
@@ -1033,7 +1035,7 @@ MSGTEST_OBJ = torture/msgtest.o $(PARAM_OBJ) $(LIBSMB_OBJ) $(LDB_OBJ) $(KRBCLIEN
 
 LOCKTEST_OBJ = torture/locktest.o $(PARAM_OBJ) $(LOCKING_OBJ) $(KRBCLIENT_OBJ) \
                $(LIBSMB_OBJ) $(LDB_OBJ) $(LIB_NONSMBD_OBJ) \
-               $(LIBNDR_GEN_OBJ0)
+               $(LIBNDR_GEN_OBJ0) $(FNAME_UTIL_OBJ)
 
 NSSTEST_OBJ = torture/nsstest.o $(PARAM_OBJ) $(LIBSMB_OBJ) $(LDB_OBJ) $(KRBCLIENT_OBJ) \
                  $(LIB_NONSMBD_OBJ) \
@@ -1052,7 +1054,7 @@ LOG2PCAP_OBJ = utils/log2pcaphex.o
 
 LOCKTEST2_OBJ = torture/locktest2.o $(PARAM_OBJ) $(LOCKING_OBJ) $(LIBSMB_OBJ) $(LDB_OBJ) \
                $(KRBCLIENT_OBJ) $(LIB_NONSMBD_OBJ) \
-               $(LIBNDR_GEN_OBJ0)
+               $(LIBNDR_GEN_OBJ0) $(FNAME_UTIL_OBJ)
 
 SMBCACLS_OBJ = utils/smbcacls.o $(PARAM_OBJ) $(LIBSMB_OBJ) \
                $(KRBCLIENT_OBJ) $(LIB_NONSMBD_OBJ) $(RPC_PARSE_OBJ) \
@@ -1476,10 +1478,10 @@ bin/swat@EXEEXT@: $(BINARY_PREREQS) $(SWAT_OBJ) @BUILD_POPT@ @LIBTALLOC_TARGET@
 
 bin/rpcclient@EXEEXT@: $(BINARY_PREREQS) $(RPCCLIENT_OBJ) @BUILD_POPT@ @LIBTALLOC_TARGET@ @LIBTDB_TARGET@ @LIBWBCLIENT_TARGET@
        @echo Linking $@
-       @$(CC) -o $@ $(LDFLAGS) $(PASSDB_LIBS) $(RPCCLIENT_OBJ) \
+       @$(CC) -o $@ $(LDFLAGS) $(RPCCLIENT_OBJ) \
                $(DYNEXP) $(TERMLDFLAGS) $(TERMLIBS) $(LIBS) $(POPT_LIBS) \
                $(KRB5LIBS) $(LDAP_LIBS) $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) \
-               $(LIBWBCLIENT_LIBS) $(ZLIB_LIBS)
+               $(LIBWBCLIENT_LIBS) $(ZLIB_LIBS) $(PASSDB_LIBS)
 
 bin/smbclient@EXEEXT@: $(BINARY_PREREQS) $(CLIENT_OBJ) @BUILD_POPT@ @LIBTALLOC_TARGET@ @LIBTDB_TARGET@ @LIBWBCLIENT_TARGET@
        @echo Linking $@
@@ -1517,7 +1519,7 @@ bin/umount.cifs@EXEEXT@: $(BINARY_PREREQS) $(CIFS_UMOUNT_OBJ)
 bin/cifs.upcall@EXEEXT@: $(BINARY_PREREQS) $(CIFS_UPCALL_OBJ) $(LIBSMBCLIENT_OBJ1) @LIBTALLOC_TARGET@ @LIBTDB_TARGET@ @LIBWBCLIENT_TARGET@
        @echo Linking $@
        @$(CC) -o $@ $(CIFS_UPCALL_OBJ) $(DYNEXP) $(LDFLAGS) \
-               -lkeyutils $(LIBS) $(LIBSMBCLIENT_OBJ1) $(KRB5LIBS) \
+               $(LIBSMBCLIENT_OBJ1) $(LIBS) -lkeyutils $(KRB5LIBS) \
                $(LDAP_LIBS) $(LIBTALLOC_LIBS) $(LIBWBCLIENT_LIBS) \
                $(LIBTDB_LIBS) $(NSCD_LIBS) $(ZLIB_LIBS)
 
index fd4c50375258875052c5046e792de58c2c500d51..ce8722a1b48d5cd0e88399d750ffcdbb11cdedcd 100644 (file)
@@ -82,7 +82,6 @@ static void get_ntlm_challenge(struct auth_context *auth_context,
        DATA_BLOB challenge = data_blob_null;
        const char *challenge_set_by = NULL;
        auth_methods *auth_method;
-       TALLOC_CTX *mem_ctx;
 
        if (auth_context->challenge.length) {
                DEBUG(5, ("get_ntlm_challenge (auth subsystem): returning previous challenge by module %s (normal)\n", 
@@ -106,12 +105,8 @@ static void get_ntlm_challenge(struct auth_context *auth_context,
                        continue;
                }
 
-               mem_ctx = talloc_init("auth_get_challenge for module %s", auth_method->name);
-               if (!mem_ctx) {
-                       smb_panic("talloc_init() failed!");
-               }
-
-               challenge = auth_method->get_chal(auth_context, &auth_method->private_data, mem_ctx);
+               challenge = auth_method->get_chal(auth_context, &auth_method->private_data,
+                                       auth_context->mem_ctx);
                if (!challenge.length) {
                        DEBUG(3, ("auth_get_challenge: getting challenge from authentication method %s FAILED.\n", 
                                  auth_method->name));
@@ -121,7 +116,6 @@ static void get_ntlm_challenge(struct auth_context *auth_context,
                        challenge_set_by = auth_method->name;
                        auth_context->challenge_set_method = auth_method;
                }
-               talloc_destroy(mem_ctx);
        }
 
        if (!challenge_set_by) {
index a2634feb6c02c4b3ddb014d2946e8672922da8eb..26b45e47e5664821828cc7bc376bb0acad14df1e 100644 (file)
@@ -226,10 +226,10 @@ static NTSTATUS sam_account_ok(TALLOC_CTX *mem_ctx,
 
        if (*workstation_list) {
                bool invalid_ws = True;
-               char *tok;
+               char *tok = NULL;
                const char *s = workstation_list;
+               char *machine_name = talloc_asprintf(mem_ctx, "%s$", user_info->wksta_name);
 
-               const char *machine_name = talloc_asprintf(mem_ctx, "%s$", user_info->wksta_name);
                if (machine_name == NULL)
                        return NT_STATUS_NO_MEMORY;
 
@@ -251,6 +251,7 @@ static NTSTATUS sam_account_ok(TALLOC_CTX *mem_ctx,
                        TALLOC_FREE(tok);
                }
                TALLOC_FREE(tok);
+               TALLOC_FREE(machine_name);
 
                if (invalid_ws)
                        return NT_STATUS_INVALID_WORKSTATION;
index ed45f4e2caacd3823d55ea3ee40e37373805d204..6b273b47b0bdaf1668a6e4f765992209dd5ce6e8 100644 (file)
@@ -2605,7 +2605,7 @@ static int cmd_lock(void)
 
        len = (uint64_t)strtol(buf, (char **)NULL, 16);
 
-       if (!cli_posix_lock(cli, fnum, start, len, true, lock_type)) {
+       if (!NT_STATUS_IS_OK(cli_posix_lock(cli, fnum, start, len, true, lock_type))) {
                d_printf("lock failed %d: %s\n", fnum, cli_errstr(cli));
        }
 
@@ -2639,7 +2639,7 @@ static int cmd_unlock(void)
 
        len = (uint64_t)strtol(buf, (char **)NULL, 16);
 
-       if (!cli_posix_unlock(cli, fnum, start, len)) {
+       if (!NT_STATUS_IS_OK(cli_posix_unlock(cli, fnum, start, len))) {
                d_printf("unlock failed %d: %s\n", fnum, cli_errstr(cli));
        }
 
index afa4e1217556ec545c4957427a2f1fbcf43d26ae..9761d54086652f953260cd5298fbaa71d4bd4195 100644 (file)
@@ -6,6 +6,8 @@
   basically this is a wrapper around ldap
 */
 
+#include "../libds/common/flags.h"
+
 enum wb_posix_mapping {
        WB_POSIX_MAP_UNKNOWN    = -1,
        WB_POSIX_MAP_TEMPLATE   = 0, 
@@ -202,124 +204,6 @@ typedef void **ADS_MODLIST;
 #define ADS_LDAP_MATCHING_RULE_BIT_AND "1.2.840.113556.1.4.803"
 #define ADS_LDAP_MATCHING_RULE_BIT_OR  "1.2.840.113556.1.4.804"
 
-/* UserFlags for userAccountControl */
-#define UF_SCRIPT                              0x00000001
-#define UF_ACCOUNTDISABLE                      0x00000002
-#define UF_UNUSED_1                            0x00000004
-#define UF_HOMEDIR_REQUIRED                    0x00000008
-
-#define UF_LOCKOUT                             0x00000010
-#define UF_PASSWD_NOTREQD                      0x00000020
-#define UF_PASSWD_CANT_CHANGE                  0x00000040
-#define UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED     0x00000080
-
-#define UF_TEMP_DUPLICATE_ACCOUNT              0x00000100
-#define UF_NORMAL_ACCOUNT                      0x00000200
-#define UF_UNUSED_2                            0x00000400
-#define UF_INTERDOMAIN_TRUST_ACCOUNT           0x00000800
-
-#define UF_WORKSTATION_TRUST_ACCOUNT           0x00001000
-#define UF_SERVER_TRUST_ACCOUNT                0x00002000
-#define UF_UNUSED_3                            0x00004000
-#define UF_UNUSED_4                            0x00008000
-
-#define UF_DONT_EXPIRE_PASSWD                  0x00010000
-#define UF_MNS_LOGON_ACCOUNT                   0x00020000
-#define UF_SMARTCARD_REQUIRED                  0x00040000
-#define UF_TRUSTED_FOR_DELEGATION              0x00080000
-
-#define UF_NOT_DELEGATED                       0x00100000
-#define UF_USE_DES_KEY_ONLY                    0x00200000
-#define UF_DONT_REQUIRE_PREAUTH                        0x00400000
-#define UF_PASSWORD_EXPIRED                    0x00800000
-
-#define UF_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION 0x01000000
-#define UF_NO_AUTH_DATA_REQUIRED               0x02000000
-#define UF_UNUSED_8                            0x04000000
-#define UF_UNUSED_9                            0x08000000
-
-#define UF_UNUSED_10                           0x10000000
-#define UF_UNUSED_11                           0x20000000
-#define UF_UNUSED_12                           0x40000000
-#define UF_UNUSED_13                           0x80000000
-
-#define UF_MACHINE_ACCOUNT_MASK (\
-               UF_INTERDOMAIN_TRUST_ACCOUNT |\
-               UF_WORKSTATION_TRUST_ACCOUNT |\
-               UF_SERVER_TRUST_ACCOUNT \
-               )
-
-#define UF_ACCOUNT_TYPE_MASK (\
-               UF_TEMP_DUPLICATE_ACCOUNT |\
-               UF_NORMAL_ACCOUNT |\
-               UF_INTERDOMAIN_TRUST_ACCOUNT |\
-               UF_WORKSTATION_TRUST_ACCOUNT |\
-               UF_SERVER_TRUST_ACCOUNT \
-                )
-
-#define UF_SETTABLE_BITS (\
-               UF_SCRIPT |\
-               UF_ACCOUNTDISABLE |\
-               UF_HOMEDIR_REQUIRED  |\
-               UF_LOCKOUT |\
-               UF_PASSWD_NOTREQD |\
-               UF_PASSWD_CANT_CHANGE |\
-               UF_ACCOUNT_TYPE_MASK | \
-               UF_DONT_EXPIRE_PASSWD | \
-               UF_MNS_LOGON_ACCOUNT |\
-               UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED |\
-               UF_SMARTCARD_REQUIRED |\
-               UF_TRUSTED_FOR_DELEGATION |\
-               UF_NOT_DELEGATED |\
-               UF_USE_DES_KEY_ONLY  |\
-               UF_DONT_REQUIRE_PREAUTH \
-               )
-
-/* sAMAccountType */
-#define ATYPE_NORMAL_ACCOUNT                   0x30000000 /* 805306368 */
-#define ATYPE_WORKSTATION_TRUST                        0x30000001 /* 805306369 */
-#define ATYPE_INTERDOMAIN_TRUST                        0x30000002 /* 805306370 */ 
-#define ATYPE_SECURITY_GLOBAL_GROUP            0x10000000 /* 268435456 */
-#define ATYPE_DISTRIBUTION_GLOBAL_GROUP                0x10000001 /* 268435457 */
-#define ATYPE_DISTRIBUTION_UNIVERSAL_GROUP     ATYPE_DISTRIBUTION_GLOBAL_GROUP
-#define ATYPE_SECURITY_LOCAL_GROUP             0x20000000 /* 536870912 */
-#define ATYPE_DISTRIBUTION_LOCAL_GROUP         0x20000001 /* 536870913 */
-
-#define ATYPE_ACCOUNT          ATYPE_NORMAL_ACCOUNT            /* 0x30000000 805306368 */
-#define ATYPE_GLOBAL_GROUP     ATYPE_SECURITY_GLOBAL_GROUP     /* 0x10000000 268435456 */
-#define ATYPE_LOCAL_GROUP      ATYPE_SECURITY_LOCAL_GROUP      /* 0x20000000 536870912 */
-
-/* groupType */
-#define GROUP_TYPE_BUILTIN_LOCAL_GROUP         0x00000001
-#define GROUP_TYPE_ACCOUNT_GROUP               0x00000002
-#define GROUP_TYPE_RESOURCE_GROUP              0x00000004
-#define GROUP_TYPE_UNIVERSAL_GROUP             0x00000008
-#define GROUP_TYPE_APP_BASIC_GROUP             0x00000010
-#define GROUP_TYPE_APP_QUERY_GROUP             0x00000020
-#define GROUP_TYPE_SECURITY_ENABLED            0x80000000
-
-#define GTYPE_SECURITY_BUILTIN_LOCAL_GROUP (   /* 0x80000005 -2147483643 */ \
-               GROUP_TYPE_BUILTIN_LOCAL_GROUP| \
-               GROUP_TYPE_RESOURCE_GROUP| \
-               GROUP_TYPE_SECURITY_ENABLED \
-               )
-#define GTYPE_SECURITY_DOMAIN_LOCAL_GROUP (    /* 0x80000004 -2147483644 */ \
-               GROUP_TYPE_RESOURCE_GROUP| \
-               GROUP_TYPE_SECURITY_ENABLED \
-               )
-#define GTYPE_SECURITY_GLOBAL_GROUP (          /* 0x80000002 -2147483646 */ \
-               GROUP_TYPE_ACCOUNT_GROUP| \
-               GROUP_TYPE_SECURITY_ENABLED \
-               )
-#define GTYPE_SECURITY_UNIVERSAL_GROUP (       /* 0x80000008 -2147483656 */ \
-               GROUP_TYPE_UNIVERSAL_GROUP| \
-               GROUP_TYPE_SECURITY_ENABLED \
-               )
-
-#define GTYPE_DISTRIBUTION_GLOBAL_GROUP                0x00000002      /* 2 */
-#define GTYPE_DISTRIBUTION_DOMAIN_LOCAL_GROUP  0x00000004      /* 4 */
-#define GTYPE_DISTRIBUTION_UNIVERSAL_GROUP     0x00000008      /* 8 */
-
 #define ADS_PINGS          0x0000FFFF  /* Ping response */
 #define ADS_DNS_CONTROLLER 0x20000000  /* DomainControllerName is a DNS name*/
 #define ADS_DNS_DOMAIN     0x40000000  /* DomainName is a DNS name */
@@ -411,11 +295,4 @@ typedef struct {
 
 #define ADS_IGNORE_PRINCIPAL "not_defined_in_RFC4178@please_ignore"
 
-/* Settings for the domainFunctionality attribute in the rootDSE */
-
-#define DS_DOMAIN_FUNCTION_2000                0
-#define DS_DOMAIN_FUCNTION_2003_MIXED  1
-#define DS_DOMAIN_FUNCTION_2003                2
-#define DS_DOMAIN_FUNCTION_2008                3
-
 #endif /* _INCLUDE_ADS_H_ */
index 4e53311eba7169a35865074483283c016be7c048..2b4f9c2e4393716f23d7095514801459c2c3141c 100644 (file)
@@ -205,6 +205,22 @@ struct pdb_domain_info {
        struct GUID guid;
 };
 
+/*
+ * Types of account policy.
+ */
+enum pdb_policy_type {
+       PDB_POLICY_MIN_PASSWORD_LEN = 1,
+       PDB_POLICY_PASSWORD_HISTORY = 2,
+       PDB_POLICY_USER_MUST_LOGON_TO_CHG_PASS  = 3,
+       PDB_POLICY_MAX_PASSWORD_AGE = 4,
+       PDB_POLICY_MIN_PASSWORD_AGE = 5,
+       PDB_POLICY_LOCK_ACCOUNT_DURATION = 6,
+       PDB_POLICY_RESET_COUNT_TIME = 7,
+       PDB_POLICY_BAD_ATTEMPT_LOCKOUT = 8,
+       PDB_POLICY_TIME_TO_LOGOUT = 9,
+       PDB_POLICY_REFUSE_MACHINE_PW_CHANGE = 10
+};
+
 #define PDB_CAP_STORE_RIDS     0x0001
 #define PDB_CAP_ADS            0x0002
 
@@ -351,10 +367,12 @@ struct pdb_methods
                                 enum lsa_SidType *attrs);
 
        NTSTATUS (*get_account_policy)(struct pdb_methods *methods,
-                                      int policy_index, uint32 *value);
+                                      enum pdb_policy_type type,
+                                      uint32_t *value);
 
        NTSTATUS (*set_account_policy)(struct pdb_methods *methods,
-                                      int policy_index, uint32 value);
+                                      enum pdb_policy_type type,
+                                      uint32_t value);
 
        NTSTATUS (*get_seq_num)(struct pdb_methods *methods, time_t *seq_num);
 
index f887b4e7967be4873288d0ee48a1e80892126a50..77283d9cf0a172af6aa38e61607920f938f6d608 100644 (file)
@@ -290,16 +290,16 @@ bool check_access(int sock, const char **allow_list, const char **deny_list);
 /* The following definitions come from lib/account_pol.c  */
 
 void account_policy_names_list(const char ***names, int *num_names);
-const char *decode_account_policy_name(int field);
-const char *get_account_policy_attr(int field);
-const char *account_policy_get_desc(int field);
-int account_policy_name_to_fieldnum(const char *name);
-bool account_policy_get_default(int account_policy, uint32 *val);
+const char *decode_account_policy_name(enum pdb_policy_type type);
+const char *get_account_policy_attr(enum pdb_policy_type type);
+const char *account_policy_get_desc(enum pdb_policy_type type);
+enum pdb_policy_type account_policy_name_to_typenum(const char *name);
+bool account_policy_get_default(enum pdb_policy_type type, uint32_t *val);
 bool init_account_policy(void);
-bool account_policy_get(int field, uint32 *value);
-bool account_policy_set(int field, uint32 value);
-bool cache_account_policy_set(int field, uint32 value);
-bool cache_account_policy_get(int field, uint32 *value);
+bool account_policy_get(enum pdb_policy_type type, uint32_t *value);
+bool account_policy_set(enum pdb_policy_type type, uint32_t value);
+bool cache_account_policy_set(enum pdb_policy_type type, uint32_t value);
+bool cache_account_policy_get(enum pdb_policy_type type, uint32_t *value);
 struct db_context *get_account_pol_db( void );
 
 /* The following definitions come from lib/adt_tree.c  */
@@ -454,6 +454,14 @@ NTSTATUS dbwrap_trans_store_uint32(struct db_context *db, const char *keystr,
 NTSTATUS dbwrap_trans_store_bystring(struct db_context *db, const char *key,
                                     TDB_DATA data, int flags);
 NTSTATUS dbwrap_trans_delete_bystring(struct db_context *db, const char *key);
+NTSTATUS dbwrap_trans_do(struct db_context *db,
+                        NTSTATUS (*action)(struct db_context *, void *),
+                        void *private_data);
+NTSTATUS dbwrap_delete_bystring_upper(struct db_context *db, const char *key);
+NTSTATUS dbwrap_store_bystring_upper(struct db_context *db, const char *key,
+                                    TDB_DATA data, int flags);
+TDB_DATA dbwrap_fetch_bystring_upper(struct db_context *db, TALLOC_CTX *mem_ctx,
+                                    const char *key);
 
 /* The following definitions come from lib/debug.c  */
 
@@ -515,17 +523,15 @@ void pull_file_id_24(char *buf, struct file_id *id);
 
 /* The following definitions come from lib/gencache.c  */
 
-bool gencache_init(void);
-bool gencache_shutdown(void);
 bool gencache_set(const char *keystr, const char *value, time_t timeout);
 bool gencache_del(const char *keystr);
 bool gencache_get(const char *keystr, char **valstr, time_t *timeout);
-bool gencache_get_data_blob(const char *keystr, DATA_BLOB *blob, bool *expired);
+bool gencache_get_data_blob(const char *keystr, DATA_BLOB *blob,
+                           time_t *timeout);
+bool gencache_stabilize(void);
 bool gencache_set_data_blob(const char *keystr, const DATA_BLOB *blob, time_t timeout);
 void gencache_iterate(void (*fn)(const char* key, const char *value, time_t timeout, void* dptr),
                       void* data, const char* keystr_pattern);
-int gencache_lock_entry( const char *key );
-void gencache_unlock_entry( const char *key );
 
 /* The following definitions come from lib/interface.c  */
 
@@ -554,7 +560,7 @@ void init_ldap_debugging(void);
 
 /* The following definitions come from lib/ldap_escape.c  */
 
-char *escape_ldap_string_alloc(const char *s);
+char *escape_ldap_string(TALLOC_CTX *mem_ctx, const char *s);
 char *escape_rdn_val_string_alloc(const char *s);
 
 /* The following definitions come from lib/module.c  */
@@ -1678,13 +1684,6 @@ ADS_STRUCT *ads_init(const char *realm,
                     const char *ldap_server);
 void ads_destroy(ADS_STRUCT **ads);
 
-/* The following definitions come from libads/ads_utils.c  */
-
-uint32 ads_acb2uf(uint32 acb);
-uint32 ads_uf2acb(uint32 uf);
-uint32 ads_uf2atype(uint32 uf);
-uint32 ads_gtype2atype(uint32 gtype);
-enum lsa_SidType ads_atype_map(uint32 atype);
 const char *ads_get_ldap_server_name(ADS_STRUCT *ads);
 
 /* The following definitions come from libads/authdata.c  */
@@ -2271,13 +2270,6 @@ bool cli_resolve_path(TALLOC_CTX *ctx,
 
 /* The following definitions come from libsmb/clidgram.c  */
 
-bool cli_send_mailslot(struct messaging_context *msg_ctx,
-                      bool unique, const char *mailslot,
-                      uint16 priority,
-                      char *buf, int len,
-                      const char *srcname, int src_type,
-                      const char *dstname, int dest_type,
-                      const struct sockaddr_storage *dest_ss);
 bool send_getdc_request(TALLOC_CTX *mem_ctx,
                        struct messaging_context *msg_ctx,
                        struct sockaddr_storage *dc_ss,
@@ -2519,15 +2511,44 @@ NTSTATUS cli_locktype(struct cli_state *cli, uint16_t fnum,
                      int timeout, unsigned char locktype);
 bool cli_lock(struct cli_state *cli, uint16_t fnum,
              uint32_t offset, uint32_t len, int timeout, enum brl_type lock_type);
-bool cli_unlock(struct cli_state *cli, uint16_t fnum, uint32_t offset, uint32_t len);
+struct tevent_req *cli_unlock_send(TALLOC_CTX *mem_ctx,
+                                struct event_context *ev,
+                                struct cli_state *cli,
+                                uint16_t fnum,
+                                uint64_t offset,
+                                uint64_t len);
+NTSTATUS cli_unlock_recv(struct tevent_req *req);
+NTSTATUS cli_unlock(struct cli_state *cli, uint16_t fnum, uint32_t offset, uint32_t len);
 bool cli_lock64(struct cli_state *cli, uint16_t fnum,
                uint64_t offset, uint64_t len, int timeout, enum brl_type lock_type);
-bool cli_unlock64(struct cli_state *cli, uint16_t fnum, uint64_t offset, uint64_t len);
-bool cli_posix_lock(struct cli_state *cli, uint16_t fnum,
+struct tevent_req *cli_unlock64_send(TALLOC_CTX *mem_ctx,
+                                struct event_context *ev,
+                                struct cli_state *cli,
+                                uint16_t fnum,
+                                uint64_t offset,
+                                uint64_t len);
+NTSTATUS cli_unlock64_recv(struct tevent_req *req);
+NTSTATUS cli_unlock64(struct cli_state *cli, uint16_t fnum, uint64_t offset, uint64_t len);
+struct tevent_req *cli_posix_lock_send(TALLOC_CTX *mem_ctx,
+                                        struct event_context *ev,
+                                        struct cli_state *cli,
+                                        uint16_t fnum,
+                                        uint64_t offset,
+                                        uint64_t len,
+                                        bool wait_lock,
+                                        enum brl_type lock_type);
+NTSTATUS cli_posix_lock_recv(struct tevent_req *req);
+NTSTATUS cli_posix_lock(struct cli_state *cli, uint16_t fnum,
                        uint64_t offset, uint64_t len,
                        bool wait_lock, enum brl_type lock_type);
-bool cli_posix_unlock(struct cli_state *cli, uint16_t fnum, uint64_t offset, uint64_t len);
-bool cli_posix_getlock(struct cli_state *cli, uint16_t fnum, uint64_t *poffset, uint64_t *plen);
+struct tevent_req *cli_posix_unlock_send(TALLOC_CTX *mem_ctx,
+                                        struct event_context *ev,
+                                        struct cli_state *cli,
+                                        uint16_t fnum,
+                                        uint64_t offset,
+                                        uint64_t len);
+NTSTATUS cli_posix_unlock_recv(struct tevent_req *req);
+NTSTATUS cli_posix_unlock(struct cli_state *cli, uint16_t fnum, uint64_t offset, uint64_t len);
 struct tevent_req *cli_getattrE_send(TALLOC_CTX *mem_ctx,
                                struct event_context *ev,
                                struct cli_state *cli,
@@ -4587,8 +4608,8 @@ NTSTATUS pdb_lookup_names(const DOM_SID *domain_sid,
                          const char **names,
                          uint32 *rids,
                          enum lsa_SidType *attrs);
-bool pdb_get_account_policy(int policy_index, uint32 *value);
-bool pdb_set_account_policy(int policy_index, uint32 value);
+bool pdb_get_account_policy(enum pdb_policy_type type, uint32_t *value);
+bool pdb_set_account_policy(enum pdb_policy_type type, uint32_t value);
 bool pdb_get_seq_num(time_t *seq_num);
 bool pdb_uid_to_rid(uid_t uid, uint32 *rid);
 bool pdb_uid_to_sid(uid_t uid, DOM_SID *sid);
@@ -5083,6 +5104,7 @@ WERROR registry_init_smbconf(const char *keyname);
 /* The following definitions come from registry/reg_objects.c  */
 
 WERROR regsubkey_ctr_init(TALLOC_CTX *mem_ctx, struct regsubkey_ctr **ctr);
+WERROR regsubkey_ctr_reinit(struct regsubkey_ctr *ctr);
 WERROR regsubkey_ctr_set_seqnum(struct regsubkey_ctr *ctr, int seqnum);
 int regsubkey_ctr_get_seqnum(struct regsubkey_ctr *ctr);
 WERROR regsubkey_ctr_addkey( struct regsubkey_ctr *ctr, const char *keyname );
@@ -5647,32 +5669,16 @@ void prs_switch_type(prs_struct *ps, bool io);
 void prs_force_dynamic(prs_struct *ps);
 void prs_set_session_key(prs_struct *ps, const char sess_key[16]);
 bool prs_uint8(const char *name, prs_struct *ps, int depth, uint8 *data8);
-bool prs_pointer( const char *name, prs_struct *ps, int depth, 
-                 void *dta, size_t data_size,
-                 bool (*prs_fn)(const char*, prs_struct*, int, void*) );
 bool prs_uint16(const char *name, prs_struct *ps, int depth, uint16 *data16);
 bool prs_uint32(const char *name, prs_struct *ps, int depth, uint32 *data32);
 bool prs_int32(const char *name, prs_struct *ps, int depth, int32 *data32);
 bool prs_uint64(const char *name, prs_struct *ps, int depth, uint64 *data64);
-bool prs_ntstatus(const char *name, prs_struct *ps, int depth, NTSTATUS *status);
 bool prs_dcerpc_status(const char *name, prs_struct *ps, int depth, NTSTATUS *status);
-bool prs_werror(const char *name, prs_struct *ps, int depth, WERROR *status);
 bool prs_uint8s(bool charmode, const char *name, prs_struct *ps, int depth, uint8 *data8s, int len);
 bool prs_uint16s(bool charmode, const char *name, prs_struct *ps, int depth, uint16 *data16s, int len);
-bool prs_uint16uni(bool charmode, const char *name, prs_struct *ps, int depth, uint16 *data16s, int len);
 bool prs_uint32s(bool charmode, const char *name, prs_struct *ps, int depth, uint32 *data32s, int len);
 bool prs_unistr(const char *name, prs_struct *ps, int depth, UNISTR *str);
 bool prs_string(const char *name, prs_struct *ps, int depth, char *str, int max_buf_size);
-bool prs_string_alloc(const char *name, prs_struct *ps, int depth, const char **str);
-bool prs_uint16_pre(const char *name, prs_struct *ps, int depth, uint16 *data16, uint32 *offset);
-bool prs_uint16_post(const char *name, prs_struct *ps, int depth, uint16 *data16,
-                               uint32 ptr_uint16, uint32 start_offset);
-bool prs_uint32_pre(const char *name, prs_struct *ps, int depth, uint32 *data32, uint32 *offset);
-bool prs_uint32_post(const char *name, prs_struct *ps, int depth, uint32 *data32,
-                               uint32 ptr_uint32, uint32 data_size);
-int tdb_prs_store(TDB_CONTEXT *tdb, TDB_DATA kbuf, prs_struct *ps);
-int tdb_prs_fetch(TDB_CONTEXT *tdb, TDB_DATA kbuf, prs_struct *ps, TALLOC_CTX *mem_ctx);
-bool prs_hash1(prs_struct *ps, uint32 offset, int len);
 void schannel_encode(struct schannel_auth_struct *a, enum pipe_auth_level auth_level,
                   enum schannel_direction direction,
                   RPC_AUTH_SCHANNEL_CHK * verf,
@@ -5877,7 +5883,6 @@ void copy_id26_to_sam_passwd(struct samu *to,
 
 /* The following definitions come from rpc_server/srv_spoolss_nt.c  */
 
-WERROR delete_printer_hook(TALLOC_CTX *ctx, NT_USER_TOKEN *token, const char *sharename );
 void do_drv