Merge branch 'master' of ssh://git.samba.org/data/git/samba
authorAndrew Tridgell <tridge@samba.org>
Tue, 16 Dec 2008 00:41:20 +0000 (11:41 +1100)
committerAndrew Tridgell <tridge@samba.org>
Tue, 16 Dec 2008 00:41:20 +0000 (11:41 +1100)
214 files changed:
docs-xml/Samba3-HOWTO/TOSHARG-TheNetCommand.xml
docs-xml/smbdotconf/misc/socketaddress.xml
docs-xml/smbdotconf/security/accessbasedshareenum.xml [new file with mode: 0644]
lib/util/util_net.c
librpc/idl/browser.idl
librpc/idl/lsa.idl
librpc/idl/misc.idl
librpc/idl/netlogon.idl
librpc/idl/samr.idl
librpc/idl/security.idl
librpc/idl/srvsvc.idl
librpc/idl/winreg.idl
librpc/ndr/ndr_sec_helper.c
packaging/RHEL-CTDB/configure.rpm
packaging/RHEL-CTDB/makerpms.sh
packaging/RHEL-CTDB/makespec.sh [new file with mode: 0755]
packaging/RHEL-CTDB/samba.spec.tmpl
pidl/lib/Parse/Pidl/Compat.pm
pidl/lib/Parse/Pidl/NDR.pm
pidl/lib/Parse/Pidl/Samba4.pm
pidl/lib/Parse/Pidl/Samba4/EJS.pm [deleted file]
pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
pidl/lib/Parse/Pidl/Samba4/Python.pm
pidl/tests/samba-ejs.pl [deleted file]
source3/Makefile.in
source3/auth/auth_util.c
source3/client/client.c
source3/client/mount.cifs.c
source3/configure.in
source3/include/ads.h
source3/include/async_req.h
source3/include/async_smb.h
source3/include/async_sock.h
source3/include/client.h
source3/include/proto.h
source3/include/smb.h
source3/include/smb_macros.h
source3/include/vfs.h
source3/include/vfs_macros.h
source3/lib/async_req.c
source3/lib/async_sock.c
source3/lib/debug.c
source3/lib/display_sec.c
source3/lib/interface.c
source3/lib/netapi/user.c
source3/lib/popt_common.c
source3/lib/secdesc.c
source3/lib/util.c
source3/lib/util_sock.c
source3/lib/util_str.c
source3/libads/kerberos.c
source3/libads/ldap.c
source3/libads/ndr.c
source3/libnet/libnet_join.c
source3/libnet/libnet_keytab.c
source3/libnet/libnet_samsync.c
source3/librpc/gen_ndr/cli_netlogon.c
source3/librpc/gen_ndr/cli_netlogon.h
source3/librpc/gen_ndr/lsa.h
source3/librpc/gen_ndr/misc.h
source3/librpc/gen_ndr/ndr_drsblobs.c
source3/librpc/gen_ndr/ndr_netlogon.c
source3/librpc/gen_ndr/ndr_netlogon.h
source3/librpc/gen_ndr/ndr_samr.c
source3/librpc/gen_ndr/ndr_security.c
source3/librpc/gen_ndr/ndr_security.h
source3/librpc/gen_ndr/ndr_srvsvc.c
source3/librpc/gen_ndr/ndr_srvsvc.h
source3/librpc/gen_ndr/netlogon.h
source3/librpc/gen_ndr/samr.h
source3/librpc/gen_ndr/security.h
source3/librpc/gen_ndr/srv_netlogon.c
source3/librpc/gen_ndr/srv_netlogon.h
source3/librpc/gen_ndr/srvsvc.h
source3/librpc/gen_ndr/winreg.h
source3/librpc/ndr/sid.c
source3/librpc/rpc/dcerpc.c
source3/libsmb/async_smb.c
source3/libsmb/cliconnect.c
source3/libsmb/clidfs.c
source3/libsmb/clientgen.c
source3/libsmb/clifile.c
source3/libsmb/clilist.c
source3/libsmb/clireadwrite.c
source3/libsmb/clitrans.c
source3/libsmb/dsgetdcname.c
source3/libsmb/libsmb_context.c
source3/libsmb/libsmb_dir.c
source3/libsmb/libsmb_server.c
source3/libsmb/namequery.c
source3/libsmb/namequery_dc.c
source3/libsmb/smb_seal.c
source3/locking/locking.c
source3/modules/gpfs.c
source3/modules/onefs.h
source3/modules/onefs_acl.c
source3/modules/onefs_open.c [new file with mode: 0644]
source3/modules/onefs_system.c [new file with mode: 0644]
source3/modules/vfs_default.c
source3/modules/vfs_full_audit.c
source3/modules/vfs_gpfs.c
source3/modules/vfs_onefs.c
source3/modules/vfs_prealloc.c
source3/nsswitch/libwbclient/wbc_guid.c
source3/nsswitch/libwbclient/wbc_idmap.c
source3/nsswitch/libwbclient/wbc_pam.c
source3/nsswitch/libwbclient/wbc_pwd.c
source3/nsswitch/libwbclient/wbc_sid.c
source3/nsswitch/libwbclient/wbc_util.c
source3/nsswitch/libwbclient/wbclient.c
source3/nsswitch/libwbclient/wbclient.h
source3/nsswitch/pam_winbind.c
source3/nsswitch/wbinfo.c
source3/param/loadparm.c
source3/passdb/pdb_ldap.c
source3/printing/nt_printing.c
source3/printing/printing.c
source3/rpc_client/cli_pipe.c
source3/rpc_client/init_samr.c
source3/rpc_server/srv_netlog_nt.c
source3/rpc_server/srv_samr_nt.c
source3/rpc_server/srv_srvsvc_nt.c
source3/rpcclient/cmd_samr.c
source3/rpcclient/cmd_spoolss.c
source3/rpcclient/rpcclient.c
source3/samba4.mk
source3/smbd/close.c
source3/smbd/dosmode.c
source3/smbd/filename.c
source3/smbd/nttrans.c
source3/smbd/open.c
source3/smbd/pipes.c
source3/smbd/posix_acls.c
source3/smbd/reply.c
source3/smbd/server.c
source3/smbd/sesssetup.c
source3/smbd/share_access.c
source3/smbd/trans2.c
source3/smbd/uid.c
source3/torture/locktest.c
source3/torture/masktest.c
source3/torture/torture.c
source3/utils/net.c
source3/utils/net_ads.c
source3/utils/net_rpc.c
source3/utils/smbcacls.c
source3/utils/smbcquotas.c
source3/utils/smbfilter.c
source3/utils/smbtree.c
source3/web/swat.c
source3/winbindd/winbindd.c
source3/winbindd/winbindd_async.c
source3/winbindd/winbindd_cm.c
source3/winbindd/winbindd_group.c
source3/winbindd/winbindd_proto.h
source3/winbindd/winbindd_reqtrans.c [new file with mode: 0644]
source3/winbindd/winbindd_user.c
source4/auth/auth.h
source4/auth/ntlm/auth_sam.c
source4/auth/sam.c
source4/dsdb/samdb/ldb_modules/kludge_acl.c
source4/dsdb/samdb/ldb_modules/password_hash.c
source4/headermap.txt
source4/kdc/pac-glue.c
source4/libcli/auth/session.c
source4/libcli/resolve/bcast.c
source4/libcli/resolve/host.c
source4/libcli/resolve/nbtlist.c
source4/libcli/resolve/resolve.c
source4/libcli/resolve/resolve.h
source4/libcli/resolve/testsuite.c
source4/libcli/resolve/wins.c
source4/libcli/security/dom_sid.c
source4/libcli/security/sddl.c
source4/libcli/security/security_descriptor.c
source4/libnet/libnet_passwd.c
source4/librpc/config.mk
source4/librpc/idl/dom_sid.idl
source4/librpc/idl/irpc.idl
source4/librpc/ndr/ndr_dom_sid.c [deleted file]
source4/librpc/ndr/py_security.c [new file with mode: 0644]
source4/ntp_signd/README [new file with mode: 0644]
source4/ntp_signd/ntp-dev-4.2.5p125.diff [new file with mode: 0644]
source4/ntvfs/cifs/vfs_cifs.c
source4/ntvfs/ntvfs.h
source4/param/loadparm.c
source4/param/secrets.h
source4/rpc_server/browser/dcesrv_browser.c [new file with mode: 0644]
source4/rpc_server/config.mk
source4/rpc_server/dcerpc_server.c
source4/rpc_server/dcerpc_server.h
source4/rpc_server/netlogon/dcerpc_netlogon.c
source4/rpc_server/samr/dcesrv_samr.c
source4/rpc_server/service_rpc.c
source4/selftest/knownfail
source4/setup/ad-schema/MS-AD_Schema_Attributes_v20080618.txt [new file with mode: 0644]
source4/setup/ad-schema/MS-AD_Schema_Classes_v20080618.txt [new file with mode: 0644]
source4/setup/ad-schema/licence.txt [new file with mode: 0644]
source4/setup/provision
source4/smb_server/smb2/smb2_server.h
source4/smb_server/smb_server.h
source4/torture/basic/delete.c
source4/torture/config.mk
source4/torture/raw/open.c
source4/torture/rpc/browser.c [new file with mode: 0644]
source4/torture/rpc/netlogon.c
source4/torture/rpc/rpc.c
source4/torture/rpc/samba3rpc.c
source4/torture/rpc/samr.c
source4/torture/unix/whoami.c
source4/winbind/config.mk
source4/winbind/wb_init_domain.c
source4/winbind/wb_server.c
source4/winbind/wb_setup_domains.c [new file with mode: 0644]

index b2b3ebd5b15c6647223161b440196e5fe4675b92..d1895829a9569225beff0e8a5cc76d6b4dfbe887 100644 (file)
@@ -1850,7 +1850,7 @@ net idmap dump /var/lib/samba/winbindd_idmap.tdb &gt; idmap_dump.txt
        <para>
        The IDMAP dump file can be restored using the following command:
 <screen>
-net idmap restore &lt;full_path_and_tdb_filename&gt; &lt; dumpfile.txt
+net idmap restore idmap_dump.txt
 </screen>
        Where the Samba run-time tdb files are stored in the <filename>/var/lib/samba</filename> directory
     the following command can be used to restore the data to the tdb file:
index 7566380e7092011683f73bba9675f293a938063e..17018efd40a682e344cc3f21cd88db27addf379a 100644 (file)
@@ -4,12 +4,14 @@
                 developer="1"
                 xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
 <description>
-       <para>This option allows you to control what 
-       address Samba will listen for connections on. This is used to 
-       support multiple virtual interfaces on the one server, each 
+       <para>This option allows you to control what
+       address Samba will listen for connections on. This is used to
+       support multiple virtual interfaces on the one server, each
        with a different configuration.</para>
-               
-       <para>By default Samba will accept connections on any 
+       <para>Setting this option should never be necessary on usual Samba
+       servers running only one nmbd.</para>
+
+       <para>By default Samba will accept connections on any
                address.</para>
 </description>
 
diff --git a/docs-xml/smbdotconf/security/accessbasedshareenum.xml b/docs-xml/smbdotconf/security/accessbasedshareenum.xml
new file mode 100644 (file)
index 0000000..c2977c4
--- /dev/null
@@ -0,0 +1,18 @@
+<samba:parameter name="access based share enum"
+                type="boolean"
+                 context="S"
+                 basic="1" advanced="1" developer="1"
+                xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
+ <synonym>public</synonym>
+ <description>
+     <para>If this parameter is <constant>yes</constant> for a
+    service, then the share hosted by the service will only be visible
+    to users who have read or write access to the share during share
+    enumeration (for example net view \\sambaserver).  This has
+    parallels to access based enumeration, the main difference being
+    that only share permissions are evaluated, and security
+    descriptors on files contained on the share are not used in
+    computing enumeration access rights.</para>
+ </description>
+ <value type="default">no</value>
+</samba:parameter>
index 228393a2bbf8cf760b87c6ff4bb17584504b8e21..d1dadc24942de8215f21c26a9df115f53ee01232 100644 (file)
@@ -360,7 +360,7 @@ bool same_net(const struct sockaddr *ip1,
  * Are two sockaddr 's the same family and address ? Ignore port etc.
  */
 
-bool addr_equal(const struct sockaddr *ip1,
+bool sockaddr_equal(const struct sockaddr *ip1,
                const struct sockaddr *ip2)
 {
        if (ip1->sa_family != ip2->sa_family) {
index 5b05be9cbb930f2d2441f46baf433ce2c1120151..94d4ce6b62afd98ec96bbd6fd83f136969fd9e50 100644 (file)
@@ -1,4 +1,6 @@
-[ 
+import "srvsvc.idl";
+
+[
   uuid("6bffd098-a112-3610-9833-012892020162"),
   version(0.0), 
   helpstring("Browsing"),
@@ -9,50 +11,76 @@ interface browser
 {
        /******************/
        /* Function  0x00 */
-       [todo] NTSTATUS BrowserrServerEnum();
+       [todo] void BrowserrServerEnum();
 
        /******************/
        /* Function  0x01 */
-       [todo] NTSTATUS BrowserrDebugCall();
+       [todo] void BrowserrDebugCall();
 
        /******************/
        /* Function  0x02 */
-       [todo] NTSTATUS BrowserrQueryOtherDomains();
+
+       typedef struct {
+               uint32 entries_read;
+               [size_is(entries_read)] srvsvc_NetSrvInfo100 *entries;
+       } BrowserrSrvInfo100Ctr;
+
+       typedef struct {
+               uint32 entries_read;
+               [size_is(entries_read)] srvsvc_NetSrvInfo101 *entries;
+       } BrowserrSrvInfo101Ctr;
+
+       typedef [switch_type(uint32)] union {
+               [case(100)] BrowserrSrvInfo100Ctr *info100;
+               [case(101)] BrowserrSrvInfo101Ctr *info101;
+               [default] ;
+       } BrowserrSrvInfoUnion;
+
+       typedef struct {
+               uint32 level;
+               [switch_is(level)] BrowserrSrvInfoUnion info;
+       } BrowserrSrvInfo;
+
+       WERROR BrowserrQueryOtherDomains(
+               [in,unique]   [string,charset(UTF16)] uint16 *server_unc,
+               [in,out,ref] BrowserrSrvInfo *info,
+               [out,ref] uint32 *total_entries
+       );
 
        /******************/
        /* Function  0x03 */
-       [todo] NTSTATUS BrowserrResetNetlogonState();
+       [todo] void BrowserrResetNetlogonState();
 
        /******************/
        /* Function  0x04 */
-       [todo] NTSTATUS BrowserrDebugTrace();
+       [todo] void BrowserrDebugTrace();
 
        /******************/
        /* Function  0x05 */
-       [todo] NTSTATUS BrowserrQueryStatistics();
+       [todo] void BrowserrQueryStatistics();
 
        /******************/
        /* Function  0x06 */
-       [todo] NTSTATUS BrowserResetStatistics();
+       [todo] void BrowserResetStatistics();
 
        /******************/
        /* Function  0x07 */
-       [todo] NTSTATUS NetrBrowserStatisticsClear();
+       [todo] void NetrBrowserStatisticsClear();
 
        /******************/
        /* Function  0x08 */
-       [todo] NTSTATUS NetrBrowserStatisticsGet();
+       [todo] void NetrBrowserStatisticsGet();
 
        /******************/
        /* Function  0x09 */
-       [todo] NTSTATUS BrowserrSetNetlogonState();
+       [todo] void BrowserrSetNetlogonState();
 
        /******************/
        /* Function  0x0a */
-       [todo] NTSTATUS BrowserrQueryEmulatedDomains();
+       [todo] void BrowserrQueryEmulatedDomains();
 
        /******************/
        /* Function  0x0b */
-       [todo] NTSTATUS BrowserrServerEnumEx();
+       [todo] void BrowserrServerEnumEx();
 
 }
index 003641d97a161231bacb487de234934468a2fe7a..db5ca3172044ad76ad30c0dc3d8f2b02f9cd7b48 100644 (file)
@@ -16,7 +16,7 @@ import "misc.idl", "security.idl";
        typedef bitmap security_secinfo security_secinfo;
        typedef bitmap kerb_EncTypes kerb_EncTypes;
 
-       typedef [public,noejs] struct {
+       typedef [public] struct {
                [value(2*strlen_m(string))] uint16 length;
                [value(2*strlen_m(string))] uint16 size;
                [charset(UTF16),size_is(size/2),length_is(length/2)] uint16 *string;
index 1907195252138962a86cfe75e9701c7f51dbb826..1ef0d913b9c429deb9e3163163010427332126ca 100644 (file)
@@ -7,7 +7,7 @@
 ]
 interface misc
 {
-       typedef [public,noprint,gensize,noejs] struct {
+       typedef [public,noprint,gensize] struct {
                uint32 time_low;
                uint16 time_mid;
                uint16 time_hi_and_version;
index cf4da7adfa9475702f9b4c2411fd1ce16fb3ebe9..f09e51e30f23be18247a4434ffa42e018f3b4e61 100644 (file)
@@ -1500,5 +1500,23 @@ interface netlogon
 
        /****************/
        /* Function 0x2e */
-       [todo] WERROR netr_NETRSERVERGETTRUSTINFO();
+
+       typedef struct {
+               uint32 count;
+               [size_is(count)] uint32 *data;
+               uint32 entry_count;
+               [size_is(count)] lsa_String *entries;
+       } netr_TrustInfo;
+
+       NTSTATUS netr_ServerGetTrustInfo(
+               [in,unique] [string,charset(UTF16)] uint16 *server_name,
+               [in,ref] [string,charset(UTF16)] uint16 *account_name,
+               [in] netr_SchannelType secure_channel_type,
+               [in,ref] [string,charset(UTF16)] uint16 *computer_name,
+               [in,ref] netr_Authenticator *credential,
+               [out,ref] netr_Authenticator *return_authenticator,
+               [out,ref] samr_Password *new_owf_password,
+               [out,ref] samr_Password *old_owf_password,
+               [out,ref] netr_TrustInfo **trust_info
+               );
 }
index 46478ee9e87d363c9616d97cbfe87b4c072cfefd..7d5d877bb1f26bbd5fa494827fc01c5f77ac0662 100644 (file)
@@ -410,8 +410,7 @@ import "misc.idl", "lsa.idl", "security.idl";
        typedef struct {
                hyper sequence_num;
                NTTIME domain_create_time;
-               uint32 unknown1;
-               uint32 unknown2;
+               hyper modified_count_at_last_promotion;
        } samr_DomInfo13;
 
        typedef [switch_type(uint16)] union {
@@ -880,10 +879,11 @@ import "misc.idl", "lsa.idl", "security.idl";
        } samr_Password;
 
        typedef struct {
-               samr_Password lm_pwd;
                samr_Password nt_pwd;
-               boolean8 lm_pwd_active;
+               samr_Password lm_pwd;
                boolean8 nt_pwd_active;
+               boolean8 lm_pwd_active;
+               uint8 password_expired;
        } samr_UserInfo18;
 
        typedef struct {
@@ -916,8 +916,8 @@ import "misc.idl", "lsa.idl", "security.idl";
                SAMR_FIELD_PARAMETERS       = 0x00200000,
                SAMR_FIELD_COUNTRY_CODE     = 0x00400000,
                SAMR_FIELD_CODE_PAGE        = 0x00800000,
-               SAMR_FIELD_PASSWORD         = 0x01000000, /* either of these */
-               SAMR_FIELD_PASSWORD2        = 0x02000000, /* two bits seems to work */
+               SAMR_FIELD_NT_PASSWORD_PRESENT = 0x01000000, /* either of these */
+               SAMR_FIELD_LM_PASSWORD_PRESENT = 0x02000000, /* two bits seems to work */
                SAMR_FIELD_PRIVATE_DATA     = 0x04000000,
                SAMR_FIELD_EXPIRED_FLAG     = 0x08000000,
                SAMR_FIELD_SEC_DESC         = 0x10000000,
@@ -945,8 +945,8 @@ import "misc.idl", "lsa.idl", "security.idl";
                lsa_String workstations;
                lsa_String comment;
                lsa_BinaryString parameters;
-               lsa_String unknown1;
-               lsa_String unknown2;
+               lsa_BinaryString lm_owf_password;
+               lsa_BinaryString nt_owf_password;
                lsa_String unknown3;
                uint32 buf_count;
                [size_is(buf_count)] uint8 *buffer;
@@ -959,8 +959,8 @@ import "misc.idl", "lsa.idl", "security.idl";
                uint16 logon_count;
                uint16 country_code;
                uint16 code_page;
-               uint8  nt_password_set;
                uint8  lm_password_set;
+               uint8  nt_password_set;
                uint8  password_expired;
                uint8  unknown4;
        } samr_UserInfo21;
index 3f70e2c36e5919d977643d660b2e21bbaadee651..4c6aa235d76b3f6e9467e4fb827f5d97ec453f18 100644 (file)
@@ -7,12 +7,39 @@
 import "misc.idl";
 import "dom_sid.idl";
 
+/*
+   use the same structure for dom_sid2 as dom_sid. A dom_sid2 is really
+   just a dom sid, but with the sub_auths represented as a conformant
+   array. As with all in-structure conformant arrays, the array length
+   is placed before the start of the structure. That's what gives rise
+   to the extra num_auths elemenent. We don't want the Samba code to
+   have to bother with such esoteric NDR details, so its easier to just
+   define it as a dom_sid and use pidl magic to make it all work. It
+   just means you need to mark a sid as a "dom_sid2" in the IDL when you
+   know it is of the conformant array variety
+*/
+cpp_quote("#define dom_sid2 dom_sid")
+
+/* same struct as dom_sid but inside a 28 bytes fixed buffer in NDR */
+cpp_quote("#define dom_sid28 dom_sid")
+
+/* same struct as dom_sid but in a variable byte buffer, which is maybe empty in NDR */
+cpp_quote("#define dom_sid0 dom_sid")
+
 [
        helper("librpc/gen_ndr/ndr_dom_sid.h"),
+       pyhelper("librpc/ndr/py_security.c"),
        pointer_default(unique)
 ]
 interface security
 {
+
+       typedef [public,gensize,noprint,nosize,nopull,nopush] struct {
+               uint8  sid_rev_num;             /**< SID revision number */
+               [range(0,15)] int8  num_auths;  /**< Number of sub-authorities */
+               uint8  id_auth[6];              /**< Identifier Authority */
+               uint32 sub_auths[15];
+       } dom_sid;
        /*
          access masks are divided up like this:
                 0xabccdddd
@@ -388,4 +415,5 @@ interface security
                KERB_ENCTYPE_AES128_CTS_HMAC_SHA1_96 = 0x00000008,
                KERB_ENCTYPE_AES256_CTS_HMAC_SHA1_96 = 0x00000010
        } kerb_EncTypes;
+
 }
index 3f24402c3f68ce590a24a41a772cd8a5294ed8e0..153d8cfbbe7783c121578e622bcf319ad9e2fd67 100644 (file)
@@ -638,12 +638,12 @@ import "security.idl", "svcctl.idl";
                PLATFORM_ID_VMS = 700
        } srvsvc_PlatformId;
 
-       typedef struct {
+       typedef [public] struct {
                srvsvc_PlatformId platform_id;
                [string,charset(UTF16)] uint16 *server_name;
        } srvsvc_NetSrvInfo100;
 
-       typedef struct {
+       typedef [public] struct {
                srvsvc_PlatformId platform_id;
                [string,charset(UTF16)] uint16 *server_name;
                uint32 version_major;
index 9216f9893bf58a83161ce1249da487794fcdf735..2f108a090bc8f7965789cbb141c488a752baecd7 100644 (file)
@@ -40,7 +40,7 @@ import "lsa.idl", "security.idl";
                REG_QWORD                      = 11
        } winreg_Type;
 
-       typedef [public,noejs] struct {
+       typedef [public] struct {
                [value(strlen_m_term(name)*2)] uint16 name_len;
                [value(strlen_m_term(name)*2)] uint16 name_size;
                [string,charset(UTF16)] uint16 *name;
index 4b135505d883806337c2c3087aaa7d4c26ae406f..898a4287eaaf8e1fc39aadb364c6033db935a18e 100644 (file)
@@ -23,6 +23,9 @@
 
 #include "includes.h"
 #include "librpc/gen_ndr/ndr_security.h"
+#if _SAMBA_BUILD_ == 4
+#include "libcli/security/security.h"
+#endif
 
 /*
   return the wire size of a security_ace
@@ -116,3 +119,224 @@ size_t ndr_size_security_descriptor(const struct security_descriptor *sd, int fl
        return ret;
 }
 
+/*
+  return the wire size of a dom_sid
+*/
+size_t ndr_size_dom_sid(const struct dom_sid *sid, int flags)
+{
+       if (!sid) return 0;
+       return 8 + 4*sid->num_auths;
+}
+
+size_t ndr_size_dom_sid28(const struct dom_sid *sid, int flags)
+{
+       struct dom_sid zero_sid;
+
+       if (!sid) return 0;
+
+       ZERO_STRUCT(zero_sid);
+
+       if (memcmp(&zero_sid, sid, sizeof(zero_sid)) == 0) {
+               return 0;
+       }
+
+       return 8 + 4*sid->num_auths;
+}
+
+size_t ndr_size_dom_sid0(const struct dom_sid *sid, int flags)
+{
+       return ndr_size_dom_sid28(sid, flags);
+}
+
+/*
+  print a dom_sid
+*/
+void ndr_print_dom_sid(struct ndr_print *ndr, const char *name, const struct dom_sid *sid)
+{
+       ndr->print(ndr, "%-25s: %s", name, dom_sid_string(ndr, sid));
+}
+
+void ndr_print_dom_sid2(struct ndr_print *ndr, const char *name, const struct dom_sid *sid)
+{
+       ndr_print_dom_sid(ndr, name, sid);
+}
+
+void ndr_print_dom_sid28(struct ndr_print *ndr, const char *name, const struct dom_sid *sid)
+{
+       ndr_print_dom_sid(ndr, name, sid);
+}
+
+void ndr_print_dom_sid0(struct ndr_print *ndr, const char *name, const struct dom_sid *sid)
+{
+       ndr_print_dom_sid(ndr, name, sid);
+}
+
+
+/*
+  parse a dom_sid2 - this is a dom_sid but with an extra copy of the num_auths field
+*/
+enum ndr_err_code ndr_pull_dom_sid2(struct ndr_pull *ndr, int ndr_flags, struct dom_sid *sid)
+{
+       uint32_t num_auths;
+       if (!(ndr_flags & NDR_SCALARS)) {
+               return NDR_ERR_SUCCESS;
+       }
+       NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &num_auths));
+       NDR_CHECK(ndr_pull_dom_sid(ndr, ndr_flags, sid));
+       if (sid->num_auths != num_auths) {
+               return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, 
+                                     "Bad array size %u should exceed %u", 
+                                     num_auths, sid->num_auths);
+       }
+       return NDR_ERR_SUCCESS;
+}
+
+/*
+  parse a dom_sid2 - this is a dom_sid but with an extra copy of the num_auths field
+*/
+enum ndr_err_code ndr_push_dom_sid2(struct ndr_push *ndr, int ndr_flags, const struct dom_sid *sid)
+{
+       if (!(ndr_flags & NDR_SCALARS)) {
+               return NDR_ERR_SUCCESS;
+       }
+       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, sid->num_auths));
+       return ndr_push_dom_sid(ndr, ndr_flags, sid);
+}
+
+/*
+  parse a dom_sid28 - this is a dom_sid in a fixed 28 byte buffer, so we need to ensure there are only upto 5 sub_auth
+*/
+enum ndr_err_code ndr_pull_dom_sid28(struct ndr_pull *ndr, int ndr_flags, struct dom_sid *sid)
+{
+       enum ndr_err_code status;
+       struct ndr_pull *subndr;
+
+       if (!(ndr_flags & NDR_SCALARS)) {
+               return NDR_ERR_SUCCESS;
+       }
+
+       subndr = talloc_zero(ndr, struct ndr_pull);
+       NDR_ERR_HAVE_NO_MEMORY(subndr);
+       subndr->flags           = ndr->flags;
+       subndr->current_mem_ctx = ndr->current_mem_ctx;
+
+       subndr->data            = ndr->data + ndr->offset;
+       subndr->data_size       = 28;
+       subndr->offset          = 0;
+
+       NDR_CHECK(ndr_pull_advance(ndr, 28));
+
+       status = ndr_pull_dom_sid(subndr, ndr_flags, sid);
+       if (!NDR_ERR_CODE_IS_SUCCESS(status)) {
+               /* handle a w2k bug which send random data in the buffer */
+               ZERO_STRUCTP(sid);
+       } else if (sid->num_auths == 0 && sid->sub_auths) {
+               ZERO_STRUCT(sid->sub_auths);
+       }
+
+       return NDR_ERR_SUCCESS;
+}
+
+/*
+  push a dom_sid28 - this is a dom_sid in a 28 byte fixed buffer
+*/
+enum ndr_err_code ndr_push_dom_sid28(struct ndr_push *ndr, int ndr_flags, const struct dom_sid *sid)
+{
+       uint32_t old_offset;
+       uint32_t padding;
+
+       if (!(ndr_flags & NDR_SCALARS)) {
+               return NDR_ERR_SUCCESS;
+       }
+
+       if (sid->num_auths > 5) {
+               return ndr_push_error(ndr, NDR_ERR_RANGE, 
+                                     "dom_sid28 allows only upto 5 sub auth [%u]", 
+                                     sid->num_auths);
+       }
+
+       old_offset = ndr->offset;
+       NDR_CHECK(ndr_push_dom_sid(ndr, ndr_flags, sid));
+
+       padding = 28 - (ndr->offset - old_offset);
+
+       if (padding > 0) {
+               NDR_CHECK(ndr_push_zero(ndr, padding));
+       }
+
+       return NDR_ERR_SUCCESS;
+}
+
+/*
+  parse a dom_sid0 - this is a dom_sid in a variable byte buffer, which is maybe empty
+*/
+enum ndr_err_code ndr_pull_dom_sid0(struct ndr_pull *ndr, int ndr_flags, struct dom_sid *sid)
+{
+       if (!(ndr_flags & NDR_SCALARS)) {
+               return NDR_ERR_SUCCESS;
+       }
+
+       if (ndr->data_size == ndr->offset) {
+               ZERO_STRUCTP(sid);
+               return NDR_ERR_SUCCESS;
+       }
+
+       return ndr_pull_dom_sid(ndr, ndr_flags, sid);
+}
+
+/*
+  push a dom_sid0 - this is a dom_sid in a variable byte buffer, which is maybe empty
+*/
+enum ndr_err_code ndr_push_dom_sid0(struct ndr_push *ndr, int ndr_flags, const struct dom_sid *sid)
+{
+       struct dom_sid zero_sid;
+
+       if (!(ndr_flags & NDR_SCALARS)) {
+               return NDR_ERR_SUCCESS;
+       }
+
+       if (!sid) {
+               return NDR_ERR_SUCCESS;
+       }
+
+       ZERO_STRUCT(zero_sid);
+
+       if (memcmp(&zero_sid, sid, sizeof(zero_sid)) == 0) {
+               return NDR_ERR_SUCCESS;
+       }
+
+       return ndr_push_dom_sid(ndr, ndr_flags, sid);
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_dom_sid(struct ndr_push *ndr, int ndr_flags, const struct dom_sid *r)
+{
+       uint32_t cntr_sub_auths_0;
+       if (ndr_flags & NDR_SCALARS) {
+               NDR_CHECK(ndr_push_align(ndr, 4));
+               NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sid_rev_num));
+               NDR_CHECK(ndr_push_int8(ndr, NDR_SCALARS, r->num_auths));
+               NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->id_auth, 6));
+               for (cntr_sub_auths_0 = 0; cntr_sub_auths_0 < r->num_auths; cntr_sub_auths_0++) {
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sub_auths[cntr_sub_auths_0]));
+               }
+       }
+       return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_dom_sid(struct ndr_pull *ndr, int ndr_flags, struct dom_sid *r)
+{
+       uint32_t cntr_sub_auths_0;
+       if (ndr_flags & NDR_SCALARS) {
+               NDR_CHECK(ndr_pull_align(ndr, 4));
+               NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sid_rev_num));
+               NDR_CHECK(ndr_pull_int8(ndr, NDR_SCALARS, &r->num_auths));
+               if (r->num_auths < 0 || r->num_auths > 15) {
+                       return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
+               }
+               NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->id_auth, 6));
+               for (cntr_sub_auths_0 = 0; cntr_sub_auths_0 < r->num_auths; cntr_sub_auths_0++) {
+                       NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sub_auths[cntr_sub_auths_0]));
+               }
+       }
+       return NDR_ERR_SUCCESS;
+}
index 75960402053b6865dfc545f07527aa42b6c334eb..b9a1ee12c2beb6f05065f98916874cec72e1264e 100755 (executable)
@@ -1,37 +1,56 @@
+#!/bin/sh
 
 case `uname -m` in
-     x86_64)
-       libdir=/usr/lib64/samba
-       ;;
-     *)
-       libdir=/usr/lib/samba
-       ;;
+       x86_64)
+               _libarch=lib64
+               ;;
+       *)
+               _libarch=lib
+               ;;
 esac
 
-CFLAGS="-Wall -g -D_GNU_SOURCE" ./configure \
-        --prefix=/usr \
-        --localstatedir=/var \
-        --with-configdir=/etc/samba \
-        --with-libdir=$libdir \
-        --with-lockdir=/var/lib/samba \
-        --with-logfilebase=/var/log/samba \
-        --with-mandir=/usr/man \
-        --with-piddir=/var/run \
-        --with-privatedir=/etc/samba \
-        --with-sambabook=/usr/share/swat/using_samba \
-        --with-swatdir=/usr/share/swat \
+_libarchdir=/usr/${_libarch}
+
+_prefix=/usr
+_sysconfdir=/etc
+_mandir=/usr/man
+_datadir=/usr/share
+
+# check for ccache
+ccache -h 2>&1 > /dev/null
+if [ $? -eq 0 ]; then
+       CC="ccache gcc"
+else
+       CC="gcc"
+fi
+
+./autogen.sh
+
+CC="$CC" CFLAGS="-Wall -g -D_GNU_SOURCE" ./configure -C \
+       --prefix=${_prefix} \
+       --localstatedir=/var \
+       --with-configdir=${_sysconfdir}/samba \
+       --with-libdir=${_libarchdir}/samba \
+       --with-pammodulesdir=/${_libarch}/security \
+       --with-lockdir=/var/lib/samba \
+       --with-logfilebase=/var/log/samba \
+       --with-mandir=${_mandir} \
+       --with-piddir=/var/run \
+       --with-privatedir=${_sysconfdir}/samba \
+       --with-sambabook=${_datadir}/swat/using_samba \
+       --with-swatdir=${_datadir}/swat \
        --disable-cups \
-        --with-acl-support \
+       --with-acl-support \
        --with-ads \
-        --with-automount \
-        --with-fhs \
+       --with-automount \
+       --with-fhs \
        --with-pam_smbpass \
        --with-libsmbclient \
        --with-libsmbsharemodes \
-        --without-smbwrapper \
+       --without-smbwrapper \
        --with-pam \
        --with-quotas \
-       --with-shared-modules=idmap_rid,idmap_ad,idmap_tdb2 \
+       --with-shared-modules=idmap_rid,idmap_ad,idmap_tdb2,vfs_gpfs \
        --with-syslog \
        --with-utmp \
        --with-cluster-support \
@@ -40,3 +59,6 @@ CFLAGS="-Wall -g -D_GNU_SOURCE" ./configure \
        --without-dnsupdate \
        --with-aio-support \
        $*
+
+make showlayout
+
index 219982fda907b8c310b338012336dc153efdf01f..50fa96c2b11248827c7d496bfad556b8ed54abf8 100755 (executable)
@@ -25,8 +25,6 @@ RPMSRCDIR=`rpm --eval %_sourcedir`
 
 DIRNAME=$(dirname $0)
 TOPDIR=${DIRNAME}/../..
-SRCDIR=${TOPDIR}/source
-VERSION_H=${SRCDIR}/include/version.h
 
 SPECFILE="samba.spec"
 DOCS="docs.tar.bz2"
@@ -49,25 +47,14 @@ esac
 ##
 ## determine the samba version and create the SPEC file
 ##
-pushd ${SRCDIR}
-./script/mkversion.sh
-popd
-if [ ! -f ${VERSION_H} ] ; then
-       echo "Error creating version.h"
-       exit 1
+${DIRNAME}/makespec.sh
+RC=$?
+if [ $RC -ne 0 ]; then
+       exit ${RC}
 fi
 
-VERSION=`grep SAMBA_VERSION_OFFICIAL_STRING ${VERSION_H} | awk '{print $3}'`
-vendor_version=`grep SAMBA_VERSION_VENDOR_SUFFIX ${VERSION_H} | awk '{print $3}'`
-if test "x${vendor_version}"  != "x" ; then
-       VERSION="${VERSION}-${vendor_version}"
-fi
-VERSION=`echo ${VERSION} | sed 's/-/_/g'`
-VERSION=`echo ${VERSION} | sed 's/\"//g'`
-echo "VERSION: ${VERSION}"
-sed -e s/PVERSION/${VERSION}/g \
-       < ${DIRNAME}/${SPECFILE}.tmpl \
-       > ${DIRNAME}/${SPECFILE}
+RELEASE=$(grep ^Release ${DIRNAME}/${SPECFILE} | sed -e 's/^Release:\ \+//')
+VERSION=$(grep ^Version ${DIRNAME}/${SPECFILE} | sed -e 's/^Version:\ \+//')
 
 ##
 ## create the tarball
diff --git a/packaging/RHEL-CTDB/makespec.sh b/packaging/RHEL-CTDB/makespec.sh
new file mode 100755 (executable)
index 0000000..7d10d55
--- /dev/null
@@ -0,0 +1,36 @@
+#!/bin/sh
+#
+# Copyright (C) Michael Adam 2008
+#
+# Script to determine the samba version and create the SPEC file from template
+
+DIRNAME=$(dirname $0)
+TOPDIR=${DIRNAME}/../..
+SRCDIR=${TOPDIR}/source
+VERSION_H=${SRCDIR}/include/version.h
+SPECFILE=${DIRNAME}/samba.spec
+
+##
+## determine the samba version and create the SPEC file
+##
+pushd ${SRCDIR}
+./script/mkversion.sh
+popd
+if [ ! -f ${VERSION_H} ] ; then
+       echo "Error creating version.h"
+       exit 1
+fi
+
+VERSION=`grep SAMBA_VERSION_OFFICIAL_STRING ${VERSION_H} | awk '{print $3}'`
+vendor_version=`grep SAMBA_VERSION_VENDOR_SUFFIX ${VERSION_H} | awk '{print
+$3}'`
+if test "x${vendor_version}"  != "x" ; then
+       VERSION="${VERSION}-${vendor_version}"
+fi
+VERSION=`echo ${VERSION} | sed 's/-/_/g'`
+VERSION=`echo ${VERSION} | sed 's/\"//g'`
+echo "VERSION: ${VERSION}"
+sed -e s/PVERSION/${VERSION}/g \
+       < ${SPECFILE}.tmpl \
+       > ${SPECFILE}
+
index b34f01f6598a01b9b9a13c229f6b0c8d52eb22dc..8a583a9bde49d86ec80deb0bb1277659a8b5df8a 100644 (file)
@@ -133,12 +133,11 @@ cd source
 # RPM_OPT_FLAGS="$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64"
 
 ## check for ccache
-# ccache -h 2>&1 > /dev/null
-#if [ $? -eq 0 ]; then
-#      CC="ccache gcc"
-#else
+if ccache -h >/dev/null 2>&1 ; then
+       CC="ccache gcc"
+else
        CC="gcc"
-#fi 
+fi
 
 ## always run autogen.sh
 ./autogen.sh
@@ -149,6 +148,7 @@ CFLAGS="$RPM_OPT_FLAGS $EXTRA -D_GNU_SOURCE" ./configure \
         --with-configdir=%{_sysconfdir}/samba \
         --libdir=%{_libarchdir} \
        --with-modulesdir=%{_libarchdir}/samba \
+       --with-pammodulesdir=%{_libarch}/security \
         --with-lockdir=/var/lib/samba \
         --with-logfilebase=/var/log/samba \
         --with-mandir=%{_mandir} \
@@ -167,7 +167,7 @@ CFLAGS="$RPM_OPT_FLAGS $EXTRA -D_GNU_SOURCE" ./configure \
         --without-smbwrapper \
        --with-pam \
        --with-quotas \
-       --with-shared-modules=idmap_rid,idmap_ad,idmap_tdb2 \
+       --with-shared-modules=idmap_rid,idmap_ad,idmap_tdb2,vfs_gpfs \
        --with-syslog \
        --with-utmp \
        --with-cluster-support \
@@ -230,8 +230,7 @@ make DESTDIR=$RPM_BUILD_ROOT \
         install
 cd ..
 
-# NSS & PAM winbind support
-install -m 755 source/bin/pam_winbind.so $RPM_BUILD_ROOT/%{_libarch}/security/pam_winbind.so
+# NSS winbind support
 install -m 755 source/nsswitch/libnss_winbind.so $RPM_BUILD_ROOT/%{_libarch}/libnss_winbind.so.2
 ( cd $RPM_BUILD_ROOT/%{_libarch};
   ln -sf libnss_winbind.so.2  libnss_winbind.so )
@@ -242,8 +241,6 @@ install -m 755 source/nsswitch/libnss_winbind.so $RPM_BUILD_ROOT/%{_libarch}/lib
 #install -m 755 source/nsswitch/libnss_wins.so $RPM_BUILD_ROOT/%{_libarch}/libnss_wins.so
 # ( cd $RPM_BUILD_ROOT/%{_libarch}; ln -sf libnss_wins.so  libnss_wins.so.2 )
 
-# Install pam_smbpass.so
-install -m755 source/bin/pam_smbpass.so $RPM_BUILD_ROOT/%{_libarch}/security/pam_smbpass.so
 
 ## cleanup
 /bin/rm -rf $RPM_BUILD_ROOT/usr/lib*/samba/security
@@ -419,6 +416,8 @@ exit 0
 /sbin/mount.cifs
 /sbin/umount.cifs
 
+%{_sbindir}/cifs.upcall
+
 %{_bindir}/rpcclient
 %{_bindir}/smbcacls
 %{_bindir}/findsmb
@@ -432,6 +431,7 @@ exit 0
 
 %{_mandir}/man8/mount.cifs.8.*
 %{_mandir}/man8/umount.cifs.8.*
+%{_mandir}/man8/cifs.upcall.8*
 %{_mandir}/man8/smbspool.8*
 %{_mandir}/man1/smbget.1*
 %{_mandir}/man5/smbgetrc.5*
@@ -512,7 +512,6 @@ exit 0
 %{_mandir}/man1/ldbedit.1*
 %{_mandir}/man1/ldbmodify.1*
 %{_mandir}/man1/ldbsearch.1*
-%{_mandir}/man8/cifs.upcall.8*
 
 %ifarch i386 i486 i586 i686 ppc s390
 %files winbind-32bit
index 75190211441e5c0db0840baa1361a21c9b1b031e..1b49c439c43bd3fdc4b679c0838d4bd832000949 100644 (file)
@@ -44,7 +44,6 @@ my %supported_properties = (
        "nopush"                => ["FUNCTION", "TYPEDEF"],
        "nopull"                => ["FUNCTION", "TYPEDEF"],
        "noprint"               => ["FUNCTION", "TYPEDEF"],
-       "noejs"                 => ["FUNCTION", "TYPEDEF"],
 
        # union
        "switch_is"             => ["ELEMENT"],
index 9b61a370e219efb1ebabfb4a9abbaec7c6fcc141..5ee26d16b68c76f611c4fedc832aab5671f513e1 100644 (file)
@@ -855,6 +855,7 @@ my %property_list = (
        "endpoint"              => ["INTERFACE"],
        "pointer_default"       => ["INTERFACE"],
        "helper"                => ["INTERFACE"],
+       "pyhelper"              => ["INTERFACE"],
        "authservice"           => ["INTERFACE"],
        "restricted"    => ["INTERFACE"],
 
@@ -890,7 +891,6 @@ my %property_list = (
        "nopull"                => ["FUNCTION", "TYPEDEF", "STRUCT", "UNION", "ENUM", "BITMAP"],
        "nosize"                => ["FUNCTION", "TYPEDEF", "STRUCT", "UNION", "ENUM", "BITMAP"],
        "noprint"               => ["FUNCTION", "TYPEDEF", "STRUCT", "UNION", "ENUM", "BITMAP", "ELEMENT"],
-       "noejs"                 => ["FUNCTION", "TYPEDEF", "STRUCT", "UNION", "ENUM", "BITMAP"],
        "todo"                  => ["FUNCTION"],
 
        # union
index d42e01cdb0424cc51d413fcfa496a934ae534d4e..5bdb91ee2519776433e64227da689ae25697846c 100644 (file)
@@ -7,7 +7,7 @@ package Parse::Pidl::Samba4;
 
 require Exporter;
 @ISA = qw(Exporter);
-@EXPORT = qw(is_intree choose_header NumStars ElementStars ArrayBrackets DeclLong);
+@EXPORT = qw(is_intree choose_header NumStars ElementStars ArrayBrackets DeclLong ArrayDynamicallyAllocated);
 
 use Parse::Pidl::Util qw(has_property is_constant);
 use Parse::Pidl::NDR qw(GetNextLevel);
@@ -36,6 +36,14 @@ sub choose_header($$)
        return "#include <$out>";
 }
 
+sub ArrayDynamicallyAllocated($$)
+{
+       my ($e, $l) = @_;
+       die("Not an array") unless ($l->{TYPE} eq "ARRAY");
+       return 0 if ($l->{IS_FIXED} and not has_property($e, "charset"));
+       return 1;
+}
+
 sub NumStars($;$)
 {
        my ($e, $d) = @_;
@@ -57,7 +65,7 @@ sub NumStars($;$)
 
        foreach my $l (@{$e->{LEVELS}}) {
                next unless ($l->{TYPE} eq "ARRAY");
-               next if ($l->{IS_FIXED}) and not has_property($e, "charset");
+               next unless (ArrayDynamicallyAllocated($e, $l));
                $n++;
        }
 
@@ -87,7 +95,7 @@ sub ArrayBrackets($)
 
        foreach my $l (@{$e->{LEVELS}}) {
                next unless ($l->{TYPE} eq "ARRAY");
-               next unless ($l->{IS_FIXED}) and not has_property($e, "charset");
+               next if ArrayDynamicallyAllocated($e, $l);
                $res .= "[$l->{SIZE_IS}]";
        }
 
diff --git a/pidl/lib/Parse/Pidl/Samba4/EJS.pm b/pidl/lib/Parse/Pidl/Samba4/EJS.pm
deleted file mode 100644 (file)
index efb3f28..0000000
+++ /dev/null
@@ -1,874 +0,0 @@
-###################################################
-# EJS function wrapper generator
-# Copyright jelmer@samba.org 2005
-# Copyright Andrew Tridgell 2005
-# released under the GNU GPL
-
-package Parse::Pidl::Samba4::EJS;
-
-use Exporter;
-@ISA = qw(Exporter);
-@EXPORT_OK = qw(check_null_pointer fn_declare TypeFunctionName);
-
-use strict;
-use Parse::Pidl::Typelist qw(typeHasBody);
-use Parse::Pidl::CUtil qw(get_pointer_to get_value_of);
-use Parse::Pidl::Util qw(has_property ParseExpr);
-use Parse::Pidl::NDR qw(GetPrevLevel GetNextLevel);
-use Parse::Pidl::Samba4::Header qw(GenerateStructEnv GenerateFunctionInEnv
-                                        GenerateFunctionOutEnv);
-
-use vars qw($VERSION);
-$VERSION = '0.01';
-
-sub new($) {
-       my ($class) = @_;
-       my $self = { res => "", res_hdr => "", tabs => "", constants => {}};
-       bless($self, $class);
-}
-
-sub pidl_hdr ($$)
-{
-       my $self = shift;
-       $self->{res_hdr} .= shift;
-}
-
-sub pidl($$)
-{
-       my ($self, $d) = @_;
-       if ($d) {
-               $self->{res} .= $self->{tabs};
-               $self->{res} .= $d;
-       }
-       $self->{res} .= "\n";
-}
-
-sub indent($)
-{
-       my ($self) = @_;
-       $self->{tabs} .= "\t";
-}
-
-sub deindent($)
-{
-       my ($self) = @_;
-       $self->{tabs} = substr($self->{tabs}, 0, -1);
-}
-
-#####################################################################
-# check that a variable we get from ParseExpr isn't a null pointer
-sub check_null_pointer($$)
-{
-       my ($self, $size) = @_;
-       if ($size =~ /^\*/) {
-               my $size2 = substr($size, 1);
-               $self->pidl("if ($size2 == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;");
-       }
-}
-
-#####################################################################
-# work out is a parse function should be declared static or not
-sub fn_declare($$$)
-{
-       my ($self,$fn,$decl) = @_;
-
-       if (has_property($fn, "public")) {
-               $self->pidl_hdr("$decl;\n");
-               $self->pidl("_PUBLIC_ $decl");
-       } else {
-               $self->pidl("static $decl");
-       }
-}
-
-###########################
-# pull a scalar element
-sub EjsPullScalar($$$$$$$)
-{
-       my ($self, $e, $l, $var, $name, $env) = @_;
-
-       return if (has_property($e, "value"));
-
-       if (ref($e->{TYPE}) eq "HASH" and not defined($e->{TYPE}->{NAME})) {
-               $self->EjsTypePull($e->{TYPE}, $var);
-       } else {
-               my $pl = Parse::Pidl::NDR::GetPrevLevel($e, $l);
-        $var = get_pointer_to($var);
-        # have to handle strings specially :(
-               if (Parse::Pidl::Typelist::scalar_is_reference($e->{TYPE})
-                       and (defined($pl) and $pl->{TYPE} eq "POINTER")) {
-                $var = get_pointer_to($var);
-        }
-
-       my $t;
-               if (ref($e->{TYPE}) eq "HASH") {
-                       $t = "$e->{TYPE}->{TYPE}_$e->{TYPE}->{NAME}";
-               } else {
-                       $t = $e->{TYPE};
-               }
-               $self->pidl("EJS_CHECK(ejs_pull_$t(ejs, v, $name, $var));");
-       }
-}
-
-###########################
-# pull a pointer element
-sub EjsPullPointer($$$$$$)
-{
-       my ($self, $e, $l, $var, $name, $env) = @_;
-       $self->pidl("if (ejs_pull_null(ejs, v, $name)) {");
-       $self->indent;
-       if ($l->{POINTER_TYPE} eq "ref") {
-               $self->pidl("return NT_STATUS_INVALID_PARAMETER_MIX;");
-       } else {
-               $self->pidl("$var = NULL;");
-       }
-       $self->deindent;
-       $self->pidl("} else {");
-       $self->indent;
-       $self->pidl("EJS_ALLOC(ejs, $var);");
-       $var = get_value_of($var);              
-       $self->EjsPullElement($e, GetNextLevel($e, $l), $var, $name, $env);
-       $self->deindent;
-       $self->pidl("}");
-}
-
-###########################
-# pull a string element
-sub EjsPullString($$$$$$)
-{
-       my ($self, $e, $l, $var, $name, $env) = @_;
-       my $pl = GetPrevLevel($e, $l);
-       $var = get_pointer_to($var);
-       if (defined($pl) and $pl->{TYPE} eq "POINTER") {
-               $var = get_pointer_to($var);
-       }
-       $self->pidl("EJS_CHECK(ejs_pull_string(ejs, v, $name, $var));");
-}
-
-###########################
-# pull an array element
-sub EjsPullArray($$$$$$)
-{
-       my ($self, $e, $l, $var, $name, $env) = @_;
-       my $nl = GetNextLevel($e, $l);
-       my $length = ParseExpr($l->{LENGTH_IS}, $env, $e);
-       my $size = ParseExpr($l->{SIZE_IS}, $env, $e);
-       my $pl = GetPrevLevel($e, $l);
-       if ($pl && $pl->{TYPE} eq "POINTER") {
-               $var = get_pointer_to($var);
-       }
-       # uint8 arrays are treated as data blobs
-       if ($nl->{TYPE} eq 'DATA' && $e->{TYPE} eq 'uint8') {
-               if (!$l->{IS_FIXED}) {
-                       $self->check_null_pointer($size);
-                       $self->pidl("EJS_ALLOC_N(ejs, $var, $size);");
-               }
-               $self->check_null_pointer($length);
-               $self->pidl("ejs_pull_array_uint8(ejs, v, $name, $var, $length);");
-               return;
-       }
-       my $avar = $var . "[i]";
-       $self->pidl("{");
-       $self->indent;
-       $self->pidl("uint32_t i;");
-       if (!$l->{IS_FIXED}) {
-               $self->pidl("EJS_ALLOC_N(ejs, $var, $size);");
-       }
-       $self->pidl("for (i=0;i<$length;i++) {");
-       $self->indent;
-       $self->pidl("char *id = talloc_asprintf(ejs, \"%s.%u\", $name, i);");
-       $self->EjsPullElement($e, $nl, $avar, "id", $env);
-       $self->pidl("talloc_free(id);");
-       $self->deindent;
-       $self->pidl("}");
-       $self->pidl("ejs_push_uint32(ejs, v, $name \".length\", &i);");
-       $self->deindent;
-       $self->pidl("}");
-}
-
-###########################
-# pull a switch element
-sub EjsPullSwitch($$$$$$)
-{
-       my ($self, $e, $l, $var, $name, $env) = @_;
-       my $switch_var = ParseExpr($l->{SWITCH_IS}, $env, $e);
-       $self->pidl("ejs_set_switch(ejs, $switch_var);");
-       $self->EjsPullElement($e, GetNextLevel($e, $l), $var, $name, $env);
-}
-
-###########################
-# pull a structure element
-sub EjsPullElement($$$$$$)
-{
-       my ($self, $e, $l, $var, $name, $env) = @_;
-       if (($l->{TYPE} eq "POINTER")) {
-               $self->EjsPullPointer($e, $l, $var, $name, $env);
-       } elsif (has_property($e, "charset")) {
-               $self->EjsPullString($e, $l, $var, $name, $env);
-       } elsif ($l->{TYPE} eq "ARRAY") {
-               $self->EjsPullArray($e, $l, $var, $name, $env);
-       } elsif ($l->{TYPE} eq "DATA") {
-               $self->EjsPullScalar($e, $l, $var, $name, $env);
-       } elsif (($l->{TYPE} eq "SWITCH")) {
-               $self->EjsPullSwitch($e, $l, $var, $name, $env);
-       } else {
-               $self->pidl("return ejs_panic(ejs, \"unhandled pull type $l->{TYPE}\");");
-       }
-}
-
-#############################################
-# pull a structure/union element at top level
-sub EjsPullElementTop($$$)
-{
-       my ($self, $e, $env) = @_;
-       my $l = $e->{LEVELS}[0];
-       my $var = ParseExpr($e->{NAME}, $env, $e);
-       my $name = "\"$e->{NAME}\"";
-       $self->EjsPullElement($e, $l, $var, $name, $env);
-}
-
-###########################
-# pull a struct
-sub EjsStructPull($$$)
-{
-       my ($self, $d, $varname) = @_;
-       my $env = GenerateStructEnv($d, $varname);
-       $self->pidl("EJS_CHECK(ejs_pull_struct_start(ejs, &v, name));");
-    foreach my $e (@{$d->{ELEMENTS}}) {
-               $self->EjsPullElementTop($e, $env);
-       }
-}
-
-###########################
-# pull a union
-sub EjsUnionPull($$$)
-{
-       my ($self, $d, $varname) = @_;
-       my $have_default = 0;
-       $self->pidl("EJS_CHECK(ejs_pull_struct_start(ejs, &v, name));");
-       $self->pidl("switch (ejs->switch_var) {");
-       $self->indent;
-       foreach my $e (@{$d->{ELEMENTS}}) {
-               if ($e->{CASE} eq "default") {
-                       $have_default = 1;
-               }
-               $self->pidl("$e->{CASE}:");
-               $self->indent;
-               if ($e->{TYPE} ne "EMPTY") {
-                       $self->EjsPullElementTop($e, { $e->{NAME} => "$varname->$e->{NAME}"});
-               }
-               $self->pidl("break;");
-               $self->deindent;
-       }
-       if (! $have_default) {
-               $self->pidl("default:");
-               $self->indent;
-               $self->pidl("return ejs_panic(ejs, \"Bad switch value\");");
-               $self->deindent;
-       }
-       $self->deindent;
-       $self->pidl("}");
-}
-
-##############################################
-# put the enum elements in the constants array
-sub EjsEnumConstant($$)
-{
-       my ($self, $d) = @_;
-       return unless (defined($d->{ELEMENTS}));
-       my $v = 0;
-       foreach my $e (@{$d->{ELEMENTS}}) {
-               my $el = $e;
-               chomp $el;
-               if ($el =~ /^(.*)=\s*(.*)\s*$/) {
-                       $el = $1;
-                       $v = $2;
-               }
-               $self->{constants}->{$el} = $v;
-               $v++;
-       }
-}
-
-###########################
-# pull a enum
-sub EjsEnumPull($$$)
-{
-       my ($self, $d, $varname) = @_;
-       $self->EjsEnumConstant($d);
-       $self->pidl("unsigned e;");
-       $self->pidl("EJS_CHECK(ejs_pull_enum(ejs, v, name, &e));");
-       $self->pidl("*$varname = e;");
-}
-
-###########################
-# pull a bitmap
-sub EjsBitmapPull($$$)
-{
-       my ($self, $d, $varname) = @_;
-       my $type_fn = $d->{BASE_TYPE};
-       $self->pidl("EJS_CHECK(ejs_pull_$type_fn(ejs, v, name, $varname));");
-}
-
-sub EjsTypePullFunction($$$)
-{
-       sub EjsTypePullFunction($$$);
-       my ($self, $d, $name) = @_;
-       return if (has_property($d, "noejs"));
-
-       if ($d->{TYPE} eq "TYPEDEF") {
-               $self->EjsTypePullFunction($d->{DATA}, $name);
-               return;
-       }
-
-       if ($d->{TYPE} eq "STRUCT") {
-               $self->fn_declare($d, "NTSTATUS ejs_pull_$name(struct ejs_rpc *ejs, struct MprVar *v, const char *name, struct $name *r)");
-       } elsif ($d->{TYPE} eq "UNION") {
-               $self->fn_declare($d, "NTSTATUS ejs_pull_$name(struct ejs_rpc *ejs, struct MprVar *v, const char *name, union $name *r)");
-       } elsif ($d->{TYPE} eq "ENUM") {
-               $self->fn_declare($d, "NTSTATUS ejs_pull_$name(struct ejs_rpc *ejs, struct MprVar *v, const char *name, enum $name *r)");
-       } elsif ($d->{TYPE} eq "BITMAP") {
-               my($type_decl) = Parse::Pidl::Typelist::mapTypeName($d->{BASE_TYPE});
-               $self->fn_declare($d, "NTSTATUS ejs_pull_$name(struct ejs_rpc *ejs, struct MprVar *v, const char *name, $type_decl *r)");
-       }
-       $self->pidl("{");
-       $self->indent;
-
-       $self->EjsTypePull($d, "r");
-
-       $self->pidl("return NT_STATUS_OK;");
-       $self->deindent;
-       $self->pidl("}\n");
-}
-
-sub EjsTypePull($$$)
-{
-       my ($self, $d, $varname) = @_;
-       if ($d->{TYPE} eq 'STRUCT') {
-               $self->EjsStructPull($d, $varname);
-       } elsif ($d->{TYPE} eq 'UNION') {
-               $self->EjsUnionPull($d, $varname);
-       } elsif ($d->{TYPE} eq 'ENUM') {
-               $self->EjsEnumPull($d, $varname);
-       } elsif ($d->{TYPE} eq 'BITMAP') {
-               $self->EjsBitmapPull($d, $varname);
-       } else {
-               warn "Unhandled pull $varname of type $d->{TYPE}";
-       }
-}
-
-#####################
-# generate a function
-sub EjsPullFunction($$)
-{
-       my ($self, $d) = @_;
-       my $env = GenerateFunctionInEnv($d);
-       my $name = $d->{NAME};
-
-       $self->pidl("\nstatic NTSTATUS ejs_pull_$name(struct ejs_rpc *ejs, struct MprVar *v, struct $name *r)");
-       $self->pidl("{");
-       $self->indent;
-       $self->pidl("EJS_CHECK(ejs_pull_struct_start(ejs, &v, \"input\"));");
-
-       # we pull non-array elements before array elements as arrays
-       # may have length_is() or size_is() properties that depend
-       # on the non-array elements
-       foreach my $e (@{$d->{ELEMENTS}}) {
-               next unless (grep(/in/, @{$e->{DIRECTION}}));
-               next if (has_property($e, "length_is") || has_property($e, "size_is"));
-               $self->EjsPullElementTop($e, $env);
-       }
-
-       foreach my $e (@{$d->{ELEMENTS}}) {
-               next unless (grep(/in/, @{$e->{DIRECTION}}));
-               next unless (has_property($e, "length_is") || has_property($e, "size_is"));
-               $self->EjsPullElementTop($e, $env);
-       }
-
-       $self->pidl("return NT_STATUS_OK;");
-       $self->deindent;
-       $self->pidl("}\n");
-}
-
-###########################
-# push a scalar element
-sub EjsPushScalar($$$$$$)
-{
-       my ($self, $e, $l, $var, $name, $env) = @_;
-
-       if (ref($e->{TYPE}) eq "HASH" and not defined($e->{TYPE}->{NAME})) {
-               $self->EjsTypePush($e->{TYPE}, get_pointer_to($var));
-       } else {
-    # have to handle strings specially :(
-        my $pl = GetPrevLevel($e, $l);
-
-               if ((not Parse::Pidl::Typelist::scalar_is_reference($e->{TYPE}))
-                       or (defined($pl) and $pl->{TYPE} eq "POINTER")) {
-                                       $var = get_pointer_to($var);
-                       }
-
-               $self->pidl("EJS_CHECK(".TypeFunctionName("ejs_push", $e->{TYPE})."(ejs, v, $name, $var));");
-       }
-}
-
-###########################
-# push a string element
-sub EjsPushString($$$$$$)
-{
-       my ($self, $e, $l, $var, $name, $env) = @_;
-       my $pl = GetPrevLevel($e, $l);
-       if (defined($pl) and $pl->{TYPE} eq "POINTER") {
-               $var = get_pointer_to($var);
-       }
-       $self->pidl("EJS_CHECK(ejs_push_string(ejs, v, $name, $var));");
-}
-
-###########################
-# push a pointer element
-sub EjsPushPointer($$$$$$)
-{
-       my ($self, $e, $l, $var, $name, $env) = @_;
-       $self->pidl("if (NULL == $var) {");
-       $self->indent;
-       if ($l->{POINTER_TYPE} eq "ref") {
-               $self->pidl("return NT_STATUS_INVALID_PARAMETER_MIX;");
-       } else {
-               $self->pidl("EJS_CHECK(ejs_push_null(ejs, v, $name));");
-       }
-       $self->deindent;
-       $self->pidl("} else {");
-       $self->indent;
-       $var = get_value_of($var);              
-       $self->EjsPushElement($e, GetNextLevel($e, $l), $var, $name, $env);
-       $self->deindent;
-       $self->pidl("}");
-}
-
-###########################
-# push a switch element
-sub EjsPushSwitch($$$$$$)
-{
-       my ($self, $e, $l, $var, $name, $env) = @_;
-       my $switch_var = ParseExpr($l->{SWITCH_IS}, $env, $e);
-       $self->pidl("ejs_set_switch(ejs, $switch_var);");
-       $self->EjsPushElement($e, GetNextLevel($e, $l), $var, $name, $env);
-}
-
-###########################
-# push an array element
-sub EjsPushArray($$$$$$)
-{
-       my ($self, $e, $l, $var, $name, $env) = @_;
-       my $nl = GetNextLevel($e, $l);
-       my $length = ParseExpr($l->{LENGTH_IS}, $env, $e);
-       my $pl = GetPrevLevel($e, $l);
-       if ($pl && $pl->{TYPE} eq "POINTER") {
-               $var = get_pointer_to($var);
-       }
-       # uint8 arrays are treated as data blobs
-       if ($nl->{TYPE} eq 'DATA' && $e->{TYPE} eq 'uint8') {
-               $self->check_null_pointer($length);
-               $self->pidl("ejs_push_array_uint8(ejs, v, $name, $var, $length);");
-               return;
-       }
-       my $avar = $var . "[i]";
-       $self->pidl("{");
-       $self->indent;
-       $self->pidl("uint32_t i;");
-       $self->pidl("for (i=0;i<$length;i++) {");
-       $self->indent;
-       $self->pidl("const char *id = talloc_asprintf(ejs, \"%s.%u\", $name, i);");
-       $self->EjsPushElement($e, $nl, $avar, "id", $env);
-       $self->deindent;
-       $self->pidl("}");
-       $self->pidl("ejs_push_uint32(ejs, v, $name \".length\", &i);");
-       $self->deindent;
-       $self->pidl("}");
-}
-
-################################
-# push a structure/union element
-sub EjsPushElement($$$$$$)
-{
-       my ($self, $e, $l, $var, $name, $env) = @_;
-       if (($l->{TYPE} eq "POINTER")) {
-               $self->EjsPushPointer($e, $l, $var, $name, $env);
-       } elsif (has_property($e, "charset")) {
-               $self->EjsPushString($e, $l, $var, $name, $env);
-       } elsif ($l->{TYPE} eq "ARRAY") {
-               $self->EjsPushArray($e, $l, $var, $name, $env);
-       } elsif ($l->{TYPE} eq "DATA") {
-               $self->EjsPushScalar($e, $l, $var, $name, $env);
-       } elsif (($l->{TYPE} eq "SWITCH")) {
-               $self->EjsPushSwitch($e, $l, $var, $name, $env);
-       } else {
-               $self->pidl("return ejs_panic(ejs, \"unhandled push type $l->{TYPE}\");");
-       }
-}
-
-#############################################
-# push a structure/union element at top level
-sub EjsPushElementTop($$$)
-{
-       my ($self, $e, $env) = @_;
-       my $l = $e->{LEVELS}[0];
-       my $var = ParseExpr($e->{NAME}, $env, $e);
-       my $name = "\"$e->{NAME}\"";
-       $self->EjsPushElement($e, $l, $var, $name, $env);
-}
-
-###########################
-# push a struct
-sub EjsStructPush($$$)
-{
-       my ($self, $d, $varname) = @_;
-       my $env = GenerateStructEnv($d, $varname);
-       $self->pidl("EJS_CHECK(ejs_push_struct_start(ejs, &v, name));");
-        foreach my $e (@{$d->{ELEMENTS}}) {
-               $self->EjsPushElementTop($e, $env);
-       }
-}
-
-###########################
-# push a union
-sub EjsUnionPush($$$)
-{
-       my ($self, $d, $varname) = @_;
-       my $have_default = 0;
-       $self->pidl("EJS_CHECK(ejs_push_struct_start(ejs, &v, name));");
-       $self->pidl("switch (ejs->switch_var) {");
-       $self->indent;
-       foreach my $e (@{$d->{ELEMENTS}}) {
-               if ($e->{CASE} eq "default") {
-                       $have_default = 1;
-               }
-               $self->pidl("$e->{CASE}:");
-               $self->indent;
-               if ($e->{TYPE} ne "EMPTY") {
-                       $self->EjsPushElementTop($e, { $e->{NAME} => "$varname->$e->{NAME}"} );
-               }
-               $self->pidl("break;");
-               $self->deindent;
-       }
-       if (! $have_default) {
-               $self->pidl("default:");
-               $self->indent;
-               $self->pidl("return ejs_panic(ejs, \"Bad switch value\");");
-               $self->deindent;
-       }
-       $self->deindent;
-       $self->pidl("}");
-}
-
-###########################
-# push a enum
-sub EjsEnumPush($$$)
-{
-       my ($self, $d, $varname) = @_;
-       $self->EjsEnumConstant($d);
-       $self->pidl("unsigned e = ".get_value_of($varname).";");
-       $self->pidl("EJS_CHECK(ejs_push_enum(ejs, v, name, &e));");
-}
-
-###########################
-# push a bitmap
-sub EjsBitmapPush($$$)
-{
-       my ($self, $d, $varname) = @_;
-       return unless (defined($d->{ELEMENTS}));
-       my $type_fn = $d->{BASE_TYPE};
-       # put the bitmap elements in the constants array
-       foreach my $e (@{$d->{ELEMENTS}}) {
-               if ($e =~ /^(\w*)\s*(.*)\s*$/) {
-                       my $bname = $1;
-                       my $v = $2;
-                       $self->{constants}->{$bname} = $v;
-               }
-       }
-       $self->pidl("EJS_CHECK(ejs_push_$type_fn(ejs, v, name, $varname));");
-}
-
-sub EjsTypePushFunction($$$)
-{
-       sub EjsTypePushFunction($$$);
-       my ($self, $d, $name) = @_;
-       return if (has_property($d, "noejs"));
-
-       my $var = undef;
-       my $dt = $d;
-       if ($dt->{TYPE} eq "TYPEDEF") {
-               $dt = $dt->{DATA};
-       }
-       if ($dt->{TYPE} eq "STRUCT") {
-               $var = "const struct $name *r";
-       } elsif ($dt->{TYPE} eq "UNION") {
-               $var = "const union $name *r";
-       } elsif ($dt->{TYPE} eq "ENUM") {
-               $var = "const enum $name *r";
-       } elsif ($dt->{TYPE} eq "BITMAP") {
-               my($type_decl) = Parse::Pidl::Typelist::mapTypeName($dt->{BASE_TYPE});
-               $var = "const $type_decl *r";
-       }
-       $self->fn_declare($d, "NTSTATUS ".TypeFunctionName("ejs_push", $d) . "(struct ejs_rpc *ejs, struct MprVar *v, const char *name, $var)");
-       $self->pidl("{");
-       $self->indent;
-       $self->EjsTypePush($d, "r");
-       $self->pidl("return NT_STATUS_OK;");
-       $self->deindent;
-       $self->pidl("}\n");
-}
-
-sub EjsTypePush($$$)
-{
-       sub EjsTypePush($$$);
-       my ($self, $d, $varname) = @_;
-
-       if ($d->{TYPE} eq 'STRUCT') {
-               $self->EjsStructPush($d, $varname);
-       } elsif ($d->{TYPE} eq 'UNION') {
-               $self->EjsUnionPush($d, $varname);
-       } elsif ($d->{TYPE} eq 'ENUM') {
-               $self->EjsEnumPush($d, $varname);
-       } elsif ($d->{TYPE} eq 'BITMAP') {
-               $self->EjsBitmapPush($d, $varname);
-       } elsif ($d->{TYPE} eq 'TYPEDEF') {
-               $self->EjsTypePush($d->{DATA}, $varname);
-       } else {
-               warn "Unhandled push $varname of type $d->{TYPE}";
-       }
-}
-
-#####################
-# generate a function
-sub EjsPushFunction($$)
-{
-       my ($self, $d) = @_;
-       my $env = GenerateFunctionOutEnv($d);
-
-       $self->pidl("\nstatic NTSTATUS ejs_push_$d->{NAME}(struct ejs_rpc *ejs, struct MprVar *v, const struct $d->{NAME} *r)");
-       $self->pidl("{");
-       $self->indent;
-       $self->pidl("EJS_CHECK(ejs_push_struct_start(ejs, &v, \"output\"));");
-
-       foreach my $e (@{$d->{ELEMENTS}}) {
-               next unless (grep(/out/, @{$e->{DIRECTION}}));
-               $self->EjsPushElementTop($e, $env);
-       }
-
-       if ($d->{RETURN_TYPE}) {
-               $self->pidl("EJS_CHECK(".TypeFunctionName("ejs_push", $d->{RETURN_TYPE})."(ejs, v, \"result\", &r->out.result));");
-       }
-
-       $self->pidl("return NT_STATUS_OK;");
-       $self->deindent;
-       $self->pidl("}\n");
-}
-
-#################################
-# generate a ejs mapping function
-sub EjsFunction($$$)
-{
-       my ($self, $d, $iface) = @_;
-       my $name = $d->{NAME};
-       my $callnum = uc("NDR_$name");
-       my $table = "&ndr_table_$iface";
-
-       $self->pidl("static int ejs_$name(int eid, int argc, struct MprVar **argv)");
-       $self->pidl("{");
-       $self->indent;
-       $self->pidl("return ejs_rpc_call(eid, argc, argv, $table, $callnum, (ejs_pull_function_t)ejs_pull_$name, (ejs_push_function_t)ejs_push_$name);");
-       $self->deindent;
-       $self->pidl("}\n");
-}
-
-###################
-# handle a constant
-sub EjsConst($$)
-{
-    my ($self, $const) = @_;
-    $self->{constants}->{$const->{NAME}} = $const->{VALUE};
-}
-
-sub EjsImport
-{
-       my $self = shift;
-       my @imports = @_;
-       foreach (@imports) {
-               s/\.idl\"$//;
-               s/^\"//;
-               $self->pidl_hdr("#include \"librpc/gen_ndr/ndr_$_\_ejs\.h\"\n");
-       }
-}
-
-#####################################################################
-# parse the interface definitions
-sub EjsInterface($$$)
-{
-       my($self,$interface,$needed) = @_;
-       my @fns = ();
-       my $name = $interface->{NAME};
-
-       $self->pidl_hdr("#ifndef _HEADER_EJS_$interface->{NAME}\n");
-       $self->pidl_hdr("#define _HEADER_EJS_$interface->{NAME}\n\n");
-
-       $self->pidl_hdr("\n");
-
-       foreach my $d (@{$interface->{TYPES}}) {
-               next unless (typeHasBody($d));
-               ($needed->{TypeFunctionName("ejs_push", $d)}) && $self->EjsTypePushFunction($d, $d->{NAME});
-               ($needed->{TypeFunctionName("ejs_pull", $d)}) && $self->EjsTypePullFunction($d, $d->{NAME});
-       }
-
-       foreach my $d (@{$interface->{FUNCTIONS}}) {
-               next if not defined($d->{OPNUM});
-               next if has_property($d, "noejs");
-
-               $self->EjsPullFunction($d);
-               $self->EjsPushFunction($d);
-               $self->EjsFunction($d, $name);
-
-               push (@fns, $d->{NAME});
-       }
-
-       foreach my $d (@{$interface->{CONSTS}}) {
-               $self->EjsConst($d);
-       }
-
-       $self->pidl("static int ejs_$name\_init(int eid, int argc, struct MprVar **argv)");
-       $self->pidl("{");
-       $self->indent;
-       $self->pidl("struct MprVar *obj = mprInitObject(eid, \"$name\", argc, argv);");
-       foreach (@fns) {
-               $self->pidl("mprSetCFunction(obj, \"$_\", ejs_$_);");
-       }
-       foreach my $v (keys %{$self->{constants}}) {
-               my $value = $self->{constants}->{$v};
-               if (substr($value, 0, 1) eq "\"") {
-                       $self->pidl("mprSetVar(obj, \"$v\", mprString($value));");
-               } else {
-                       $self->pidl("mprSetVar(obj, \"$v\", mprCreateNumberVar($value));");
-               }
-       }
-       $self->pidl("return ejs_rpc_init(obj, \"$name\");");
-       $self->deindent;
-       $self->pidl("}\n");
-
-       $self->pidl("NTSTATUS ejs_init_$name(void)");
-       $self->pidl("{");
-       $self->indent;
-       $self->pidl("ejsDefineCFunction(-1, \"$name\_init\", ejs_$name\_init, NULL, MPR_VAR_SCRIPT_HANDLE);");
-       $self->pidl("return NT_STATUS_OK;");
-       $self->deindent;
-       $self->pidl("}");
-
-       $self->pidl_hdr("\n");
-       $self->pidl_hdr("#endif /* _HEADER_EJS_$interface->{NAME} */\n");
-}
-
-#####################################################################
-# parse a parsed IDL into a C header
-sub Parse($$$)
-{
-    my($self,$ndr,$hdr) = @_;
-    
-    my $ejs_hdr = $hdr;
-    $ejs_hdr =~ s/.h$/_ejs.h/;
-
-    $self->pidl_hdr("/* header auto-generated by pidl */\n\n");
-       
-    $self->pidl("
-/* EJS wrapper functions auto-generated by pidl */
-#include \"includes.h\"
-#include \"librpc/rpc/dcerpc.h\"
-#include \"lib/appweb/ejs/ejs.h\"
-#include \"scripting/ejs/ejsrpc.h\"
-#include \"scripting/ejs/smbcalls.h\"
-#include \"librpc/gen_ndr/ndr_misc_ejs.h\"
-#include \"$hdr\"
-#include \"$ejs_hdr\"
-
-");
-
-    my %needed = ();
-
-    foreach my $x (@{$ndr}) {
-           ($x->{TYPE} eq "INTERFACE") && NeededInterface($x, \%needed);
-    }
-
-    foreach my $x (@$ndr) {
-           ($x->{TYPE} eq "INTERFACE") && $self->EjsInterface($x, \%needed);
-               ($x->{TYPE} eq "IMPORT") && $self->EjsImport(@{$x->{PATHS}});
-    }
-
-    return ($self->{res_hdr}, $self->{res});
-}
-
-sub NeededFunction($$)
-{
-       my ($fn,$needed) = @_;
-
-       $needed->{"ejs_pull_$fn->{NAME}"} = 1;
-       $needed->{"ejs_push_$fn->{NAME}"} = 1;
-        
-       foreach (@{$fn->{ELEMENTS}}) {
-               next if (has_property($_, "subcontext")); #FIXME: Support subcontexts
-               if (grep(/in/, @{$_->{DIRECTION}})) {
-                       $needed->{TypeFunctionName("ejs_pull", $_->{TYPE})} = 1;
-               }
-               if (grep(/out/, @{$_->{DIRECTION}})) {
-                       $needed->{TypeFunctionName("ejs_push", $_->{TYPE})} = 1;
-               }
-       }
-}
-
-sub NeededType($$$)
-{
-       sub NeededType($$$);
-       my ($t,$needed,$req) = @_;
-
-       NeededType($t->{DATA}, $needed, $req) if ($t->{TYPE} eq "TYPEDEF");
-
-       return unless (($t->{TYPE} eq "STRUCT") or ($t->{TYPE} eq "UNION"));
-
-       return unless(typeHasBody($t));
-
-       foreach (@{$t->{ELEMENTS}}) {
-               next if (has_property($_, "subcontext")); #FIXME: Support subcontexts
-               my $n;
-               if (ref($_->{TYPE}) ne "HASH" or defined($_->{TYPE}->{NAME})) {
-                       $needed->{TypeFunctionName("ejs_$req", $_->{TYPE})} = 1;
-               }
-               NeededType($_->{TYPE}, $needed, $req) if (ref($_->{TYPE}) eq "HASH");
-       }
-}
-
-#####################################################################
-# work out what parse functions are needed
-sub NeededInterface($$)
-{
-       my ($interface,$needed) = @_;
-
-       NeededFunction($_, $needed) foreach (@{$interface->{FUNCTIONS}});
-
-       foreach (reverse @{$interface->{TYPES}}) {
-               if (has_property($_, "public")) {
-                       $needed->{TypeFunctionName("ejs_pull", $_)} = not has_property($_, "noejs");
-                       $needed->{TypeFunctionName("ejs_push", $_)} = not has_property($_, "noejs");
-               }
-
-               NeededType($_, $needed, "pull")  if ($needed->{TypeFunctionName("ejs_pull", $_)});
-               NeededType($_, $needed, "push")  if ($needed->{TypeFunctionName("ejs_push", $_)});
-       }
-}
-
-sub TypeFunctionName($$)
-{
-       my ($prefix, $t) = @_;
-
-       return "$prefix\_$t->{NAME}" if (ref($t) eq "HASH" and 
-                       $t->{TYPE} eq "TYPEDEF");
-       return "$prefix\_$t->{TYPE}_$t->{NAME}" if (ref($t) eq "HASH");
-       return "$prefix\_$t";
-}
-
-
-
-1;
index fb73075f1ad218f07880989860eeb86c85627f83..ee81e51f254bf2dc67cc5f8245ec5486e9275478 100644 (file)
@@ -16,7 +16,7 @@ use Parse::Pidl::Typelist qw(hasType getType mapTypeName typeHasBody);
 use Parse::Pidl::Util qw(has_property ParseExpr ParseExprExt print_uuid unmake_str);
 use Parse::Pidl::CUtil qw(get_pointer_to get_value_of get_array_element);
 use Parse::Pidl::NDR qw(GetPrevLevel GetNextLevel ContainsDeferred is_charset_array);
-use Parse::Pidl::Samba4 qw(is_intree choose_header);
+use Parse::Pidl::Samba4 qw(is_intree choose_header ArrayDynamicallyAllocated);
 use Parse::Pidl::Samba4::Header qw(GenerateFunctionInEnv GenerateFunctionOutEnv EnvSubstituteValue GenerateStructEnv);
 use Parse::Pidl qw(warning);
 
@@ -376,7 +376,7 @@ sub ParseArrayPullHeader($$$$$$)
                $self->defer("}");
        }
 
-       if (not $l->{IS_FIXED} and not is_charset_array($e, $l)) {
+       if (ArrayDynamicallyAllocated($e,$l) and not is_charset_array($e,$l)) {
                $self->AllocateArrayLevel($e,$l,$ndr,$var_name,$size);
        }
 
@@ -917,7 +917,7 @@ sub ParseMemCtxPullFlags($$$$)
 
        return undef unless ($l->{TYPE} eq "POINTER" or $l->{TYPE} eq "ARRAY");
 
-       return undef if ($l->{TYPE} eq "ARRAY" and $l->{IS_FIXED});
+       return undef unless ($l->{TYPE} ne "ARRAY" or ArrayDynamicallyAllocated($e,$l));
        return undef if has_fast_array($e, $l);
        return undef if is_charset_array($e, $l);
 
index a3107d4672fcf61e5823e82906778dfb74954fdc..4c598b3ca0da5f45bbcb414cd5e6f4bd0a35401a 100644 (file)
@@ -14,6 +14,7 @@ use Parse::Pidl::Typelist qw(hasType resolveType getType mapTypeName expandAlias
 use Parse::Pidl::Util qw(has_property ParseExpr unmake_str);
 use Parse::Pidl::NDR qw(GetPrevLevel GetNextLevel ContainsDeferred is_charset_array);
 use Parse::Pidl::CUtil qw(get_value_of get_pointer_to);
+use Parse::Pidl::Samba4 qw(ArrayDynamicallyAllocated);
 use Parse::Pidl::Samba4::Header qw(GenerateFunctionInEnv GenerateFunctionOutEnv EnvSubstituteValue GenerateStructEnv);
 
 use vars qw($VERSION);
@@ -223,7 +224,10 @@ sub PythonStruct($$$$$$)
        $self->pidl("static PyObject *py_$name\_new(PyTypeObject *self, PyObject *args, PyObject *kwargs)");
        $self->pidl("{");
        $self->indent;
+       $self->pidl("char *kwlist[] = {NULL};");
        $self->pidl("$cname *ret = talloc_zero(NULL, $cname);");
+       $self->pidl("if (!PyArg_ParseTupleAndKeywords(args, kwargs, \"\", kwlist))");
+       $self->pidl("\treturn NULL;");
        $self->pidl("return py_talloc_import(&$name\_Type, ret);");
        $self->deindent;
        $self->pidl("}");
@@ -279,6 +283,11 @@ sub PythonStruct($$$$$$)
                $self->indent;
                $self->pidl("{ \"__ndr_pack__\", (PyCFunction)py_$name\_ndr_pack, METH_NOARGS, \"S.pack() -> blob\\nNDR pack\" },");
                $self->pidl("{ \"__ndr_unpack__\", (PyCFunction)py_$name\_ndr_unpack, METH_VARARGS, \"S.unpack(blob) -> None\\nNDR unpack\" },");
+               $self->deindent;
+               $self->pidl("#ifdef ".uc("py_$name\_extra_methods"));
+               $self->pidl("\t" .uc("py_$name\_extra_methods"));
+               $self->pidl("#endif");
+               $self->indent;
                $self->pidl("{ NULL, NULL, 0, NULL }");
                $self->deindent;
                $self->pidl("};");
@@ -289,6 +298,10 @@ sub PythonStruct($$$$$$)
        $self->pidl_hdr("#define $name\_Check(op) PyObject_TypeCheck(op, &$name\_Type)\n");
        $self->pidl_hdr("#define $name\_CheckExact(op) ((op)->ob_type == &$name\_Type)\n");
        $self->pidl_hdr("\n");
+       $self->pidl("#ifndef ".uc("py_$name\_repr"));
+       $self->pidl("#define ".uc("py_$name\_repr") . " py_talloc_default_repr");
+       $self->pidl("#endif");
+       $self->pidl("");
        my $docstring = ($self->DocString($d, $name) or "NULL");
        my $typeobject = "$name\_Type";
        $self->pidl("PyTypeObject $typeobject = {");
@@ -298,7 +311,7 @@ sub PythonStruct($$$$$$)
        $self->pidl(".tp_basicsize = sizeof(py_talloc_Object),");
        $self->pidl(".tp_dealloc = py_talloc_dealloc,");
        $self->pidl(".tp_getset = $getsetters,");
-       $self->pidl(".tp_repr = py_talloc_default_repr,");
+       $self->pidl(".tp_repr = ".uc("py_$name\_repr").",");
        $self->pidl(".tp_doc = $docstring,");
        $self->pidl(".tp_methods = $py_methods,");
        $self->pidl(".tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,");
@@ -623,6 +636,10 @@ sub Interface($$$)
 
        $self->pidl_hdr("\n");
 
+       if (has_property($interface, "pyhelper")) {
+               $self->pidl("#include \"".unmake_str($interface->{PROPERTIES}->{pyhelper})."\"\n");
+       }
+
        $self->Const($_) foreach (@{$interface->{CONSTS}});
 
        foreach my $d (@{$interface->{TYPES}}) {
@@ -942,7 +959,7 @@ sub ConvertObjectFromPythonLevel($$$$$$$$)
                        $self->pidl("{");
                        $self->indent;
                        $self->pidl("int $counter;");
-                       if (!$l->{IS_FIXED}) {
+                       if (ArrayDynamicallyAllocated($e, $l)) {
                                $self->pidl("$var_name = talloc_array_ptrtype($mem_ctx, $var_name, PyList_Size($py_var));");
                        }
                        $self->pidl("for ($counter = 0; $counter < PyList_Size($py_var); $counter++) {");
diff --git a/pidl/tests/samba-ejs.pl b/pidl/tests/samba-ejs.pl
deleted file mode 100755 (executable)
index 094d37a..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/usr/bin/perl
-# (C) 2007 Jelmer Vernooij <jelmer@samba.org>
-# Published under the GNU General Public License
-use strict;
-use warnings;
-
-use Test::More tests => 10;
-use FindBin qw($RealBin);
-use lib "$RealBin";
-use Util;
-use Parse::Pidl::Util qw(MyDumper);
-use Parse::Pidl::Samba4::EJS qw(check_null_pointer
-        fn_declare TypeFunctionName);
-
-my $ejs = new Parse::Pidl::Samba4::EJS();
-
-$ejs->check_null_pointer("bla");
-is($ejs->{res}, "");
-
-$ejs = new Parse::Pidl::Samba4::EJS();
-$ejs->check_null_pointer("*bla");
-is($ejs->{res}, "if (bla == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;\n");
-
-$ejs = new Parse::Pidl::Samba4::EJS();
-$ejs->fn_declare({ PROPERTIES => { public => 1 } }, "myproto(int x)");
-is($ejs->{res}, "_PUBLIC_ myproto(int x)\n");
-is($ejs->{res_hdr}, "myproto(int x);\n");
-
-$ejs = new Parse::Pidl::Samba4::EJS();
-$ejs->fn_declare({ PROPERTIES => {} }, "mybla(int foo)");
-is($ejs->{res}, "static mybla(int foo)\n");
-is($ejs->{res_hdr}, "");
-
-is(TypeFunctionName("ejs_pull", "uint32"), "ejs_pull_uint32");
-is(TypeFunctionName("ejs_pull", {TYPE => "ENUM", NAME => "bar"}), "ejs_pull_ENUM_bar");
-is(TypeFunctionName("ejs_pull", {TYPE => "TYPEDEF", NAME => "bar", DATA => undef}), "ejs_pull_bar");
-is(TypeFunctionName("ejs_push", {TYPE => "STRUCT", NAME => "bar"}), "ejs_push_STRUCT_bar");
index 83e94a438238b5c491b7506d7e7ea41aa4b7947c..f53406c39eec6168b93f464cc023b8ed44ed06e9 100644 (file)
@@ -650,7 +650,8 @@ VFS_SYNCOPS_OBJ = modules/vfs_syncops.o
 VFS_ACL_XATTR_OBJ = modules/vfs_acl_xattr.o
 VFS_ACL_TDB_OBJ = modules/vfs_acl_tdb.o
 VFS_SMB_TRAFFIC_ANALYZER_OBJ = modules/vfs_smb_traffic_analyzer.o
-VFS_ONEFS_OBJ = modules/vfs_onefs.o modules/onefs_acl.o
+VFS_ONEFS_OBJ = modules/vfs_onefs.o modules/onefs_acl.o modules/onefs_system.o \
+               modules/onefs_open.o
 
 PLAINTEXT_AUTH_OBJ = auth/pampass.o auth/pass_check.o
 
@@ -1036,6 +1037,7 @@ IDMAP_ADEX_OBJ = \
 
 WINBINDD_OBJ1 = \
                winbindd/winbindd.o       \
+               winbindd/winbindd_reqtrans.o \
                winbindd/winbindd_user.o  \
                winbindd/winbindd_group.o \
                winbindd/winbindd_util.o  \
index 9220df01c001ea7b8a9e4e3f6c0448f4b7653214..d2a8591ae61e9e97dadc3877dd86b21997f0edad 100644 (file)
@@ -1294,7 +1294,7 @@ NTSTATUS make_serverinfo_from_username(TALLOC_CTX *mem_ctx,
 
 
 struct auth_serversupplied_info *copy_serverinfo(TALLOC_CTX *mem_ctx,
-                                                auth_serversupplied_info *src)
+                                                const auth_serversupplied_info *src)
 {
        auth_serversupplied_info *dst;
 
index 39f8f90bbae06ab0505f7781f03c8ae88eeb8b94..c88b918dc8c0eba265cb384d57668b621fe434ba 100644 (file)
@@ -218,13 +218,12 @@ static int readfile(char *b, int n, XFILE *f)
  Send a message.
 ****************************************************************************/
 
-static void send_message(void)
+static void send_message(const char *username)
 {
        int total_len = 0;
        int grp_id;
 
-       if (!cli_message_start(cli, desthost,
-                               get_cmdline_auth_info_username(), &grp_id)) {
+       if (!cli_message_start(cli, desthost, username, &grp_id)) {
                d_printf("message start: %s\n", cli_errstr(cli));
                return;
        }
@@ -4607,7 +4606,7 @@ static int do_tar_op(const char *base_directory)
  Handle a message operation.
 ****************************************************************************/
 
-static int do_message_op(void)
+static int do_message_op(struct user_auth_info *auth_info)
 {
        struct sockaddr_storage ss;
        struct nmb_name called, calling;
@@ -4623,7 +4622,7 @@ static int do_message_op(void)
        snprintf(name_type_hex, sizeof(name_type_hex), "#%X", name_type);
        fstrcat(server_name, name_type_hex);
 
-        zero_addr(&ss);
+        zero_sockaddr(&ss);
        if (have_ip)
                ss = dest_ss;
 
@@ -4648,7 +4647,7 @@ static int do_message_op(void)
                return 1;
        }
 
-       send_message();
+       send_message(get_cmdline_auth_info_username(auth_info));
        cli_cm_shutdown();
 
        return 0;
@@ -4695,6 +4694,7 @@ static int do_message_op(void)
                POPT_TABLEEND
        };
        TALLOC_CTX *frame = talloc_stackframe();
+       struct user_auth_info *auth_info;
 
        if (!client_set_cur_dir("\\")) {
                exit(ENOMEM);
@@ -4724,6 +4724,12 @@ static int do_message_op(void)
 
        load_case_tables();
 
+       auth_info = user_auth_info_init(frame);
+       if (auth_info == NULL) {
+               exit(1);
+       }
+       popt_common_set_auth_info(auth_info);
+
        /* skip argv(0) */
        pc = poptGetContext("smbclient", argc, (const char **) argv, long_options, 0);
        poptSetOtherOptionHelp(pc, "service <password>");
@@ -4751,8 +4757,11 @@ static int do_message_op(void)
                }
 
                /* if the service has already been retrieved then check if we have also a password */
-               if (service_opt && (!get_cmdline_auth_info_got_pass()) && poptPeekArg(pc)) {
-                       set_cmdline_auth_info_password(poptGetArg(pc));
+               if (service_opt
+                   && (!get_cmdline_auth_info_got_pass(auth_info))
+                   && poptPeekArg(pc)) {
+                       set_cmdline_auth_info_password(auth_info,
+                                                      poptGetArg(pc));
                }
 
                switch (opt) {
@@ -4858,8 +4867,11 @@ static int do_message_op(void)
        }
 
        /* if the service has already been retrieved then check if we have also a password */
-       if (service_opt && !get_cmdline_auth_info_got_pass() && poptPeekArg(pc)) {
-               set_cmdline_auth_info_password(poptGetArg(pc));
+       if (service_opt
+           && !get_cmdline_auth_info_got_pass(auth_info)
+           && poptPeekArg(pc)) {
+               set_cmdline_auth_info_password(auth_info,
+                                              poptGetArg(pc));
        }
 
        /* check for the -P option */
@@ -4893,8 +4905,8 @@ static int do_message_op(void)
                        argv[0], get_dyn_CONFIGFILE());
        }
 
-       if (get_cmdline_auth_info_use_machine_account() &&
-           !set_cmdline_auth_info_machine_account_creds()) {
+       if (get_cmdline_auth_info_use_machine_account(auth_info) &&
+           !set_cmdline_auth_info_machine_account_creds(auth_info)) {
                exit(-1);
        }
 
@@ -4929,7 +4941,7 @@ static int do_message_op(void)
                calling_name = talloc_strdup(frame, global_myname() );
        }
 
-       smb_encrypt = get_cmdline_auth_info_smb_encrypt();
+       smb_encrypt = get_cmdline_auth_info_smb_encrypt(auth_info);
        if (!init_names()) {
                fprintf(stderr, "init_names() failed\n");
                exit(1);
@@ -4947,7 +4959,7 @@ static int do_message_op(void)
 
        /* Store the username and password for dfs support */
 
-       cli_cm_set_credentials();
+       cli_cm_set_credentials(auth_info);
 
        DEBUG(3,("Client started (version %s).\n", SAMBA_VERSION_STRING));
 
@@ -4980,7 +4992,7 @@ static int do_message_op(void)
        }
 
        if (message) {
-               return do_message_op();
+               return do_message_op(auth_info);
        }
 
        if (process(base_directory)) {
index da2f98bff86e8f1f9ac19962a19cd688165b447c..9f4d1d3fd06abc558fed15d959af6cfe4f0334d2 100644 (file)
@@ -80,6 +80,9 @@
 #define MOUNT_PASSWD_SIZE 64
 #define DOMAIN_SIZE 64
 
+/* currently maximum length of IPv6 address string */
+#define MAX_ADDRESS_LEN INET6_ADDRSTRLEN
+
 const char *thisprogram;
 int verboseflag = 0;
 static int got_password = 0;
@@ -189,12 +192,6 @@ static char * getusername(void) {
        return username;
 }
 
-static char * parse_cifs_url(char * unc_name)
-{
-       printf("\nMounting cifs URL not implemented yet. Attempt to mount %s\n",unc_name);
-       return NULL;
-}
-
 static int open_cred_file(char * file_name)
 {
        char * line_buf;
@@ -494,7 +491,7 @@ static int parse_options(char ** optionsp, int * filesys_flags)
                } else if (strncmp(data, "ip", 2) == 0) {
                        if (!value || !*value) {
                                printf("target ip address argument missing");
-                       } else if (strnlen(value, 35) < 35) {
+                       } else if (strnlen(value, MAX_ADDRESS_LEN) <= MAX_ADDRESS_LEN) {
                                if(verboseflag)
                                        printf("ip address %s override specified\n",value);
                                got_ip = 1;
@@ -882,23 +879,23 @@ static void replace_char(char *string, char from, char to, int maxlen)
 }
 
 /* Note that caller frees the returned buffer if necessary */
-static char * parse_server(char ** punc_name)
+static struct addrinfo *
+parse_server(char ** punc_name)
 {
        char * unc_name = *punc_name;
        int length = strnlen(unc_name, MAX_UNC_LEN);
        char * share;
-       char * ipaddress_string = NULL;
-       struct hostent * host_entry = NULL;
-       struct in_addr server_ipaddr;
+       struct addrinfo *addrlist;
+       int rc;
 
        if(length > (MAX_UNC_LEN - 1)) {
                printf("mount error: UNC name too long");
                return NULL;
        }
-       if (strncasecmp("cifs://",unc_name,7) == 0)
-               return parse_cifs_url(unc_name+7);
-       if (strncasecmp("smb://",unc_name,6) == 0) {
-               return parse_cifs_url(unc_name+6);
+       if ((strncasecmp("cifs://", unc_name, 7) == 0) ||
+           (strncasecmp("smb://", unc_name, 6) == 0)) {
+               printf("\nMounting cifs URL not implemented yet. Attempt to mount %s\n", unc_name);
+               return NULL;
        }
 
        if(length < 3) {
@@ -939,7 +936,12 @@ continue_unc_parsing:
                                *share = 0;  /* temporarily terminate the string */
                                share += 1;
                                if(got_ip == 0) {
-                                       host_entry = gethostbyname(unc_name);
+                                       rc = getaddrinfo(unc_name, NULL, NULL, &addrlist);
+                                       if (rc != 0) {
+                                               printf("mount error: could not resolve address for %s: %s\n",
+                                                       unc_name, gai_strerror(rc));
+                                               addrlist = NULL;
+                                       }
                                }
                                *(share - 1) = '/'; /* put delimiter back */
 
@@ -954,23 +956,9 @@ continue_unc_parsing:
                                                printf("ip address specified explicitly\n");
                                        return NULL;
                                }
-                               if(host_entry == NULL) {
-                                       printf("mount error: could not find target server. TCP name %s not found\n", unc_name);
-                                       return NULL;
-                               } else {
-                                       /* BB should we pass an alternate version of the share name as Unicode */
-                                       /* BB what about ipv6? BB */
-                                       /* BB add retries with alternate servers in list */
+                               /* BB should we pass an alternate version of the share name as Unicode */
 
-                                       memcpy(&server_ipaddr.s_addr, host_entry->h_addr, 4);
-
-                                       ipaddress_string = inet_ntoa(server_ipaddr);                                                                                     
-                                       if(ipaddress_string == NULL) {
-                                               printf("mount error: could not get valid ip address for target server\n");
-                                               return NULL;
-                                       }
-                                       return ipaddress_string; 
-                               }
+                               return addrlist; 
                        } else {
                                /* BB add code to find DFS root (send null path on get DFS Referral to specified server here */
                                printf("Mounting the DFS root for a particular server not implemented yet\n");
@@ -1034,10 +1022,11 @@ int main(int argc, char ** argv)
        int flags = MS_MANDLOCK; /* no need to set legacy MS_MGC_VAL */
        char * orgoptions = NULL;
        char * share_name = NULL;
-       char * ipaddr = NULL;
+       const char * ipaddr = NULL;
        char * uuid = NULL;
        char * mountpoint = NULL;
        char * options = NULL;
+       char * optionstail;
        char * resolved_path = NULL;
        char * temp;
        char * dev_name;
@@ -1050,10 +1039,14 @@ int main(int argc, char ** argv)
        int optlen = 0;
        int orgoptlen = 0;
        size_t options_size = 0;
+       size_t current_len;
        int retry = 0; /* set when we have to retry mount with uppercase */
+       struct addrinfo *addrhead = NULL, *addr;
        struct stat statbuf;
        struct utsname sysinfo;
        struct mntent mountent;
+       struct sockaddr_in *addr4;
+       struct sockaddr_in6 *addr6;
        FILE * pmntfile;
 
        /* setlocale(LC_ALL, "");
@@ -1245,8 +1238,8 @@ int main(int argc, char ** argv)
                 rc = EX_USAGE;
                goto mount_exit;
        }
-       ipaddr = parse_server(&share_name);
-       if((ipaddr == NULL) && (got_ip == 0)) {
+       addrhead = addr = parse_server(&share_name);
+       if((addrhead == NULL) && (got_ip == 0)) {
                printf("No ip address specified and hostname not found\n");
                rc = EX_USAGE;
                goto mount_exit;
@@ -1293,7 +1286,13 @@ int main(int argc, char ** argv)
        }
 
        if(got_user == 0) {
-               user_name = getusername();
+               /* Note that the password will not be retrieved from the
+                  USER env variable (ie user%password form) as there is
+                  already a PASSWD environment varaible */
+               if (getenv("USER"))
+                       user_name = strdup(getenv("USER"));
+               if (user_name == NULL)
+                       user_name = getusername();
                got_user = 1;
        }
        
@@ -1310,7 +1309,6 @@ int main(int argc, char ** argv)
        }
        /* FIXME launch daemon (handles dfs name resolution and credential change) 
           remember to clear parms and overwrite password field before launching */
-mount_retry:
        if(orgoptions) {
                optlen = strlen(orgoptions);
                orgoptlen = optlen;
@@ -1325,10 +1323,10 @@ mount_retry:
        }
        if(user_name)
                optlen += strlen(user_name) + 6;
-       if(ipaddr)
-               optlen += strlen(ipaddr) + 4;
+       optlen += MAX_ADDRESS_LEN + 4;
        if(mountpassword)
                optlen += strlen(mountpassword) + 6;
+mount_retry:
        SAFE_FREE(options);
        options_size = optlen + 10 + DOMAIN_SIZE;
        options = (char *)malloc(options_size /* space for commas in password */ + 8 /* space for domain=  , domain name itself was counted as part of the length username string above */);
@@ -1338,18 +1336,12 @@ mount_retry:
                exit(EX_SYSERR);
        }
 
-       options[0] = 0;
-       strlcpy(options,"unc=",options_size);
+       strlcpy(options, "unc=", options_size);
        strlcat(options,share_name,options_size);
        /* scan backwards and reverse direction of slash */
        temp = strrchr(options, '/');
        if(temp > options + 6)
                *temp = '\\';
-       if(ipaddr) {
-               strlcat(options,",ip=",options_size);
-               strlcat(options,ipaddr,options_size);
-       }
-
        if(user_name) {
                /* check for syntax like user=domain\user */
                if(got_domain == 0)
@@ -1391,11 +1383,42 @@ mount_retry:
        /* convert all '\\' to '/' in share portion so that /proc/mounts looks pretty */
        replace_char(dev_name, '\\', '/', strlen(share_name));
 
-       if(mount(dev_name, mountpoint, "cifs", flags, options)) {
-       /* remember to kill daemon on error */
+       if (!got_ip && addr) {
+               strlcat(options, ",ip=", options_size);
+               current_len = strnlen(options, options_size);
+               optionstail = options + current_len;
+               switch (addr->ai_addr->sa_family) {
+               case AF_INET6:
+                       addr6 = (struct sockaddr_in6 *) addr->ai_addr;
+                       ipaddr = inet_ntop(AF_INET6, &addr6->sin6_addr, optionstail,
+                                          options_size - current_len);
+                       break;
+               case AF_INET:
+                       addr4 = (struct sockaddr_in *) addr->ai_addr;
+                       ipaddr = inet_ntop(AF_INET, &addr4->sin_addr, optionstail,
+                                          options_size - current_len);
+                       break;
+               }
+
+               /* if the address looks bogus, try the next one */
+               if (!ipaddr) {
+                       addr = addr->ai_next;
+                       if (addr)
+                               goto mount_retry;
+                       rc = EX_SYSERR;
+                       goto mount_exit;
+               }
+       }
+
+       if (mount(dev_name, mountpoint, "cifs", flags, options)) {
                switch (errno) {
-               case 0:
-                       printf("mount failed but no error number set\n");
+               case ECONNREFUSED:
+               case EHOSTUNREACH:
+                       if (addr) {
+                               addr = addr->ai_next;
+                               if (addr)
+                                       goto mount_retry;
+                       }
                        break;
                case ENODEV:
                        printf("mount error: cifs filesystem not supported by the system\n");
@@ -1410,64 +1433,64 @@ mount_retry:
                                        goto mount_retry;
                                }
                        }
-               default:
-                       printf("mount error %d = %s\n",errno,strerror(errno));
                }
+               printf("mount error(%d): %s\n", errno, strerror(errno));
                printf("Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)\n");
                rc = EX_FAIL;
-       } else {
-               atexit(unlock_mtab);
-               rc = lock_mtab();
-               if (rc) {
-                       printf("cannot lock mtab");
-                       goto mount_exit;
-               }
-               pmntfile = setmntent(MOUNTED, "a+");
-               if (!pmntfile) {
-                       printf("could not update mount table\n");
-                       unlock_mtab();
-                       rc = EX_FILEIO;
-                       goto mount_exit;
-               }
-               mountent.mnt_fsname = dev_name;
-               mountent.mnt_dir = mountpoint;
-               mountent.mnt_type = CONST_DISCARD(char *,"cifs");
-               mountent.mnt_opts = (char *)malloc(220);
-               if(mountent.mnt_opts) {
-                       char * mount_user = getusername();
-                       memset(mountent.mnt_opts,0,200);
-                       if(flags & MS_RDONLY)
-                               strlcat(mountent.mnt_opts,"ro",220);
-                       else
-                               strlcat(mountent.mnt_opts,"rw",220);
-                       if(flags & MS_MANDLOCK)
-                               strlcat(mountent.mnt_opts,",mand",220);
-                       if(flags & MS_NOEXEC)
-                               strlcat(mountent.mnt_opts,",noexec",220);
-                       if(flags & MS_NOSUID)
-                               strlcat(mountent.mnt_opts,",nosuid",220);
-                       if(flags & MS_NODEV)
-                               strlcat(mountent.mnt_opts,",nodev",220);
-                       if(flags & MS_SYNCHRONOUS)
-                               strlcat(mountent.mnt_opts,",sync",220);
-                       if(mount_user) {
-                               if(getuid() != 0) {
-                                       strlcat(mountent.mnt_opts,
-                                               ",user=", 220);
-                                       strlcat(mountent.mnt_opts,
-                                               mount_user, 220);
-                               }
+               goto mount_exit;
+       }
+
+       atexit(unlock_mtab);
+       rc = lock_mtab();
+       if (rc) {
+               printf("cannot lock mtab");
+               goto mount_exit;
+       }
+       pmntfile = setmntent(MOUNTED, "a+");
+       if (!pmntfile) {
+               printf("could not update mount table\n");
+               unlock_mtab();
+               rc = EX_FILEIO;
+               goto mount_exit;
+       }
+       mountent.mnt_fsname = dev_name;
+       mountent.mnt_dir = mountpoint;
+       mountent.mnt_type = CONST_DISCARD(char *,"cifs");
+       mountent.mnt_opts = (char *)malloc(220);
+       if(mountent.mnt_opts) {
+               char * mount_user = getusername();
+               memset(mountent.mnt_opts,0,200);
+               if(flags & MS_RDONLY)
+                       strlcat(mountent.mnt_opts,"ro",220);
+               else
+                       strlcat(mountent.mnt_opts,"rw",220);
+               if(flags & MS_MANDLOCK)
+                       strlcat(mountent.mnt_opts,",mand",220);
+               if(flags & MS_NOEXEC)
+                       strlcat(mountent.mnt_opts,",noexec",220);
+               if(flags & MS_NOSUID)
+                       strlcat(mountent.mnt_opts,",nosuid",220);
+               if(flags & MS_NODEV)
+                       strlcat(mountent.mnt_opts,",nodev",220);
+               if(flags & MS_SYNCHRONOUS)
+                       strlcat(mountent.mnt_opts,",sync",220);
+               if(mount_user) {
+                       if(getuid() != 0) {
+                               strlcat(mountent.mnt_opts,
+                                       ",user=", 220);
+                               strlcat(mountent.mnt_opts,
+                                       mount_user, 220);
                        }
                }
-               mountent.mnt_freq = 0;
-               mountent.mnt_passno = 0;
-               rc = addmntent(pmntfile,&mountent);
-               endmntent(pmntfile);
-               unlock_mtab();
-               SAFE_FREE(mountent.mnt_opts);
-               if (rc)
-                       rc = EX_FILEIO;
        }
+       mountent.mnt_freq = 0;
+       mountent.mnt_passno = 0;
+       rc = addmntent(pmntfile,&mountent);
+       endmntent(pmntfile);
+       unlock_mtab();
+       SAFE_FREE(mountent.mnt_opts);
+       if (rc)
+               rc = EX_FILEIO;
 mount_exit:
        if(mountpassword) {
                int len = strlen(mountpassword);
@@ -1475,6 +1498,8 @@ mount_exit:
                SAFE_FREE(mountpassword);
        }
 
+       if (addrhead)
+               freeaddrinfo(addrhead);
        SAFE_FREE(options);
        SAFE_FREE(orgoptions);
        SAFE_FREE(resolved_path);
index 40e78e89d93c6448cefacc720f88fa9932ae5d4c..b90b1b3f6043ac8a4ebc5b9d05c672ef678e39e7 100644 (file)
@@ -1052,6 +1052,20 @@ if test x"$samba_cv_HAVE_GPFS" = x"yes"; then
 fi
 LIBS="$save_LIBS"
 
+printf "%s" "checking for GPFS libs (with 3.2.1 PTF8 available as GPL)... "
+save_LIBS="$LIBS"
+LIBS="$LIBS -lgpfs"
+AC_TRY_LINK([#include <gpfs.h>],
+          [gpfs_set_share(0,GPFS_SHARE_READ,GPFS_DENY_NONE)],
+          samba_cv_HAVE_GPFS=yes,
+          samba_cv_HAVE_GPFS=no)
+echo $samba_cv_HAVE_GPFS
+if test x"$samba_cv_HAVE_GPFS" = x"yes"; then
+    AC_DEFINE(HAVE_GPFS,1,[Whether GPFS GPL libs are available])
+    default_shared_modules="$default_shared_modules vfs_gpfs"
+fi
+LIBS="$save_LIBS"
+
 #############################################
 # check if building on Isilon OneFS
 printf "%s" "checking for Isilon OneFS... "
index b72d25094025156108c6815f62c44c8a0b141867..abff9eaa8c7268a88d4a078ebb46dfa29cc9cfac 100644 (file)
@@ -80,7 +80,6 @@ typedef struct ads_struct {
                char *server_site_name;
                char *client_site_name;
                time_t current_time;
-               int tried_closest_dc;
                char *schema_path;
                char *config_path;
        } config;
index 2d01b53814cbe60d8bb28f67fb56dc8e9496573d..14a30696c4d0c906ccf404b54573e3449bdb021d 100644 (file)
@@ -134,4 +134,8 @@ bool async_post_status(struct async_req *req, NTSTATUS status);
 
 bool async_req_nomem(const void *p, struct async_req *req);
 
+bool async_req_is_error(struct async_req *req, NTSTATUS *status);
+
+NTSTATUS async_req_simple_recv(struct async_req *req);
+
 #endif
index 4e2061813f533a4f69cc56d805d696d647695f5c..25fd353632aa58af9c57ae1f58570246f25d1c62 100644 (file)
@@ -125,6 +125,10 @@ bool cli_chain_cork(struct cli_state *cli, struct event_context *ev,
                    size_t size_hint);
 void cli_chain_uncork(struct cli_state *cli);
 bool cli_in_chain(struct cli_state *cli);
+bool smb_splice_chain(char **poutbuf, uint8_t smb_command,
+                     uint8_t wct, const uint16_t *vwv,
+                     size_t bytes_alignment,
+                     uint16_t num_bytes, const uint8_t *bytes);
 
 NTSTATUS cli_pull_reply(struct async_req *req,
                        uint8_t *pwct, uint16_t **pvwv,
index 3c9045360161e3b1f256c4c1ad448b4942802ed7..f0cd5fdaa4e9ada828c29b63d7f6c31521160654 100644 (file)
 
 #include "includes.h"
 
-ssize_t async_syscall_result_ssize_t(struct async_req **req, int *perrno);
-size_t  async_syscall_result_size_t (struct async_req **req, int *perrno);
-ssize_t async_syscall_result_int    (struct async_req **req, int *perrno);
+ssize_t async_syscall_result_ssize_t(struct async_req *req, int *perrno);
+size_t async_syscall_result_size_t(struct async_req *req, int *perrno);
+ssize_t async_syscall_result_int(struct async_req *req, int *perrno);
 
 struct async_req *async_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
                             int fd, const void *buffer, size_t length,
                             int flags);
-struct async_req *async_sendall(TALLOC_CTX *mem_ctx, struct event_context *ev,
-                               int fd, const void *buffer, size_t length,
-                               int flags);
 struct async_req *async_recv(TALLOC_CTX *mem_ctx, struct event_context *ev,
                             int fd, void *buffer, size_t length,
                             int flags);
-struct async_req *async_recvall(TALLOC_CTX *mem_ctx, struct event_context *ev,
-                               int fd, void *buffer, size_t length,
-                               int flags);
 struct async_req *async_connect(TALLOC_CTX *mem_ctx, struct event_context *ev,
                                int fd, const struct sockaddr *address,
                                socklen_t address_len);
 
+struct async_req *sendall_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
+                              int fd, const void *buffer, size_t length,
+                              int flags);
+NTSTATUS sendall_recv(struct async_req *req);
+
+struct async_req *recvall_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
+                              int fd, void *buffer, size_t length,
+                              int flags);
+NTSTATUS recvall_recv(struct async_req *req);
+
 #endif
index 8d57fe1eed9da5e48e2319c02d69512453233130..587f3f6c67749274c1bc0fbf85c375c4180f3383 100644 (file)
@@ -52,6 +52,7 @@ struct cli_pipe_auth_data {
 
        char *domain;
        char *user_name;
+       DATA_BLOB user_session_key;
 
        union {
                struct schannel_auth_struct *schannel_auth;
index f2bbb07f926f2c13fb6a6e0fb9ac77a3764baf73..24929f6d7fe1d0e0ec72c801fb223b844fd2425b 100644 (file)
@@ -123,7 +123,7 @@ NTSTATUS make_serverinfo_from_username(TALLOC_CTX *mem_ctx,
                                       bool is_guest,
                                       struct auth_serversupplied_info **presult);
 struct auth_serversupplied_info *copy_serverinfo(TALLOC_CTX *mem_ctx,
-                                                auth_serversupplied_info *src);
+                                                const auth_serversupplied_info *src);
 bool init_guest_info(void);
 bool server_info_set_session_key(struct auth_serversupplied_info *info,
                                 DATA_BLOB session_key);
@@ -637,6 +637,7 @@ void pidfile_create(const char *program_name);
 
 /* The following definitions come from lib/popt_common.c  */
 
+void popt_common_set_auth_info(struct user_auth_info *auth_info);
 
 /* The following definitions come from lib/privileges.c  */
 
@@ -723,6 +724,7 @@ bool sec_acl_equal(SEC_ACL *s1, SEC_ACL *s2);
 /* The following definitions come from lib/secdesc.c  */
 
 bool sec_desc_equal(SEC_DESC *s1, SEC_DESC *s2);
+uint32_t get_sec_info(const SEC_DESC *sd);
 SEC_DESC_BUF *sec_desc_merge(TALLOC_CTX *ctx, SEC_DESC_BUF *new_sdb, SEC_DESC_BUF *old_sdb);
 SEC_DESC *make_sec_desc(TALLOC_CTX *ctx,
                        enum security_descriptor_revision revision,
@@ -1138,22 +1140,28 @@ void gfree_all( void );
 const char *my_netbios_names(int i);
 bool set_netbios_aliases(const char **str_array);
 bool init_names(void);
-const char *get_cmdline_auth_info_username(void);
-void set_cmdline_auth_info_username(const char *username);
-const char *get_cmdline_auth_info_password(void);
-void set_cmdline_auth_info_password(const char *password);
-bool set_cmdline_auth_info_signing_state(const char *arg);
-int get_cmdline_auth_info_signing_state(void);
-void set_cmdline_auth_info_use_kerberos(bool b);
-bool get_cmdline_auth_info_use_kerberos(void);
-void set_cmdline_auth_info_use_krb5_ticket(void);
-void set_cmdline_auth_info_smb_encrypt(void);
-void set_cmdline_auth_info_use_machine_account(void);
-bool get_cmdline_auth_info_got_pass(void);
-bool get_cmdline_auth_info_smb_encrypt(void);
-bool get_cmdline_auth_info_use_machine_account(void);
-bool get_cmdline_auth_info_copy(struct user_auth_info *info);
-bool set_cmdline_auth_info_machine_account_creds(void);
+struct user_auth_info *user_auth_info_init(TALLOC_CTX *mem_ctx);
+const char *get_cmdline_auth_info_username(struct user_auth_info *auth_info);
+void set_cmdline_auth_info_username(struct user_auth_info *auth_info,
+                                   const char *username);
+void set_cmdline_auth_info_password(struct user_auth_info *auth_info,
+                                   const char *password);
+const char *get_cmdline_auth_info_password(struct user_auth_info *auth_info);
+bool set_cmdline_auth_info_signing_state(struct user_auth_info *auth_info,
+                                        const char *arg);
+int get_cmdline_auth_info_signing_state(struct user_auth_info *auth_info);
+void set_cmdline_auth_info_use_kerberos(struct user_auth_info *auth_info,
+                                       bool b);
+bool get_cmdline_auth_info_use_kerberos(struct user_auth_info *auth_info);
+void set_cmdline_auth_info_use_krb5_ticket(struct user_auth_info *auth_info);
+void set_cmdline_auth_info_smb_encrypt(struct user_auth_info *auth_info);
+void set_cmdline_auth_info_use_machine_account(struct user_auth_info *auth_info);
+bool get_cmdline_auth_info_got_pass(struct user_auth_info *auth_info);
+bool get_cmdline_auth_info_smb_encrypt(struct user_auth_info *auth_info);
+bool get_cmdline_auth_info_use_machine_account(struct user_auth_info *auth_info);
+struct user_auth_info *get_cmdline_auth_info_copy(TALLOC_CTX *mem_ctx,
+                                                struct user_auth_info *info);
+bool set_cmdline_auth_info_machine_account_creds(struct user_auth_info *auth_info);
 bool add_gid_to_array_unique(TALLOC_CTX *mem_ctx, gid_t gid,
                             gid_t **gids, size_t *num_gids);
 const char *get_numlist(const char *p, uint32 **num, int *count);
@@ -1396,13 +1404,13 @@ bool is_loopback_ip_v4(struct in_addr ip);
 bool is_loopback_addr(const struct sockaddr *pss);
 bool is_zero_addr(const struct sockaddr *pss);
 void zero_ip_v4(struct in_addr *ip);
-void zero_addr(struct sockaddr_storage *pss);
+void zero_sockaddr(struct sockaddr_storage *pss);
 void in_addr_to_sockaddr_storage(struct sockaddr_storage *ss,
                struct in_addr ip);
 bool same_net(const struct sockaddr *ip1,
                const struct sockaddr *ip2,
                const struct sockaddr *mask);
-bool addr_equal(const struct sockaddr *ip1,
+bool sockaddr_equal(const struct sockaddr *ip1,
                const struct sockaddr *ip2);
 bool is_address_any(const struct sockaddr *psa);
 uint16_t get_sockaddr_port(const struct sockaddr_storage *pss);
@@ -2314,15 +2322,7 @@ void ndr_print_dom_sid0(struct ndr_print *ndr, const char *name, const struct do
 
 /* The following definitions come from librpc/ndr/sid.c  */
 
-enum ndr_err_code ndr_push_dom_sid(struct ndr_push *ndr, int ndr_flags, const struct dom_sid *r);
-enum ndr_err_code ndr_pull_dom_sid(struct ndr_pull *ndr, int ndr_flags, struct dom_sid *r);
 char *dom_sid_string(TALLOC_CTX *mem_ctx, const struct dom_sid *sid);
-enum ndr_err_code ndr_pull_dom_sid2(struct ndr_pull *ndr, int ndr_flags, struct dom_sid *sid);
-enum ndr_err_code ndr_push_dom_sid2(struct ndr_push *ndr, int ndr_flags, const struct dom_sid *sid);
-enum ndr_err_code ndr_pull_dom_sid28(struct ndr_pull *ndr, int ndr_flags, struct dom_sid *sid);
-enum ndr_err_code ndr_push_dom_sid28(struct ndr_push *ndr, int ndr_flags, const struct dom_sid *sid);
-enum ndr_err_code ndr_pull_dom_sid0(struct ndr_pull *ndr, int ndr_flags, struct dom_sid *sid);
-enum ndr_err_code ndr_push_dom_sid0(struct ndr_push *ndr, int ndr_flags, const struct dom_sid *sid);
 
 /* The following definitions come from librpc/rpc/binding.c  */
 
@@ -2418,7 +2418,7 @@ struct cli_state *cli_cm_open(TALLOC_CTX *ctx,
                                bool force_encrypt);
 void cli_cm_shutdown(void);
 void cli_cm_display(void);
-void cli_cm_set_credentials(void);
+void cli_cm_set_credentials(struct user_auth_info *auth_info);
 void cli_cm_set_port(int port_number);
 void cli_cm_set_dest_name_type(int type);
 void cli_cm_set_signing_state(int state);
@@ -2983,6 +2983,7 @@ bool namecache_status_fetch(const char *keyname,
 /* The following definitions come from libsmb/namequery.c  */
 
 bool saf_store( const char *domain, const char *servername );
+bool saf_join_store( const char *domain, const char *servername );
 bool saf_delete( const char *domain );
 char *saf_fetch( const char *domain );
 NODE_STATUS_STRUCT *node_status_query(int fd,
@@ -3454,7 +3455,7 @@ bool is_valid_share_mode_entry(const struct share_mode_entry *e);
 bool is_deferred_open_entry(const struct share_mode_entry *e);
 bool is_unused_share_mode_entry(const struct share_mode_entry *e);
 void set_share_mode(struct share_mode_lock *lck, files_struct *fsp,
-                       uid_t uid, uint16 mid, uint16 op_type, bool initial_delete_on_close_allowed);
+                   uid_t uid, uint16 mid, uint16 op_type);
 void add_deferred_open(struct share_mode_lock *lck, uint16 mid,
                       struct timeval request_time,
                       struct file_id id);
@@ -3464,11 +3465,9 @@ bool remove_share_oplock(struct share_mode_lock *lck, files_struct *fsp);
 bool downgrade_share_oplock(struct share_mode_lock *lck, files_struct *fsp);
 NTSTATUS can_set_delete_on_close(files_struct *fsp, bool delete_on_close,
                                 uint32 dosmode);
-bool can_set_initial_delete_on_close(const struct share_mode_lock *lck);
 void set_delete_on_close_token(struct share_mode_lock *lck, UNIX_USER_TOKEN *tok);
 void set_delete_on_close_lck(struct share_mode_lock *lck, bool delete_on_close, UNIX_USER_TOKEN *tok);
 bool set_delete_on_close(files_struct *fsp, bool delete_on_close, UNIX_USER_TOKEN *tok);
-bool set_allow_initial_delete_on_close(struct share_mode_lock *lck, files_struct *fsp, bool delete_on_close);
 bool set_sticky_write_time(struct file_id fileid, struct timespec write_time);
 bool set_write_time(struct file_id fileid, struct timespec write_time);
 int share_mode_forall(void (*fn)(const struct share_mode_entry *, const char *,
@@ -3922,7 +3921,7 @@ char *lp_remote_announce(void);
 char *lp_remote_browse_sync(void);
 const char **lp_wins_server_list(void);
 const char **lp_interfaces(void);
-char *lp_socket_address(void);
+const char *lp_socket_address(void);
 char *lp_nis_home_map_name(void);
 const char **lp_netbios_aliases(void);
 const char *lp_passdb_backend(void);
@@ -4136,6 +4135,7 @@ bool lp_hide_special_files(int );
 bool lp_hideunreadable(int );
 bool lp_hideunwriteable_files(int );
 bool lp_browseable(int );
+bool lp_access_based_share_enum(int );
 bool lp_readonly(int );
 bool lp_no_set_dir(int );
 bool lp_guest_ok(int );
@@ -4252,7 +4252,7 @@ const char *lp_ldap_machine_suffix(void);
 const char *lp_ldap_user_suffix(void);
 const char *lp_ldap_group_suffix(void);
 const char *lp_ldap_idmap_suffix(void);
-void *lp_local_ptr(int snum, void *ptr);
+void *lp_local_ptr_by_snum(int snum, void *ptr);
 bool lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue);
 void init_locals(void);
 bool lp_is_default(int snum, struct parm_struct *parm);
@@ -5672,7 +5672,8 @@ void init_samr_user_info16(struct samr_UserInfo16 *r,
                           uint32_t acct_flags);
 void init_samr_user_info18(struct samr_UserInfo18 *r,
                           const uint8 lm_pwd[16],
-                          const uint8 nt_pwd[16]);
+                          const uint8 nt_pwd[16],
+                          uint8_t password_expired);
 void init_samr_user_info20(struct samr_UserInfo20 *r,
                           struct lsa_BinaryString *parameters);
 void init_samr_user_info21(struct samr_UserInfo21 *r,
@@ -6520,70 +6521,6 @@ bool svcctl_io_r_query_service_config2(const char *desc, SVCCTL_R_QUERY_SERVICE_
 bool svcctl_io_q_query_service_status_ex(const char *desc, SVCCTL_Q_QUERY_SERVICE_STATUSEX *q_u, prs_struct *ps, int depth);
 bool svcctl_io_r_query_service_status_ex(const char *desc, SVCCTL_R_QUERY_SERVICE_STATUSEX *r_u, prs_struct *ps, int depth);
 
-/* The following definitions come from rpc_server/srv_dfs_nt.c  */
-
-void _dfs_GetManagerVersion(pipes_struct *p, struct dfs_GetManagerVersion *r);
-WERROR _dfs_Add(pipes_struct *p, struct dfs_Add *r);
-WERROR _dfs_Remove(pipes_struct *p, struct dfs_Remove *r);
-WERROR _dfs_Enum(pipes_struct *p, struct dfs_Enum *r);
-WERROR _dfs_GetInfo(pipes_struct *p, struct dfs_GetInfo *r);
-WERROR _dfs_SetInfo(pipes_struct *p, struct dfs_SetInfo *r);
-WERROR _dfs_Rename(pipes_struct *p, struct dfs_Rename *r);
-WERROR _dfs_Move(pipes_struct *p, struct dfs_Move *r);
-WERROR _dfs_ManagerGetConfigInfo(pipes_struct *p, struct dfs_ManagerGetConfigInfo *r);
-WERROR _dfs_ManagerSendSiteInfo(pipes_struct *p, struct dfs_ManagerSendSiteInfo *r);
-WERROR _dfs_AddFtRoot(pipes_struct *p, struct dfs_AddFtRoot *r);
-WERROR _dfs_RemoveFtRoot(pipes_struct *p, struct dfs_RemoveFtRoot *r);
-WERROR _dfs_AddStdRoot(pipes_struct *p, struct dfs_AddStdRoot *r);
-WERROR _dfs_RemoveStdRoot(pipes_struct *p, struct dfs_RemoveStdRoot *r);
-WERROR _dfs_ManagerInitialize(pipes_struct *p, struct dfs_ManagerInitialize *r);
-WERROR _dfs_AddStdRootForced(pipes_struct *p, struct dfs_AddStdRootForced *r);
-WERROR _dfs_GetDcAddress(pipes_struct *p, struct dfs_GetDcAddress *r);
-WERROR _dfs_SetDcAddress(pipes_struct *p, struct dfs_SetDcAddress *r);
-WERROR _dfs_FlushFtTable(pipes_struct *p, struct dfs_FlushFtTable *r);
-WERROR _dfs_Add2(pipes_struct *p, struct dfs_Add2 *r);
-WERROR _dfs_Remove2(pipes_struct *p, struct dfs_Remove2 *r);
-WERROR _dfs_EnumEx(pipes_struct *p, struct dfs_EnumEx *r);
-WERROR _dfs_SetInfo2(pipes_struct *p, struct dfs_SetInfo2 *r);
-
-/* The following definitions come from rpc_server/srv_dssetup_nt.c  */
-
-WERROR _dssetup_DsRoleGetPrimaryDomainInformation(pipes_struct *p,
-                                                 struct dssetup_DsRoleGetPrimaryDomainInformation *r);
-WERROR _dssetup_DsRoleDnsNameToFlatName(pipes_struct *p,
-                                       struct dssetup_DsRoleDnsNameToFlatName *r);
-WERROR _dssetup_DsRoleDcAsDc(pipes_struct *p,
-                            struct dssetup_DsRoleDcAsDc *r);
-WERROR _dssetup_DsRoleDcAsReplica(pipes_struct *p,
-                                 struct dssetup_DsRoleDcAsReplica *r);
-WERROR _dssetup_DsRoleDemoteDc(pipes_struct *p,
-                              struct dssetup_DsRoleDemoteDc *r);
-WERROR _dssetup_DsRoleGetDcOperationProgress(pipes_struct *p,
-                                            struct dssetup_DsRoleGetDcOperationProgress *r);
-WERROR _dssetup_DsRoleGetDcOperationResults(pipes_struct *p,
-                                           struct dssetup_DsRoleGetDcOperationResults *r);
-WERROR _dssetup_DsRoleCancel(pipes_struct *p,
-                            struct dssetup_DsRoleCancel *r);
-WERROR _dssetup_DsRoleServerSaveStateForUpgrade(pipes_struct *p,
-                                               struct dssetup_DsRoleServerSaveStateForUpgrade *r);
-WERROR _dssetup_DsRoleUpgradeDownlevelServer(pipes_struct *p,
-                                            struct dssetup_DsRoleUpgradeDownlevelServer *r);
-WERROR _dssetup_DsRoleAbortDownlevelServerUpgrade(pipes_struct *p,
-                                                 struct dssetup_DsRoleAbortDownlevelServerUpgrade *r);
-
-/* The following definitions come from rpc_server/srv_echo_nt.c  */
-
-void _echo_AddOne(pipes_struct *p, struct echo_AddOne *r );
-void _echo_EchoData(pipes_struct *p, struct echo_EchoData *r);
-void _echo_SinkData(pipes_struct *p, struct echo_SinkData *r);
-void _echo_SourceData(pipes_struct *p, struct echo_SourceData *r);
-void _echo_TestCall(pipes_struct *p, struct echo_TestCall *r);
-NTSTATUS _echo_TestCall2(pipes_struct *p, struct echo_TestCall2 *r);
-uint32 _echo_TestSleep(pipes_struct *p, struct echo_TestSleep *r);
-void _echo_TestEnum(pipes_struct *p, struct echo_TestEnum *r);
-void _echo_TestSurrounding(pipes_struct *p, struct echo_TestSurrounding *r);
-uint16 _echo_TestDoublePointer(pipes_struct *p, struct echo_TestDoublePointer *r);
-
 /* The following definitions come from rpc_server/srv_eventlog.c  */
 
 NTSTATUS rpc_eventlog2_init(void);
@@ -6604,43 +6541,9 @@ bool parse_logentry( char *line, Eventlog_entry * entry, bool * eor );
 
 /* The following definitions come from rpc_server/srv_eventlog_nt.c  */
 
-NTSTATUS _eventlog_OpenEventLogW(pipes_struct *p,
-                                struct eventlog_OpenEventLogW *r);
-NTSTATUS _eventlog_ClearEventLogW(pipes_struct *p,
-                                 struct eventlog_ClearEventLogW *r);
-NTSTATUS _eventlog_CloseEventLog( pipes_struct * p, struct eventlog_CloseEventLog *r );
 NTSTATUS _eventlog_read_eventlog( pipes_struct * p,
                                EVENTLOG_Q_READ_EVENTLOG * q_u,
                                EVENTLOG_R_READ_EVENTLOG * r_u );
-NTSTATUS _eventlog_GetOldestRecord(pipes_struct *p,
-                                  struct eventlog_GetOldestRecord *r);
-NTSTATUS _eventlog_GetNumRecords(pipes_struct *p,
-                                struct eventlog_GetNumRecords *r);
-NTSTATUS _eventlog_BackupEventLogW(pipes_struct *p, struct eventlog_BackupEventLogW *r);
-NTSTATUS _eventlog_DeregisterEventSource(pipes_struct *p, struct eventlog_DeregisterEventSource *r);
-NTSTATUS _eventlog_ChangeNotify(pipes_struct *p, struct eventlog_ChangeNotify *r);
-NTSTATUS _eventlog_RegisterEventSourceW(pipes_struct *p, struct eventlog_RegisterEventSourceW *r);
-NTSTATUS _eventlog_OpenBackupEventLogW(pipes_struct *p, struct eventlog_OpenBackupEventLogW *r);
-NTSTATUS _eventlog_ReadEventLogW(pipes_struct *p, struct eventlog_ReadEventLogW *r);
-NTSTATUS _eventlog_ReportEventW(pipes_struct *p, struct eventlog_ReportEventW *r);
-NTSTATUS _eventlog_ClearEventLogA(pipes_struct *p, struct eventlog_ClearEventLogA *r);
-NTSTATUS _eventlog_BackupEventLogA(pipes_struct *p, struct eventlog_BackupEventLogA *r);
-NTSTATUS _eventlog_OpenEventLogA(pipes_struct *p, struct eventlog_OpenEventLogA *r);
-NTSTATUS _eventlog_RegisterEventSourceA(pipes_struct *p, struct eventlog_RegisterEventSourceA *r);
-NTSTATUS _eventlog_OpenBackupEventLogA(pipes_struct *p, struct eventlog_OpenBackupEventLogA *r);
-NTSTATUS _eventlog_ReadEventLogA(pipes_struct *p, struct eventlog_ReadEventLogA *r);
-NTSTATUS _eventlog_ReportEventA(pipes_struct *p, struct eventlog_ReportEventA *r);
-NTSTATUS _eventlog_RegisterClusterSvc(pipes_struct *p, struct eventlog_RegisterClusterSvc *r);
-NTSTATUS _eventlog_DeregisterClusterSvc(pipes_struct *p, struct eventlog_DeregisterClusterSvc *r);
-NTSTATUS _eventlog_WriteClusterEvents(pipes_struct *p, struct eventlog_WriteClusterEvents *r);
-NTSTATUS _eventlog_GetLogIntormation(pipes_struct *p, struct eventlog_GetLogIntormation *r);
-NTSTATUS _eventlog_FlushEventLog(pipes_struct *p, struct eventlog_FlushEventLog *r);
-
-/* The following definitions come from rpc_server/srv_initshutdown_nt.c  */
-
-WERROR _initshutdown_Init(pipes_struct *p, struct initshutdown_Init *r);
-WERROR _initshutdown_InitEx(pipes_struct *p, struct initshutdown_InitEx *r);
-WERROR _initshutdown_Abort(pipes_struct *p, struct initshutdown_Abort *r);
 
 /* The following definitions come from rpc_server/srv_lsa_hnd.c  */
 
@@ -6651,216 +6554,6 @@ bool close_policy_hnd(pipes_struct *p, POLICY_HND *hnd);
 void close_policy_by_pipe(pipes_struct *p);
 bool pipe_access_check(pipes_struct *p);
 
-/* The following definitions come from rpc_server/srv_lsa_nt.c  */
-
-NTSTATUS _lsa_OpenPolicy2(pipes_struct *p,
-                         struct lsa_OpenPolicy2 *r);
-NTSTATUS _lsa_OpenPolicy(pipes_struct *p,
-                        struct lsa_OpenPolicy *r);
-NTSTATUS _lsa_EnumTrustDom(pipes_struct *p,
-                          struct lsa_EnumTrustDom *r);
-NTSTATUS _lsa_QueryInfoPolicy(pipes_struct *p,
-                             struct lsa_QueryInfoPolicy *r);
-NTSTATUS _lsa_LookupSids(pipes_struct *p,
-                        struct lsa_LookupSids *r);
-NTSTATUS _lsa_LookupSids2(pipes_struct *p,
-                         struct lsa_LookupSids2 *r);
-NTSTATUS _lsa_LookupSids3(pipes_struct *p,
-                         struct lsa_LookupSids3 *r);
-NTSTATUS _lsa_LookupNames(pipes_struct *p,
-                         struct lsa_LookupNames *r);
-NTSTATUS _lsa_LookupNames2(pipes_struct *p,
-                          struct lsa_LookupNames2 *r);
-NTSTATUS _lsa_LookupNames3(pipes_struct *p,
-                          struct lsa_LookupNames3 *r);
-NTSTATUS _lsa_LookupNames4(pipes_struct *p,
-                          struct lsa_LookupNames4 *r);
-NTSTATUS _lsa_Close(pipes_struct *p, struct lsa_Close *r);
-NTSTATUS _lsa_OpenSecret(pipes_struct *p, struct lsa_OpenSecret *r);
-NTSTATUS _lsa_OpenTrustedDomain(pipes_struct *p, struct lsa_OpenTrustedDomain *r);
-NTSTATUS _lsa_CreateTrustedDomain(pipes_struct *p, struct lsa_CreateTrustedDomain *r);
-NTSTATUS _lsa_CreateSecret(pipes_struct *p, struct lsa_CreateSecret *r);
-NTSTATUS _lsa_SetSecret(pipes_struct *p, struct lsa_SetSecret *r);
-NTSTATUS _lsa_DeleteObject(pipes_struct *p,
-                          struct lsa_DeleteObject *r);
-NTSTATUS _lsa_EnumPrivs(pipes_struct *p,
-                       struct lsa_EnumPrivs *r);
-NTSTATUS _lsa_LookupPrivDisplayName(pipes_struct *p,
-                                   struct lsa_LookupPrivDisplayName *r);
-NTSTATUS _lsa_EnumAccounts(pipes_struct *p,
-                          struct lsa_EnumAccounts *r);
-NTSTATUS _lsa_GetUserName(pipes_struct *p,
-                         struct lsa_GetUserName *r);
-NTSTATUS _lsa_CreateAccount(pipes_struct *p,
-                           struct lsa_CreateAccount *r);
-NTSTATUS _lsa_OpenAccount(pipes_struct *p,
-                         struct lsa_OpenAccount *r);
-NTSTATUS _lsa_EnumPrivsAccount(pipes_struct *p,
-                              struct lsa_EnumPrivsAccount *r);
-NTSTATUS _lsa_GetSystemAccessAccount(pipes_struct *p,
-                                    struct lsa_GetSystemAccessAccount *r);
-NTSTATUS _lsa_SetSystemAccessAccount(pipes_struct *p,
-                                    struct lsa_SetSystemAccessAccount *r);
-NTSTATUS _lsa_AddPrivilegesToAccount(pipes_struct *p,
-                                    struct lsa_AddPrivilegesToAccount *r);
-NTSTATUS _lsa_RemovePrivilegesFromAccount(pipes_struct *p,
-                                         struct lsa_RemovePrivilegesFromAccount *r);
-NTSTATUS _lsa_QuerySecurity(pipes_struct *p,
-                           struct lsa_QuerySecurity *r);
-NTSTATUS _lsa_AddAccountRights(pipes_struct *p,
-                              struct lsa_AddAccountRights *r);
-NTSTATUS _lsa_RemoveAccountRights(pipes_struct *p,
-                                 struct lsa_RemoveAccountRights *r);
-NTSTATUS _lsa_EnumAccountRights(pipes_struct *p,
-                               struct lsa_EnumAccountRights *r);
-NTSTATUS _lsa_LookupPrivValue(pipes_struct *p,
-                             struct lsa_LookupPrivValue *r);
-NTSTATUS _lsa_Delete(pipes_struct *p, struct lsa_Delete *r);
-NTSTATUS _lsa_SetSecObj(pipes_struct *p, struct lsa_SetSecObj *r);
-NTSTATUS _lsa_ChangePassword(pipes_struct *p, struct lsa_ChangePassword *r);
-NTSTATUS _lsa_SetInfoPolicy(pipes_struct *p, struct lsa_SetInfoPolicy *r);
-NTSTATUS _lsa_ClearAuditLog(pipes_struct *p, struct lsa_ClearAuditLog *r);
-NTSTATUS _lsa_GetQuotasForAccount(pipes_struct *p, struct lsa_GetQuotasForAccount *r);
-NTSTATUS _lsa_SetQuotasForAccount(pipes_struct *p, struct lsa_SetQuotasForAccount *r);
-NTSTATUS _lsa_QueryTrustedDomainInfo(pipes_struct *p, struct lsa_QueryTrustedDomainInfo *r);
-NTSTATUS _lsa_SetInformationTrustedDomain(pipes_struct *p, struct lsa_SetInformationTrustedDomain *r);
-NTSTATUS _lsa_QuerySecret(pipes_struct *p, struct lsa_QuerySecret *r);
-NTSTATUS _lsa_LookupPrivName(pipes_struct *p, struct lsa_LookupPrivName *r);
-NTSTATUS _lsa_EnumAccountsWithUserRight(pipes_struct *p, struct lsa_EnumAccountsWithUserRight *r);
-NTSTATUS _lsa_QueryTrustedDomainInfoBySid(pipes_struct *p, struct lsa_QueryTrustedDomainInfoBySid *r);
-NTSTATUS _lsa_SetTrustedDomainInfo(pipes_struct *p, struct lsa_SetTrustedDomainInfo *r);
-NTSTATUS _lsa_DeleteTrustedDomain(pipes_struct *p, struct lsa_DeleteTrustedDomain *r);
-NTSTATUS _lsa_StorePrivateData(pipes_struct *p, struct lsa_StorePrivateData *r);
-NTSTATUS _lsa_RetrievePrivateData(pipes_struct *p, struct lsa_RetrievePrivateData *r);
-NTSTATUS _lsa_QueryInfoPolicy2(pipes_struct *p, struct lsa_QueryInfoPolicy2 *r);
-NTSTATUS _lsa_SetInfoPolicy2(pipes_struct *p, struct lsa_SetInfoPolicy2 *r);
-NTSTATUS _lsa_QueryTrustedDomainInfoByName(pipes_struct *p, struct lsa_QueryTrustedDomainInfoByName *r);
-NTSTATUS _lsa_SetTrustedDomainInfoByName(pipes_struct *p, struct lsa_SetTrustedDomainInfoByName *r);
-NTSTATUS _lsa_EnumTrustedDomainsEx(pipes_struct *p, struct lsa_EnumTrustedDomainsEx *r);
-NTSTATUS _lsa_CreateTrustedDomainEx(pipes_struct *p, struct lsa_CreateTrustedDomainEx *r);
-NTSTATUS _lsa_CloseTrustedDomainEx(pipes_struct *p, struct lsa_CloseTrustedDomainEx *r);
-NTSTATUS _lsa_QueryDomainInformationPolicy(pipes_struct *p, struct lsa_QueryDomainInformationPolicy *r);
-NTSTATUS _lsa_SetDomainInformationPolicy(pipes_struct *p, struct lsa_SetDomainInformationPolicy *r);
-NTSTATUS _lsa_OpenTrustedDomainByName(pipes_struct *p, struct lsa_OpenTrustedDomainByName *r);
-NTSTATUS _lsa_TestCall(pipes_struct *p, struct lsa_TestCall *r);
-NTSTATUS _lsa_CreateTrustedDomainEx2(pipes_struct *p, struct lsa_CreateTrustedDomainEx2 *r);
-NTSTATUS _lsa_CREDRWRITE(pipes_struct *p, struct lsa_CREDRWRITE *r);
-NTSTATUS _lsa_CREDRREAD(pipes_struct *p, struct lsa_CREDRREAD *r);
-NTSTATUS _lsa_CREDRENUMERATE(pipes_struct *p, struct lsa_CREDRENUMERATE *r);
-NTSTATUS _lsa_CREDRWRITEDOMAINCREDENTIALS(pipes_struct *p, struct lsa_CREDRWRITEDOMAINCREDENTIALS *r);
-NTSTATUS _lsa_CREDRREADDOMAINCREDENTIALS(pipes_struct *p, struct lsa_CREDRREADDOMAINCREDENTIALS *r);
-NTSTATUS _lsa_CREDRDELETE(pipes_struct *p, struct lsa_CREDRDELETE *r);
-NTSTATUS _lsa_CREDRGETTARGETINFO(pipes_struct *p, struct lsa_CREDRGETTARGETINFO *r);
-NTSTATUS _lsa_CREDRPROFILELOADED(pipes_struct *p, struct lsa_CREDRPROFILELOADED *r);
-NTSTATUS _lsa_CREDRGETSESSIONTYPES(pipes_struct *p, struct lsa_CREDRGETSESSIONTYPES *r);
-NTSTATUS _lsa_LSARREGISTERAUDITEVENT(pipes_struct *p, struct lsa_LSARREGISTERAUDITEVENT *r);
-NTSTATUS _lsa_LSARGENAUDITEVENT(pipes_struct *p, struct lsa_LSARGENAUDITEVENT *r);
-NTSTATUS _lsa_LSARUNREGISTERAUDITEVENT(pipes_struct *p, struct lsa_LSARUNREGISTERAUDITEVENT *r);
-NTSTATUS _lsa_lsaRQueryForestTrustInformation(pipes_struct *p, struct lsa_lsaRQueryForestTrustInformation *r);
-NTSTATUS _lsa_LSARSETFORESTTRUSTINFORMATION(pipes_struct *p, struct lsa_LSARSETFORESTTRUSTINFORMATION *r);
-NTSTATUS _lsa_CREDRRENAME(pipes_struct *p, struct lsa_CREDRRENAME *r);
-NTSTATUS _lsa_LSAROPENPOLICYSCE(pipes_struct *p, struct lsa_LSAROPENPOLICYSCE *r);
-NTSTATUS _lsa_LSARADTREGISTERSECURITYEVENTSOURCE(pipes_struct *p, struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE *r);
-NTSTATUS _lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(pipes_struct *p, struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE *r);
-NTSTATUS _lsa_LSARADTREPORTSECURITYEVENT(pipes_struct *p, struct lsa_LSARADTREPORTSECURITYEVENT *r);
-
-/* The following definitions come from rpc_server/srv_netlog_nt.c  */
-
-WERROR _netr_LogonControl(pipes_struct *p,
-                         struct netr_LogonControl *r);
-WERROR _netr_LogonControl2(pipes_struct *p,
-                          struct netr_LogonControl2 *r);
-WERROR _netr_NetrEnumerateTrustedDomains(pipes_struct *p,
-                                        struct netr_NetrEnumerateTrustedDomains *r);
-NTSTATUS _netr_ServerReqChallenge(pipes_struct *p,
-                                 struct netr_ServerReqChallenge *r);
-NTSTATUS _netr_ServerAuthenticate(pipes_struct *p,
-                                 struct netr_ServerAuthenticate *r);
-NTSTATUS _netr_ServerAuthenticate2(pipes_struct *p,
-                                  struct netr_ServerAuthenticate2 *r);
-NTSTATUS _netr_ServerPasswordSet(pipes_struct *p,
-                                struct netr_ServerPasswordSet *r);
-NTSTATUS _netr_LogonSamLogoff(pipes_struct *p,
-                             struct netr_LogonSamLogoff *r);
-NTSTATUS _netr_LogonSamLogon(pipes_struct *p,
-                            struct netr_LogonSamLogon *r);
-NTSTATUS _netr_LogonSamLogonEx(pipes_struct *p,
-                              struct netr_LogonSamLogonEx *r);
-WERROR _netr_LogonUasLogon(pipes_struct *p,
-                          struct netr_LogonUasLogon *r);
-WERROR _netr_LogonUasLogoff(pipes_struct *p,
-                           struct netr_LogonUasLogoff *r);
-NTSTATUS _netr_DatabaseDeltas(pipes_struct *p,
-                             struct netr_DatabaseDeltas *r);
-NTSTATUS _netr_DatabaseSync(pipes_struct *p,
-                           struct netr_DatabaseSync *r);
-NTSTATUS _netr_AccountDeltas(pipes_struct *p,
-                            struct netr_AccountDeltas *r);
-NTSTATUS _netr_AccountSync(pipes_struct *p,
-                          struct netr_AccountSync *r);
-WERROR _netr_GetDcName(pipes_struct *p,
-                      struct netr_GetDcName *r);
-WERROR _netr_GetAnyDCName(pipes_struct *p,
-                         struct netr_GetAnyDCName *r);
-NTSTATUS _netr_DatabaseSync2(pipes_struct *p,
-                            struct netr_DatabaseSync2 *r);
-NTSTATUS _netr_DatabaseRedo(pipes_struct *p,
-                           struct netr_DatabaseRedo *r);
-WERROR _netr_LogonControl2Ex(pipes_struct *p,
-                            struct netr_LogonControl2Ex *r);
-WERROR _netr_DsRGetDCName(pipes_struct *p,
-                         struct netr_DsRGetDCName *r);
-WERROR _netr_NETRLOGONDUMMYROUTINE1(pipes_struct *p,
-                                   struct netr_NETRLOGONDUMMYROUTINE1 *r);
-WERROR _netr_NETRLOGONSETSERVICEBITS(pipes_struct *p,
-                                    struct netr_NETRLOGONSETSERVICEBITS *r);
-WERROR _netr_LogonGetTrustRid(pipes_struct *p,
-                             struct netr_LogonGetTrustRid *r);
-WERROR _netr_NETRLOGONCOMPUTESERVERDIGEST(pipes_struct *p,
-                                         struct netr_NETRLOGONCOMPUTESERVERDIGEST *r);
-WERROR _netr_NETRLOGONCOMPUTECLIENTDIGEST(pipes_struct *p,
-                                         struct netr_NETRLOGONCOMPUTECLIENTDIGEST *r);
-NTSTATUS _netr_ServerAuthenticate3(pipes_struct *p,
-                                  struct netr_ServerAuthenticate3 *r);
-WERROR _netr_DsRGetDCNameEx(pipes_struct *p,
-                           struct netr_DsRGetDCNameEx *r);
-WERROR _netr_DsRGetSiteName(pipes_struct *p,
-                           struct netr_DsRGetSiteName *r);
-NTSTATUS _netr_LogonGetDomainInfo(pipes_struct *p,
-                                 struct netr_LogonGetDomainInfo *r);
-NTSTATUS _netr_ServerPasswordSet2(pipes_struct *p,
-                                 struct netr_ServerPasswordSet2 *r);
-WERROR _netr_ServerPasswordGet(pipes_struct *p,
-                              struct netr_ServerPasswordGet *r);
-WERROR _netr_NETRLOGONSENDTOSAM(pipes_struct *p,
-                               struct netr_NETRLOGONSENDTOSAM *r);
-WERROR _netr_DsRAddressToSitenamesW(pipes_struct *p,
-                                   struct netr_DsRAddressToSitenamesW *r);
-WERROR _netr_DsRGetDCNameEx2(pipes_struct *p,
-                            struct netr_DsRGetDCNameEx2 *r);
-WERROR _netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(pipes_struct *p,
-                                                struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN *r);
-WERROR _netr_NetrEnumerateTrustedDomainsEx(pipes_struct *p,
-                                          struct netr_NetrEnumerateTrustedDomainsEx *r);
-WERROR _netr_DsRAddressToSitenamesExW(pipes_struct *p,
-                                     struct netr_DsRAddressToSitenamesExW *r);
-WERROR _netr_DsrGetDcSiteCoverageW(pipes_struct *p,
-                                  struct netr_DsrGetDcSiteCoverageW *r);
-WERROR _netr_DsrEnumerateDomainTrusts(pipes_struct *p,
-                                     struct netr_DsrEnumerateDomainTrusts *r);
-WERROR _netr_DsrDeregisterDNSHostRecords(pipes_struct *p,
-                                        struct netr_DsrDeregisterDNSHostRecords *r);
-NTSTATUS _netr_ServerTrustPasswordsGet(pipes_struct *p,
-                                      struct netr_ServerTrustPasswordsGet *r);
-WERROR _netr_DsRGetForestTrustInformation(pipes_struct *p,
-                                         struct netr_DsRGetForestTrustInformation *r);
-WERROR _netr_GetForestTrustInformation(pipes_struct *p,
-                                      struct netr_GetForestTrustInformation *r);
-NTSTATUS _netr_LogonSamLogonWithFlags(pipes_struct *p,
-                                     struct netr_LogonSamLogonWithFlags *r);
-WERROR _netr_NETRSERVERGETTRUSTINFO(pipes_struct *p,
-                                   struct netr_NETRSERVERGETTRUSTINFO *r);
-
 /* The following definitions come from rpc_server/srv_ntsvcs.c  */
 
 void ntsvcs2_get_pipe_fns( struct api_struct **fns, int *n_fns );
@@ -6868,137 +6561,7 @@ NTSTATUS rpc_ntsvcs2_init(void);
 
 /* The following definitions come from rpc_server/srv_ntsvcs_nt.c  */
 
-WERROR _PNP_GetVersion(pipes_struct *p,
-                      struct PNP_GetVersion *r);
-WERROR _PNP_GetDeviceListSize(pipes_struct *p,
-                             struct PNP_GetDeviceListSize *r);
 WERROR _ntsvcs_get_device_list( pipes_struct *p, NTSVCS_Q_GET_DEVICE_LIST *q_u, NTSVCS_R_GET_DEVICE_LIST *r_u );
-WERROR _PNP_ValidateDeviceInstance(pipes_struct *p,
-                                  struct PNP_ValidateDeviceInstance *r);
-WERROR _PNP_GetHwProfInfo(pipes_struct *p,
-                         struct PNP_GetHwProfInfo *r);
-WERROR _PNP_HwProfFlags(pipes_struct *p,
-                       struct PNP_HwProfFlags *r);
-WERROR _PNP_Disconnect(pipes_struct *p,
-                      struct PNP_Disconnect *r);
-WERROR _PNP_Connect(pipes_struct *p,
-                   struct PNP_Connect *r);
-WERROR _PNP_GetGlobalState(pipes_struct *p,
-                          struct PNP_GetGlobalState *r);
-WERROR _PNP_InitDetection(pipes_struct *p,
-                         struct PNP_InitDetection *r);
-WERROR _PNP_ReportLogOn(pipes_struct *p,
-                       struct PNP_ReportLogOn *r);
-WERROR _PNP_GetRootDeviceInstance(pipes_struct *p,
-                                 struct PNP_GetRootDeviceInstance *r);
-WERROR _PNP_GetRelatedDeviceInstance(pipes_struct *p,
-                                    struct PNP_GetRelatedDeviceInstance *r);
-WERROR _PNP_EnumerateSubKeys(pipes_struct *p,
-                            struct PNP_EnumerateSubKeys *r);
-WERROR _PNP_GetDeviceList(pipes_struct *p,
-                         struct PNP_GetDeviceList *r);
-WERROR _PNP_GetDepth(pipes_struct *p,
-                    struct PNP_GetDepth *r);
-WERROR _PNP_GetDeviceRegProp(pipes_struct *p,
-                            struct PNP_GetDeviceRegProp *r);
-WERROR _PNP_SetDeviceRegProp(pipes_struct *p,
-                            struct PNP_SetDeviceRegProp *r);
-WERROR _PNP_GetClassInstance(pipes_struct *p,
-                            struct PNP_GetClassInstance *r);
-WERROR _PNP_CreateKey(pipes_struct *p,
-                     struct PNP_CreateKey *r);
-WERROR _PNP_DeleteRegistryKey(pipes_struct *p,
-                             struct PNP_DeleteRegistryKey *r);
-WERROR _PNP_GetClassCount(pipes_struct *p,
-                         struct PNP_GetClassCount *r);
-WERROR _PNP_GetClassName(pipes_struct *p,
-                        struct PNP_GetClassName *r);
-WERROR _PNP_DeleteClassKey(pipes_struct *p,
-                          struct PNP_DeleteClassKey *r);
-WERROR _PNP_GetInterfaceDeviceAlias(pipes_struct *p,
-                                   struct PNP_GetInterfaceDeviceAlias *r);
-WERROR _PNP_GetInterfaceDeviceList(pipes_struct *p,
-                                  struct PNP_GetInterfaceDeviceList *r);
-WERROR _PNP_GetInterfaceDeviceListSize(pipes_struct *p,
-                                      struct PNP_GetInterfaceDeviceListSize *r);
-WERROR _PNP_RegisterDeviceClassAssociation(pipes_struct *p,
-                                          struct PNP_RegisterDeviceClassAssociation *r);
-WERROR _PNP_UnregisterDeviceClassAssociation(pipes_struct *p,
-                                            struct PNP_UnregisterDeviceClassAssociation *r);
-WERROR _PNP_GetClassRegProp(pipes_struct *p,
-                           struct PNP_GetClassRegProp *r);
-WERROR _PNP_SetClassRegProp(pipes_struct *p,
-                           struct PNP_SetClassRegProp *r);
-WERROR _PNP_CreateDevInst(pipes_struct *p,
-                         struct PNP_CreateDevInst *r);
-WERROR _PNP_DeviceInstanceAction(pipes_struct *p,
-                                struct PNP_DeviceInstanceAction *r);
-WERROR _PNP_GetDeviceStatus(pipes_struct *p,
-                           struct PNP_GetDeviceStatus *r);
-WERROR _PNP_SetDeviceProblem(pipes_struct *p,
-                            struct PNP_SetDeviceProblem *r);
-WERROR _PNP_DisableDevInst(pipes_struct *p,
-                          struct PNP_DisableDevInst *r);
-WERROR _PNP_UninstallDevInst(pipes_struct *p,
-                            struct PNP_UninstallDevInst *r);
-WERROR _PNP_AddID(pipes_struct *p,
-                 struct PNP_AddID *r);
-WERROR _PNP_RegisterDriver(pipes_struct *p,
-                          struct PNP_RegisterDriver *r);
-WERROR _PNP_QueryRemove(pipes_struct *p,
-                       struct PNP_QueryRemove *r);
-WERROR _PNP_RequestDeviceEject(pipes_struct *p,
-                              struct PNP_RequestDeviceEject *r);
-WERROR _PNP_IsDockStationPresent(pipes_struct *p,
-                                struct PNP_IsDockStationPresent *r);
-WERROR _PNP_RequestEjectPC(pipes_struct *p,
-                          struct PNP_RequestEjectPC *r);
-WERROR _PNP_AddEmptyLogConf(pipes_struct *p,
-                           struct PNP_AddEmptyLogConf *r);
-WERROR _PNP_FreeLogConf(pipes_struct *p,
-                       struct PNP_FreeLogConf *r);
-WERROR _PNP_GetFirstLogConf(pipes_struct *p,
-                           struct PNP_GetFirstLogConf *r);
-WERROR _PNP_GetNextLogConf(pipes_struct *p,
-                          struct PNP_GetNextLogConf *r);
-WERROR _PNP_GetLogConfPriority(pipes_struct *p,
-                              struct PNP_GetLogConfPriority *r);
-WERROR _PNP_AddResDes(pipes_struct *p,
-                     struct PNP_AddResDes *r);
-WERROR _PNP_FreeResDes(pipes_struct *p,
-                      struct PNP_FreeResDes *r);
-WERROR _PNP_GetNextResDes(pipes_struct *p,
-                         struct PNP_GetNextResDes *r);
-WERROR _PNP_GetResDesData(pipes_struct *p,
-                         struct PNP_GetResDesData *r);
-WERROR _PNP_GetResDesDataSize(pipes_struct *p,
-                             struct PNP_GetResDesDataSize *r);
-WERROR _PNP_ModifyResDes(pipes_struct *p,
-                        struct PNP_ModifyResDes *r);
-WERROR _PNP_DetectResourceLimit(pipes_struct *p,
-                               struct PNP_DetectResourceLimit *r);
-WERROR _PNP_QueryResConfList(pipes_struct *p,
-                            struct PNP_QueryResConfList *r);
-WERROR _PNP_SetHwProf(pipes_struct *p,
-                     struct PNP_SetHwProf *r);
-WERROR _PNP_QueryArbitratorFreeData(pipes_struct *p,
-                                   struct PNP_QueryArbitratorFreeData *r);
-WERROR _PNP_QueryArbitratorFreeSize(pipes_struct *p,
-                                   struct PNP_QueryArbitratorFreeSize *r);
-WERROR _PNP_RunDetection(pipes_struct *p,
-                        struct PNP_RunDetection *r);
-WERROR _PNP_RegisterNotification(pipes_struct *p,
-                                struct PNP_RegisterNotification *r);
-WERROR _PNP_UnregisterNotification(pipes_struct *p,
-                                  struct PNP_UnregisterNotification *r);
-WERROR _PNP_GetCustomDevProp(pipes_struct *p,
-                            struct PNP_GetCustomDevProp *r);
-WERROR _PNP_GetVersionInternal(pipes_struct *p,
-                              struct PNP_GetVersionInternal *r);
-WERROR _PNP_GetBlockedDriverInfo(pipes_struct *p,
-                                struct PNP_GetBlockedDriverInfo *r);
-WERROR _PNP_GetServerSideDeviceInstallFlags(pipes_struct *p,
-                                           struct PNP_GetServerSideDeviceInstallFlags *r);
 
 /* The following definitions come from rpc_server/srv_pipe.c  */
 
@@ -7035,145 +6598,6 @@ NTSTATUS np_write(struct files_struct *fsp, const uint8_t *data, size_t len,
 NTSTATUS np_read(struct files_struct *fsp, uint8_t *data, size_t len,
                 ssize_t *nread, bool *is_data_outstanding);
 
-
-/* The following definitions come from rpc_server/srv_samr_nt.c  */
-
-NTSTATUS _samr_Close(pipes_struct *p, struct samr_Close *r);
-NTSTATUS _samr_OpenDomain(pipes_struct *p,
-                         struct samr_OpenDomain *r);
-NTSTATUS _samr_GetUserPwInfo(pipes_struct *p,
-                            struct samr_GetUserPwInfo *r);
-NTSTATUS _samr_SetSecurity(pipes_struct *p,
-                          struct samr_SetSecurity *r);
-NTSTATUS _samr_QuerySecurity(pipes_struct *p,
-                            struct samr_QuerySecurity *r);
-NTSTATUS _samr_EnumDomainUsers(pipes_struct *p,
-                              struct samr_EnumDomainUsers *r);
-NTSTATUS _samr_EnumDomainGroups(pipes_struct *p,
-                               struct samr_EnumDomainGroups *r);
-NTSTATUS _samr_EnumDomainAliases(pipes_struct *p,
-                                struct samr_EnumDomainAliases *r);
-NTSTATUS _samr_QueryDisplayInfo(pipes_struct *p,
-                               struct samr_QueryDisplayInfo *r);
-NTSTATUS _samr_QueryDisplayInfo2(pipes_struct *p,
-                                struct samr_QueryDisplayInfo2 *r);
-NTSTATUS _samr_QueryDisplayInfo3(pipes_struct *p,
-                                struct samr_QueryDisplayInfo3 *r);
-NTSTATUS _samr_QueryAliasInfo(pipes_struct *p,
-                             struct samr_QueryAliasInfo *r);
-NTSTATUS _samr_LookupNames(pipes_struct *p,
-                          struct samr_LookupNames *r);
-NTSTATUS _samr_ChangePasswordUser2(pipes_struct *p,
-                                  struct samr_ChangePasswordUser2 *r);
-NTSTATUS _samr_ChangePasswordUser3(pipes_struct *p,
-                                  struct samr_ChangePasswordUser3 *r);
-NTSTATUS _samr_LookupRids(pipes_struct *p,
-                         struct samr_LookupRids *r);
-NTSTATUS _samr_OpenUser(pipes_struct *p,
-                       struct samr_OpenUser *r);
-NTSTATUS _samr_QueryUserInfo(pipes_struct *p,
-                            struct samr_QueryUserInfo *r);
-NTSTATUS _samr_GetGroupsForUser(pipes_struct *p,
-                               struct samr_GetGroupsForUser *r);
-NTSTATUS _samr_QueryDomainInfo(pipes_struct *p,
-                              struct samr_QueryDomainInfo *r);
-NTSTATUS _samr_CreateUser2(pipes_struct *p,
-                          struct samr_CreateUser2 *r);
-NTSTATUS _samr_Connect(pipes_struct *p,
-                      struct samr_Connect *r);
-NTSTATUS _samr_Connect2(pipes_struct *p,
-                       struct samr_Connect2 *r);
-NTSTATUS _samr_Connect4(pipes_struct *p,
-                       struct samr_Connect4 *r);
-NTSTATUS _samr_Connect5(pipes_struct *p,
-                       struct samr_Connect5 *r);
-NTSTATUS _samr_LookupDomain(pipes_struct *p,
-                           struct samr_LookupDomain *r);
-NTSTATUS _samr_EnumDomains(pipes_struct *p,
-                          struct samr_EnumDomains *r);
-NTSTATUS _samr_OpenAlias(pipes_struct *p,
-                        struct samr_OpenAlias *r);
-NTSTATUS _samr_SetUserInfo(pipes_struct *p,
-                          struct samr_SetUserInfo *r);
-NTSTATUS _samr_SetUserInfo2(pipes_struct *p,
-                           struct samr_SetUserInfo2 *r);
-NTSTATUS _samr_GetAliasMembership(pipes_struct *p,
-                                 struct samr_GetAliasMembership *r);
-NTSTATUS _samr_GetMembersInAlias(pipes_struct *p,
-                                struct samr_GetMembersInAlias *r);
-NTSTATUS _samr_QueryGroupMember(pipes_struct *p,
-                               struct samr_QueryGroupMember *r);
-NTSTATUS _samr_AddAliasMember(pipes_struct *p,
-                             struct samr_AddAliasMember *r);
-NTSTATUS _samr_DeleteAliasMember(pipes_struct *p,
-                                struct samr_DeleteAliasMember *r);
-NTSTATUS _samr_AddGroupMember(pipes_struct *p,
-                             struct samr_AddGroupMember *r);
-NTSTATUS _samr_DeleteGroupMember(pipes_struct *p,
-                                struct samr_DeleteGroupMember *r);
-NTSTATUS _samr_DeleteUser(pipes_struct *p,
-                         struct samr_DeleteUser *r);
-NTSTATUS _samr_DeleteDomainGroup(pipes_struct *p,
-                                struct samr_DeleteDomainGroup *r);
-NTSTATUS _samr_DeleteDomAlias(pipes_struct *p,
-                             struct samr_DeleteDomAlias *r);
-NTSTATUS _samr_CreateDomainGroup(pipes_struct *p,
-                                struct samr_CreateDomainGroup *r);
-NTSTATUS _samr_CreateDomAlias(pipes_struct *p,
-                             struct samr_CreateDomAlias *r);
-NTSTATUS _samr_QueryGroupInfo(pipes_struct *p,
-                             struct samr_QueryGroupInfo *r);
-NTSTATUS _samr_SetGroupInfo(pipes_struct *p,
-                           struct samr_SetGroupInfo *r);
-NTSTATUS _samr_SetAliasInfo(pipes_struct *p,
-                           struct samr_SetAliasInfo *r);
-NTSTATUS _samr_GetDomPwInfo(pipes_struct *p,
-                           struct samr_GetDomPwInfo *r);
-NTSTATUS _samr_OpenGroup(pipes_struct *p,
-                        struct samr_OpenGroup *r);
-NTSTATUS _samr_RemoveMemberFromForeignDomain(pipes_struct *p,
-                                            struct samr_RemoveMemberFromForeignDomain *r);
-NTSTATUS _samr_QueryDomainInfo2(pipes_struct *p,
-                               struct samr_QueryDomainInfo2 *r);
-NTSTATUS _samr_SetDomainInfo(pipes_struct *p,
-                            struct samr_SetDomainInfo *r);
-NTSTATUS _samr_GetDisplayEnumerationIndex(pipes_struct *p,
-                                         struct samr_GetDisplayEnumerationIndex *r);
-NTSTATUS _samr_GetDisplayEnumerationIndex2(pipes_struct *p,
-                                          struct samr_GetDisplayEnumerationIndex2 *r);
-NTSTATUS _samr_Shutdown(pipes_struct *p,
-                       struct samr_Shutdown *r);
-NTSTATUS _samr_CreateUser(pipes_struct *p,
-                         struct samr_CreateUser *r);
-NTSTATUS _samr_SetMemberAttributesOfGroup(pipes_struct *p,
-                                         struct samr_SetMemberAttributesOfGroup *r);
-NTSTATUS _samr_ChangePasswordUser(pipes_struct *p,
-                                 struct samr_ChangePasswordUser *r);
-NTSTATUS _samr_TestPrivateFunctionsDomain(pipes_struct *p,
-                                         struct samr_TestPrivateFunctionsDomain *r);
-NTSTATUS _samr_TestPrivateFunctionsUser(pipes_struct *p,
-                                       struct samr_TestPrivateFunctionsUser *r);
-NTSTATUS _samr_QueryUserInfo2(pipes_struct *p,
-                             struct samr_QueryUserInfo2 *r);
-NTSTATUS _samr_AddMultipleMembersToAlias(pipes_struct *p,
-                                        struct samr_AddMultipleMembersToAlias *r);
-NTSTATUS _samr_RemoveMultipleMembersFromAlias(pipes_struct *p,
-                                             struct samr_RemoveMultipleMembersFromAlias *r);
-NTSTATUS _samr_OemChangePasswordUser2(pipes_struct *p,
-                                     struct samr_OemChangePasswordUser2 *r);
-NTSTATUS _samr_SetBootKeyInformation(pipes_struct *p,
-                                    struct samr_SetBootKeyInformation *r);
-NTSTATUS _samr_GetBootKeyInformation(pipes_struct *p,
-                                    struct samr_GetBootKeyInformation *r);
-NTSTATUS _samr_Connect3(pipes_struct *p,
-                       struct samr_Connect3 *r);
-NTSTATUS _samr_RidToSid(pipes_struct *p,
-                       struct samr_RidToSid *r);
-NTSTATUS _samr_SetDsrmPassword(pipes_struct *p,
-                              struct samr_SetDsrmPassword *r);
-NTSTATUS _samr_ValidatePassword(pipes_struct *p,
-                               struct samr_ValidatePassword *r);
-
 /* The following definitions come from rpc_server/srv_samr_util.c  */
 
 void copy_id20_to_sam_passwd(struct samu *to,
@@ -7333,79 +6757,7 @@ WERROR _spoolss_xcvdataport(pipes_struct *p, SPOOL_Q_XCVDATAPORT *q_u, SPOOL_R_X
 
 /* The following definitions come from rpc_server/srv_srvsvc_nt.c  */
 
-WERROR _srvsvc_NetFileEnum(pipes_struct *p,
-                          struct srvsvc_NetFileEnum *r);
-WERROR _srvsvc_NetSrvGetInfo(pipes_struct *p,
-                            struct srvsvc_NetSrvGetInfo *r);
-WERROR _srvsvc_NetSrvSetInfo(pipes_struct *p,
-                            struct srvsvc_NetSrvSetInfo *r);
-WERROR _srvsvc_NetConnEnum(pipes_struct *p,
-                          struct srvsvc_NetConnEnum *r);
-WERROR _srvsvc_NetSessEnum(pipes_struct *p,
-                          struct srvsvc_NetSessEnum *r);
-WERROR _srvsvc_NetSessDel(pipes_struct *p,
-                         struct srvsvc_NetSessDel *r);
-WERROR _srvsvc_NetShareEnumAll(pipes_struct *p,
-                              struct srvsvc_NetShareEnumAll *r);
-WERROR _srvsvc_NetShareEnum(pipes_struct *p,
-                           struct srvsvc_NetShareEnum *r);
-WERROR _srvsvc_NetShareGetInfo(pipes_struct *p,
-                              struct srvsvc_NetShareGetInfo *r);
 char *valid_share_pathname(TALLOC_CTX *ctx, const char *dos_pathname);
-WERROR _srvsvc_NetShareSetInfo(pipes_struct *p,
-                              struct srvsvc_NetShareSetInfo *r);
-WERROR _srvsvc_NetShareAdd(pipes_struct *p,
-                          struct srvsvc_NetShareAdd *r);
-WERROR _srvsvc_NetShareDel(pipes_struct *p,
-                          struct srvsvc_NetShareDel *r);
-WERROR _srvsvc_NetShareDelSticky(pipes_struct *p,
-                                struct srvsvc_NetShareDelSticky *r);
-WERROR _srvsvc_NetRemoteTOD(pipes_struct *p,
-                           struct srvsvc_NetRemoteTOD *r);
-WERROR _srvsvc_NetGetFileSecurity(pipes_struct *p,
-                                 struct srvsvc_NetGetFileSecurity *r);
-WERROR _srvsvc_NetSetFileSecurity(pipes_struct *p,
-                                 struct srvsvc_NetSetFileSecurity *r);
-WERROR _srvsvc_NetDiskEnum(pipes_struct *p,
-                          struct srvsvc_NetDiskEnum *r);
-WERROR _srvsvc_NetNameValidate(pipes_struct *p,
-                              struct srvsvc_NetNameValidate *r);
-WERROR _srvsvc_NetFileClose(pipes_struct *p, struct srvsvc_NetFileClose *r);
-WERROR _srvsvc_NetCharDevEnum(pipes_struct *p, struct srvsvc_NetCharDevEnum *r);
-WERROR _srvsvc_NetCharDevGetInfo(pipes_struct *p, struct srvsvc_NetCharDevGetInfo *r);
-WERROR _srvsvc_NetCharDevControl(pipes_struct *p, struct srvsvc_NetCharDevControl *r);
-WERROR _srvsvc_NetCharDevQEnum(pipes_struct *p, struct srvsvc_NetCharDevQEnum *r);
-WERROR _srvsvc_NetCharDevQGetInfo(pipes_struct *p, struct srvsvc_NetCharDevQGetInfo *r);
-WERROR _srvsvc_NetCharDevQSetInfo(pipes_struct *p, struct srvsvc_NetCharDevQSetInfo *r);
-WERROR _srvsvc_NetCharDevQPurge(pipes_struct *p, struct srvsvc_NetCharDevQPurge *r);
-WERROR _srvsvc_NetCharDevQPurgeSelf(pipes_struct *p, struct srvsvc_NetCharDevQPurgeSelf *r);
-WERROR _srvsvc_NetFileGetInfo(pipes_struct *p, struct srvsvc_NetFileGetInfo *r);
-WERROR _srvsvc_NetShareCheck(pipes_struct *p, struct srvsvc_NetShareCheck *r);
-WERROR _srvsvc_NetServerStatisticsGet(pipes_struct *p, struct srvsvc_NetServerStatisticsGet *r);
-WERROR _srvsvc_NetTransportAdd(pipes_struct *p, struct srvsvc_NetTransportAdd *r);
-WERROR _srvsvc_NetTransportEnum(pipes_struct *p, struct srvsvc_NetTransportEnum *r);
-WERROR _srvsvc_NetTransportDel(pipes_struct *p, struct srvsvc_NetTransportDel *r);
-WERROR _srvsvc_NetSetServiceBits(pipes_struct *p, struct srvsvc_NetSetServiceBits *r);
-WERROR _srvsvc_NetPathType(pipes_struct *p, struct srvsvc_NetPathType *r);
-WERROR _srvsvc_NetPathCanonicalize(pipes_struct *p, struct srvsvc_NetPathCanonicalize *r);
-WERROR _srvsvc_NetPathCompare(pipes_struct *p, struct srvsvc_NetPathCompare *r);
-WERROR _srvsvc_NETRPRNAMECANONICALIZE(pipes_struct *p, struct srvsvc_NETRPRNAMECANONICALIZE *r);
-WERROR _srvsvc_NetPRNameCompare(pipes_struct *p, struct srvsvc_NetPRNameCompare *r);
-WERROR _srvsvc_NetShareDelStart(pipes_struct *p, struct srvsvc_NetShareDelStart *r);
-WERROR _srvsvc_NetShareDelCommit(pipes_struct *p, struct srvsvc_NetShareDelCommit *r);
-WERROR _srvsvc_NetServerTransportAddEx(pipes_struct *p, struct srvsvc_NetServerTransportAddEx *r);
-WERROR _srvsvc_NetServerSetServiceBitsEx(pipes_struct *p, struct srvsvc_NetServerSetServiceBitsEx *r);
-WERROR _srvsvc_NETRDFSGETVERSION(pipes_struct *p, struct srvsvc_NETRDFSGETVERSION *r);
-WERROR _srvsvc_NETRDFSCREATELOCALPARTITION(pipes_struct *p, struct srvsvc_NETRDFSCREATELOCALPARTITION *r);
-WERROR _srvsvc_NETRDFSDELETELOCALPARTITION(pipes_struct *p, struct srvsvc_NETRDFSDELETELOCALPARTITION *r);
-WERROR _srvsvc_NETRDFSSETLOCALVOLUMESTATE(pipes_struct *p, struct srvsvc_NETRDFSSETLOCALVOLUMESTATE *r);
-WERROR _srvsvc_NETRDFSSETSERVERINFO(pipes_struct *p, struct srvsvc_NETRDFSSETSERVERINFO *r);
-WERROR _srvsvc_NETRDFSCREATEEXITPOINT(pipes_struct *p, struct srvsvc_NETRDFSCREATEEXITPOINT *r);
-WERROR _srvsvc_NETRDFSDELETEEXITPOINT(pipes_struct *p, struct srvsvc_NETRDFSDELETEEXITPOINT *r);
-WERROR _srvsvc_NETRDFSMODIFYPREFIX(pipes_struct *p, struct srvsvc_NETRDFSMODIFYPREFIX *r);
-WERROR _srvsvc_NETRDFSFIXLOCALVOLUME(pipes_struct *p, struct srvsvc_NETRDFSFIXLOCALVOLUME *r);
-WERROR _srvsvc_NETRDFSMANAGERREPORTSITEINFO(pipes_struct *p, struct srvsvc_NETRDFSMANAGERREPORTSITEINFO *r);
-WERROR _srvsvc_NETRSERVERTRANSPORTDELEX(pipes_struct *p, struct srvsvc_NETRSERVERTRANSPORTDELEX *r);
 
 /* The following definitions come from rpc_server/srv_svcctl.c  */
 
@@ -7415,138 +6767,9 @@ NTSTATUS rpc_svcctl2_init(void);
 /* The following definitions come from rpc_server/srv_svcctl_nt.c  */
 
 bool init_service_op_table( void );
-WERROR _svcctl_OpenSCManagerW(pipes_struct *p,
-                             struct svcctl_OpenSCManagerW *r);
-WERROR _svcctl_OpenServiceW(pipes_struct *p,
-                           struct svcctl_OpenServiceW *r);
-WERROR _svcctl_CloseServiceHandle(pipes_struct *p, struct svcctl_CloseServiceHandle *r);
-WERROR _svcctl_GetServiceDisplayNameW(pipes_struct *p,
-                                     struct svcctl_GetServiceDisplayNameW *r);
-WERROR _svcctl_QueryServiceStatus(pipes_struct *p,
-                                 struct svcctl_QueryServiceStatus *r);
 WERROR _svcctl_enum_services_status(pipes_struct *p, SVCCTL_Q_ENUM_SERVICES_STATUS *q_u, SVCCTL_R_ENUM_SERVICES_STATUS *r_u);
-WERROR _svcctl_StartServiceW(pipes_struct *p,
-                            struct svcctl_StartServiceW *r);
-WERROR _svcctl_ControlService(pipes_struct *p,
-                             struct svcctl_ControlService *r);
-WERROR _svcctl_EnumDependentServicesW(pipes_struct *p,
-                                     struct svcctl_EnumDependentServicesW *r);
 WERROR _svcctl_query_service_status_ex( pipes_struct *p, SVCCTL_Q_QUERY_SERVICE_STATUSEX *q_u, SVCCTL_R_QUERY_SERVICE_STATUSEX *r_u );
 WERROR _svcctl_query_service_config2( pipes_struct *p, SVCCTL_Q_QUERY_SERVICE_CONFIG2 *q_u, SVCCTL_R_QUERY_SERVICE_CONFIG2 *r_u );
-WERROR _svcctl_LockServiceDatabase(pipes_struct *p,
-                                  struct svcctl_LockServiceDatabase *r);
-WERROR _svcctl_UnlockServiceDatabase(pipes_struct *p,
-                                    struct svcctl_UnlockServiceDatabase *r);
-WERROR _svcctl_QueryServiceObjectSecurity(pipes_struct *p,
-                                         struct svcctl_QueryServiceObjectSecurity *r);
-WERROR _svcctl_SetServiceObjectSecurity(pipes_struct *p,
-                                       struct svcctl_SetServiceObjectSecurity *r);
-WERROR _svcctl_DeleteService(pipes_struct *p, struct svcctl_DeleteService *r);
-WERROR _svcctl_SetServiceStatus(pipes_struct *p, struct svcctl_SetServiceStatus *r);
-WERROR _svcctl_NotifyBootConfigStatus(pipes_struct *p, struct svcctl_NotifyBootConfigStatus *r);
-WERROR _svcctl_SCSetServiceBitsW(pipes_struct *p, struct svcctl_SCSetServiceBitsW *r);
-WERROR _svcctl_ChangeServiceConfigW(pipes_struct *p, struct svcctl_ChangeServiceConfigW *r);
-WERROR _svcctl_CreateServiceW(pipes_struct *p, struct svcctl_CreateServiceW *r);
-WERROR _svcctl_EnumServicesStatusW(pipes_struct *p, struct svcctl_EnumServicesStatusW *r);
-WERROR _svcctl_QueryServiceConfigW(pipes_struct *p, struct svcctl_QueryServiceConfigW *r);
-WERROR _svcctl_QueryServiceLockStatusW(pipes_struct *p, struct svcctl_QueryServiceLockStatusW *r);
-WERROR _svcctl_GetServiceKeyNameW(pipes_struct *p, struct svcctl_GetServiceKeyNameW *r);
-WERROR _svcctl_SCSetServiceBitsA(pipes_struct *p, struct svcctl_SCSetServiceBitsA *r);
-WERROR _svcctl_ChangeServiceConfigA(pipes_struct *p, struct svcctl_ChangeServiceConfigA *r);
-WERROR _svcctl_CreateServiceA(pipes_struct *p, struct svcctl_CreateServiceA *r);
-WERROR _svcctl_EnumDependentServicesA(pipes_struct *p, struct svcctl_EnumDependentServicesA *r);
-WERROR _svcctl_EnumServicesStatusA(pipes_struct *p, struct svcctl_EnumServicesStatusA *r);
-WERROR _svcctl_OpenSCManagerA(pipes_struct *p, struct svcctl_OpenSCManagerA *r);
-WERROR _svcctl_OpenServiceA(pipes_struct *p, struct svcctl_OpenServiceA *r);
-WERROR _svcctl_QueryServiceConfigA(pipes_struct *p, struct svcctl_QueryServiceConfigA *r);
-WERROR _svcctl_QueryServiceLockStatusA(pipes_struct *p, struct svcctl_QueryServiceLockStatusA *r);
-WERROR _svcctl_StartServiceA(pipes_struct *p, struct svcctl_StartServiceA *r);
-WERROR _svcctl_GetServiceDisplayNameA(pipes_struct *p, struct svcctl_GetServiceDisplayNameA *r);
-WERROR _svcctl_GetServiceKeyNameA(pipes_struct *p, struct svcctl_GetServiceKeyNameA *r);
-WERROR _svcctl_GetCurrentGroupeStateW(pipes_struct *p, struct svcctl_GetCurrentGroupeStateW *r);
-WERROR _svcctl_EnumServiceGroupW(pipes_struct *p, struct svcctl_EnumServiceGroupW *r);
-WERROR _svcctl_ChangeServiceConfig2A(pipes_struct *p, struct svcctl_ChangeServiceConfig2A *r);
-WERROR _svcctl_ChangeServiceConfig2W(pipes_struct *p, struct svcctl_ChangeServiceConfig2W *r);
-WERROR _svcctl_QueryServiceConfig2A(pipes_struct *p, struct svcctl_QueryServiceConfig2A *r);
-WERROR _svcctl_QueryServiceConfig2W(pipes_struct *p, struct svcctl_QueryServiceConfig2W *r);
-WERROR _svcctl_QueryServiceStatusEx(pipes_struct *p, struct svcctl_QueryServiceStatusEx *r);
-WERROR _EnumServicesStatusExA(pipes_struct *p, struct EnumServicesStatusExA *r);
-WERROR _EnumServicesStatusExW(pipes_struct *p, struct EnumServicesStatusExW *r);
-WERROR _svcctl_SCSendTSMessage(pipes_struct *p, struct svcctl_SCSendTSMessage *r);
-
-/* The following definitions come from rpc_server/srv_winreg_nt.c  */
-
-WERROR _winreg_CloseKey(pipes_struct *p, struct winreg_CloseKey *r);
-WERROR _winreg_OpenHKLM(pipes_struct *p, struct winreg_OpenHKLM *r);
-WERROR _winreg_OpenHKPD(pipes_struct *p, struct winreg_OpenHKPD *r);
-WERROR _winreg_OpenHKPT(pipes_struct *p, struct winreg_OpenHKPT *r);
-WERROR _winreg_OpenHKCR(pipes_struct *p, struct winreg_OpenHKCR *r);
-WERROR _winreg_OpenHKU(pipes_struct *p, struct winreg_OpenHKU *r);
-WERROR _winreg_OpenHKCU(pipes_struct *p, struct winreg_OpenHKCU *r);
-WERROR _winreg_OpenHKCC(pipes_struct *p, struct winreg_OpenHKCC *r);
-WERROR _winreg_OpenHKDD(pipes_struct *p, struct winreg_OpenHKDD *r);
-WERROR _winreg_OpenHKPN(pipes_struct *p, struct winreg_OpenHKPN *r);
-WERROR _winreg_OpenKey(pipes_struct *p, struct winreg_OpenKey *r);
-WERROR _winreg_QueryValue(pipes_struct *p, struct winreg_QueryValue *r);
-WERROR _winreg_QueryInfoKey(pipes_struct *p, struct winreg_QueryInfoKey *r);
-WERROR _winreg_GetVersion(pipes_struct *p, struct winreg_GetVersion *r);
-WERROR _winreg_EnumKey(pipes_struct *p, struct winreg_EnumKey *r);
-WERROR _winreg_EnumValue(pipes_struct *p, struct winreg_EnumValue *r);
-WERROR _winreg_InitiateSystemShutdown(pipes_struct *p, struct winreg_InitiateSystemShutdown *r);
-WERROR _winreg_InitiateSystemShutdownEx(pipes_struct *p, struct winreg_InitiateSystemShutdownEx *r);
-WERROR _winreg_AbortSystemShutdown(pipes_struct *p, struct winreg_AbortSystemShutdown *r);
-WERROR _winreg_RestoreKey(pipes_struct *p, struct winreg_RestoreKey *r);
-WERROR _winreg_SaveKey(pipes_struct *p, struct winreg_SaveKey *r);
-WERROR _winreg_SaveKeyEx(pipes_struct *p, struct winreg_SaveKeyEx *r);
-WERROR _winreg_CreateKey( pipes_struct *p, struct winreg_CreateKey *r);
-WERROR _winreg_SetValue(pipes_struct *p, struct winreg_SetValue *r);
-WERROR _winreg_DeleteKey(pipes_struct *p, struct winreg_DeleteKey *r);
-WERROR _winreg_DeleteValue(pipes_struct *p, struct winreg_DeleteValue *r);
-WERROR _winreg_GetKeySecurity(pipes_struct *p, struct winreg_GetKeySecurity *r);
-WERROR _winreg_SetKeySecurity(pipes_struct *p, struct winreg_SetKeySecurity *r);
-WERROR _winreg_FlushKey(pipes_struct *p, struct winreg_FlushKey *r);
-WERROR _winreg_UnLoadKey(pipes_struct *p, struct winreg_UnLoadKey *r);
-WERROR _winreg_ReplaceKey(pipes_struct *p, struct winreg_ReplaceKey *r);
-WERROR _winreg_LoadKey(pipes_struct *p, struct winreg_LoadKey *r);
-WERROR _winreg_NotifyChangeKeyValue(pipes_struct *p, struct winreg_NotifyChangeKeyValue *r);
-WERROR _winreg_QueryMultipleValues(pipes_struct *p, struct winreg_QueryMultipleValues *r);
-WERROR _winreg_QueryMultipleValues2(pipes_struct *p, struct winreg_QueryMultipleValues2 *r);
-
-/* The following definitions come from rpc_server/srv_wkssvc_nt.c  */
-
-WERROR _wkssvc_NetWkstaGetInfo(pipes_struct *p, struct wkssvc_NetWkstaGetInfo *r);
-WERROR _wkssvc_NetWkstaSetInfo(pipes_struct *p, struct wkssvc_NetWkstaSetInfo *r);
-WERROR _wkssvc_NetWkstaEnumUsers(pipes_struct *p, struct wkssvc_NetWkstaEnumUsers *r);
-WERROR _wkssvc_NetrWkstaUserGetInfo(pipes_struct *p, struct wkssvc_NetrWkstaUserGetInfo *r);
-WERROR _wkssvc_NetrWkstaUserSetInfo(pipes_struct *p, struct wkssvc_NetrWkstaUserSetInfo *r);
-WERROR _wkssvc_NetWkstaTransportEnum(pipes_struct *p, struct wkssvc_NetWkstaTransportEnum *r);
-WERROR _wkssvc_NetrWkstaTransportAdd(pipes_struct *p, struct wkssvc_NetrWkstaTransportAdd *r);
-WERROR _wkssvc_NetrWkstaTransportDel(pipes_struct *p, struct wkssvc_NetrWkstaTransportDel *r);
-WERROR _wkssvc_NetrUseAdd(pipes_struct *p, struct wkssvc_NetrUseAdd *r);
-WERROR _wkssvc_NetrUseGetInfo(pipes_struct *p, struct wkssvc_NetrUseGetInfo *r);
-WERROR _wkssvc_NetrUseDel(pipes_struct *p, struct wkssvc_NetrUseDel *r);
-WERROR _wkssvc_NetrUseEnum(pipes_struct *p, struct wkssvc_NetrUseEnum *r);
-WERROR _wkssvc_NetrMessageBufferSend(pipes_struct *p, struct wkssvc_NetrMessageBufferSend *r);
-WERROR _wkssvc_NetrWorkstationStatisticsGet(pipes_struct *p, struct wkssvc_NetrWorkstationStatisticsGet *r) ;
-WERROR _wkssvc_NetrLogonDomainNameAdd(pipes_struct *p, struct wkssvc_NetrLogonDomainNameAdd *r);
-WERROR _wkssvc_NetrLogonDomainNameDel(pipes_struct *p, struct wkssvc_NetrLogonDomainNameDel *r);
-WERROR _wkssvc_NetrJoinDomain(pipes_struct *p, struct wkssvc_NetrJoinDomain *r);
-WERROR _wkssvc_NetrUnjoinDomain(pipes_struct *p, struct wkssvc_NetrUnjoinDomain *r);
-WERROR _wkssvc_NetrRenameMachineInDomain(pipes_struct *p, struct wkssvc_NetrRenameMachineInDomain *r);
-WERROR _wkssvc_NetrValidateName(pipes_struct *p, struct wkssvc_NetrValidateName *r);
-WERROR _wkssvc_NetrGetJoinInformation(pipes_struct *p, struct wkssvc_NetrGetJoinInformation *r);
-WERROR _wkssvc_NetrGetJoinableOus(pipes_struct *p, struct wkssvc_NetrGetJoinableOus *r);
-WERROR _wkssvc_NetrJoinDomain2(pipes_struct *p,
-                              struct wkssvc_NetrJoinDomain2 *r);
-WERROR _wkssvc_NetrUnjoinDomain2(pipes_struct *p,
-                                struct wkssvc_NetrUnjoinDomain2 *r);
-WERROR _wkssvc_NetrRenameMachineInDomain2(pipes_struct *p, struct wkssvc_NetrRenameMachineInDomain2 *r);
-WERROR _wkssvc_NetrValidateName2(pipes_struct *p, struct wkssvc_NetrValidateName2 *r);
-WERROR _wkssvc_NetrGetJoinableOus2(pipes_struct *p, struct wkssvc_NetrGetJoinableOus2 *r);
-WERROR _wkssvc_NetrAddAlternateComputerName(pipes_struct *p, struct wkssvc_NetrAddAlternateComputerName *r);
-WERROR _wkssvc_NetrRemoveAlternateComputerName(pipes_struct *p, struct wkssvc_NetrRemoveAlternateComputerName *r);
-WERROR _wkssvc_NetrSetPrimaryComputername(pipes_struct *p, struct wkssvc_NetrSetPrimaryComputername *r);
-WERROR _wkssvc_NetrEnumerateComputerNames(pipes_struct *p, struct wkssvc_NetrEnumerateComputerNames *r);
 
 /* The following definitions come from rpcclient/cmd_dfs.c  */
 
@@ -7819,6 +7042,7 @@ bool dns_register_smbd_reply(struct dns_reg_state *dns_state,
 mode_t unix_mode(connection_struct *conn, int dosmode, const char *fname,
                 const char *inherit_from_dir);
 uint32 dos_mode_msdfs(connection_struct *conn, const char *path,SMB_STRUCT_STAT *sbuf);
+int dos_attributes_to_stat_dos_flags(uint32_t dosmode);
 uint32 dos_mode(connection_struct *conn, const char *path,SMB_STRUCT_STAT *sbuf);
 int file_set_dosmode(connection_struct *conn, const char *fname,
                     uint32 dosmode, SMB_STRUCT_STAT *st,
@@ -7894,6 +7118,9 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx,
                        char **pp_saved_last_component,
                        SMB_STRUCT_STAT *pst);
 NTSTATUS check_name(connection_struct *conn, const char *name);
+int get_real_filename(connection_struct *conn, const char *path,
+                     const char *name, TALLOC_CTX *mem_ctx,
+                     char **found_name);
 
 /* The following definitions come from smbd/files.c  */
 
@@ -8095,78 +7322,74 @@ NTSTATUS smb1_file_se_access_check(const struct security_descriptor *sd,
                           uint32_t access_desired,
                           uint32_t *access_granted);
 NTSTATUS fd_close(files_struct *fsp);
+void change_file_owner_to_parent(connection_struct *conn,
+                                const char *inherit_from_dir,
+                                files_struct *fsp);
+NTSTATUS change_dir_owner_to_parent(connection_struct *conn,
+                                   const char *inherit_from_dir,
+                                   const char *fname,
+                                   SMB_STRUCT_STAT *psbuf);
+bool is_executable(const char *fname);
+bool is_stat_open(uint32 access_mask);
+bool request_timed_out(struct timeval request_time,
+                      struct timeval timeout);
+bool open_match_attributes(connection_struct *conn,
+                          const char *path,
+                          uint32 old_dos_attr,
+                          uint32 new_dos_attr,
+                          mode_t existing_unx_mode,
+                          mode_t new_unx_mode,
+                          mode_t *returned_unx_mode);
+NTSTATUS fcb_or_dos_open(struct smb_request *req,
+                        connection_struct *conn,
+                        files_struct *fsp_to_dup_into,
+                        const char *fname,
+                        struct file_id id,
+                        uint16 file_pid,
+                        uint16 vuid,
+                        uint32 access_mask,
+                        uint32 share_access,
+                        uint32 create_options);
 bool map_open_params_to_ntcreate(const char *fname, int deny_mode, int open_func,
                                 uint32 *paccess_mask,
                                 uint32 *pshare_mode,
                                 uint32 *pcreate_disposition,
                                 uint32 *pcreate_options);
-NTSTATUS open_file_ntcreate(connection_struct *conn,
-                           struct smb_request *req,
-                           const char *fname,
-                           SMB_STRUCT_STAT *psbuf,
-                           uint32 access_mask,         /* access bits (FILE_READ_DATA etc.) */
-                           uint32 share_access,        /* share constants (FILE_SHARE_READ etc) */
-                           uint32 create_disposition,  /* FILE_OPEN_IF etc. */
-                           uint32 create_options,      /* options such as delete on close. */
-                           uint32 new_dos_attributes,  /* attributes used for new file. */
-                           int oplock_request,         /* internal Samba oplock codes. */
-                                                       /* Information (FILE_EXISTS etc.) */
-                           int *pinfo,
-                           files_struct **result);
 NTSTATUS open_file_fchmod(struct smb_request *req, connection_struct *conn,
                          const char *fname,
                          SMB_STRUCT_STAT *psbuf, files_struct **result);
 NTSTATUS close_file_fchmod(struct smb_request *req, files_struct *fsp);
-NTSTATUS open_directory(connection_struct *conn,
-                       struct smb_request *req,
-                       const char *fname,
-                       SMB_STRUCT_STAT *psbuf,
-                       uint32 access_mask,
-                       uint32 share_access,
-                       uint32 create_disposition,
-                       uint32 create_options,
-                       uint32 file_attributes,
-                       int *pinfo,
-                       files_struct **result);
 NTSTATUS create_directory(connection_struct *conn, struct smb_request *req, const char *directory);
 void msg_file_was_renamed(struct messaging_context *msg,
                          void *private_data,
                          uint32_t msg_type,
                          struct server_id server_id,
                          DATA_BLOB *data);
-NTSTATUS create_file_unixpath(connection_struct *conn,
-                             struct smb_request *req,
-                             const char *fname,
-                             uint32_t access_mask,
-                             uint32_t share_access,
-                             uint32_t create_disposition,
-                             uint32_t create_options,
-                             uint32_t file_attributes,
-                             uint32_t oplock_request,
-                             uint64_t allocation_size,
-                             struct security_descriptor *sd,
-                             struct ea_list *ea_list,
-
-                             files_struct **result,
-                             int *pinfo,
-                             SMB_STRUCT_STAT *psbuf);
-NTSTATUS create_file(connection_struct *conn,
-                    struct smb_request *req,
-                    uint16_t root_dir_fid,
-                    const char *fname,
-                    uint32_t access_mask,
-                    uint32_t share_access,
-                    uint32_t create_disposition,
-                    uint32_t create_options,
-                    uint32_t file_attributes,
-                    uint32_t oplock_request,
-                    uint64_t allocation_size,
-                    struct security_descriptor *sd,
-                    struct ea_list *ea_list,
-
-                    files_struct **result,
-                    int *pinfo,
-                    SMB_STRUCT_STAT *psbuf);
+struct case_semantics_state;
+struct case_semantics_state *set_posix_case_semantics(TALLOC_CTX *mem_ctx,
+                                                     connection_struct *conn);
+NTSTATUS create_file_default(connection_struct *conn,
+                            struct smb_request *req,
+                            uint16_t root_dir_fid,
+                            const char *fname,
+                            uint32_t create_file_flags,
+                            uint32_t access_mask,
+                            uint32_t share_access,
+                            uint32_t create_disposition,
+                            uint32_t create_options,
+                            uint32_t file_attributes,
+                            uint32_t oplock_request,
+                            uint64_t allocation_size,
+                            struct security_descriptor *sd,
+                            struct ea_list *ea_list,
+
+                            files_struct **result,
+                            int *pinfo,
+                            SMB_STRUCT_STAT *psbuf);
+NTSTATUS get_relative_fid_filename(connection_struct *conn,
+                                  struct smb_request *req,
+                                  uint16_t root_dir_fid,
+                                  const char *fname, char **new_fname);
 
 /* The following definitions come from smbd/oplock.c  */
 
@@ -8501,10 +7724,10 @@ bool token_contains_name_in_list(const char *username,
                                 const struct nt_user_token *token,
                                 const char **list);
 bool user_ok_token(const char *username, const char *domain,
-                  struct nt_user_token *token, int snum);
+                  const struct nt_user_token *token, int snum);
 bool is_share_read_only_for_token(const char *username,
                                  const char *domain,
-                                 struct nt_user_token *token,
+                                 const struct nt_user_token *token,
                                  connection_struct *conn);
 
 /* The following definitions come from smbd/srvstr.c  */
index bcf605ee53fe260e632bf9d7da7bce1d75366f12..891bd4aaf74139b29962cbcf812bda9bce57a0d1 100644 (file)
@@ -209,18 +209,7 @@ typedef uint32 codepoint_t;
  *
  * @sa http://msdn.microsoft.com/library/default.asp?url=/library/en-us/security/accctrl_38yn.asp
  **/
-typedef struct dom_sid {
-       uint8  sid_rev_num;             /**< SID revision number */
-       uint8  num_auths;               /**< Number of sub-authorities */
-       uint8  id_auth[6];              /**< Identifier Authority */
-       /*
-        *  Pointer to sub-authorities.
-        *
-        * @note The values in these uint32's are in *native* byteorder, not
-        * neccessarily little-endian...... JRA.
-        */
-       uint32 sub_auths[MAXSUBAUTHS];  
-} DOM_SID;
+typedef struct dom_sid DOM_SID;
 
 enum id_mapping {
        ID_UNKNOWN = 0,
@@ -710,7 +699,6 @@ struct pending_message_list {
 };
 
 #define SHARE_MODE_FLAG_POSIX_OPEN     0x1
-#define SHARE_MODE_ALLOW_INITIAL_DELETE_ON_CLOSE      0x2
 
 /* struct returned by get_share_modes */
 struct share_mode_entry {
@@ -1895,4 +1883,9 @@ struct smb_extended_info {
        char   samba_version_string[SAMBA_EXTENDED_INFO_VERSION_STRING_LENGTH];
 };
 
+/*
+ * create_file_flags
+ */
+#define CFF_DOS_PATH           0x00000001
+
 #endif /* _SMB_H */
index 119ceeb158c28779264f4c9f04a53f2facb36f17..5149da0cb3dcb9d90edcedaf087820a71b318da9 100644 (file)
@@ -333,7 +333,7 @@ do { \
 /* Warning - this must only be called with 0 <= c < 128. IT WILL
  * GIVE GARBAGE if c > 128 or c < 0. JRA.
  */
-extern char toupper_ascii_fast_table[];
+extern const char toupper_ascii_fast_table[];
 #define toupper_ascii_fast(c) toupper_ascii_fast_table[(unsigned int)(c)];
 #endif
 
index 4cedb4a9c6bfcc1895323867a7f69e1a6c796584..d02d14b854c689379feec4ed813d2612d1bccb4c 100644 (file)
    open handle. JRA. */
 /* Changed to version 24 - make security descriptor const in fset_nt_acl. JRA. */
 /* Changed to version 25 - Jelmer's change from SMB_BIG_UINT to uint64_t. */
+/* Leave at 25 - not yet released. Add create_file call. -- tprouty. */
 
 #define SMB_VFS_INTERFACE_VERSION 25
 
@@ -134,6 +135,8 @@ struct connection_struct;
 struct files_struct;
 struct security_descriptor;
 struct vfs_statvfs_struct;
+struct smb_request;
+struct ea_list;
 
 /*
     Available VFS operations. These values must be in sync with vfs_ops struct
@@ -170,6 +173,7 @@ typedef enum _vfs_op_type {
        /* File operations */
 
        SMB_VFS_OP_OPEN,
+       SMB_VFS_OP_CREATE_FILE,
        SMB_VFS_OP_CLOSE,
        SMB_VFS_OP_READ,
        SMB_VFS_OP_PREAD,
@@ -206,6 +210,7 @@ typedef enum _vfs_op_type {
        SMB_VFS_OP_CHFLAGS,
        SMB_VFS_OP_FILE_ID_CREATE,
        SMB_VFS_OP_STREAMINFO,
+       SMB_VFS_OP_GET_REAL_FILENAME,
 
        /* NT ACL operations. */
 
@@ -305,6 +310,23 @@ struct vfs_ops {
                /* File operations */
 
                int (*open)(struct vfs_handle_struct *handle, const char *fname, files_struct *fsp, int flags, mode_t mode);
+               NTSTATUS (*create_file)(struct vfs_handle_struct *handle,
+                                       struct smb_request *req,
+                                       uint16_t root_dir_fid,
+                                       const char *fname,
+                                       uint32_t create_file_flags,
+                                       uint32_t access_mask,
+                                       uint32_t share_access,
+                                       uint32_t create_disposition,
+                                       uint32_t create_options,
+                                       uint32_t file_attributes,
+                                       uint32_t oplock_request,
+                                       uint64_t allocation_size,
+                                       struct security_descriptor *sd,
+                                       struct ea_list *ea_list,
+                                       files_struct **result,
+                                       int *pinfo,
+                                       SMB_STRUCT_STAT *psbuf);
                int (*close_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp);
                ssize_t (*vfs_read)(struct vfs_handle_struct *handle, struct files_struct *fsp, void *data, size_t n);
                ssize_t (*pread)(struct vfs_handle_struct *handle, struct files_struct *fsp, void *data, size_t n, SMB_OFF_T offset);
@@ -354,6 +376,12 @@ struct vfs_ops {
                                       unsigned int *num_streams,
                                       struct stream_struct **streams);
 
+               int (*get_real_filename)(struct vfs_handle_struct *handle,
+                                        const char *path,
+                                        const char *name,
+                                        TALLOC_CTX *mem_ctx,
+                                        char **found_name);
+
                /* NT ACL operations. */
 
                NTSTATUS (*fget_nt_acl)(struct vfs_handle_struct *handle,
@@ -452,6 +480,7 @@ struct vfs_ops {
                /* File operations */
 
                struct vfs_handle_struct *open;
+               struct vfs_handle_struct *create_file;
                struct vfs_handle_struct *close_hnd;
                struct vfs_handle_struct *vfs_read;
                struct vfs_handle_struct *pread;
@@ -488,6 +517,7 @@ struct vfs_ops {
                struct vfs_handle_struct *chflags;
                struct vfs_handle_struct *file_id_create;
                struct vfs_handle_struct *streaminfo;
+               struct vfs_handle_struct *get_real_filename;
 
                /* NT ACL operations. */
 
index 8fbc21b12d426fc1dc238f60172e8735b715b22b..b008d86b3ca624f716356babc1b1ac0f2fbfa566 100644 (file)
@@ -48,6 +48,7 @@
 
 /* File operations */
 #define SMB_VFS_OPEN(conn, fname, fsp, flags, mode) (((conn)->vfs.ops.open)((conn)->vfs.handles.open, (fname), (fsp), (flags), (mode)))
+#define SMB_VFS_CREATE_FILE(conn, req, root_dir_fid, fname, create_file_flags, access_mask, share_access, create_disposition, create_options, file_attributes, oplock_request, allocation_size, sd, ea_list, result, pinfo, psbuf) (((conn)->vfs.ops.create_file)((conn)->vfs.handles.create_file, (req), (root_dir_fid), (fname), (create_file_flags), (access_mask), (share_access), (create_disposition), (create_options), (file_attributes), (oplock_request), (allocation_size), (sd), (ea_list), (result), (pinfo), (psbuf)))
 #define SMB_VFS_CLOSE(fsp) ((fsp)->conn->vfs.ops.close_fn((fsp)->conn->vfs.handles.close_hnd, (fsp)))
 #define SMB_VFS_READ(fsp, data, n) ((fsp)->conn->vfs.ops.vfs_read((fsp)->conn->vfs.handles.vfs_read, (fsp), (data), (n)))
 #define SMB_VFS_PREAD(fsp, data, n, off) ((fsp)->conn->vfs.ops.pread((fsp)->conn->vfs.handles.pread, (fsp), (data), (n), (off)))
@@ -84,6 +85,7 @@
 #define SMB_VFS_CHFLAGS(conn, path, flags) ((conn)->vfs.ops.chflags((conn)->vfs.handles.chflags, (path), (flags)))
 #define SMB_VFS_FILE_ID_CREATE(conn, dev, inode) ((conn)->vfs.ops.file_id_create((conn)->vfs.handles.file_id_create, (dev), (inode)))
 #define SMB_VFS_STREAMINFO(conn, fsp, fname, mem_ctx, num_streams, streams) ((conn)->vfs.ops.streaminfo((conn)->vfs.handles.streaminfo, (fsp), (fname), (mem_ctx), (num_streams), (streams)))
+#define SMB_VFS_GET_REAL_FILENAME(conn, path, name, mem_ctx, found_name) ((conn)->vfs.ops.get_real_filename((conn)->vfs.handles.get_real_filename, (path), (name), (mem_ctx), (found_name)))
 
 /* NT ACL operations. */
 #define SMB_VFS_FGET_NT_ACL(fsp, security_info, ppdesc) ((fsp)->conn->vfs.ops.fget_nt_acl((fsp)->conn->vfs.handles.fget_nt_acl, (fsp), (security_info), (ppdesc)))
 
 /* File operations */
 #define SMB_VFS_OPAQUE_OPEN(conn, fname, fsp, flags, mode) (((conn)->vfs_opaque.ops.open)((conn)->vfs_opaque.handles.open, (fname), (fsp), (flags), (mode)))
+#define SMB_VFS_OPAQUE_CREATE_FILE(conn, req, root_dir_fid, fname, create_file_flags, access_mask, share_access, create_disposition, create_options, file_attributes, oplock_request, allocation_size, sd, ea_list, result, pinfo, psbuf) (((conn)->vfs_opaque.ops.create_file)((conn)->vfs_opaque.handles.create_file, (req), (root_dir_fid), (fname), (create_file_flags), (access_mask), (share_access), (create_disposition), (create_options), (file_attributes), (oplock_request), (allocation_size), (sd), (ea_list), (result), (pinfo), (psbuf)))
 #define SMB_VFS_OPAQUE_CLOSE(fsp) ((fsp)->conn->vfs_opaque.ops.close_fn((fsp)->conn->vfs_opaque.handles.close_hnd, (fsp)))
 #define SMB_VFS_OPAQUE_READ(fsp, data, n) ((fsp)->conn->vfs_opaque.ops.vfs_read((fsp)->conn->vfs_opaque.handles.vfs_read, (fsp), (data), (n)))
 #define SMB_VFS_OPAQUE_PREAD(fsp, data, n, off) ((fsp)->conn->vfs_opaque.ops.pread((fsp)->conn->vfs_opaque.handles.pread, (fsp), (data), (n), (off)))
 #define SMB_VFS_OPAQUE_CHFLAGS(conn, path, flags) ((conn)->vfs_opaque.ops.chflags((conn)->vfs_opaque.handles.chflags, (path), (flags)))
 #define SMB_VFS_OPAQUE_FILE_ID_CREATE(conn, dev, inode) ((conn)->vfs.ops_opaque.file_id_create((conn)->vfs_opaque.handles.file_id_create, (dev), (inode)))
 #define SMB_VFS_OPAQUE_STREAMINFO(conn, fsp, fname, mem_ctx, num_streams, streams) ((conn)->vfs_opaque.ops.streaminfo((conn)->vfs_opaque.handles.streaminfo, (fsp), (fname), (mem_ctx), (num_streams), (streams)))
+#define SMB_VFS_OPAQUE_GET_REAL_FILENAME(conn, path, name, mem_ctx, found_name) ((conn)->vfs_opaque.ops.get_real_filename((conn)->vfs_opaque.handles.get_real_filename, (path), (name), (mem_ctx), (found_name)))
 
 /* NT ACL operations. */
 #define SMB_VFS_OPAQUE_FGET_NT_ACL(fsp, security_info, ppdesc) ((fsp)->conn->vfs_opaque.ops.fget_nt_acl((fsp)->conn->vfs_opaque.handles.fget_nt_acl, (fsp), (security_info), (ppdesc)))
 
 /* File operations */
 #define SMB_VFS_NEXT_OPEN(handle, fname, fsp, flags, mode) (((handle)->vfs_next.ops.open)((handle)->vfs_next.handles.open, (fname), (fsp), (flags), (mode)))
+#define SMB_VFS_NEXT_CREATE_FILE(handle, req, root_dir_fid, fname, create_file_flags, access_mask, share_access, create_disposition, create_options, file_attributes, oplock_request, allocation_size, sd, ea_list, result, pinfo, psbuf) (((handle)->vfs_next.ops.create_file)((handle)->vfs_next.handles.create_file, (req), (root_dir_fid), (fname), (create_file_flags), (access_mask), (share_access), (create_disposition), (create_options), (file_attributes), (oplock_request), (allocation_size), (sd), (ea_list), (result), (pinfo), (psbuf)))
 #define SMB_VFS_NEXT_CLOSE(handle, fsp) ((handle)->vfs_next.ops.close_fn((handle)->vfs_next.handles.close_hnd, (fsp)))
 #define SMB_VFS_NEXT_READ(handle, fsp, data, n) ((handle)->vfs_next.ops.vfs_read((handle)->vfs_next.handles.vfs_read, (fsp), (data), (n)))
 #define SMB_VFS_NEXT_PREAD(handle, fsp, data, n, off) ((handle)->vfs_next.ops.pread((handle)->vfs_next.handles.pread, (fsp), (data), (n), (off)))
 #define SMB_VFS_NEXT_CHFLAGS(handle, path, flags) ((handle)->vfs_next.ops.chflags((handle)->vfs_next.handles.chflags, (path), (flags)))
 #define SMB_VFS_NEXT_FILE_ID_CREATE(handle, dev, inode) ((handle)->vfs_next.ops.file_id_create((handle)->vfs_next.handles.file_id_create, (dev), (inode)))
 #define SMB_VFS_NEXT_STREAMINFO(handle, fsp, fname, mem_ctx, num_streams, streams) ((handle)->vfs_next.ops.streaminfo((handle)->vfs_next.handles.streaminfo, (fsp), (fname), (mem_ctx), (num_streams), (streams)))
+#define SMB_VFS_NEXT_GET_REAL_FILENAME(conn, path, name, mem_ctx, found_name) ((conn)->vfs_next.ops.get_real_filename((conn)->vfs_next.handles.get_real_filename, (path), (name), (mem_ctx), (found_name)))
 
 /* NT ACL operations. */
 #define SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp, security_info, ppdesc) ((handle)->vfs_next.ops.fget_nt_acl((handle)->vfs_next.handles.fget_nt_acl, (fsp), (security_info), (ppdesc)))
index 501a6b5524f470e1f2169f661d48f82b5ffdc286..159666f15c874abbf0ac859afc019e7b0459ec90 100644 (file)
@@ -172,3 +172,26 @@ bool async_req_nomem(const void *p, struct async_req *req)
        async_req_error(req, NT_STATUS_NO_MEMORY);
        return true;
 }
+
+bool async_req_is_error(struct async_req *req, NTSTATUS *status)
+{
+       if (req->state < ASYNC_REQ_DONE) {
+               *status = NT_STATUS_INTERNAL_ERROR;
+               return true;
+       }
+       if (req->state == ASYNC_REQ_ERROR) {
+               *status = req->status;
+               return true;
+       }
+       return false;
+}
+
+NTSTATUS async_req_simple_recv(struct async_req *req)
+{
+       NTSTATUS status;
+
+       if (async_req_is_error(req, &status)) {
+               return status;
+       }
+       return NT_STATUS_OK;
+}
index ffba6de83245a147d2b13772aaae38ad3b0d5f8b..225cc7b195e38ff2599ce603fb5ddfd5544f2480 100644 (file)
@@ -177,18 +177,13 @@ static struct async_req *async_fde_syscall_new(
  * @retval The return value from the asynchronously called syscall
  */
 
-ssize_t async_syscall_result_ssize_t(struct async_req **req, int *perrno)
+ssize_t async_syscall_result_ssize_t(struct async_req *req, int *perrno)
 {
        struct async_syscall_state *state = talloc_get_type_abort(
-               (*req)->private_data, struct async_syscall_state);
-
-       int sys_errno = state->sys_errno;
-       ssize_t result = state->result.result_ssize_t;
-
-       TALLOC_FREE(*req);
+               req->private_data, struct async_syscall_state);
 
-       *perrno = sys_errno;
-       return result;
+       *perrno = state->sys_errno;
+       return state->result.result_ssize_t;
 }
 
 /**
@@ -198,18 +193,13 @@ ssize_t async_syscall_result_ssize_t(struct async_req **req, int *perrno)
  * @retval The return value from the asynchronously called syscall
  */
 
-size_t async_syscall_result_size_t(struct async_req **req, int *perrno)
+size_t async_syscall_result_size_t(struct async_req *req, int *perrno)
 {
        struct async_syscall_state *state = talloc_get_type_abort(
-               (*req)->private_data, struct async_syscall_state);
-
-       int sys_errno = state->sys_errno;
-       size_t result = state->result.result_ssize_t;
-
-       TALLOC_FREE(*req);
+               req->private_data, struct async_syscall_state);
 
-       *perrno = sys_errno;
-       return result;
+       *perrno = state->sys_errno;
+       return state->result.result_size_t;
 }
 
 /**
@@ -219,18 +209,13 @@ size_t async_syscall_result_size_t(struct async_req **req, int *perrno)
  * @retval The return value from the asynchronously called syscall
  */
 
-ssize_t async_syscall_result_int(struct async_req **req, int *perrno)
+ssize_t async_syscall_result_int(struct async_req *req, int *perrno)
 {
        struct async_syscall_state *state = talloc_get_type_abort(
-               (*req)->private_data, struct async_syscall_state);
-
-       int sys_errno = state->sys_errno;
-       int result = state->result.result_ssize_t;
-
-       TALLOC_FREE(*req);
+               req->private_data, struct async_syscall_state);
 
-       *perrno = sys_errno;
-       return result;
+       *perrno = state->sys_errno;
+       return state->result.result_int;
 }
 
 /**
@@ -353,9 +338,9 @@ static void async_sendall_callback(struct event_context *ev,
  * "length" bytes
  */
 
-struct async_req *async_sendall(TALLOC_CTX *mem_ctx, struct event_context *ev,
-                               int fd, const void *buffer, size_t length,
-                               int flags)
+struct async_req *sendall_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
+                              int fd, const void *buffer, size_t length,
+                              int flags)
 {
        struct async_req *result;
        struct async_syscall_state *state;
@@ -377,6 +362,11 @@ struct async_req *async_sendall(TALLOC_CTX *mem_ctx, struct event_context *ev,
        return result;
 }
 
+NTSTATUS sendall_recv(struct async_req *req)
+{
+       return async_req_simple_recv(req);
+}
+
 /**
  * fde event handler for the "recv" syscall
  * @param[in] ev       The event context that sent us here
@@ -498,9 +488,9 @@ static void async_recvall_callback(struct event_context *ev,
  * async_recvall will call recv(2) until "length" bytes are received
  */
 
-struct async_req *async_recvall(TALLOC_CTX *mem_ctx, struct event_context *ev,
-                               int fd, void *buffer, size_t length,
-                               int flags)
+struct async_req *recvall_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
+                              int fd, void *buffer, size_t length,
+                              int flags)
 {
        struct async_req *result;
        struct async_syscall_state *state;
@@ -522,6 +512,11 @@ struct async_req *async_recvall(TALLOC_CTX *mem_ctx, struct event_context *ev,
        return result;
 }
 
+NTSTATUS recvall_recv(struct async_req *req)
+{
+       return async_req_simple_recv(req);
+}
+
 /**
  * fde event handler for connect(2)
  * @param[in] ev       The event context that sent us here
index d64fcb66d989d56d05d56fa34fabf0466687b0e2..193e9efc965d5aeb3a72cf9d8b819042d9e6d29e 100644 (file)
@@ -851,7 +851,7 @@ void check_log_size( void )
                ret = vasprintf(&msgbuf, format_str, ap);
                va_end(ap);
 
-               if (ret == -1) {
+               if (ret != -1) {
                        syslog(priority, "%s", msgbuf);
                }
                SAFE_FREE(msgbuf);
index a0d93d6fe76ccb6eac85f51d38a65b1e9438fa6f..636639c11d8e36c94b572b7b9e2d14bba4e9df77 100644 (file)
@@ -240,7 +240,7 @@ void display_sec_acl(SEC_ACL *sec_acl)
 
 void display_acl_type(uint16 type)
 {
-       static fstring typestr="";
+       fstring typestr="";
 
        typestr[0] = 0;
 
index f533ec92c780bd1ae8f0039ff0fb4eff5c9813cd..48fa4d32a93a1e01669f17c623e592fa602287da 100644 (file)
@@ -33,7 +33,7 @@ bool ismyaddr(const struct sockaddr *ip)
 {
        struct interface *i;
        for (i=local_interfaces;i;i=i->next) {
-               if (addr_equal((struct sockaddr *)&i->ip,ip)) {
+               if (sockaddr_equal((struct sockaddr *)&i->ip,ip)) {
                        return true;
                }
        }
@@ -65,7 +65,7 @@ static struct interface *iface_find(const struct sockaddr *ip,
                        if (same_net(ip, (struct sockaddr *)&i->ip, (struct sockaddr *)&i->netmask)) {
                                return i;
                        }
-               } else if (addr_equal((struct sockaddr *)&i->ip, ip)) {
+               } else if (sockaddr_equal((struct sockaddr *)&i->ip, ip)) {
                        return i;
                }
        }
@@ -93,7 +93,7 @@ void setup_linklocal_scope_id(struct sockaddr *pss)
 {
        struct interface *i;
        for (i=local_interfaces;i;i=i->next) {
-               if (addr_equal((struct sockaddr *)&i->ip,pss)) {
+               if (sockaddr_equal((struct sockaddr *)&i->ip,pss)) {
                        struct sockaddr_in6 *psa6 =
                                (struct sockaddr_in6 *)pss;
                        psa6->sin6_scope_id = if_nametoindex(i->name);
@@ -388,7 +388,7 @@ static void interpret_interface(char *token)
                }
 
                for (i=0;i<total_probed;i++) {
-                       if (addr_equal((struct sockaddr *)&ss, (struct sockaddr *)&probed_ifaces[i].ip)) {
+                       if (sockaddr_equal((struct sockaddr *)&ss, (struct sockaddr *)&probed_ifaces[i].ip)) {
                                add_interface(&probed_ifaces[i]);
                                return;
                        }
@@ -441,8 +441,8 @@ static void interpret_interface(char *token)
        make_net(&ss_net, &ss, &ss_mask);
 
        /* Maybe the first component was a broadcast address. */
-       if (addr_equal((struct sockaddr *)&ss_bcast, (struct sockaddr *)&ss) || 
-               addr_equal((struct sockaddr *)&ss_net, (struct sockaddr *)&ss)) {
+       if (sockaddr_equal((struct sockaddr *)&ss_bcast, (struct sockaddr *)&ss) ||
+               sockaddr_equal((struct sockaddr *)&ss_net, (struct sockaddr *)&ss)) {
                for (i=0;i<total_probed;i++) {
                        if (same_net((struct sockaddr *)&ss, 
                                                 (struct sockaddr *)&probed_ifaces[i].ip, 
index 2e319cf23cbdb57a21b38ba4cfc56040c173261e..1f4b03f677b4ded0aacf8d8105291c0699504a55 100644 (file)
@@ -46,7 +46,7 @@ static void convert_USER_INFO_X_to_samr_user_info21(struct USER_INFO_X *infoX,
                fields_present |= SAMR_FIELD_ACCOUNT_NAME;
        }
        if (infoX->usriX_password) {
-               fields_present |= SAMR_FIELD_PASSWORD;
+               fields_present |= SAMR_FIELD_NT_PASSWORD_PRESENT;
        }
        if (infoX->usriX_flags) {
                fields_present |= SAMR_FIELD_ACCT_FLAGS;
index 2e6d3b3cb10538809021bf8957ed52eaa83a4914..cad14ec493092ebd18b4fd1a4c48795681e0f9f9 100644 (file)
@@ -166,7 +166,7 @@ struct poptOption popt_common_configfile[] = {
 };
 
 struct poptOption popt_common_version[] = {
-       { NULL, 0, POPT_ARG_CALLBACK, (void *)popt_common_callback },
+       { NULL, 0, POPT_ARG_CALLBACK|POPT_CBFLAG_POST, (void *)popt_common_callback },
        { "version", 'V', POPT_ARG_NONE, NULL, 'V', "Print version" },
        POPT_TABLEEND
 };
@@ -318,7 +318,7 @@ const struct poptOption popt_common_dynconfig[] = {
  * exit on failure
  * ****************************************************************************/
 
-static void get_password_file(void)
+static void get_password_file(struct user_auth_info *auth_info)
 {
        int fd = -1;
        char *p;
@@ -377,13 +377,14 @@ static void get_password_file(void)
        }
        SAFE_FREE(spec);
 
-       set_cmdline_auth_info_password(pass);
+       set_cmdline_auth_info_password(auth_info, pass);
        if (close_it) {
                close(fd);
        }
 }
 
-static void get_credentials_file(const char *file)
+static void get_credentials_file(struct user_auth_info *auth_info,
+                                const char *file)
 {
        XFILE *auth;
        fstring buf;
@@ -426,9 +427,9 @@ static void get_credentials_file(const char *file)
                        val++;
 
                if (strwicmp("password", param) == 0) {
-                       set_cmdline_auth_info_password(val);
+                       set_cmdline_auth_info_password(auth_info, val);
                } else if (strwicmp("username", param) == 0) {
-                       set_cmdline_auth_info_username(val);
+                       set_cmdline_auth_info_username(auth_info, val);
                } else if (strwicmp("domain", param) == 0) {
                        set_global_myworkgroup(val);
                }
@@ -453,13 +454,16 @@ static void popt_common_credentials_callback(poptContext con,
                                        const struct poptOption *opt,
                                        const char *arg, const void *data)
 {
+       struct user_auth_info *auth_info = talloc_get_type_abort(
+               *((const char **)data), struct user_auth_info);
        char *p;
 
        if (reason == POPT_CALLBACK_REASON_PRE) {
-               set_cmdline_auth_info_username("GUEST");
+               set_cmdline_auth_info_username(auth_info, "GUEST");
 
                if (getenv("LOGNAME")) {
-                       set_cmdline_auth_info_username(getenv("LOGNAME"));
+                       set_cmdline_auth_info_username(auth_info,
+                                                      getenv("LOGNAME"));
                }
 
                if (getenv("USER")) {
@@ -467,24 +471,25 @@ static void popt_common_credentials_callback(poptContext con,
                        if (!puser) {
                                exit(ENOMEM);
                        }
-                       set_cmdline_auth_info_username(puser);
+                       set_cmdline_auth_info_username(auth_info, puser);
 
                        if ((p = strchr_m(puser,'%'))) {
                                size_t len;
                                *p = 0;
                                len = strlen(p+1);
-                               set_cmdline_auth_info_password(p+1);
+                               set_cmdline_auth_info_password(auth_info, p+1);
                                memset(strchr_m(getenv("USER"),'%')+1,'X',len);
                        }
                        SAFE_FREE(puser);
                }
 
                if (getenv("PASSWD")) {
-                       set_cmdline_auth_info_password(getenv("PASSWD"));
+                       set_cmdline_auth_info_password(auth_info,
+                                                      getenv("PASSWD"));
                }
 
                if (getenv("PASSWD_FD") || getenv("PASSWD_FILE")) {
-                       get_password_file();
+                       get_password_file(auth_info);
                }
 
                return;
@@ -499,19 +504,22 @@ static void popt_common_credentials_callback(poptContext con,
                        if ((lp=strchr_m(puser,'%'))) {
                                size_t len;
                                *lp = 0;
-                               set_cmdline_auth_info_username(puser);
-                               set_cmdline_auth_info_password(lp+1);
+                               set_cmdline_auth_info_username(auth_info,
+                                                              puser);
+                               set_cmdline_auth_info_password(auth_info,
+                                                              lp+1);
                                len = strlen(lp+1);
                                memset(strchr_m(arg,'%')+1,'X',len);
                        } else {
-                               set_cmdline_auth_info_username(puser);
+                               set_cmdline_auth_info_username(auth_info,
+                                                              puser);
                        }
                        SAFE_FREE(puser);
                }
                break;
 
        case 'A':
-               get_credentials_file(arg);
+               get_credentials_file(auth_info, arg);
                break;
 
        case 'k':
@@ -519,31 +527,40 @@ static void popt_common_credentials_callback(poptContext con,
                d_printf("No kerberos support compiled in\n");
                exit(1);
 #else
-               set_cmdline_auth_info_use_krb5_ticket();
+               set_cmdline_auth_info_use_krb5_ticket(auth_info);
 #endif
                break;
 
        case 'S':
-               if (!set_cmdline_auth_info_signing_state(arg)) {
+               if (!set_cmdline_auth_info_signing_state(auth_info, arg)) {
                        fprintf(stderr, "Unknown signing option %s\n", arg );
                        exit(1);
                }
                break;
        case 'P':
-               set_cmdline_auth_info_use_machine_account();
+               set_cmdline_auth_info_use_machine_account(auth_info);
                break;
        case 'N':
-               set_cmdline_auth_info_password("");
+               set_cmdline_auth_info_password(auth_info, "");
                break;
        case 'e':
-               set_cmdline_auth_info_smb_encrypt();
+               set_cmdline_auth_info_smb_encrypt(auth_info);
                break;
 
        }
 }
 
+static struct user_auth_info *global_auth_info;
+
+void popt_common_set_auth_info(struct user_auth_info *auth_info)
+{
+       global_auth_info = auth_info;
+}
+
 struct poptOption popt_common_credentials[] = {
-       { NULL, 0, POPT_ARG_CALLBACK|POPT_CBFLAG_PRE, (void *)popt_common_credentials_callback },
+       { NULL, 0, POPT_ARG_CALLBACK|POPT_CBFLAG_PRE,
+         (void *)popt_common_credentials_callback, 0,
+         (const char *)&global_auth_info },
        { "user", 'U', POPT_ARG_STRING, NULL, 'U', "Set the network username", "USERNAME" },
        { "no-pass", 'N', POPT_ARG_NONE, NULL, 'N', "Don't ask for a password" },
        { "kerberos", 'k', POPT_ARG_NONE, NULL, 'k', "Use kerberos (active directory) authentication" },
index df853366039f1d4cbb2b1205fec849406234962c..400f5f31b0b98bd00635b128044baea58d71ea80 100644 (file)
@@ -99,6 +99,33 @@ bool sec_desc_equal(SEC_DESC *s1, SEC_DESC *s2)
        return True;
 }
 
+/*******************************************************************
+ Given a security_descriptor return the sec_info.
+********************************************************************/
+
+uint32_t get_sec_info(const SEC_DESC *sd)
+{
+       uint32_t sec_info = ALL_SECURITY_INFORMATION;
+
+       SMB_ASSERT(sd);
+
+       if (sd->owner_sid == NULL) {
+               sec_info &= ~OWNER_SECURITY_INFORMATION;
+       }
+       if (sd->group_sid == NULL) {
+               sec_info &= ~GROUP_SECURITY_INFORMATION;
+       }
+       if (sd->sacl == NULL) {
+               sec_info &= ~SACL_SECURITY_INFORMATION;
+       }
+       if (sd->dacl == NULL) {
+               sec_info &= ~DACL_SECURITY_INFORMATION;
+       }
+
+       return sec_info;
+}
+
+
 /*******************************************************************
  Merge part of security descriptor old_sec in to the empty sections of 
  security descriptor new_sec.
index 074b523ae0b8a320076629d7284ebfd0b9f366ff..dd23d547b5d240425617587792ae87aafc6141a2 100644 (file)
@@ -280,135 +280,154 @@ bool init_names(void)
   Used mainly in client tools.
 ****************************************************************************/
 
-static struct user_auth_info cmdline_auth_info = {
-       NULL,   /* username */
-       NULL,   /* password */
-       false,  /* got_pass */
-       false,  /* use_kerberos */
-       Undefined, /* signing state */
-       false,  /* smb_encrypt */
-       false   /* use machine account */
-};
-
-const char *get_cmdline_auth_info_username(void)
-{
-       if (!cmdline_auth_info.username) {
+struct user_auth_info *user_auth_info_init(TALLOC_CTX *mem_ctx)
+{
+       struct user_auth_info *result;
+
+       result = TALLOC_ZERO_P(mem_ctx, struct user_auth_info);
+       if (result == NULL) {
+               return NULL;
+       }
+
+       result->signing_state = Undefined;
+       return result;
+}
+
+const char *get_cmdline_auth_info_username(struct user_auth_info *auth_info)
+{
+       if (!auth_info->username) {
                return "";
        }
-       return cmdline_auth_info.username;
+       return auth_info->username;
 }
 
-void set_cmdline_auth_info_username(const char *username)
+void set_cmdline_auth_info_username(struct user_auth_info *auth_info,
+                                   const char *username)
 {
-       SAFE_FREE(cmdline_auth_info.username);
-       cmdline_auth_info.username = SMB_STRDUP(username);
-       if (!cmdline_auth_info.username) {
+       TALLOC_FREE(auth_info->username);
+       auth_info->username = talloc_strdup(auth_info, username);
+       if (!auth_info->username) {
                exit(ENOMEM);
        }
 }
 
-const char *get_cmdline_auth_info_password(void)
+const char *get_cmdline_auth_info_password(struct user_auth_info *auth_info)
 {
-       if (!cmdline_auth_info.password) {
+       if (!auth_info->password) {
                return "";
        }
-       return cmdline_auth_info.password;
+       return auth_info->password;
 }
 
-void set_cmdline_auth_info_password(const char *password)
+void set_cmdline_auth_info_password(struct user_auth_info *auth_info,
+                                   const char *password)
 {
-       SAFE_FREE(cmdline_auth_info.password);
-       cmdline_auth_info.password = SMB_STRDUP(password);
-       if (!cmdline_auth_info.password) {
+       TALLOC_FREE(auth_info->password);
+       auth_info->password = talloc_strdup(auth_info, password);
+       if (!auth_info->password) {
                exit(ENOMEM);
        }
-       cmdline_auth_info.got_pass = true;
+       auth_info->got_pass = true;
 }
 
-bool set_cmdline_auth_info_signing_state(const char *arg)
+bool set_cmdline_auth_info_signing_state(struct user_auth_info *auth_info,
+                                        const char *arg)
 {
-       cmdline_auth_info.signing_state = -1;
+       auth_info->signing_state = -1;
        if (strequal(arg, "off") || strequal(arg, "no") ||
                        strequal(arg, "false")) {
-               cmdline_auth_info.signing_state = false;
+               auth_info->signing_state = false;
        } else if (strequal(arg, "on") || strequal(arg, "yes") ||
                        strequal(arg, "true") || strequal(arg, "auto")) {
-               cmdline_auth_info.signing_state = true;
+               auth_info->signing_state = true;
        } else if (strequal(arg, "force") || strequal(arg, "required") ||
                        strequal(arg, "forced")) {
-               cmdline_auth_info.signing_state = Required;
+               auth_info->signing_state = Required;
        } else {
                return false;
        }
        return true;
 }
 
-int get_cmdline_auth_info_signing_state(void)
+int get_cmdline_auth_info_signing_state(struct user_auth_info *auth_info)
 {
-       return cmdline_auth_info.signing_state;
+       return auth_info->signing_state;
 }
 
-void set_cmdline_auth_info_use_kerberos(bool b)
+void set_cmdline_auth_info_use_kerberos(struct user_auth_info *auth_info,
+                                       bool b)
 {
-        cmdline_auth_info.use_kerberos = b;
+        auth_info->use_kerberos = b;
 }
 
-bool get_cmdline_auth_info_use_kerberos(void)
+bool get_cmdline_auth_info_use_kerberos(struct user_auth_info *auth_info)
 {
-       return cmdline_auth_info.use_kerberos;
+       return auth_info->use_kerberos;
 }
 
 /* This should only be used by lib/popt_common.c JRA */
-void set_cmdline_auth_info_use_krb5_ticket(void)
+void set_cmdline_auth_info_use_krb5_ticket(struct user_auth_info *auth_info)
 {
-       cmdline_auth_info.use_kerberos = true;
-       cmdline_auth_info.got_pass = true;
+       auth_info->use_kerberos = true;
+       auth_info->got_pass = true;
 }
 
 /* This should only be used by lib/popt_common.c JRA */
-void set_cmdline_auth_info_smb_encrypt(void)
+void set_cmdline_auth_info_smb_encrypt(struct user_auth_info *auth_info)
 {
-       cmdline_auth_info.smb_encrypt = true;
+       auth_info->smb_encrypt = true;
 }
 
-void set_cmdline_auth_info_use_machine_account(void)
+void set_cmdline_auth_info_use_machine_account(struct user_auth_info *auth_info)
 {
-       cmdline_auth_info.use_machine_account = true;
+       auth_info->use_machine_account = true;
 }
 
-bool get_cmdline_auth_info_got_pass(void)
+bool get_cmdline_auth_info_got_pass(struct user_auth_info *auth_info)
 {
-       return cmdline_auth_info.got_pass;
+       return auth_info->got_pass;
 }
 
-bool get_cmdline_auth_info_smb_encrypt(void)
+bool get_cmdline_auth_info_smb_encrypt(struct user_auth_info *auth_info)
 {
-       return cmdline_auth_info.smb_encrypt;
+       return auth_info->smb_encrypt;
 }
 
-bool get_cmdline_auth_info_use_machine_account(void)
+bool get_cmdline_auth_info_use_machine_account(struct user_auth_info *auth_info)
 {
-       return cmdline_auth_info.use_machine_account;
+       return auth_info->use_machine_account;
 }
 
-bool get_cmdline_auth_info_copy(struct user_auth_info *info)
+struct user_auth_info *get_cmdline_auth_info_copy(TALLOC_CTX *mem_ctx,
+                                                 struct user_auth_info *src)
 {
-       *info = cmdline_auth_info;
-       /* Now re-alloc the strings. */
-       info->username = SMB_STRDUP(get_cmdline_auth_info_username());
-       info->password = SMB_STRDUP(get_cmdline_auth_info_password());
-       if (!info->username || !info->password) {
-               return false;
+       struct user_auth_info *result;
+
+       result = user_auth_info_init(mem_ctx);
+       if (result == NULL) {
+               return NULL;
        }
-       return true;
+
+       *result = *src;
+
+       result->username = talloc_strdup(
+               result, get_cmdline_auth_info_username(src));
+       result->password = talloc_strdup(
+               result, get_cmdline_auth_info_password(src));
+       if ((result->username == NULL) || (result->password == NULL)) {
+               TALLOC_FREE(result);
+               return NULL;
+       }
+
+       return result;
 }
 
-bool set_cmdline_auth_info_machine_account_creds(void)
+bool set_cmdline_auth_info_machine_account_creds(struct user_auth_info *auth_info)
 {
        char *pass = NULL;
        char *account = NULL;
 
-       if (!get_cmdline_auth_info_use_machine_account()) {
+       if (!get_cmdline_auth_info_use_machine_account(auth_info)) {
                return false;
        }
 
@@ -430,8 +449,8 @@ bool set_cmdline_auth_info_machine_account_creds(void)
                return false;
        }
 
-       set_cmdline_auth_info_username(account);
-       set_cmdline_auth_info_password(pass);
+       set_cmdline_auth_info_username(auth_info, account);
+       set_cmdline_auth_info_password(auth_info, pass);
 
        SAFE_FREE(account);
        SAFE_FREE(pass);
index 5721f412d6225bc1d6976d6a33d6699b6065efd5..605bbf1fb6b4b557e6aff4926cc09f196a87276d 100644 (file)
@@ -52,7 +52,7 @@ bool interpret_string_addr(struct sockaddr_storage *pss,
        }
 #endif
 
-       zero_addr(pss);
+       zero_sockaddr(pss);
 
        if (!interpret_string_addr_internal(&res, str, flags|AI_ADDRCONFIG)) {
                return false;
@@ -81,7 +81,7 @@ bool interpret_string_addr(struct sockaddr_storage *pss,
  Set an address to INADDR_ANY.
 ******************************************************************/
 
-void zero_addr(struct sockaddr_storage *pss)
+void zero_sockaddr(struct sockaddr_storage *pss)
 {
        memset(pss, '\0', sizeof(*pss));
        /* Ensure we're at least a valid sockaddr-storage. */
@@ -1254,7 +1254,7 @@ static bool matchname(const char *remotehost,
                if (!res->ai_addr) {
                        continue;
                }
-               if (addr_equal((const struct sockaddr *)res->ai_addr,
+               if (sockaddr_equal((const struct sockaddr *)res->ai_addr,
                                        (struct sockaddr *)pss)) {
                        freeaddrinfo(ailist);
                        return true;
@@ -1367,7 +1367,7 @@ const char *get_peer_name(int fd, bool force_lookup)
        p = get_peer_addr_internal(fd, addr_buf, sizeof(addr_buf), (struct sockaddr *)&ss, &length);
 
        /* it might be the same as the last one - save some DNS work */
-       if (addr_equal((struct sockaddr *)&ss, (struct sockaddr *)&nc.ss)) {
+       if (sockaddr_equal((struct sockaddr *)&ss, (struct sockaddr *)&nc.ss)) {
                return nc.name ? nc.name : "UNKNOWN";
        }
 
@@ -1687,7 +1687,7 @@ bool is_myname_or_ipaddr(const char *s)
                }
                n = get_interfaces(nics, MAX_INTERFACES);
                for (i=0; i<n; i++) {
-                       if (addr_equal((struct sockaddr *)&nics[i].ip, (struct sockaddr *)&ss)) {
+                       if (sockaddr_equal((struct sockaddr *)&nics[i].ip, (struct sockaddr *)&ss)) {
                                TALLOC_FREE(nics);
                                return true;
                        }
index fde4f825e81416b45ade0b5f08ff7b5eef19f7cf..9358061797abd36cf9f811eb1d5e45cc7703468f 100644 (file)
@@ -24,7 +24,7 @@
 
 #include "includes.h"
 
-char toupper_ascii_fast_table[128] = {
+const char toupper_ascii_fast_table[128] = {
        0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf,
        0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
        0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
index 4658f66cfdc42b99595326523d148be8c156b297..7dfc19b4628573f7304eaffa595462a65766758c 100644 (file)
@@ -772,7 +772,7 @@ static char *get_kdc_ip_string(char *mem_ctx,
                get_kdc_list(realm, sitename, &ip_srv_site, &count_site);
 
                for (i = 0; i < count_site; i++) {
-                       if (addr_equal((struct sockaddr *)&ip_srv_site[i].ss, 
+                       if (sockaddr_equal((struct sockaddr *)&ip_srv_site[i].ss,
                                                   (struct sockaddr *)pss)) {
                                continue;
                        }
@@ -795,13 +795,13 @@ static char *get_kdc_ip_string(char *mem_ctx,
        for (i = 0; i < count_nonsite; i++) {
                int j;
 
-               if (addr_equal((struct sockaddr *)&ip_srv_nonsite[i].ss, (struct sockaddr *)pss)) {
+               if (sockaddr_equal((struct sockaddr *)&ip_srv_nonsite[i].ss, (struct sockaddr *)pss)) {
                        continue;
                }
 
                /* Ensure this isn't an IP already seen (YUK! this is n*n....) */
                for (j = 0; j < count_site; j++) {
-                       if (addr_equal((struct sockaddr *)&ip_srv_nonsite[i].ss,
+                       if (sockaddr_equal((struct sockaddr *)&ip_srv_nonsite[i].ss,
                                                (struct sockaddr *)&ip_srv_site[j].ss)) {
                                break;
                        }
index 932e42e0766fbd587cfa05932df8549cc81dbed6..cf8a7ebb1b3750f844df59faa6294d7c2ed38a47 100644 (file)
@@ -162,6 +162,11 @@ bool ads_closest_dc(ADS_STRUCT *ads)
                return True;
        }
 
+       if (ads->config.client_site_name == NULL) {
+               DEBUG(10,("ads_closest_dc: client belongs to no site\n"));
+               return True;
+       }
+
        DEBUG(10,("ads_closest_dc: %s is not the closest DC\n", 
                ads->config.ldap_server_name));
 
@@ -267,10 +272,12 @@ static bool ads_try_connect(ADS_STRUCT *ads, const char *server, bool gc)
 
 static NTSTATUS ads_find_dc(ADS_STRUCT *ads)
 {
+       const char *c_domain;
        const char *c_realm;
        int count, i=0;
        struct ip_service *ip_list;
        const char *realm;
+       const char *domain;
        bool got_realm = False;
        bool use_own_domain = False;
        char *sitename;
@@ -308,13 +315,44 @@ static NTSTATUS ads_find_dc(ADS_STRUCT *ads)
                return NT_STATUS_INVALID_PARAMETER; /* rather need MISSING_PARAMETER ... */
        }
 
+       if ( use_own_domain ) {
+               c_domain = lp_workgroup();
+       } else {
+               c_domain = ads->server.workgroup;
+       }
+
        realm = c_realm;
+       domain = c_domain;
+
+       /*
+        * In case of LDAP we use get_dc_name() as that
+        * creates the custom krb5.conf file
+        */
+       if (!(ads->auth.flags & ADS_AUTH_NO_BIND)) {
+               fstring srv_name;
+               struct sockaddr_storage ip_out;
+
+               DEBUG(6,("ads_find_dc: (ldap) looking for %s '%s'\n",
+                       (got_realm ? "realm" : "domain"), realm));
+
+               if (get_dc_name(domain, realm, srv_name, &ip_out)) {
+                       /*
+                        * we call ads_try_connect() to fill in the
+                        * ads->config details
+                        */
+                       if (ads_try_connect(ads, srv_name, false)) {
+                               return NT_STATUS_OK;
+                       }
+               }
+
+               return NT_STATUS_NO_LOGON_SERVERS;
+       }
 
        sitename = sitename_fetch(realm);
 
  again:
 
-       DEBUG(6,("ads_find_dc: looking for %s '%s'\n",
+       DEBUG(6,("ads_find_dc: (cldap) looking for %s '%s'\n",
                (got_realm ? "realm" : "domain"), realm));
 
        status = get_sorted_dc_list(realm, sitename, &ip_list, &count, got_realm);
@@ -613,9 +651,8 @@ got_connection:
 
        /* cache the successful connection for workgroup and realm */
        if (ads_closest_dc(ads)) {
-               print_sockaddr(addr, sizeof(addr), &ads->ldap.ss);
-               saf_store( ads->server.workgroup, addr);
-               saf_store( ads->server.realm, addr);
+               saf_store( ads->server.workgroup, ads->config.ldap_server_name);
+               saf_store( ads->server.realm, ads->config.ldap_server_name);
        }
 
        ldap_set_option(ads->ldap.ld, LDAP_OPT_PROTOCOL_VERSION, &version);
index 6324a22041fdbe713f637b8eeefa282d0191ed54..6ada66ca40d9ccf1eb2a4d5eb8c8fddd71d055a5 100644 (file)
@@ -75,7 +75,6 @@ void ndr_print_ads_struct(struct ndr_print *ndr, const char *name, const struct
        ndr_print_string(ndr, "server_site_name", r->config.server_site_name);
        ndr_print_string(ndr, "client_site_name", r->config.client_site_name);
        ndr_print_time_t(ndr, "current_time", r->config.current_time);
-       ndr_print_bool(ndr, "tried_closest_dc", r->config.tried_closest_dc);
        ndr_print_string(ndr, "schema_path", r->config.schema_path);
        ndr_print_string(ndr, "config_path", r->config.config_path);
        ndr->depth--;
index 908fb78ab4ddffaa439943cf4970648ad019aa6d..691f6ff8ebb7038d57b8373e6d49385c8c687a51 100644 (file)
@@ -1521,7 +1521,10 @@ static WERROR libnet_join_post_processing(TALLOC_CTX *mem_ctx,
                return WERR_OK;
        }
 
-       saf_store(r->in.domain_name, r->in.dc_name);
+       saf_join_store(r->out.netbios_domain_name, r->in.dc_name);
+       if (r->out.dns_domain_name) {
+               saf_join_store(r->out.dns_domain_name, r->in.dc_name);
+       }
 
 #ifdef WITH_ADS
        if (r->out.domain_is_ad) {
@@ -1752,6 +1755,7 @@ static WERROR libnet_DomainJoin(TALLOC_CTX *mem_ctx,
                                     r->in.domain_name,
                                     NULL,
                                     NULL,
+                                    DS_FORCE_REDISCOVERY |
                                     DS_DIRECTORY_SERVICE_REQUIRED |
                                     DS_WRITABLE_REQUIRED |
                                     DS_RETURN_DNS_NAME,
index 990f6f6a6372f8b8781bc2216203ed6378576109..81956942caf05130715782b692b7081cf5680ed9 100644 (file)
@@ -324,7 +324,7 @@ struct libnet_keytab_entry *libnet_keytab_search(struct libnet_keytab_context *c
 
        ret = krb5_kt_start_seq_get(ctx->context, ctx->keytab, &cursor);
        if (ret) {
-               DEBUG(10, ("krb5_kt_start_seq_get failed: %s",
+               DEBUG(10, ("krb5_kt_start_seq_get failed: %s\n",
                          error_message(ret)));
                return NULL;
        }
index 435181016992fb4e02c762c0c31bc5c9da1d871c..73d443974397952939eced9444cd5fa6b003b9b9 100644 (file)
@@ -282,8 +282,8 @@ static const char *samsync_debug_str(TALLOC_CTX *mem_ctx,
  * libnet_samsync
  */
 
-void libnet_init_netr_ChangeLogEntry(struct samsync_object *o,
-                                    struct netr_ChangeLogEntry *e)
+static void libnet_init_netr_ChangeLogEntry(struct samsync_object *o,
+                                           struct netr_ChangeLogEntry *e)
 {
        ZERO_STRUCTP(e);
 
index 1af32494730d241f78f76be34d7d477b08d63d92..1ce4e67c56a638ec69eb30d0246249e082074023 100644 (file)
@@ -2296,23 +2296,36 @@ NTSTATUS rpccli_netr_LogonSamLogonWithFlags(struct rpc_pipe_client *cli,
        return r.out.result;
 }
 
-NTSTATUS rpccli_netr_NETRSERVERGETTRUSTINFO(struct rpc_pipe_client *cli,
-                                           TALLOC_CTX *mem_ctx,
-                                           WERROR *werror)
+NTSTATUS rpccli_netr_ServerGetTrustInfo(struct rpc_pipe_client *cli,
+                                       TALLOC_CTX *mem_ctx,
+                                       const char *server_name /* [in] [unique,charset(UTF16)] */,
+                                       const char *account_name /* [in] [ref,charset(UTF16)] */,
+                                       enum netr_SchannelType secure_channel_type /* [in]  */,
+                                       const char *computer_name /* [in] [ref,charset(UTF16)] */,
+                                       struct netr_Authenticator *credential /* [in] [ref] */,
+                                       struct netr_Authenticator *return_authenticator /* [out] [ref] */,
+                                       struct samr_Password *new_owf_password /* [out] [ref] */,
+                                       struct samr_Password *old_owf_password /* [out] [ref] */,
+                                       struct netr_TrustInfo **trust_info /* [out] [ref] */)
 {
-       struct netr_NETRSERVERGETTRUSTINFO r;
+       struct netr_ServerGetTrustInfo r;
        NTSTATUS status;
 
        /* In parameters */
+       r.in.server_name = server_name;
+       r.in.account_name = account_name;
+       r.in.secure_channel_type = secure_channel_type;
+       r.in.computer_name = computer_name;
+       r.in.credential = credential;
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(netr_NETRSERVERGETTRUSTINFO, &r);
+               NDR_PRINT_IN_DEBUG(netr_ServerGetTrustInfo, &r);
        }
 
        status = cli_do_rpc_ndr(cli,
                                mem_ctx,
                                &ndr_table_netlogon,
-                               NDR_NETR_NETRSERVERGETTRUSTINFO,
+                               NDR_NETR_SERVERGETTRUSTINFO,
                                &r);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -2320,7 +2333,7 @@ NTSTATUS rpccli_netr_NETRSERVERGETTRUSTINFO(struct rpc_pipe_client *cli,
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(netr_NETRSERVERGETTRUSTINFO, &r);
+               NDR_PRINT_OUT_DEBUG(netr_ServerGetTrustInfo, &r);
        }
 
        if (NT_STATUS_IS_ERR(status)) {
@@ -2328,12 +2341,12 @@ NTSTATUS rpccli_netr_NETRSERVERGETTRUSTINFO(struct rpc_pipe_client *cli,
        }
 
        /* Return variables */
+       *return_authenticator = *r.out.return_authenticator;
+       *new_owf_password = *r.out.new_owf_password;
+       *old_owf_password = *r.out.old_owf_password;
+       *trust_info = *r.out.trust_info;
 
        /* Return result */
-       if (werror) {
-               *werror = r.out.result;
-       }
-
-       return werror_to_ntstatus(r.out.result);
+       return r.out.result;
 }
 
index 9f5eac15b20b5a0c5ec1a225831553ad112a29b6..3fbc00e9dab12eb505a4661364b31d7155afb71a 100644 (file)
@@ -356,7 +356,15 @@ NTSTATUS rpccli_netr_LogonSamLogonWithFlags(struct rpc_pipe_client *cli,
                                            union netr_Validation *validation /* [out] [ref,switch_is(validation_level)] */,
                                            uint8_t *authoritative /* [out] [ref] */,
                                            uint32_t *flags /* [in,out] [ref] */);
-NTSTATUS rpccli_netr_NETRSERVERGETTRUSTINFO(struct rpc_pipe_client *cli,
-                                           TALLOC_CTX *mem_ctx,
-                                           WERROR *werror);
+NTSTATUS rpccli_netr_ServerGetTrustInfo(struct rpc_pipe_client *cli,
+                                       TALLOC_CTX *mem_ctx,
+                                       const char *server_name /* [in] [unique,charset(UTF16)] */,
+                                       const char *account_name /* [in] [ref,charset(UTF16)] */,
+                                       enum netr_SchannelType secure_channel_type /* [in]  */,
+                                       const char *computer_name /* [in] [ref,charset(UTF16)] */,
+                                       struct netr_Authenticator *credential /* [in] [ref] */,
+                                       struct netr_Authenticator *return_authenticator /* [out] [ref] */,
+                                       struct samr_Password *new_owf_password /* [out] [ref] */,
+                                       struct samr_Password *old_owf_password /* [out] [ref] */,
+                                       struct netr_TrustInfo **trust_info /* [out] [ref] */);
 #endif /* __CLI_NETLOGON__ */
index 0ccbcdf5b0c467930eb2601ac813b28e6c686c5f..ee8a31138d20b371894d33cf237d7d1fd9bee5e4 100644 (file)
@@ -17,7 +17,7 @@ struct lsa_String {
        uint16_t length;/* [value(2*strlen_m(string))] */
        uint16_t size;/* [value(2*strlen_m(string))] */
        const char *string;/* [unique,charset(UTF16),length_is(length/2),size_is(size/2)] */
-}/* [public,noejs] */;
+}/* [public] */;
 
 struct lsa_StringLarge {
        uint16_t length;/* [value(2*strlen_m(string))] */
index d1cf64e0ebf6e03d8f194b8c556970ed32beafb9..de4abdcae5932fdf1db707bef0dbaedf17ad4cb9 100644 (file)
@@ -11,7 +11,7 @@ struct GUID {
        uint16_t time_hi_and_version;
        uint8_t clock_seq[2];
        uint8_t node[6];
-}/* [noprint,gensize,public,noejs] */;
+}/* [noprint,gensize,public] */;
 
 struct ndr_syntax_id {
        struct GUID uuid;
index dd8d77ea15a4b65cded03f1c0a66e7f43c4cde34..d965e40bd27cfbaef506b05748f07720618985be 100644 (file)
@@ -2351,7 +2351,6 @@ static enum ndr_err_code ndr_push_AuthInfoNT4Owf(struct ndr_push *ndr, int ndr_f
                NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->password));
        }
        if (ndr_flags & NDR_BUFFERS) {
-               NDR_CHECK(ndr_push_samr_Password(ndr, NDR_BUFFERS, &r->password));
        }
        return NDR_ERR_SUCCESS;
 }
@@ -2364,7 +2363,6 @@ static enum ndr_err_code ndr_pull_AuthInfoNT4Owf(struct ndr_pull *ndr, int ndr_f
                NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->password));
        }
        if (ndr_flags & NDR_BUFFERS) {
-               NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_BUFFERS, &r->password));
        }
        return NDR_ERR_SUCCESS;
 }
@@ -2477,7 +2475,6 @@ static enum ndr_err_code ndr_push_AuthInfo(struct ndr_push *ndr, int ndr_flags,
                        break;
 
                        case TRUST_AUTH_TYPE_NT4OWF:
-                               NDR_CHECK(ndr_push_AuthInfoNT4Owf(ndr, NDR_BUFFERS, &r->nt4owf));
                        break;
 
                        case TRUST_AUTH_TYPE_CLEAR:
@@ -2525,7 +2522,6 @@ static enum ndr_err_code ndr_pull_AuthInfo(struct ndr_pull *ndr, int ndr_flags,
                        break;
 
                        case TRUST_AUTH_TYPE_NT4OWF:
-                               NDR_CHECK(ndr_pull_AuthInfoNT4Owf(ndr, NDR_BUFFERS, &r->nt4owf));
                        break;
 
                        case TRUST_AUTH_TYPE_CLEAR:
@@ -2584,7 +2580,6 @@ _PUBLIC_ enum ndr_err_code ndr_push_AuthenticationInformation(struct ndr_push *n
                }
        }
        if (ndr_flags & NDR_BUFFERS) {
-               NDR_CHECK(ndr_push_AuthInfo(ndr, NDR_BUFFERS, &r->AuthInfo));
        }
        return NDR_ERR_SUCCESS;
 }
@@ -2605,7 +2600,6 @@ _PUBLIC_ enum ndr_err_code ndr_pull_AuthenticationInformation(struct ndr_pull *n
                }
        }
        if (ndr_flags & NDR_BUFFERS) {
-               NDR_CHECK(ndr_pull_AuthInfo(ndr, NDR_BUFFERS, &r->AuthInfo));
        }
        return NDR_ERR_SUCCESS;
 }
@@ -2641,7 +2635,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_trustCurrentPasswords(struct ndr_push *ndr,
                for (cntr_current_0 = 0; cntr_current_0 < r->count; cntr_current_0++) {
                        if (r->current[cntr_current_0]) {
                                NDR_CHECK(ndr_push_relative_ptr2(ndr, r->current[cntr_current_0]));
-                               NDR_CHECK(ndr_push_AuthenticationInformation(ndr, NDR_SCALARS|NDR_BUFFERS, r->current[cntr_current_0]));
+                               NDR_CHECK(ndr_push_AuthenticationInformation(ndr, NDR_SCALARS, r->current[cntr_current_0]));
                        }
                }
        }
@@ -2681,7 +2675,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_trustCurrentPasswords(struct ndr_pull *ndr,
                                NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->current[cntr_current_0]));
                                _mem_save_current_1 = NDR_PULL_GET_MEM_CTX(ndr);
                                NDR_PULL_SET_MEM_CTX(ndr, r->current[cntr_current_0], 0);
-                               NDR_CHECK(ndr_pull_AuthenticationInformation(ndr, NDR_SCALARS|NDR_BUFFERS, r->current[cntr_current_0]));
+                               NDR_CHECK(ndr_pull_AuthenticationInformation(ndr, NDR_SCALARS, r->current[cntr_current_0]));
                                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_current_1, 0);
                                ndr->offset = _relative_save_offset;
                        }
index c4102eba6e927278db94d41207f2f45981d43dfd..81f8ddcab9faabb8faca6fdcc362fb0933389252 100644 (file)
@@ -8617,6 +8617,145 @@ _PUBLIC_ void ndr_print_DcSitesCtr(struct ndr_print *ndr, const char *name, cons
        ndr->depth--;
 }
 
+static enum ndr_err_code ndr_push_netr_TrustInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_TrustInfo *r)
+{
+       uint32_t cntr_data_1;
+       uint32_t cntr_entries_1;
+       if (ndr_flags & NDR_SCALARS) {
+               NDR_CHECK(ndr_push_align(ndr, 4));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
+               NDR_CHECK(ndr_push_unique_ptr(ndr, r->data));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->entry_count));
+               NDR_CHECK(ndr_push_unique_ptr(ndr, r->entries));
+       }
+       if (ndr_flags & NDR_BUFFERS) {
+               if (r->data) {
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
+                       for (cntr_data_1 = 0; cntr_data_1 < r->count; cntr_data_1++) {
+                               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->data[cntr_data_1]));
+                       }
+               }
+               if (r->entries) {
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
+                       for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) {
+                               NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->entries[cntr_entries_1]));
+                       }
+                       for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) {
+                               NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1]));
+                       }
+               }
+       }
+       return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_netr_TrustInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_TrustInfo *r)
+{
+       uint32_t _ptr_data;
+       uint32_t cntr_data_1;
+       TALLOC_CTX *_mem_save_data_0;
+       TALLOC_CTX *_mem_save_data_1;
+       uint32_t _ptr_entries;
+       uint32_t cntr_entries_1;
+       TALLOC_CTX *_mem_save_entries_0;
+       TALLOC_CTX *_mem_save_entries_1;
+       if (ndr_flags & NDR_SCALARS) {
+               NDR_CHECK(ndr_pull_align(ndr, 4));
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data));
+               if (_ptr_data) {
+                       NDR_PULL_ALLOC(ndr, r->data);
+               } else {
+                       r->data = NULL;
+               }
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->entry_count));
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_entries));
+               if (_ptr_entries) {
+                       NDR_PULL_ALLOC(ndr, r->entries);
+               } else {
+                       r->entries = NULL;
+               }
+       }
+       if (ndr_flags & NDR_BUFFERS) {
+               if (r->data) {
+                       _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->data, 0);
+                       NDR_CHECK(ndr_pull_array_size(ndr, &r->data));
+                       NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data));
+                       _mem_save_data_1 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->data, 0);
+                       for (cntr_data_1 = 0; cntr_data_1 < r->count; cntr_data_1++) {
+                               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->data[cntr_data_1]));
+                       }
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_1, 0);
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0);
+               }
+               if (r->entries) {
+                       _mem_save_entries_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0);
+                       NDR_CHECK(ndr_pull_array_size(ndr, &r->entries));
+                       NDR_PULL_ALLOC_N(ndr, r->entries, ndr_get_array_size(ndr, &r->entries));
+                       _mem_save_entries_1 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0);
+                       for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) {
+                               NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->entries[cntr_entries_1]));
+                       }
+                       for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) {
+                               NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1]));
+                       }
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_1, 0);
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_0, 0);
+               }
+               if (r->data) {
+                       NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->count));
+               }
+               if (r->entries) {
+                       NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->entries, r->count));
+               }
+       }
+       return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_netr_TrustInfo(struct ndr_print *ndr, const char *name, const struct netr_TrustInfo *r)
+{
+       uint32_t cntr_data_1;
+       uint32_t cntr_entries_1;
+       ndr_print_struct(ndr, name, "netr_TrustInfo");
+       ndr->depth++;
+       ndr_print_uint32(ndr, "count", r->count);
+       ndr_print_ptr(ndr, "data", r->data);
+       ndr->depth++;
+       if (r->data) {
+               ndr->print(ndr, "%s: ARRAY(%d)", "data", (int)r->count);
+               ndr->depth++;
+               for (cntr_data_1=0;cntr_data_1<r->count;cntr_data_1++) {
+                       char *idx_1=NULL;
+                       if (asprintf(&idx_1, "[%d]", cntr_data_1) != -1) {
+                               ndr_print_uint32(ndr, "data", r->data[cntr_data_1]);
+                               free(idx_1);
+                       }
+               }
+               ndr->depth--;
+       }
+       ndr->depth--;
+       ndr_print_uint32(ndr, "entry_count", r->entry_count);
+       ndr_print_ptr(ndr, "entries", r->entries);
+       ndr->depth++;
+       if (r->entries) {
+               ndr->print(ndr, "%s: ARRAY(%d)", "entries", (int)r->count);
+               ndr->depth++;
+               for (cntr_entries_1=0;cntr_entries_1<r->count;cntr_entries_1++) {
+                       char *idx_1=NULL;
+                       if (asprintf(&idx_1, "[%d]", cntr_entries_1) != -1) {
+                               ndr_print_lsa_String(ndr, "entries", &r->entries[cntr_entries_1]);
+                               free(idx_1);
+                       }
+               }
+               ndr->depth--;
+       }
+       ndr->depth--;
+       ndr->depth--;
+}
+
 static enum ndr_err_code ndr_push_netr_LogonUasLogon(struct ndr_push *ndr, int flags, const struct netr_LogonUasLogon *r)
 {
        if (flags & NDR_IN) {
@@ -15424,42 +15563,225 @@ _PUBLIC_ void ndr_print_netr_LogonSamLogonWithFlags(struct ndr_print *ndr, const
        ndr->depth--;
 }
 
-static enum ndr_err_code ndr_push_netr_NETRSERVERGETTRUSTINFO(struct ndr_push *ndr, int flags, const struct netr_NETRSERVERGETTRUSTINFO *r)
+static enum ndr_err_code ndr_push_netr_ServerGetTrustInfo(struct ndr_push *ndr, int flags, const struct netr_ServerGetTrustInfo *r)
 {
        if (flags & NDR_IN) {
+               NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name));
+               if (r->in.server_name) {
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_name, CH_UTF16)));
+                       NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server_name, ndr_charset_length(r->in.server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
+               }
+               if (r->in.account_name == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_name, CH_UTF16)));
+               NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.account_name, ndr_charset_length(r->in.account_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
+               NDR_CHECK(ndr_push_netr_SchannelType(ndr, NDR_SCALARS, r->in.secure_channel_type));
+               if (r->in.computer_name == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16)));
+               NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.computer_name, ndr_charset_length(r->in.computer_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
+               if (r->in.credential == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
        }
        if (flags & NDR_OUT) {
-               NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
+               if (r->out.return_authenticator == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
+               if (r->out.new_owf_password == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->out.new_owf_password));
+               if (r->out.old_owf_password == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->out.old_owf_password));
+               if (r->out.trust_info == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.trust_info));
+               if (*r->out.trust_info) {
+                       NDR_CHECK(ndr_push_netr_TrustInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.trust_info));
+               }
+               NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
        }
        return NDR_ERR_SUCCESS;
 }
 
-static enum ndr_err_code ndr_pull_netr_NETRSERVERGETTRUSTINFO(struct ndr_pull *ndr, int flags, struct netr_NETRSERVERGETTRUSTINFO *r)
+static enum ndr_err_code ndr_pull_netr_ServerGetTrustInfo(struct ndr_pull *ndr, int flags, struct netr_ServerGetTrustInfo *r)
 {
+       uint32_t _ptr_server_name;
+       uint32_t _ptr_trust_info;
+       TALLOC_CTX *_mem_save_server_name_0;
+       TALLOC_CTX *_mem_save_credential_0;
+       TALLOC_CTX *_mem_save_return_authenticator_0;
+       TALLOC_CTX *_mem_save_new_owf_password_0;
+       TALLOC_CTX *_mem_save_old_owf_password_0;
+       TALLOC_CTX *_mem_save_trust_info_0;
+       TALLOC_CTX *_mem_save_trust_info_1;
        if (flags & NDR_IN) {
+               ZERO_STRUCT(r->out);
+
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
+               if (_ptr_server_name) {
+                       NDR_PULL_ALLOC(ndr, r->in.server_name);
+               } else {
+                       r->in.server_name = NULL;
+               }
+               if (r->in.server_name) {
+                       _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0);
+                       NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name));
+                       NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name));
+                       if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_name)) {
+                               return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_name), ndr_get_array_length(ndr, &r->in.server_name));
+                       }
+                       NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t)));
+                       NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
+               }
+               NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name));
+               NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name));
+               if (ndr_get_array_length(ndr, &r->in.account_name) > ndr_get_array_size(ndr, &r->in.account_name)) {
+                       return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.account_name), ndr_get_array_length(ndr, &r->in.account_name));
+               }
+               NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t)));
+               NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t), CH_UTF16));
+               NDR_CHECK(ndr_pull_netr_SchannelType(ndr, NDR_SCALARS, &r->in.secure_channel_type));
+               NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name));
+               NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name));
+               if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_name)) {
+                       return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.computer_name), ndr_get_array_length(ndr, &r->in.computer_name));
+               }
+               NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t)));
+               NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->in.credential);
+               }
+               _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC);
+               NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
+               ZERO_STRUCTP(r->out.return_authenticator);
+               NDR_PULL_ALLOC(ndr, r->out.new_owf_password);
+               ZERO_STRUCTP(r->out.new_owf_password);
+               NDR_PULL_ALLOC(ndr, r->out.old_owf_password);
+               ZERO_STRUCTP(r->out.old_owf_password);
+               NDR_PULL_ALLOC(ndr, r->out.trust_info);
+               ZERO_STRUCTP(r->out.trust_info);
        }
        if (flags & NDR_OUT) {
-               NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.return_authenticator);
+               }
+               _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC);
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.new_owf_password);
+               }
+               _mem_save_new_owf_password_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.new_owf_password, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->out.new_owf_password));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_new_owf_password_0, LIBNDR_FLAG_REF_ALLOC);
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.old_owf_password);
+               }
+               _mem_save_old_owf_password_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.old_owf_password, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->out.old_owf_password));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_old_owf_password_0, LIBNDR_FLAG_REF_ALLOC);
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.trust_info);
+               }
+               _mem_save_trust_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.trust_info, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_trust_info));
+               if (_ptr_trust_info) {
+                       NDR_PULL_ALLOC(ndr, *r->out.trust_info);
+               } else {
+                       *r->out.trust_info = NULL;
+               }
+               if (*r->out.trust_info) {
+                       _mem_save_trust_info_1 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, *r->out.trust_info, 0);
+                       NDR_CHECK(ndr_pull_netr_TrustInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.trust_info));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trust_info_1, 0);
+               }
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trust_info_0, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
        }
        return NDR_ERR_SUCCESS;
 }
 
-_PUBLIC_ void ndr_print_netr_NETRSERVERGETTRUSTINFO(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRSERVERGETTRUSTINFO *r)
+_PUBLIC_ void ndr_print_netr_ServerGetTrustInfo(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerGetTrustInfo *r)
 {
-       ndr_print_struct(ndr, name, "netr_NETRSERVERGETTRUSTINFO");
+       ndr_print_struct(ndr, name, "netr_ServerGetTrustInfo");
        ndr->depth++;
        if (flags & NDR_SET_VALUES) {
                ndr->flags |= LIBNDR_PRINT_SET_VALUES;
        }
        if (flags & NDR_IN) {
-               ndr_print_struct(ndr, "in", "netr_NETRSERVERGETTRUSTINFO");
+               ndr_print_struct(ndr, "in", "netr_ServerGetTrustInfo");
+               ndr->depth++;
+               ndr_print_ptr(ndr, "server_name", r->in.server_name);
                ndr->depth++;
+               if (r->in.server_name) {
+                       ndr_print_string(ndr, "server_name", r->in.server_name);
+               }
+               ndr->depth--;
+               ndr_print_ptr(ndr, "account_name", r->in.account_name);
+               ndr->depth++;
+               ndr_print_string(ndr, "account_name", r->in.account_name);
+               ndr->depth--;
+               ndr_print_netr_SchannelType(ndr, "secure_channel_type", r->in.secure_channel_type);
+               ndr_print_ptr(ndr, "computer_name", r->in.computer_name);
+               ndr->depth++;
+               ndr_print_string(ndr, "computer_name", r->in.computer_name);
+               ndr->depth--;
+               ndr_print_ptr(ndr, "credential", r->in.credential);
+               ndr->depth++;
+               ndr_print_netr_Authenticator(ndr, "credential", r->in.credential);
+               ndr->depth--;
                ndr->depth--;
        }
        if (flags & NDR_OUT) {
-               ndr_print_struct(ndr, "out", "netr_NETRSERVERGETTRUSTINFO");
+               ndr_print_struct(ndr, "out", "netr_ServerGetTrustInfo");
                ndr->depth++;
-               ndr_print_WERROR(ndr, "result", r->out.result);
+               ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator);
+               ndr->depth++;
+               ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator);
+               ndr->depth--;
+               ndr_print_ptr(ndr, "new_owf_password", r->out.new_owf_password);
+               ndr->depth++;
+               ndr_print_samr_Password(ndr, "new_owf_password", r->out.new_owf_password);
+               ndr->depth--;
+               ndr_print_ptr(ndr, "old_owf_password", r->out.old_owf_password);
+               ndr->depth++;
+               ndr_print_samr_Password(ndr, "old_owf_password", r->out.old_owf_password);
+               ndr->depth--;
+               ndr_print_ptr(ndr, "trust_info", r->out.trust_info);
+               ndr->depth++;
+               ndr_print_ptr(ndr, "trust_info", *r->out.trust_info);
+               ndr->depth++;
+               if (*r->out.trust_info) {
+                       ndr_print_netr_TrustInfo(ndr, "trust_info", *r->out.trust_info);
+               }
+               ndr->depth--;
+               ndr->depth--;
+               ndr_print_NTSTATUS(ndr, "result", r->out.result);
                ndr->depth--;
        }
        ndr->depth--;
@@ -15835,11 +16157,11 @@ static const struct ndr_interface_call netlogon_calls[] = {
                false,
        },
        {
-               "netr_NETRSERVERGETTRUSTINFO",
-               sizeof(struct netr_NETRSERVERGETTRUSTINFO),
-               (ndr_push_flags_fn_t) ndr_push_netr_NETRSERVERGETTRUSTINFO,
-               (ndr_pull_flags_fn_t) ndr_pull_netr_NETRSERVERGETTRUSTINFO,
-               (ndr_print_function_t) ndr_print_netr_NETRSERVERGETTRUSTINFO,
+               "netr_ServerGetTrustInfo",
+               sizeof(struct netr_ServerGetTrustInfo),
+               (ndr_push_flags_fn_t) ndr_push_netr_ServerGetTrustInfo,
+               (ndr_pull_flags_fn_t) ndr_pull_netr_ServerGetTrustInfo,
+               (ndr_print_function_t) ndr_print_netr_ServerGetTrustInfo,
                false,
        },
        { NULL, 0, NULL, NULL, NULL, false }
index be204486362c4103a79a73825da4646553376627..5858906c1c8c778fb6d7db059684696b222c2f6a 100644 (file)
@@ -104,7 +104,7 @@ extern const struct ndr_interface_table ndr_table_netlogon;
 
 #define NDR_NETR_LOGONSAMLOGONWITHFLAGS (0x2d)
 
-#define NDR_NETR_NETRSERVERGETTRUSTINFO (0x2e)
+#define NDR_NETR_SERVERGETTRUSTINFO (0x2e)
 
 #define NDR_NETLOGON_CALL_COUNT (47)
 void ndr_print_netr_UasInfo(struct ndr_print *ndr, const char *name, const struct netr_UasInfo *r);
@@ -226,6 +226,7 @@ void ndr_print_netr_DomainTrust(struct ndr_print *ndr, const char *name, const s
 void ndr_print_netr_DomainTrustList(struct ndr_print *ndr, const char *name, const struct netr_DomainTrustList *r);
 void ndr_print_netr_DsRAddressToSitenamesExWCtr(struct ndr_print *ndr, const char *name, const struct netr_DsRAddressToSitenamesExWCtr *r);
 void ndr_print_DcSitesCtr(struct ndr_print *ndr, const char *name, const struct DcSitesCtr *r);
+void ndr_print_netr_TrustInfo(struct ndr_print *ndr, const char *name, const struct netr_TrustInfo *r);
 void ndr_print_netr_LogonUasLogon(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonUasLogon *r);
 void ndr_print_netr_LogonUasLogoff(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonUasLogoff *r);
 void ndr_print_netr_LogonSamLogon(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonSamLogon *r);
@@ -276,5 +277,5 @@ void ndr_print_netr_ServerTrustPasswordsGet(struct ndr_print *ndr, const char *n
 void ndr_print_netr_DsRGetForestTrustInformation(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRGetForestTrustInformation *r);
 void ndr_print_netr_GetForestTrustInformation(struct ndr_print *ndr, const char *name, int flags, const struct netr_GetForestTrustInformation *r);
 void ndr_print_netr_LogonSamLogonWithFlags(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonSamLogonWithFlags *r);
-void ndr_print_netr_NETRSERVERGETTRUSTINFO(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRSERVERGETTRUSTINFO *r);
+void ndr_print_netr_ServerGetTrustInfo(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerGetTrustInfo *r);
 #endif /* _HEADER_NDR_netlogon */
index 975bde334077e85a78428e6d5a7fdcfe1db1b57e..83db0faaef9c90473a3d115ff406faf0099f19d6 100644 (file)
@@ -852,8 +852,7 @@ static enum ndr_err_code ndr_push_samr_DomInfo13(struct ndr_push *ndr, int ndr_f
                NDR_CHECK(ndr_push_align(ndr, 8));
                NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->sequence_num));
                NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->domain_create_time));
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1));
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2));
+               NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->modified_count_at_last_promotion));
        }
        if (ndr_flags & NDR_BUFFERS) {
        }
@@ -866,8 +865,7 @@ static enum ndr_err_code ndr_pull_samr_DomInfo13(struct ndr_pull *ndr, int ndr_f
                NDR_CHECK(ndr_pull_align(ndr, 8));
                NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->sequence_num));
                NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->domain_create_time));
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1));
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2));
+               NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->modified_count_at_last_promotion));
        }
        if (ndr_flags & NDR_BUFFERS) {
        }
@@ -880,8 +878,7 @@ _PUBLIC_ void ndr_print_samr_DomInfo13(struct ndr_print *ndr, const char *name,
        ndr->depth++;
        ndr_print_hyper(ndr, "sequence_num", r->sequence_num);
        ndr_print_NTTIME(ndr, "domain_create_time", r->domain_create_time);
-       ndr_print_uint32(ndr, "unknown1", r->unknown1);
-       ndr_print_uint32(ndr, "unknown2", r->unknown2);
+       ndr_print_hyper(ndr, "modified_count_at_last_promotion", r->modified_count_at_last_promotion);
        ndr->depth--;
 }
 
@@ -2652,10 +2649,11 @@ static enum ndr_err_code ndr_push_samr_UserInfo18(struct ndr_push *ndr, int ndr_
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 1));
-               NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->lm_pwd));
                NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->nt_pwd));
-               NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->lm_pwd_active));
+               NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->lm_pwd));
                NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->nt_pwd_active));
+               NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->lm_pwd_active));
+               NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->password_expired));
        }
        if (ndr_flags & NDR_BUFFERS) {
        }
@@ -2666,10 +2664,11 @@ static enum ndr_err_code ndr_pull_samr_UserInfo18(struct ndr_pull *ndr, int ndr_
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_pull_align(ndr, 1));
-               NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->lm_pwd));
                NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->nt_pwd));
-               NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->lm_pwd_active));
+               NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->lm_pwd));
                NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->nt_pwd_active));
+               NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->lm_pwd_active));
+               NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->password_expired));
        }
        if (ndr_flags & NDR_BUFFERS) {
        }
@@ -2680,10 +2679,11 @@ _PUBLIC_ void ndr_print_samr_UserInfo18(struct ndr_print *ndr, const char *name,
 {
        ndr_print_struct(ndr, name, "samr_UserInfo18");
        ndr->depth++;
-       ndr_print_samr_Password(ndr, "lm_pwd", &r->lm_pwd);
        ndr_print_samr_Password(ndr, "nt_pwd", &r->nt_pwd);
-       ndr_print_uint8(ndr, "lm_pwd_active", r->lm_pwd_active);
+       ndr_print_samr_Password(ndr, "lm_pwd", &r->lm_pwd);
        ndr_print_uint8(ndr, "nt_pwd_active", r->nt_pwd_active);
+       ndr_print_uint8(ndr, "lm_pwd_active", r->lm_pwd_active);
+       ndr_print_uint8(ndr, "password_expired", r->password_expired);
        ndr->depth--;