summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/Makefile.in97
-rw-r--r--source3/auth/auth.c4
-rw-r--r--source3/auth/auth_sam.c2
-rw-r--r--source3/auth/token_util.c4
-rw-r--r--source3/client/client.c22
-rw-r--r--source3/client/clitar.c28
-rw-r--r--source3/client/smbspool.c2
-rw-r--r--source3/configure.in40
-rw-r--r--source3/groupdb/mapping_ldb.c4
-rw-r--r--source3/include/byteorder.h176
-rw-r--r--source3/include/client.h2
-rw-r--r--source3/include/dcerpc.h0
-rw-r--r--source3/include/debug.h12
-rw-r--r--source3/include/dlinklist.h113
-rw-r--r--source3/include/fake_file.h3
-rw-r--r--source3/include/includes.h293
-rw-r--r--source3/include/messages.h7
-rw-r--r--source3/include/module.h1
-rw-r--r--source3/include/nameserv.h4
-rw-r--r--source3/include/ndr.h1
-rw-r--r--source3/include/ntdomain.h57
-rw-r--r--source3/include/ntlmssp.h6
-rw-r--r--source3/include/ntquotas.h26
-rw-r--r--source3/include/packet.h4
-rw-r--r--source3/include/proto.h341
-rw-r--r--source3/include/rbtree.h132
-rw-r--r--source3/include/rpc_lsa.h1
-rw-r--r--source3/include/rpc_svcctl.h26
-rw-r--r--source3/include/smb.h25
-rw-r--r--source3/include/smbprofile.h8
-rw-r--r--source3/include/sysquotas.h20
-rw-r--r--source3/include/util_tdb.h32
-rw-r--r--source3/include/vfs.h19
-rw-r--r--source3/include/xfile.h48
-rw-r--r--source3/intl/lang_tdb.c6
-rw-r--r--source3/lib/access.c6
-rw-r--r--source3/lib/arc4.c79
-rw-r--r--source3/lib/charcnv.c58
-rw-r--r--source3/lib/ctdbd_conn.c8
-rw-r--r--source3/lib/data_blob.c180
-rw-r--r--source3/lib/dbwrap_ctdb.c4
-rw-r--r--source3/lib/dbwrap_file.c2
-rw-r--r--source3/lib/dbwrap_rbt.c2
-rw-r--r--source3/lib/dbwrap_tdb.c6
-rw-r--r--source3/lib/debug.c12
-rw-r--r--source3/lib/display_sec.c8
-rw-r--r--source3/lib/dprintf.c2
-rw-r--r--source3/lib/events.c2
-rw-r--r--source3/lib/fsusage.c157
-rw-r--r--source3/lib/genrand.c17
-rw-r--r--source3/lib/ldb/libldb.m432
-rw-r--r--source3/lib/memcache.c2
-rw-r--r--source3/lib/netapi/group.c2
-rw-r--r--source3/lib/netapi/localgroup.c4
-rw-r--r--source3/lib/packet.c12
-rw-r--r--source3/lib/rbtree.c422
-rw-r--r--source3/lib/select.c4
-rw-r--r--source3/lib/signal.c138
-rw-r--r--source3/lib/smbconf/smbconf_txt.c2
-rw-r--r--source3/lib/smbldap.c2
-rw-r--r--source3/lib/sysquotas.c6
-rw-r--r--source3/lib/sysquotas_4A.c16
-rw-r--r--source3/lib/sysquotas_linux.c48
-rw-r--r--source3/lib/sysquotas_xfs.c16
-rw-r--r--source3/lib/time.c558
-rw-r--r--source3/lib/util.c306
-rw-r--r--source3/lib/util_file.c352
-rw-r--r--source3/lib/util_pw.c4
-rw-r--r--source3/lib/util_sock.c12
-rw-r--r--source3/lib/util_str.c142
-rw-r--r--source3/lib/util_tdb.c297
-rw-r--r--source3/lib/util_uuid.c78
-rw-r--r--source3/lib/xfile.c417
-rw-r--r--source3/libads/authdata.c4
-rw-r--r--source3/libads/disp_sec.c8
-rw-r--r--source3/libads/krb5_setpw.c8
-rw-r--r--source3/libads/ldap.c10
-rw-r--r--source3/libads/util.c2
-rw-r--r--source3/libgpo/gpext/registry.c4
-rw-r--r--source3/libgpo/gpext/security.c2
-rw-r--r--source3/libgpo/gpo_ini.c4
-rw-r--r--source3/libnet/libnet_dssync.c17
-rw-r--r--source3/libnet/libnet_join.c2
-rw-r--r--source3/librpc/gen_ndr/cli_initshutdown.c4
-rw-r--r--source3/librpc/gen_ndr/cli_initshutdown.h4
-rw-r--r--source3/librpc/gen_ndr/cli_lsa.c66
-rw-r--r--source3/librpc/gen_ndr/cli_lsa.h37
-rw-r--r--source3/librpc/gen_ndr/cli_netlogon.c16
-rw-r--r--source3/librpc/gen_ndr/cli_netlogon.h16
-rw-r--r--source3/librpc/gen_ndr/cli_ntsvcs.c19
-rw-r--r--source3/librpc/gen_ndr/cli_ntsvcs.h8
-rw-r--r--source3/librpc/gen_ndr/cli_svcctl.c8
-rw-r--r--source3/librpc/gen_ndr/cli_svcctl.h6
-rw-r--r--source3/librpc/gen_ndr/cli_winreg.c18
-rw-r--r--source3/librpc/gen_ndr/cli_winreg.h10
-rw-r--r--source3/librpc/gen_ndr/drsblobs.h189
-rw-r--r--source3/librpc/gen_ndr/drsuapi.h34
-rw-r--r--source3/librpc/gen_ndr/epmapper.h4
-rw-r--r--source3/librpc/gen_ndr/initshutdown.h15
-rw-r--r--source3/librpc/gen_ndr/lsa.h157
-rw-r--r--source3/librpc/gen_ndr/misc.h4
-rw-r--r--source3/librpc/gen_ndr/ndr_drsblobs.c1311
-rw-r--r--source3/librpc/gen_ndr/ndr_drsblobs.h50
-rw-r--r--source3/librpc/gen_ndr/ndr_drsuapi.c351
-rw-r--r--source3/librpc/gen_ndr/ndr_drsuapi.h12
-rw-r--r--source3/librpc/gen_ndr/ndr_epmapper.c20
-rw-r--r--source3/librpc/gen_ndr/ndr_initshutdown.c112
-rw-r--r--source3/librpc/gen_ndr/ndr_initshutdown.h4
-rw-r--r--source3/librpc/gen_ndr/ndr_lsa.c815
-rw-r--r--source3/librpc/gen_ndr/ndr_lsa.h18
-rw-r--r--source3/librpc/gen_ndr/ndr_misc.c2
-rw-r--r--source3/librpc/gen_ndr/ndr_netlogon.c880
-rw-r--r--source3/librpc/gen_ndr/ndr_netlogon.h18
-rw-r--r--source3/librpc/gen_ndr/ndr_notify.c2
-rw-r--r--source3/librpc/gen_ndr/ndr_ntsvcs.c167
-rw-r--r--source3/librpc/gen_ndr/ndr_samr.c84
-rw-r--r--source3/librpc/gen_ndr/ndr_samr.h6
-rw-r--r--source3/librpc/gen_ndr/ndr_security.c26
-rw-r--r--source3/librpc/gen_ndr/ndr_security.h3
-rw-r--r--source3/librpc/gen_ndr/ndr_svcctl.c237
-rw-r--r--source3/librpc/gen_ndr/ndr_svcctl.h4
-rw-r--r--source3/librpc/gen_ndr/ndr_winreg.c198
-rw-r--r--source3/librpc/gen_ndr/ndr_winreg.h33
-rw-r--r--source3/librpc/gen_ndr/ndr_xattr.c492
-rw-r--r--source3/librpc/gen_ndr/ndr_xattr.h17
-rw-r--r--source3/librpc/gen_ndr/netlogon.h157
-rw-r--r--source3/librpc/gen_ndr/notify.h2
-rw-r--r--source3/librpc/gen_ndr/ntsvcs.h14
-rw-r--r--source3/librpc/gen_ndr/samr.h18
-rw-r--r--source3/librpc/gen_ndr/security.h14
-rw-r--r--source3/librpc/gen_ndr/srv_dfs.c46
-rw-r--r--source3/librpc/gen_ndr/srv_dssetup.c22
-rw-r--r--source3/librpc/gen_ndr/srv_echo.c20
-rw-r--r--source3/librpc/gen_ndr/srv_epmapper.c16
-rw-r--r--source3/librpc/gen_ndr/srv_eventlog.c48
-rw-r--r--source3/librpc/gen_ndr/srv_initshutdown.c6
-rw-r--r--source3/librpc/gen_ndr/srv_lsa.c178
-rw-r--r--source3/librpc/gen_ndr/srv_netlogon.c94
-rw-r--r--source3/librpc/gen_ndr/srv_ntsvcs.c140
-rw-r--r--source3/librpc/gen_ndr/srv_samr.c136
-rw-r--r--source3/librpc/gen_ndr/srv_srvsvc.c108
-rw-r--r--source3/librpc/gen_ndr/srv_svcctl.c90
-rw-r--r--source3/librpc/gen_ndr/srv_winreg.c72
-rw-r--r--source3/librpc/gen_ndr/srv_wkssvc.c62
-rw-r--r--source3/librpc/gen_ndr/svcctl.h18
-rw-r--r--source3/librpc/gen_ndr/winreg.h21
-rw-r--r--source3/librpc/gen_ndr/xattr.h63
-rw-r--r--source3/librpc/idl/dfs.idl419
-rw-r--r--source3/librpc/idl/drsblobs.idl436
-rw-r--r--source3/librpc/idl/drsuapi.idl1601
-rw-r--r--source3/librpc/idl/dssetup.idl101
-rw-r--r--source3/librpc/idl/echo.idl127
-rw-r--r--source3/librpc/idl/epmapper.idl305
-rw-r--r--source3/librpc/idl/eventlog.idl181
-rw-r--r--source3/librpc/idl/idl_types.h86
-rw-r--r--source3/librpc/idl/initshutdown.idl48
-rw-r--r--source3/librpc/idl/lsa.idl195
-rw-r--r--source3/librpc/idl/misc.idl51
-rw-r--r--source3/librpc/idl/nbt.idl650
-rw-r--r--source3/librpc/idl/netlogon.idl151
-rw-r--r--source3/librpc/idl/notify.idl58
-rw-r--r--source3/librpc/idl/ntsvcs.idl376
-rw-r--r--source3/librpc/idl/samr.idl18
-rw-r--r--source3/librpc/idl/security.idl376
-rw-r--r--source3/librpc/idl/spoolss.idl1571
-rw-r--r--source3/librpc/idl/svcctl.idl529
-rw-r--r--source3/librpc/idl/winreg.idl69
-rw-r--r--source3/librpc/idl/wkssvc.idl795
-rw-r--r--source3/librpc/idl/xattr.idl54
-rw-r--r--source3/librpc/ndr/libndr.h354
-rw-r--r--source3/librpc/ndr/ndr.c1108
-rw-r--r--source3/librpc/ndr/ndr_basic.c859
-rw-r--r--source3/librpc/ndr/ndr_compression.c293
-rw-r--r--source3/librpc/ndr/ndr_compression.h51
-rw-r--r--source3/librpc/ndr/ndr_drsuapi.c177
-rw-r--r--source3/librpc/ndr/ndr_drsuapi.h35
-rw-r--r--source3/librpc/ndr/ndr_krb5pac.c141
-rw-r--r--source3/librpc/ndr/ndr_misc.c94
-rw-r--r--source3/librpc/ndr/ndr_string.c71
-rw-r--r--source3/librpc/ndr/util.c174
-rw-r--r--source3/librpc/ndr/uuid.c227
-rw-r--r--source3/librpc/rpc/binding.c709
-rw-r--r--source3/librpc/rpc/dcerpc.c2
-rw-r--r--source3/librpc/rpc/dcerpc.h48
-rw-r--r--source3/librpc/rpc/dcerpc_util.c1438
-rw-r--r--source3/librpc/tools/ndrdump.c14
-rw-r--r--source3/libsmb/async_smb.c4
-rw-r--r--source3/libsmb/clidgram.c2
-rw-r--r--source3/libsmb/clifile.c12
-rw-r--r--source3/libsmb/clikrb5.c4
-rw-r--r--source3/libsmb/cliquota.c40
-rw-r--r--source3/libsmb/clireadwrite.c6
-rw-r--r--source3/libsmb/ntlmssp_sign.c66
-rw-r--r--source3/libsmb/smbdes.c13
-rw-r--r--source3/libsmb/smbencrypt.c2
-rw-r--r--source3/libsmb/trusts_util.c5
-rw-r--r--source3/locking/locking.c20
-rw-r--r--source3/locking/posix.c32
-rw-r--r--source3/modules/vfs_cap.c8
-rw-r--r--source3/modules/vfs_default.c6
-rw-r--r--source3/modules/vfs_full_audit.c14
-rw-r--r--source3/modules/vfs_smb_traffic_analyzer.c23
-rw-r--r--source3/modules/vfs_xattr_tdb.c64
-rw-r--r--source3/nmbd/nmbd.c4
-rw-r--r--source3/nmbd/nmbd_processlogon.c2
-rw-r--r--source3/nmbd/nmbd_winsserver.c6
-rw-r--r--source3/nsswitch/winbind_nss_irix.c1
-rw-r--r--source3/nsswitch/wins.c1
-rw-r--r--source3/param/loadparm.c23
-rw-r--r--source3/param/params.c590
-rw-r--r--source3/param/test_lp_load.c2
-rw-r--r--source3/passdb/machine_sid.c6
-rw-r--r--source3/passdb/secrets.c2
-rw-r--r--source3/printing/nt_printing.c24
-rw-r--r--source3/printing/pcap.c2
-rw-r--r--source3/printing/print_generic.c8
-rw-r--r--source3/printing/print_svid.c8
-rw-r--r--source3/printing/printfsp.c9
-rw-r--r--source3/printing/printing.c4
-rw-r--r--source3/registry/reg_perfcount.c12
-rw-r--r--source3/rpc_client/cli_netlogon.c20
-rw-r--r--source3/rpc_client/cli_pipe.c4
-rw-r--r--source3/rpc_client/cli_svcctl.c76
-rw-r--r--source3/rpc_client/init_samr.c32
-rw-r--r--source3/rpc_client/ndr.c2
-rw-r--r--source3/rpc_parse/parse_svcctl.c116
-rw-r--r--source3/rpc_server/srv_eventlog_lib.c2
-rw-r--r--source3/rpc_server/srv_lsa_nt.c25
-rw-r--r--source3/rpc_server/srv_netlog_nt.c10
-rw-r--r--source3/rpc_server/srv_pipe_hnd.c401
-rw-r--r--source3/rpc_server/srv_samr_nt.c32
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c20
-rw-r--r--source3/rpc_server/srv_srvsvc_nt.c8
-rw-r--r--source3/rpc_server/srv_svcctl.c18
-rw-r--r--source3/rpc_server/srv_svcctl_nt.c42
-rw-r--r--source3/rpc_server/srv_winreg_nt.c20
-rw-r--r--source3/rpcclient/cmd_drsuapi.c19
-rw-r--r--source3/rpcclient/cmd_lsarpc.c4
-rw-r--r--source3/rpcclient/cmd_netlogon.c2
-rw-r--r--source3/rpcclient/cmd_samr.c48
-rw-r--r--source3/rpcclient/cmd_spoolss.c2
-rw-r--r--source3/samba4.m445
-rw-r--r--source3/samba4.mk6
-rwxr-xr-xsource3/script/build_idl.sh12
-rw-r--r--source3/smbd/blocking.c25
-rw-r--r--source3/smbd/chgpasswd.c2
-rw-r--r--source3/smbd/close.c25
-rw-r--r--source3/smbd/connection.c116
-rw-r--r--source3/smbd/dfree.c36
-rw-r--r--source3/smbd/dosmode.c10
-rw-r--r--source3/smbd/fake_file.c10
-rw-r--r--source3/smbd/files.c51
-rw-r--r--source3/smbd/ipc.c102
-rw-r--r--source3/smbd/lanman.c6
-rw-r--r--source3/smbd/map_username.c4
-rw-r--r--source3/smbd/noquotas.c6
-rw-r--r--source3/smbd/ntquotas.c26
-rw-r--r--source3/smbd/nttrans.c89
-rw-r--r--source3/smbd/open.c80
-rw-r--r--source3/smbd/password.c4
-rw-r--r--source3/smbd/pipes.c116
-rw-r--r--source3/smbd/posix_acls.c10
-rw-r--r--source3/smbd/process.c6
-rw-r--r--source3/smbd/quotas.c106
-rw-r--r--source3/smbd/reply.c173
-rw-r--r--source3/smbd/seal.c24
-rw-r--r--source3/smbd/server.c6
-rw-r--r--source3/smbd/service.c7
-rw-r--r--source3/smbd/session.c5
-rw-r--r--source3/smbd/statvfs.c2
-rw-r--r--source3/smbd/trans2.c157
-rw-r--r--source3/smbd/vfs.c12
-rw-r--r--source3/torture/cmd_vfs.c2
-rw-r--r--source3/torture/locktest.c6
-rw-r--r--source3/torture/torture.c19
-rw-r--r--source3/torture/vfstest.c2
-rw-r--r--source3/utils/net_ads.c5
-rw-r--r--source3/utils/net_registry_util.c2
-rw-r--r--source3/utils/net_rpc.c22
-rw-r--r--source3/utils/net_rpc_join.c10
-rw-r--r--source3/utils/net_rpc_service.c49
-rw-r--r--source3/utils/net_usershare.c4
-rw-r--r--source3/utils/ntlm_auth.c8
-rw-r--r--source3/utils/pdbedit.c23
-rw-r--r--source3/utils/smbcacls.c183
-rw-r--r--source3/utils/smbcquotas.c6
-rw-r--r--source3/utils/status_profile.c12
-rw-r--r--source3/utils/testparm.c6
-rw-r--r--source3/web/cgi.c7
-rw-r--r--source3/web/swat.c7
-rw-r--r--source3/winbindd/idmap_tdb.c2
-rw-r--r--source3/winbindd/winbindd.c4
-rw-r--r--source3/winbindd/winbindd_dual.c2
-rw-r--r--source3/winbindd/winbindd_proto.h2
-rw-r--r--source3/winbindd/winbindd_rpc.c2
295 files changed, 7451 insertions, 21997 deletions
diff --git a/source3/Makefile.in b/source3/Makefile.in
index 8bee54d075..fed38c828e 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -56,6 +56,7 @@ PIDL_ARGS=@PIDL_ARGS@
TERMLDFLAGS=@TERMLDFLAGS@
TERMLIBS=@TERMLIBS@
PRINT_LIBS=@PRINT_LIBS@
+ZLIB_LIBS=@ZLIB_LIBS@
AUTH_LIBS=@AUTH_LIBS@
ACL_LIBS=@ACL_LIBS@
PASSDB_LIBS=@PASSDB_LIBS@
@@ -151,7 +152,7 @@ CODEPAGEDIR = @codepagedir@
# the directory where pid files go
PIDDIR = @piddir@
-FLAGS = -I. -I$(srcdir) @FLAGS1@ @SAMBA_CPPFLAGS@ $(CPPFLAGS) -I$(CTDBDIR)/include $(ISA) -I$(srcdir)/lib -D_SAMBA_BUILD_=3
+FLAGS = -I. -I$(srcdir) @FLAGS1@ @SAMBA_CPPFLAGS@ $(CPPFLAGS) -I$(CTDBDIR)/include $(ISA) -I$(srcdir)/lib -I.. -D_SAMBA_BUILD_=3
PATH_FLAGS = -DSMB_PASSWD_FILE=\"$(SMB_PASSWD_FILE)\" \
-DPRIVATE_DIR=\"$(PRIVATE_DIR)\" \
@@ -227,7 +228,7 @@ MODULES = $(VFS_MODULES) $(PDB_MODULES) $(RPC_MODULES) $(IDMAP_MODULES) \
# object file lists
######################################################################
-TDB_LIB_OBJ = lib/util_tdb.o \
+TDB_LIB_OBJ = lib/util_tdb.o ../lib/util/util_tdb.o \
lib/dbwrap.o lib/dbwrap_tdb.o \
lib/dbwrap_ctdb.o \
lib/dbwrap_rbt.o @LIBTDB_STATIC@
@@ -246,25 +247,31 @@ SERVER_MUTEX_OBJ = lib/server_mutex.o
PASSCHANGE_OBJ = libsmb/passchange.o
-LIBNDR_DRSUAPI_OBJ = librpc/ndr/ndr_drsuapi.o \
- librpc/ndr/ndr_compression.o \
+LIBNDR_DRSUAPI_OBJ = ../librpc/ndr/ndr_drsuapi.o \
+ ../librpc/ndr/ndr_compression.o \
librpc/gen_ndr/ndr_drsuapi.o \
+ ../librpc/ndr/ndr_drsblobs.o \
librpc/gen_ndr/ndr_drsblobs.o
-COMPRESSION_OBJ = ../lib/compression/mszip.o
+ZLIB_OBJ = @ZLIB_OBJS@
+
+COMPRESSION_OBJ = ../lib/compression/mszip.o \
+ ../lib/compression/lzxpress.o \
+ $(ZLIB_OBJ)
DRSUAPI_OBJ = $(LIBNDR_DRSUAPI_OBJ) \
$(COMPRESSION_OBJ)
-LIBNDR_OBJ = librpc/ndr/ndr_basic.o \
- librpc/ndr/ndr.o \
- librpc/ndr/ndr_misc.o \
+LIBNDR_OBJ = ../librpc/ndr/ndr_basic.o \
+ ../librpc/ndr/ndr.o \
+ ../librpc/ndr/ndr_misc.o \
librpc/gen_ndr/ndr_misc.o \
librpc/gen_ndr/ndr_security.o \
librpc/ndr/ndr_sec_helper.o \
librpc/ndr/ndr_string.o \
librpc/ndr/sid.o \
- librpc/ndr/uuid.o
+ ../librpc/ndr/uuid.o \
+ librpc/ndr/util.o
RPCCLIENT_NDR_OBJ = rpc_client/ndr.o
@@ -309,29 +316,36 @@ LIBSAMBAUTIL_OBJ = @LIBTALLOC_STATIC@ \
$(SOCKET_WRAPPER_OBJ) \
$(NSS_WRAPPER_OBJ)
-LIB_OBJ = $(LIBSAMBAUTIL_OBJ) \
+UTIL_OBJ = ../lib/util/rbtree.o ../lib/util/signal.o ../lib/util/time.o \
+ ../lib/util/xfile.o ../lib/util/util_strlist.o \
+ ../lib/util/util_file.o ../lib/util/data_blob.o \
+ ../lib/util/util.o ../lib/util/fsusage.o
+
+CRYPTO_OBJ = ../lib/crypto/crc32.o ../lib/crypto/md5.o \
+ ../lib/crypto/hmacmd5.o ../lib/crypto/arcfour.o \
+ ../lib/crypto/md4.o
+
+LIB_OBJ = $(LIBSAMBAUTIL_OBJ) $(UTIL_OBJ) $(CRYPTO_OBJ) \
lib/messages.o librpc/gen_ndr/ndr_messaging.o lib/messages_local.o \
lib/messages_ctdbd.o lib/packet.o lib/ctdbd_conn.o lib/talloc_stack.o \
- lib/interfaces.o lib/rbtree.o lib/memcache.o \
+ lib/interfaces.o lib/memcache.o \
lib/util_transfer_file.o lib/async_req.o \
lib/async_sock.o \
$(TDB_LIB_OBJ) \
$(VERSION_OBJ) lib/charcnv.o lib/debug.o lib/fault.o \
- lib/interface.o ../lib/crypto/md4.o \
- lib/pidfile.o \
- lib/signal.o lib/system.o lib/sendfile.o lib/recvfile.o lib/time.o \
+ lib/interface.o lib/pidfile.o \
+ lib/system.o lib/sendfile.o lib/recvfile.o lib/time.o \
lib/ufc.o lib/genrand.o lib/username.o \
lib/util_pw.o lib/access.o lib/smbrun.o \
- lib/bitmap.o ../lib/crypto/crc32.o lib/dprintf.o \
- lib/xfile.o lib/wins_srv.o $(UTIL_REG_OBJ) \
+ lib/bitmap.o lib/dprintf.o $(UTIL_REG_OBJ) \
+ lib/wins_srv.o \
lib/util_str.o lib/clobber.o lib/util_sid.o lib/util_uuid.o \
- lib/util_unistr.o lib/util_file.o lib/data_blob.o \
+ lib/util_unistr.o lib/util_file.o \
lib/util.o lib/util_sock.o lib/sock_exec.o lib/util_sec.o \
- lib/substitute.o lib/fsusage.o lib/dbwrap_util.o \
+ lib/substitute.o lib/dbwrap_util.o \
lib/ms_fnmatch.o lib/select.o lib/errmap_unix.o \
lib/tallocmsg.o lib/dmallocmsg.o libsmb/smb_signing.o \
- ../lib/crypto/md5.o ../lib/crypto/hmacmd5.o lib/arc4.o lib/iconv.o \
- lib/pam_errors.o intl/lang_tdb.o lib/conn_tdb.o \
+ lib/iconv.o lib/pam_errors.o intl/lang_tdb.o lib/conn_tdb.o \
lib/adt_tree.o lib/gencache.o \
lib/module.o lib/events.o lib/ldap_escape.o @CHARSET_STATIC@ \
lib/secdesc.o lib/util_seaccess.o lib/secace.o lib/secacl.o \
@@ -347,7 +361,7 @@ READLINE_OBJ = lib/readline.o
# Be sure to include them into your application
POPT_LIB_OBJ = lib/popt_common.o
-PARAM_WITHOUT_REG_OBJ = dynconfig.o param/loadparm.o param/params.o param/util.o lib/sharesec.o lib/ldap_debug_handler.o
+PARAM_WITHOUT_REG_OBJ = dynconfig.o param/loadparm.o ../lib/util/params.o param/util.o lib/sharesec.o lib/ldap_debug_handler.o
PARAM_REG_ADD_OBJ = $(REG_SMBCONF_OBJ) $(LIBSMBCONF_OBJ) $(PRIVILEGES_BASIC_OBJ)
PARAM_OBJ = $(PARAM_WITHOUT_REG_OBJ) $(PARAM_REG_ADD_OBJ)
@@ -373,7 +387,7 @@ LIBADS_OBJ = libads/ldap.o libads/ldap_printer.o \
libads/ldap_schema.o libads/util.o libads/ndr.o
LIBADS_SERVER_OBJ = libads/kerberos_verify.o libads/authdata.o \
- librpc/ndr/ndr_krb5pac.o \
+ ../librpc/ndr/ndr_krb5pac.o \
librpc/gen_ndr/ndr_krb5pac.o
SECRETS_OBJ = passdb/secrets.o passdb/machine_sid.o
@@ -432,7 +446,7 @@ LIBMSRPC_OBJ = rpc_client/cli_lsarpc.o rpc_client/cli_samr.o \
rpc_client/cli_svcctl.o \
rpc_client/init_samr.o \
librpc/rpc/dcerpc.o \
- librpc/rpc/binding.o
+ ../librpc/rpc/binding.o
LIBMSRPC_GEN_OBJ = librpc/gen_ndr/cli_lsa.o \
librpc/gen_ndr/cli_dfs.o \
@@ -733,7 +747,7 @@ SMBCONTROL_OBJ = utils/smbcontrol.o $(LOCKING_OBJ) $(PARAM_OBJ) \
SMBTREE_OBJ = utils/smbtree.o $(PARAM_OBJ) \
$(PROFILE_OBJ) $(LIB_NONSMBD_OBJ) $(LIBSMB_OBJ) \
$(KRBCLIENT_OBJ) $(POPT_LIB_OBJ) \
- rpc_client/cli_pipe.o librpc/rpc/binding.o $(RPC_PARSE_OBJ2) \
+ rpc_client/cli_pipe.o ../librpc/rpc/binding.o $(RPC_PARSE_OBJ2) \
$(RPC_CLIENT_OBJ1) \
$(PASSDB_OBJ) @LIBWBCLIENT_STATIC@ $(SMBLDAP_OBJ) $(LDB_OBJ) $(GROUPDB_OBJ) \
$(LIBMSRPC_GEN_OBJ)
@@ -817,7 +831,7 @@ LIBBIGBALLOFMUD_OBJ = $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) \
$(GROUPDB_OBJ) $(KRBCLIENT_OBJ) $(SMBLDAP_OBJ) $(LDB_OBJ)
CLIENT_OBJ1 = client/client.o client/clitar.o rpc_client/cli_pipe.o \
- librpc/rpc/binding.o \
+ ../librpc/rpc/binding.o \
client/dnsbrowse.o \
$(RPC_CLIENT_OBJ1) \
$(RPC_PARSE_OBJ2)
@@ -966,7 +980,7 @@ REPLACETORT_OBJ = @libreplacedir@/test/testsuite.o \
@libreplacedir@/test/main.o \
$(LIBREPLACE_OBJ)
-NDRDUMP_OBJ = librpc/tools/ndrdump.o \
+NDRDUMP_OBJ = ../librpc/tools/ndrdump.o \
$(PARAM_OBJ) $(LIBNDR_GEN_OBJ) \
$(LIBSAMBA_OBJ) $(LIB_NONSMBD_OBJ) $(POPT_LIB_OBJ) \
librpc/gen_ndr/ndr_svcctl.o
@@ -1110,7 +1124,7 @@ NTLM_AUTH_OBJ = ${NTLM_AUTH_OBJ1} $(LIBSAMBA_OBJ) $(POPT_LIB_OBJ) \
$(LIBNDR_GEN_OBJ0) $(LIBNDR_GEN_OBJ1)
-VLP_OBJ1 = ../testsuite/printing/vlp.o $(RPC_CLIENT_OBJ1) $(RPC_PARSE_OBJ2) $(RPC_CLIENT_OBJ) librpc/rpc/binding.o
+VLP_OBJ1 = ../testsuite/printing/vlp.o $(RPC_CLIENT_OBJ1) $(RPC_PARSE_OBJ2) $(RPC_CLIENT_OBJ) ../librpc/rpc/binding.o
VLP_OBJ = $(VLP_OBJ1) $(PARAM_OBJ) $(LIBSMB_OBJ) \
$(LIB_NONSMBD_OBJ) $(KRBCLIENT_OBJ) $(LIBMSRPC_GEN_OBJ) \
@@ -1128,7 +1142,7 @@ RPC_OPEN_TCP_OBJ = torture/rpc_open_tcp.o \
$(RPC_PARSE_OBJ2) \
$(RPC_CLIENT_OBJ1) \
rpc_client/cli_pipe.o \
- librpc/rpc/binding.o \
+ ../librpc/rpc/binding.o \
$(LIBMSRPC_GEN_OBJ)
@@ -1191,14 +1205,16 @@ modules:: SHOWFLAGS $(MODULES)
#####################################################################
## Perl IDL Compiler
samba3-idl::
- @IDL_FILES="lsa.idl dfs.idl echo.idl winreg.idl initshutdown.idl \
- srvsvc.idl svcctl.idl eventlog.idl wkssvc.idl netlogon.idl notify.idl \
- epmapper.idl messaging.idl xattr.idl misc.idl samr.idl security.idl \
- dssetup.idl krb5pac.idl ntsvcs.idl libnetapi.idl drsuapi.idl drsblobs.idl \
- nbt.idl" \
- CPP="$(CPP)" PIDL="../pidl/pidl" \
- srcdir="$(srcdir)" $(srcdir)/script/build_idl.sh $(PIDL_ARGS)
-
+ @PIDL_ARGS="$(PIDL_ARGS)" CPP="$(CPP)" PIDL="../pidl/pidl" \
+ srcdir="$(srcdir)" $(srcdir)/script/build_idl.sh librpc/idl/lsa.idl \
+ ../librpc/idl/dfs.idl ../librpc/idl/echo.idl librpc/idl/winreg.idl \
+ ../librpc/idl/initshutdown.idl librpc/idl/srvsvc.idl ../librpc/idl/svcctl.idl \
+ ../librpc/idl/eventlog.idl ../librpc/idl/wkssvc.idl librpc/idl/netlogon.idl \
+ ../librpc/idl/notify.idl ../librpc/idl/epmapper.idl librpc/idl/messaging.idl \
+ ../librpc/idl/xattr.idl ../librpc/idl/misc.idl librpc/idl/samr.idl \
+ ../librpc/idl/security.idl ../librpc/idl/dssetup.idl librpc/idl/krb5pac.idl \
+ ../librpc/idl/ntsvcs.idl librpc/idl/libnetapi.idl ../librpc/idl/drsuapi.idl \
+ ../librpc/idl/drsblobs.idl ../librpc/idl/nbt.idl
#####################################################################
@@ -2676,7 +2692,10 @@ clean:: cleanlibs
$(MODULES) $(TORTURE_PROGS) \
$(EVERYTHING_PROGS) \
bin/timelimit \
- .headers.stamp */src/*.o
+ .headers.stamp */src/*.o \
+ ../lib/*/*.o \
+ ../libcli/*.o ../libcli/*/*.o \
+ ../librpc/*/*.o
-rm -rf t_dir
include/build_env.h: script/build_env.sh
@@ -2687,7 +2706,9 @@ include/build_env.h: script/build_env.sh
proto::
etags::
- etags `find $(srcdir)/.. -name "*.[ch]"`
+ etags `find $(srcdir) -name "*.[ch]"`
+ etags --append `find $(srcdir)/../lib -name "*.[ch]"`
+ etags --append `find $(srcdir)/../source4 -name "*.[ch]"`
ctags::
ctags `find $(srcdir)/.. -name "*.[ch]"`
diff --git a/source3/auth/auth.c b/source3/auth/auth.c
index 754cb7a508..7f95656bef 100644
--- a/source3/auth/auth.c
+++ b/source3/auth/auth.c
@@ -459,8 +459,8 @@ NTSTATUS make_auth_context_subsystem(struct auth_context **auth_context)
NTSTATUS nt_status;
if (lp_auth_methods()
- && !str_list_copy(talloc_tos(), &auth_method_list,
- lp_auth_methods())) {
+ && !(auth_method_list = str_list_copy(talloc_tos(),
+ lp_auth_methods()))) {
return NT_STATUS_NO_MEMORY;
}
diff --git a/source3/auth/auth_sam.c b/source3/auth/auth_sam.c
index 50bf15318b..7fe76fbfd6 100644
--- a/source3/auth/auth_sam.c
+++ b/source3/auth/auth_sam.c
@@ -176,7 +176,7 @@ static NTSTATUS sam_account_ok(TALLOC_CTX *mem_ctx,
/* check for expired password */
if (must_change_time < time(NULL) && must_change_time != 0) {
DEBUG(1,("sam_account_ok: Account for user '%s' password expired!.\n", pdb_get_username(sampass)));
- DEBUG(1,("sam_account_ok: Password expired at '%s' (%ld) unix time.\n", http_timestring(must_change_time), (long)must_change_time));
+ DEBUG(1,("sam_account_ok: Password expired at '%s' (%ld) unix time.\n", http_timestring(talloc_tos(), must_change_time), (long)must_change_time));
return NT_STATUS_PASSWORD_EXPIRED;
}
}
diff --git a/source3/auth/token_util.c b/source3/auth/token_util.c
index d6cd2ea3a8..e739fdaabe 100644
--- a/source3/auth/token_util.c
+++ b/source3/auth/token_util.c
@@ -84,7 +84,7 @@ NT_USER_TOKEN *get_root_nt_token( void )
cache_data = memcache_lookup_talloc(
NULL, SINGLETON_CACHE_TALLOC,
- data_blob_string_const("root_nt_token"));
+ data_blob_string_const_null("root_nt_token"));
if (cache_data != NULL) {
return talloc_get_type_abort(
@@ -109,7 +109,7 @@ NT_USER_TOKEN *get_root_nt_token( void )
memcache_add_talloc(
NULL, SINGLETON_CACHE_TALLOC,
- data_blob_string_const("root_nt_token"), token);
+ data_blob_string_const_null("root_nt_token"), token);
return token;
}
diff --git a/source3/client/client.c b/source3/client/client.c
index eb9f31bdf2..26badc4051 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -84,9 +84,9 @@ static struct sockaddr_storage dest_ss;
static bool abort_mget = true;
/* timing globals */
-SMB_BIG_UINT get_total_size = 0;
+uint64_t get_total_size = 0;
unsigned int get_total_time_ms = 0;
-static SMB_BIG_UINT put_total_size = 0;
+static uint64_t put_total_size = 0;
static unsigned int put_total_time_ms = 0;
/* totals globals */
@@ -1203,7 +1203,7 @@ static void do_mget(file_info *finfo, const char *dir)
strlower_m(finfo->name);
}
- if (!directory_exist(finfo->name,NULL) &&
+ if (!directory_exist(finfo->name) &&
mkdir(finfo->name,0777) != 0) {
d_printf("failed to create directory %s\n",finfo->name);
client_set_cur_dir(saved_curdir);
@@ -1752,7 +1752,7 @@ static int cmd_put(void)
SMB_STRUCT_STAT st;
/* allow '-' to represent stdin
jdblair, 24.jun.98 */
- if (!file_exist(lname,&st) &&
+ if (!file_exist_stat(lname,&st) &&
(strcmp(lname,"-"))) {
d_printf("%s does not exist\n",lname);
return 1;
@@ -2555,7 +2555,7 @@ static int cmd_lock(void)
{
TALLOC_CTX *ctx = talloc_tos();
char *buf = NULL;
- SMB_BIG_UINT start, len;
+ uint64_t start, len;
enum brl_type lock_type;
int fnum;
@@ -2584,14 +2584,14 @@ static int cmd_lock(void)
return 1;
}
- start = (SMB_BIG_UINT)strtol(buf, (char **)NULL, 16);
+ start = (uint64_t)strtol(buf, (char **)NULL, 16);
if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
d_printf("lock <fnum> [r|w] <hex-start> <hex-len>\n");
return 1;
}
- len = (SMB_BIG_UINT)strtol(buf, (char **)NULL, 16);
+ len = (uint64_t)strtol(buf, (char **)NULL, 16);
if (!cli_posix_lock(cli, fnum, start, len, true, lock_type)) {
d_printf("lock failed %d: %s\n", fnum, cli_errstr(cli));
@@ -2604,7 +2604,7 @@ static int cmd_unlock(void)
{
TALLOC_CTX *ctx = talloc_tos();
char *buf = NULL;
- SMB_BIG_UINT start, len;
+ uint64_t start, len;
int fnum;
if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
@@ -2618,14 +2618,14 @@ static int cmd_unlock(void)
return 1;
}
- start = (SMB_BIG_UINT)strtol(buf, (char **)NULL, 16);
+ start = (uint64_t)strtol(buf, (char **)NULL, 16);
if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
d_printf("unlock <fnum> <hex-start> <hex-len>\n");
return 1;
}
- len = (SMB_BIG_UINT)strtol(buf, (char **)NULL, 16);
+ len = (uint64_t)strtol(buf, (char **)NULL, 16);
if (!cli_posix_unlock(cli, fnum, start, len)) {
d_printf("unlock failed %d: %s\n", fnum, cli_errstr(cli));
@@ -3566,7 +3566,7 @@ static int cmd_reput(void)
return 1;
}
- if (!file_exist(local_name, &st)) {
+ if (!file_exist_stat(local_name, &st)) {
d_printf("%s does not exist\n", local_name);
return 1;
}
diff --git a/source3/client/clitar.c b/source3/client/clitar.c
index 084f87e399..7ad8a73e9c 100644
--- a/source3/client/clitar.c
+++ b/source3/client/clitar.c
@@ -112,11 +112,11 @@ extern int get_total_size;
static int blocksize=20;
static int tarhandle;
-static void writetarheader(int f, const char *aname, SMB_BIG_UINT size, time_t mtime,
+static void writetarheader(int f, const char *aname, uint64_t size, time_t mtime,
const char *amode, unsigned char ftype);
static void do_atar(const char *rname_in,char *lname,file_info *finfo1);
static void do_tar(file_info *finfo, const char *dir);
-static void oct_it(SMB_BIG_UINT value, int ndgs, char *p);
+static void oct_it(uint64_t value, int ndgs, char *p);
static void fixtarname(char *tptr, const char *fp, size_t l);
static int dotarbuf(int f, char *b, int n);
static void dozerobuf(int f, int n);
@@ -154,7 +154,7 @@ static char *string_create_s(int size)
Write a tar header to buffer
****************************************************************************/
-static void writetarheader(int f, const char *aname, SMB_BIG_UINT size, time_t mtime,
+static void writetarheader(int f, const char *aname, uint64_t size, time_t mtime,
const char *amode, unsigned char ftype)
{
union hblock hb;
@@ -195,10 +195,10 @@ static void writetarheader(int f, const char *aname, SMB_BIG_UINT size, time_t m
hb.dbuf.name[NAMSIZ-1]='\0';
safe_strcpy(hb.dbuf.mode, amode, sizeof(hb.dbuf.mode)-1);
- oct_it((SMB_BIG_UINT)0, 8, hb.dbuf.uid);
- oct_it((SMB_BIG_UINT)0, 8, hb.dbuf.gid);
- oct_it((SMB_BIG_UINT) size, 13, hb.dbuf.size);
- if (size > (SMB_BIG_UINT)077777777777LL) {
+ oct_it((uint64_t)0, 8, hb.dbuf.uid);
+ oct_it((uint64_t)0, 8, hb.dbuf.gid);
+ oct_it((uint64_t) size, 13, hb.dbuf.size);
+ if (size > (uint64_t)077777777777LL) {
/* This is a non-POSIX compatible extention to store files
greater than 8GB. */
@@ -207,7 +207,7 @@ static void writetarheader(int f, const char *aname, SMB_BIG_UINT size, time_t m
for (i = 8, jp=(char*)&size; i; i--)
hb.dbuf.size[i+3] = *(jp++);
}
- oct_it((SMB_BIG_UINT) mtime, 13, hb.dbuf.mtime);
+ oct_it((uint64_t) mtime, 13, hb.dbuf.mtime);
memcpy(hb.dbuf.chksum, " ", sizeof(hb.dbuf.chksum));
memset(hb.dbuf.linkname, 0, NAMSIZ);
hb.dbuf.linkflag=ftype;
@@ -215,7 +215,7 @@ static void writetarheader(int f, const char *aname, SMB_BIG_UINT size, time_t m
for (chk=0, i=sizeof(hb.dummy), jp=hb.dummy; --i>=0;)
chk+=(0xFF & *jp++);
- oct_it((SMB_BIG_UINT) chk, 8, hb.dbuf.chksum);
+ oct_it((uint64_t) chk, 8, hb.dbuf.chksum);
hb.dbuf.chksum[6] = '\0';
(void) dotarbuf(f, hb.dummy, sizeof(hb.dummy));
@@ -431,7 +431,7 @@ static void fixtarname(char *tptr, const char *fp, size_t l)
Convert from decimal to octal string
****************************************************************************/
-static void oct_it (SMB_BIG_UINT value, int ndgs, char *p)
+static void oct_it (uint64_t value, int ndgs, char *p)
{
/* Converts long to octal string, pads with leading zeros */
@@ -567,7 +567,7 @@ static bool ensurepath(const char *fname)
return True;
}
-static int padit(char *buf, SMB_BIG_UINT bufsize, SMB_BIG_UINT padsize)
+static int padit(char *buf, uint64_t bufsize, uint64_t padsize)
{
int berr= 0;
int bytestowrite;
@@ -607,7 +607,7 @@ append one remote file to the tar file
static void do_atar(const char *rname_in,char *lname,file_info *finfo1)
{
int fnum = -1;
- SMB_BIG_UINT nread=0;
+ uint64_t nread=0;
char ftype;
file_info2 finfo;
bool shallitime=True;
@@ -738,7 +738,7 @@ static void do_atar(const char *rname_in,char *lname,file_info *finfo1)
if (nread < finfo.size) {
DEBUG(0, ("Didn't get entire file. size=%.0f, nread=%d\n",
(double)finfo.size, (int)nread));
- if (padit(data, (SMB_BIG_UINT)sizeof(data), finfo.size - nread))
+ if (padit(data, (uint64_t)sizeof(data), finfo.size - nread))
DEBUG(0,("Error writing tar file - %s\n", strerror(errno)));
}
@@ -992,7 +992,7 @@ static int skip_file(int skipsize)
static int get_file(file_info2 finfo)
{
int fnum = -1, pos = 0, dsize = 0, bpos = 0;
- SMB_BIG_UINT rsize = 0;
+ uint64_t rsize = 0;
DEBUG(5, ("get_file: file: %s, size %.0f\n", finfo.name, (double)finfo.size));
diff --git a/source3/client/smbspool.c b/source3/client/smbspool.c
index 4a173714fe..1910ccd4fe 100644
--- a/source3/client/smbspool.c
+++ b/source3/client/smbspool.c
@@ -482,7 +482,7 @@ smb_connect(const char *workgroup, /* I - Workgroup */
/*
* Get the names and addresses of the client and server...
*/
- myname = get_myname(talloc_tos());
+ myname = talloc_get_myname(talloc_tos());
if (!myname) {
return NULL;
}
diff --git a/source3/configure.in b/source3/configure.in
index 1eba4a0a58..9388ebabc0 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -350,7 +350,7 @@ AC_CACHE_CHECK([that the C compiler understands negative enum values],samba_cv_C
],
samba_cv_CC_NEGATIVE_ENUM_VALUES=yes,samba_cv__CC_NEGATIVE_ENUM_VALUES=no)])
if test x"$samba_cv_CC_NEGATIVE_ENUM_VALUES" != x"yes"; then
- AC_MSG_WARN([using --unit-enums for pidl])
+ AC_MSG_WARN([using --uint-enums for pidl])
PIDL_ARGS="$PIDL_ARGS --uint-enums"
fi
@@ -6219,13 +6219,49 @@ MSG
fi
AC_ARG_ENABLE(merged-build,
-[AS_HELP_STRING([--enable-merged-build], [Build Samba 4 as well])])
+[AS_HELP_STRING([--enable-merged-build], [Build Samba 4 as well])],
+[ enable_merged_build=$enableval ], [ enable_merged_build=auto ])
+
+if test x$enable_merged_build = xauto; then
+ merged_build_possible=yes
+
+ # Check for GNU make
+ m4_include(../source4/build/m4/check_make.m4)
+ AC_SAMBA_GNU_MAKE([true], [merged_build_possible=no])
+
+ # Check for perl
+ m4_include(../source4/build/m4/check_perl.m4)
+ AC_SAMBA_PERL([true], [merged_build_possible=no])
+
+ # Check for python
+ m4_include(../source4/build/m4/check_python.m4)
+ AC_SAMBA_PYTHON_DEVEL([true], [merged_build_possible=no])
+
+ AC_MSG_CHECKING([whether it would be possible to do a merged build])
+ AC_MSG_RESULT([$merged_build_possible])
+
+ dnl FIXME: enable_merged_build=$merged_build_possible
+fi
if test x$enable_merged_build = xyes; then
MERGED_BUILD=1
m4_include(samba4.m4)
fi
+m4_include(../lib/zlib/zlib.m4)
+AC_SUBST(ZLIB_LIBS)
+AC_SUBST(ZLIB_OBJS)
+AC_ZLIB([ZLIB_OBJS=""], [
+ ZLIB_LIBS=""
+ for o in adler32.o compress.o crc32.o gzio.o uncompr.o \
+ deflate.o trees.o zutil.o inflate.o infback.o \
+ inftrees.o inffast.o
+ do
+ ZLIB_OBJS="$ZLIB_OBJS ../lib/zlib/$o"
+ done
+ CFLAGS="$CFLAGS -I../lib/zlib"
+])
+
dnl Remove -L/usr/lib/? from LDFLAGS and LIBS
LIB_REMOVE_USR_LIB(LDFLAGS)
LIB_REMOVE_USR_LIB(LIBS)
diff --git a/source3/groupdb/mapping_ldb.c b/source3/groupdb/mapping_ldb.c
index 7ce879fb6e..1a6b99fa18 100644
--- a/source3/groupdb/mapping_ldb.c
+++ b/source3/groupdb/mapping_ldb.c
@@ -63,7 +63,7 @@ static bool init_group_mapping(void)
/* Ensure this db is created read/write for root only. */
ldb_set_create_perms(ldb, 0600);
- existed = file_exist(db_path, NULL);
+ existed = file_exist(db_path);
if (lp_parm_bool(-1, "groupmap", "nosync", False)) {
flags |= LDB_FLG_NOSYNC;
@@ -99,7 +99,7 @@ static bool init_group_mapping(void)
/* possibly upgrade */
tdb_path = state_path("group_mapping.tdb");
- if (file_exist(tdb_path, NULL) && !mapping_upgrade(tdb_path)) {
+ if (file_exist(tdb_path) && !mapping_upgrade(tdb_path)) {
unlink(state_path("group_mapping.ldb"));
goto failed;
}
diff --git a/source3/include/byteorder.h b/source3/include/byteorder.h
deleted file mode 100644
index 9ced9cea3a..0000000000
--- a/source3/include/byteorder.h
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- Unix SMB/CIFS implementation.
- SMB Byte handling
- Copyright (C) Andrew Tridgell 1992-1998
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef _BYTEORDER_H
-#define _BYTEORDER_H
-
-/*
- This file implements macros for machine independent short and
- int manipulation
-
-Here is a description of this file that I emailed to the samba list once:
-
-> I am confused about the way that byteorder.h works in Samba. I have
-> looked at it, and I would have thought that you might make a distinction
-> between LE and BE machines, but you only seem to distinguish between 386
-> and all other architectures.
->
-> Can you give me a clue?
-
-sure.
-
-The distinction between 386 and other architectures is only there as
-an optimisation. You can take it out completely and it will make no
-difference. The routines (macros) in byteorder.h are totally byteorder
-independent. The 386 optimsation just takes advantage of the fact that
-the x86 processors don't care about alignment, so we don't have to
-align ints on int boundaries etc. If there are other processors out
-there that aren't alignment sensitive then you could also define
-CAREFUL_ALIGNMENT=0 on those processors as well.
-
-Ok, now to the macros themselves. I'll take a simple example, say we
-want to extract a 2 byte integer from a SMB packet and put it into a
-type called uint16 that is in the local machines byte order, and you
-want to do it with only the assumption that uint16 is _at_least_ 16
-bits long (this last condition is very important for architectures
-that don't have any int types that are 2 bytes long)
-
-You do this:
-
-#define CVAL(buf,pos) (((unsigned char *)(buf))[pos])
-#define PVAL(buf,pos) ((unsigned)CVAL(buf,pos))
-#define SVAL(buf,pos) (PVAL(buf,pos)|PVAL(buf,(pos)+1)<<8)
-
-then to extract a uint16 value at offset 25 in a buffer you do this:
-
-char *buffer = foo_bar();
-uint16 xx = SVAL(buffer,25);
-
-We are using the byteoder independence of the ANSI C bitshifts to do
-the work. A good optimising compiler should turn this into efficient
-code, especially if it happens to have the right byteorder :-)
-
-I know these macros can be made a bit tidier by removing some of the
-casts, but you need to look at byteorder.h as a whole to see the
-reasoning behind them. byteorder.h defines the following macros:
-
-SVAL(buf,pos) - extract a 2 byte SMB value
-IVAL(buf,pos) - extract a 4 byte SMB value
-SVALS(buf,pos) signed version of SVAL()
-IVALS(buf,pos) signed version of IVAL()
-
-SSVAL(buf,pos,val) - put a 2 byte SMB value into a buffer
-SIVAL(buf,pos,val) - put a 4 byte SMB value into a buffer
-SSVALS(buf,pos,val) - signed version of SSVAL()
-SIVALS(buf,pos,val) - signed version of SIVAL()
-
-RSVAL(buf,pos) - like SVAL() but for NMB byte ordering
-RSVALS(buf,pos) - like SVALS() but for NMB byte ordering
-RIVAL(buf,pos) - like IVAL() but for NMB byte ordering
-RIVALS(buf,pos) - like IVALS() but for NMB byte ordering
-RSSVAL(buf,pos,val) - like SSVAL() but for NMB ordering
-RSIVAL(buf,pos,val) - like SIVAL() but for NMB ordering
-RSIVALS(buf,pos,val) - like SIVALS() but for NMB ordering
-
-it also defines lots of intermediate macros, just ignore those :-)
-
-*/
-
-#undef CAREFUL_ALIGNMENT
-
-/* we know that the 386 can handle misalignment and has the "right"
- byteorder */
-#ifdef __i386__
-#define CAREFUL_ALIGNMENT 0
-#endif
-
-#ifndef CAREFUL_ALIGNMENT
-#define CAREFUL_ALIGNMENT 1
-#endif
-
-#define CVAL(buf,pos) ((unsigned)(((const unsigned char *)(buf))[pos]))
-#define CVAL_NC(buf,pos) (((unsigned char *)(buf))[pos]) /* Non-const version of CVAL */
-#define PVAL(buf,pos) (CVAL(buf,pos))
-#define SCVAL(buf,pos,val) (CVAL_NC(buf,pos) = (val))
-
-
-#if CAREFUL_ALIGNMENT
-
-#define SVAL(buf,pos) (PVAL(buf,pos)|PVAL(buf,(pos)+1)<<8)
-#define IVAL(buf,pos) (SVAL(buf,pos)|SVAL(buf,(pos)+2)<<16)
-#define SSVALX(buf,pos,val) (CVAL_NC(buf,pos)=(unsigned char)((val)&0xFF),CVAL_NC(buf,pos+1)=(unsigned char)((val)>>8))
-#define SIVALX(buf,pos,val) (SSVALX(buf,pos,val&0xFFFF),SSVALX(buf,pos+2,val>>16))
-#define SVALS(buf,pos) ((int16)SVAL(buf,pos))
-#define IVALS(buf,pos) ((int32)IVAL(buf,pos))
-#define SSVAL(buf,pos,val) SSVALX((buf),(pos),((uint16)(val)))
-#define SIVAL(buf,pos,val) SIVALX((buf),(pos),((uint32)(val)))
-#define SSVALS(buf,pos,val) SSVALX((buf),(pos),((int16)(val)))
-#define SIVALS(buf,pos,val) SIVALX((buf),(pos),((int32)(val)))
-
-#else /* CAREFUL_ALIGNMENT */
-
-/* this handles things for architectures like the 386 that can handle
- alignment errors */
-/*
- WARNING: This section is dependent on the length of int16 and int32
- being correct
-*/
-
-/* get single value from an SMB buffer */
-#define SVAL(buf,pos) (*(const uint16 *)((const char *)(buf) + (pos)))
-#define SVAL_NC(buf,pos) (*(uint16 *)((char *)(buf) + (pos))) /* Non const version of above. */
-#define IVAL(buf,pos) (*(const uint32 *)((const char *)(buf) + (pos)))
-#define IVAL_NC(buf,pos) (*(uint32 *)((char *)(buf) + (pos))) /* Non const version of above. */
-#define SVALS(buf,pos) (*(const int16 *)((const char *)(buf) + (pos)))
-#define SVALS_NC(buf,pos) (*(int16 *)((char *)(buf) + (pos))) /* Non const version of above. */
-#define IVALS(buf,pos) (*(const int32 *)((const char *)(buf) + (pos)))
-#define IVALS_NC(buf,pos) (*(int32 *)((char *)(buf) + (pos))) /* Non const version of above. */
-
-/* store single value in an SMB buffer */
-#define SSVAL(buf,pos,val) SVAL_NC(buf,pos)=((uint16)(val))
-#define SIVAL(buf,pos,val) IVAL_NC(buf,pos)=((uint32)(val))
-#define SSVALS(buf,pos,val) SVALS_NC(buf,pos)=((int16)(val))
-#define SIVALS(buf,pos,val) IVALS_NC(buf,pos)=((int32)(val))
-
-#endif /* CAREFUL_ALIGNMENT */
-
-/* now the reverse routines - these are used in nmb packets (mostly) */
-#define SREV(x) ((((x)&0xFF)<<8) | (((x)>>8)&0xFF))
-#define IREV(x) ((SREV(x)<<16) | (SREV((x)>>16)))
-
-#define RSVAL(buf,pos) SREV(SVAL(buf,pos))
-#define RSVALS(buf,pos) SREV(SVALS(buf,pos))
-#define RIVAL(buf,pos) IREV(IVAL(buf,pos))
-#define RIVALS(buf,pos) IREV(IVALS(buf,pos))
-#define RSSVAL(buf,pos,val) SSVAL(buf,pos,SREV(val))
-#define RSSVALS(buf,pos,val) SSVALS(buf,pos,SREV(val))
-#define RSIVAL(buf,pos,val) SIVAL(buf,pos,IREV(val))
-#define RSIVALS(buf,pos,val) SIVALS(buf,pos,IREV(val))
-
-/* Alignment macros. */
-#define ALIGN4(p,base) ((p) + ((4 - (PTR_DIFF((p), (base)) & 3)) & 3))
-#define ALIGN2(p,base) ((p) + ((2 - (PTR_DIFF((p), (base)) & 1)) & 1))
-
-/* 64 bit macros */
-#define BVAL(p, ofs) (IVAL(p,ofs) | (((uint64_t)IVAL(p,(ofs)+4)) << 32))
-#define BVALS(p, ofs) ((int64_t)BVAL(p,ofs))
-#define SBVAL(p, ofs, v) (SIVAL(p,ofs,(v)&0xFFFFFFFF), SIVAL(p,(ofs)+4,((uint64_t)(v))>>32))
-#define SBVALS(p, ofs, v) (SBVAL(p,ofs,(uint64_t)v))
-
-#endif /* _BYTEORDER_H */
diff --git a/source3/include/client.h b/source3/include/client.h
index 70b0421c6d..8d57fe1eed 100644
--- a/source3/include/client.h
+++ b/source3/include/client.h
@@ -232,7 +232,7 @@ struct cli_state {
typedef struct file_info {
struct cli_state *cli;
- SMB_BIG_UINT size;
+ uint64_t size;
uint16 mode;
uid_t uid;
gid_t gid;
diff --git a/source3/include/dcerpc.h b/source3/include/dcerpc.h
deleted file mode 100644
index e69de29bb2..0000000000
--- a/source3/include/dcerpc.h
+++ /dev/null
diff --git a/source3/include/debug.h b/source3/include/debug.h
index d1716320b3..56d0237c3f 100644
--- a/source3/include/debug.h
+++ b/source3/include/debug.h
@@ -40,11 +40,13 @@
int Debug1( const char *, ... ) PRINTF_ATTRIBUTE(1,2);
/* PRINTFLIKE1 */
bool dbgtext( const char *, ... ) PRINTF_ATTRIBUTE(1,2);
-bool dbghdr( int level, int cls, const char *file, const char *func, int line );
+bool dbghdrclass( int level, int cls, const char *location, const char *func);
+bool dbghdr( int level, const char *location, const char *func);
#if defined(sgi) && (_COMPILER_VERSION >= 730)
#pragma mips_frequency_hint NEVER Debug1
#pragma mips_frequency_hint NEVER dbgtext
+#pragma mips_frequency_hint NEVER dbghdrclass
#pragma mips_frequency_hint NEVER dbghdr
#endif
@@ -192,7 +194,7 @@ extern bool *DEBUGLEVEL_CLASS_ISSET;
#define DEBUGLVL( level ) \
( CHECK_DEBUGLVL(level) \
- && dbghdr( level, DBGC_CLASS, __FILE__, FUNCTION_MACRO, (__LINE__) ) )
+ && dbghdrclass( level, DBGC_CLASS, __location__, FUNCTION_MACRO ) )
#define DEBUGLVLC( dbgc_class, level ) \
@@ -200,7 +202,7 @@ extern bool *DEBUGLEVEL_CLASS_ISSET;
unlikely((DEBUGLEVEL_CLASS[ dbgc_class ] >= (level))|| \
(!DEBUGLEVEL_CLASS_ISSET[ dbgc_class ] && \
DEBUGLEVEL_CLASS[ DBGC_ALL ] >= (level)) ) \
- && dbghdr( level, DBGC_CLASS, __FILE__, FUNCTION_MACRO, (__LINE__) ) )
+ && dbghdrclass( level, DBGC_CLASS, __location__, FUNCTION_MACRO) )
#define DEBUG( level, body ) \
@@ -208,7 +210,7 @@ extern bool *DEBUGLEVEL_CLASS_ISSET;
unlikely((DEBUGLEVEL_CLASS[ DBGC_CLASS ] >= (level))|| \
(!DEBUGLEVEL_CLASS_ISSET[ DBGC_CLASS ] && \
DEBUGLEVEL_CLASS[ DBGC_ALL ] >= (level)) ) \
- && (dbghdr( level, DBGC_CLASS, __FILE__, FUNCTION_MACRO, (__LINE__) )) \
+ && (dbghdrclass( level, DBGC_CLASS, __location__, FUNCTION_MACRO )) \
&& (dbgtext body) )
#define DEBUGC( dbgc_class, level, body ) \
@@ -216,7 +218,7 @@ extern bool *DEBUGLEVEL_CLASS_ISSET;
unlikely((DEBUGLEVEL_CLASS[ dbgc_class ] >= (level))|| \
(!DEBUGLEVEL_CLASS_ISSET[ dbgc_class ] && \
DEBUGLEVEL_CLASS[ DBGC_ALL ] >= (level)) ) \
- && (dbghdr( level, DBGC_CLASS, __FILE__, FUNCTION_MACRO, (__LINE__) )) \
+ && (dbghdrclass( level, DBGC_CLASS, __location__, FUNCTION_MACRO)) \
&& (dbgtext body) )
#define DEBUGADD( level, body ) \
diff --git a/source3/include/dlinklist.h b/source3/include/dlinklist.h
deleted file mode 100644
index 1a4ebb6fa0..0000000000
--- a/source3/include/dlinklist.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- Unix SMB/CIFS implementation.
- some simple double linked list macros
- Copyright (C) Andrew Tridgell 1998
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-/* To use these macros you must have a structure containing a next and
- prev pointer */
-
-#ifndef _DLINKLIST_H
-#define _DLINKLIST_H
-
-
-/* hook into the front of the list */
-#define DLIST_ADD(list, p) \
-do { \
- if (!(list)) { \
- (list) = (p); \
- (p)->next = (p)->prev = NULL; \
- } else { \
- (list)->prev = (p); \
- (p)->next = (list); \
- (p)->prev = NULL; \
- (list) = (p); \
- }\
-} while (0)
-
-/* remove an element from a list - element doesn't have to be in list. */
-#define DLIST_REMOVE(list, p) \
-do { \
- if ((p) == (list)) { \
- (list) = (p)->next; \
- if (list) (list)->prev = NULL; \
- } else { \
- if ((p)->prev) (p)->prev->next = (p)->next; \
- if ((p)->next) (p)->next->prev = (p)->prev; \
- } \
- if ((p) != (list)) (p)->next = (p)->prev = NULL; \
-} while (0)
-
-/* promote an element to the top of the list */
-#define DLIST_PROMOTE(list, p) \
-do { \
- DLIST_REMOVE(list, p); \
- DLIST_ADD(list, p); \
-} while (0)
-
-/* hook into the end of the list - needs the entry type */
-#define DLIST_ADD_END(list, p, type) \
-do { \
- if (!(list)) { \
- (list) = (p); \
- (p)->next = (p)->prev = NULL; \
- } else { \
- type tmp; \
- for (tmp = (list); tmp->next; tmp = tmp->next) ; \
- tmp->next = (p); \
- (p)->next = NULL; \
- (p)->prev = tmp; \
- } \
-} while (0)
-
-/* insert 'p' after the given element 'el' in a list. If el is NULL then
- this is the same as a DLIST_ADD() */
-#define DLIST_ADD_AFTER(list, p, el) \
-do { \
- if (!(list) || !(el)) { \
- DLIST_ADD(list, p); \
- } else { \
- p->prev = el; \
- p->next = el->next; \
- el->next = p; \
- if (p->next) p->next->prev = p; \
- }\
-} while (0)
-
-/* demote an element to the end of the list, needs a tmp pointer */
-#define DLIST_DEMOTE(list, p, tmp) \
-do { \
- DLIST_REMOVE(list, p); \
- DLIST_ADD_END(list, p, tmp); \
-} while (0)
-
-/* concatenate two lists - putting all elements of the 2nd list at the
- end of the first list */
-#define DLIST_CONCATENATE(list1, list2, type) \
-do { \
- if (!(list1)) { \
- (list1) = (list2); \
- } else { \
- type tmp; \
- for (tmp = (list1); tmp->next; tmp = tmp->next) ; \
- tmp->next = (list2); \
- if (list2) { \
- (list2)->prev = tmp; \
- } \
- } \
-} while (0)
-
-#endif /* _DLINKLIST_H */
diff --git a/source3/include/fake_file.h b/source3/include/fake_file.h
index 93da106030..c4b271f85d 100644
--- a/source3/include/fake_file.h
+++ b/source3/include/fake_file.h
@@ -22,7 +22,8 @@
enum FAKE_FILE_TYPE {
FAKE_FILE_TYPE_NONE = 0,
- FAKE_FILE_TYPE_QUOTA
+ FAKE_FILE_TYPE_QUOTA,
+ FAKE_FILE_TYPE_NAMED_PIPE
};
/*
diff --git a/source3/include/includes.h b/source3/include/includes.h
index 79495a7ecf..ac5b2b215c 100644
--- a/source3/include/includes.h
+++ b/source3/include/includes.h
@@ -71,23 +71,6 @@
#undef HAVE_TERMIOS_H
#endif
-#ifndef _PUBLIC_
-#ifdef HAVE_VISIBILITY_ATTR
-# define _PUBLIC_ __attribute__((visibility("default")))
-#else
-# define _PUBLIC_
-#endif
-#endif
-
-#if defined(__GNUC__) && !defined(__cplusplus)
-/** gcc attribute used on function parameters so that it does not emit
- * warnings about them being unused. **/
-# define UNUSED(param) param __attribute__ ((unused))
-#else
-# define UNUSED(param) param
-/** Feel free to add definitions for other compilers here. */
-#endif
-
#ifdef RELIANTUNIX
/*
* <unistd.h> has to be included before any other to get
@@ -286,36 +269,18 @@ typedef int ber_int_t;
#endif
/*
- * Define VOLATILE if needed.
- */
-
-#if defined(HAVE_VOLATILE)
-#define VOLATILE volatile
-#else
-#define VOLATILE
-#endif
-
-/*
* Define additional missing types
*/
-#if defined(HAVE_SIG_ATOMIC_T_TYPE) && defined(AIX)
+#if defined(AIX)
typedef sig_atomic_t SIG_ATOMIC_T;
-#elif defined(HAVE_SIG_ATOMIC_T_TYPE) && !defined(AIX)
-typedef sig_atomic_t VOLATILE SIG_ATOMIC_T;
#else
-typedef int VOLATILE SIG_ATOMIC_T;
+typedef sig_atomic_t volatile SIG_ATOMIC_T;
#endif
#ifndef uchar
#define uchar unsigned char
#endif
-#ifdef HAVE_UNSIGNED_CHAR
-#define schar signed char
-#else
-#define schar char
-#endif
-
/*
Samba needs type definitions for int16, int32, uint16 and uint32.
@@ -326,15 +291,11 @@ typedef int VOLATILE SIG_ATOMIC_T;
*/
#ifndef uint8
-#define uint8 unsigned char
+#define uint8 uint8_t
#endif
#if !defined(int16) && !defined(HAVE_INT16_FROM_RPC_RPC_H)
-# if (SIZEOF_SHORT == 4)
-# define int16 __ERROR___CANNOT_DETERMINE_TYPE_FOR_INT16;
-# else /* SIZEOF_SHORT != 4 */
-# define int16 short
-# endif /* SIZEOF_SHORT != 4 */
+# define int16 int16_t
/* needed to work around compile issue on HP-UX 11.x */
# define _INT16 1
#endif
@@ -344,25 +305,13 @@ typedef int VOLATILE SIG_ATOMIC_T;
* case as int16 may be a typedef from rpc/rpc.h
*/
+
#if !defined(uint16) && !defined(HAVE_UINT16_FROM_RPC_RPC_H)
-#if (SIZEOF_SHORT == 4)
-#define uint16 __ERROR___CANNOT_DETERMINE_TYPE_FOR_INT16;
-#else /* SIZEOF_SHORT != 4 */
-#define uint16 unsigned short
-#endif /* SIZEOF_SHORT != 4 */
+# define uint16 uint16_t
#endif
#if !defined(int32) && !defined(HAVE_INT32_FROM_RPC_RPC_H)
-# if (SIZEOF_INT == 4)
-# define int32 int
-# elif (SIZEOF_LONG == 4)
-# define int32 long
-# elif (SIZEOF_SHORT == 4)
-# define int32 short
-# else
- /* uggh - no 32 bit type?? probably a CRAY. just hope this works ... */
-# define int32 int
-# endif
+# define int32 int32_t
/* needed to work around compile issue on HP-UX 11.x */
# define _INT32 1
#endif
@@ -373,16 +322,7 @@ typedef int VOLATILE SIG_ATOMIC_T;
*/
#if !defined(uint32) && !defined(HAVE_UINT32_FROM_RPC_RPC_H)
-#if (SIZEOF_INT == 4)
-#define uint32 unsigned int
-#elif (SIZEOF_LONG == 4)
-#define uint32 unsigned long
-#elif (SIZEOF_SHORT == 4)
-#define uint32 unsigned short
-#else
-/* uggh - no 32 bit type?? probably a CRAY. just hope this works ... */
-#define uint32 unsigned
-#endif
+# define uint32 uint32_t
#endif
/*
@@ -390,19 +330,11 @@ typedef int VOLATILE SIG_ATOMIC_T;
*/
#if !defined(uint64)
-#if (SIZEOF_LONG == 8)
-#define uint64 unsigned long
-#elif (SIZEOF_LONG_LONG == 8)
-#define uint64 unsigned long long
-#endif /* don't lie. If we don't have it, then don't use it */
+# define uint64 uint64_t
#endif
#if !defined(int64)
-#if (SIZEOF_LONG == 8)
-#define int64 long
-#elif (SIZEOF_LONG_LONG == 8)
-#define int64 long long
-#endif /* don't lie. If we don't have it, then don't use it */
+# define int64 int64_t
#endif
@@ -426,7 +358,7 @@ typedef int VOLATILE SIG_ATOMIC_T;
#ifdef LARGE_SMB_DEV_T
#define SDEV_T_VAL(p, ofs, v) (SIVAL((p),(ofs),(v)&0xFFFFFFFF), SIVAL((p),(ofs)+4,(v)>>32))
-#define DEV_T_VAL(p, ofs) ((SMB_DEV_T)(((SMB_BIG_UINT)(IVAL((p),(ofs))))| (((SMB_BIG_UINT)(IVAL((p),(ofs)+4))) << 32)))
+#define DEV_T_VAL(p, ofs) ((SMB_DEV_T)(((uint64_t)(IVAL((p),(ofs))))| (((uint64_t)(IVAL((p),(ofs)+4))) << 32)))
#else
#define SDEV_T_VAL(p, ofs, v) (SIVAL((p),(ofs),v),SIVAL((p),(ofs)+4,0))
#define DEV_T_VAL(p, ofs) ((SMB_DEV_T)(IVAL((p),(ofs))))
@@ -452,7 +384,7 @@ typedef int VOLATILE SIG_ATOMIC_T;
#ifdef LARGE_SMB_INO_T
#define SINO_T_VAL(p, ofs, v) (SIVAL((p),(ofs),(v)&0xFFFFFFFF), SIVAL((p),(ofs)+4,(v)>>32))
-#define INO_T_VAL(p, ofs) ((SMB_INO_T)(((SMB_BIG_UINT)(IVAL(p,ofs)))| (((SMB_BIG_UINT)(IVAL(p,(ofs)+4))) << 32)))
+#define INO_T_VAL(p, ofs) ((SMB_INO_T)(((uint64_t)(IVAL(p,ofs)))| (((uint64_t)(IVAL(p,(ofs)+4))) << 32)))
#else
#define SINO_T_VAL(p, ofs, v) (SIVAL(p,ofs,v),SIVAL(p,(ofs)+4,0))
#define INO_T_VAL(p, ofs) ((SMB_INO_T)(IVAL((p),(ofs))))
@@ -466,20 +398,13 @@ typedef int VOLATILE SIG_ATOMIC_T;
# endif
#endif
-#if defined(HAVE_LONGLONG)
-#define SMB_BIG_UINT unsigned long long
-#define SMB_BIG_INT long long
#define SBIG_UINT(p, ofs, v) (SIVAL(p,ofs,(v)&0xFFFFFFFF), SIVAL(p,(ofs)+4,(v)>>32))
-#else
-#define SMB_BIG_UINT unsigned long
-#define SMB_BIG_INT long
-#define SBIG_UINT(p, ofs, v) (SIVAL(p,ofs,v),SIVAL(p,(ofs)+4,0))
-#endif
+#define IVAL2_TO_SMB_BIG_UINT(buf,off) ( (((uint64_t)(IVAL((buf),(off)))) & ((uint64_t)0xFFFFFFFF)) | \
+ (( ((uint64_t)(IVAL((buf),(off+4)))) & ((uint64_t)0xFFFFFFFF) ) << 32 ) )
-#define SMB_BIG_UINT_BITS (sizeof(SMB_BIG_UINT)*8)
/* this should really be a 64 bit type if possible */
-#define br_off SMB_BIG_UINT
+typedef uint64_t br_off;
#define SMB_OFF_T_BITS (sizeof(SMB_OFF_T)*8)
@@ -497,15 +422,11 @@ typedef int VOLATILE SIG_ATOMIC_T;
#ifdef LARGE_SMB_OFF_T
#define SOFF_T(p, ofs, v) (SIVAL(p,ofs,(v)&0xFFFFFFFF), SIVAL(p,(ofs)+4,(v)>>32))
#define SOFF_T_R(p, ofs, v) (SIVAL(p,(ofs)+4,(v)&0xFFFFFFFF), SIVAL(p,ofs,(v)>>32))
-#define IVAL_TO_SMB_OFF_T(buf,off) ((SMB_OFF_T)(( ((SMB_BIG_UINT)(IVAL((buf),(off)))) & ((SMB_BIG_UINT)0xFFFFFFFF) )))
-#define IVAL2_TO_SMB_BIG_UINT(buf,off) ( (((SMB_BIG_UINT)(IVAL((buf),(off)))) & ((SMB_BIG_UINT)0xFFFFFFFF)) | \
- (( ((SMB_BIG_UINT)(IVAL((buf),(off+4)))) & ((SMB_BIG_UINT)0xFFFFFFFF) ) << 32 ) )
+#define IVAL_TO_SMB_OFF_T(buf,off) ((SMB_OFF_T)(( ((uint64_t)(IVAL((buf),(off)))) & ((uint64_t)0xFFFFFFFF) )))
#else
#define SOFF_T(p, ofs, v) (SIVAL(p,ofs,v),SIVAL(p,(ofs)+4,0))
#define SOFF_T_R(p, ofs, v) (SIVAL(p,(ofs)+4,v),SIVAL(p,ofs,0))
#define IVAL_TO_SMB_OFF_T(buf,off) ((SMB_OFF_T)(( ((uint32)(IVAL((buf),(off)))) & 0xFFFFFFFF )))
-#define IVAL2_TO_SMB_BIG_UINT(buf,off) ( (((SMB_BIG_UINT)(IVAL((buf),(off)))) & ((SMB_BIG_UINT)0xFFFFFFFF)) | \
- (( ((SMB_BIG_UINT)(IVAL((buf),(off+4)))) & ((SMB_BIG_UINT)0xFFFFFFFF) ) << 32 ) )
#endif
/*
@@ -645,14 +566,24 @@ struct timespec {
typedef char fstring[FSTRING_LEN];
#endif
+/* Samba 3 doesn't use iconv_convenience: */
+extern void *global_loadparm;
+extern void *cmdline_lp_ctx;
+struct smb_iconv_convenience *lp_iconv_convenience(void *lp_ctx);
+
/* Lists, trees, caching, database... */
-#include "xfile.h"
+#include "../lib/util/xfile.h"
+#include "../lib/util/memory.h"
+#include "../lib/util/attr.h"
#include "intl.h"
-#include "dlinklist.h"
+#include "../lib/util/dlinklist.h"
#include "tdb.h"
#include "util_tdb.h"
#include "../talloc/talloc.h"
+
+#include "../lib/util/data_blob.h"
+#include "../lib/util/time.h"
/* And a little extension. Abort on type mismatch */
#define talloc_get_type_abort(ptr, type) \
(type *)talloc_check_name_abort(ptr, #type)
@@ -675,7 +606,7 @@ typedef char fstring[FSTRING_LEN];
#include "smb.h"
#include "nameserv.h"
#include "secrets.h"
-#include "byteorder.h"
+#include "../lib/util/byteorder.h"
#include "privileges.h"
#include "rpc_misc.h"
#include "rpc_dce.h"
@@ -687,6 +618,7 @@ typedef char fstring[FSTRING_LEN];
#include "msdfs.h"
#include "rap.h"
#include "../lib/crypto/md5.h"
+#include "../lib/crypto/arcfour.h"
#include "../lib/crypto/crc32.h"
#include "../lib/crypto/hmacmd5.h"
#include "ntlmssp.h"
@@ -832,14 +764,6 @@ enum flush_reason_enum {
/* prototypes from lib/util_transfer_file.c */
#include "transfer_file.h"
-#ifdef __COMPAR_FN_T
-#define QSORT_CAST (__compar_fn_t)
-#endif
-
-#ifndef QSORT_CAST
-#define QSORT_CAST (int (*)(const void *, const void *))
-#endif
-
#ifndef DEFAULT_PRINTING
#ifdef HAVE_CUPS
#define DEFAULT_PRINTING PRINT_CUPS
@@ -889,26 +813,10 @@ enum flush_reason_enum {
#define SYNC_DNS 1
#endif
-#ifndef SEEK_SET
-#define SEEK_SET 0
-#endif
-
-#ifndef INADDR_LOOPBACK
-#define INADDR_LOOPBACK 0x7f000001
-#endif
-
-#ifndef INADDR_NONE
-#define INADDR_NONE 0xffffffff
-#endif
-
#ifndef HAVE_CRYPT
#define crypt ufc_crypt
#endif
-#ifndef O_ACCMODE
-#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
-#endif
-
#if defined(HAVE_CRYPT16) && defined(HAVE_GETAUTHUID)
#define ULTRIX_AUTH 1
#endif
@@ -921,26 +829,9 @@ int setresuid(uid_t ruid, uid_t euid, uid_t suid);
int setresgid(gid_t rgid, gid_t egid, gid_t sgid);
#endif
-/*
- * Some older systems seem not to have MAXHOSTNAMELEN
- * defined.
- */
-#ifndef MAXHOSTNAMELEN
-#define MAXHOSTNAMELEN 255
-#endif
-
/* yuck, I'd like a better way of doing this */
#define DIRP_SIZE (256 + 32)
-/*
- * glibc on linux doesn't seem to have MSG_WAITALL
- * defined. I think the kernel has it though..
- */
-
-#ifndef MSG_WAITALL
-#define MSG_WAITALL 0
-#endif
-
/* default socket options. Dave Miller thinks we should default to TCP_NODELAY
given the socket IO pattern that Samba uses */
#ifdef TCP_NODELAY
@@ -956,84 +847,6 @@ int setresgid(gid_t rgid, gid_t egid, gid_t sgid);
#endif
-/* Some POSIX definitions for those without */
-
-#ifndef S_IFDIR
-#define S_IFDIR 0x4000
-#endif
-#ifndef S_ISDIR
-#define S_ISDIR(mode) ((mode & 0xF000) == S_IFDIR)
-#endif
-#ifndef S_IRWXU
-#define S_IRWXU 00700 /* read, write, execute: owner */
-#endif
-#ifndef S_IRUSR
-#define S_IRUSR 00400 /* read permission: owner */
-#endif
-#ifndef S_IWUSR
-#define S_IWUSR 00200 /* write permission: owner */
-#endif
-#ifndef S_IXUSR
-#define S_IXUSR 00100 /* execute permission: owner */
-#endif
-#ifndef S_IRWXG
-#define S_IRWXG 00070 /* read, write, execute: group */
-#endif
-#ifndef S_IRGRP
-#define S_IRGRP 00040 /* read permission: group */
-#endif
-#ifndef S_IWGRP
-#define S_IWGRP 00020 /* write permission: group */
-#endif
-#ifndef S_IXGRP
-#define S_IXGRP 00010 /* execute permission: group */
-#endif
-#ifndef S_IRWXO
-#define S_IRWXO 00007 /* read, write, execute: other */
-#endif
-#ifndef S_IROTH
-#define S_IROTH 00004 /* read permission: other */
-#endif
-#ifndef S_IWOTH
-#define S_IWOTH 00002 /* write permission: other */
-#endif
-#ifndef S_IXOTH
-#define S_IXOTH 00001 /* execute permission: other */
-#endif
-
-/* For sys_adminlog(). */
-#ifndef LOG_EMERG
-#define LOG_EMERG 0 /* system is unusable */
-#endif
-
-#ifndef LOG_ALERT
-#define LOG_ALERT 1 /* action must be taken immediately */
-#endif
-
-#ifndef LOG_CRIT
-#define LOG_CRIT 2 /* critical conditions */
-#endif
-
-#ifndef LOG_ERR
-#define LOG_ERR 3 /* error conditions */
-#endif
-
-#ifndef LOG_WARNING
-#define LOG_WARNING 4 /* warning conditions */
-#endif
-
-#ifndef LOG_NOTICE
-#define LOG_NOTICE 5 /* normal but significant condition */
-#endif
-
-#ifndef LOG_INFO
-#define LOG_INFO 6 /* informational */
-#endif
-
-#ifndef LOG_DEBUG
-#define LOG_DEBUG 7 /* debug-level messages */
-#endif
-
#if HAVE_KERNEL_SHARE_MODES
#ifndef LOCK_MAND
#define LOCK_MAND 32 /* This is a mandatory flock */
@@ -1061,19 +874,6 @@ extern int DEBUGLEVEL;
#endif
-/* Needed for sys_dlopen/sys_dlsym/sys_dlclose */
-#ifndef RTLD_GLOBAL
-#define RTLD_GLOBAL 0
-#endif
-
-#ifndef RTLD_LAZY
-#define RTLD_LAZY 0
-#endif
-
-#ifndef RTLD_NOW
-#define RTLD_NOW 0
-#endif
-
/* needed for some systems without iconv. Doesn't really matter
what error code we use */
#ifndef EILSEQ
@@ -1106,17 +906,6 @@ char *talloc_asprintf_strupper_m(TALLOC_CTX *t, const char *fmt, ...) PRINTF_ATT
#define slprintf snprintf
#define vslprintf vsnprintf
-/* we need to use __va_copy() on some platforms */
-#ifdef HAVE_VA_COPY
-#define VA_COPY(dest, src) va_copy(dest, src)
-#else
-#ifdef HAVE___VA_COPY
-#define VA_COPY(dest, src) __va_copy(dest, src)
-#else
-#define VA_COPY(dest, src) (dest) = (src)
-#endif
-#endif
-
/*
* Veritas File System. Often in addition to native.
* Quotas different.
@@ -1272,10 +1061,6 @@ LDAP *ldap_open_with_timeout(const char *server, int port, unsigned int to);
ssize_t readahead(int fd, off64_t offset, size_t count);
#endif
-/* TRUE and FALSE are part of the C99 standard and gcc, but
- unfortunately many vendor compilers don't support them. Use True
- and False instead. */
-
#ifdef TRUE
#undef TRUE
#endif
@@ -1296,19 +1081,11 @@ ssize_t readahead(int fd, off64_t offset, size_t count);
#define CONST_DISCARD(type, ptr) ((type) ((void *) (ptr)))
#define CONST_ADD(type, ptr) ((type) ((const void *) (ptr)))
-#ifndef NORETURN_ATTRIBUTE
-#if (__GNUC__ >= 3)
-#define NORETURN_ATTRIBUTE __attribute__ ((noreturn))
-#else
-#define NORETURN_ATTRIBUTE
-#endif
-#endif
-
-void smb_panic( const char *why ) NORETURN_ATTRIBUTE ;
-void dump_core(void) NORETURN_ATTRIBUTE ;
-void exit_server(const char *const reason) NORETURN_ATTRIBUTE ;
-void exit_server_cleanly(const char *const reason) NORETURN_ATTRIBUTE ;
-void exit_server_fault(void) NORETURN_ATTRIBUTE ;
+void smb_panic( const char *why ) _NORETURN_;
+void dump_core(void) _NORETURN_;
+void exit_server(const char *const reason) _NORETURN_;
+void exit_server_cleanly(const char *const reason) _NORETURN_;
+void exit_server_fault(void) _NORETURN_;
#ifdef HAVE_LIBNSCD
#include "libnscd.h"
diff --git a/source3/include/messages.h b/source3/include/messages.h
index db805a2093..785f116e1c 100644
--- a/source3/include/messages.h
+++ b/source3/include/messages.h
@@ -82,7 +82,6 @@ struct server_id {
struct messaging_context;
struct messaging_rec;
-struct data_blob;
/*
* struct messaging_context belongs to messages.c, but because we still have
@@ -102,7 +101,7 @@ struct messaging_context {
struct messaging_backend {
NTSTATUS (*send_fn)(struct messaging_context *msg_ctx,
struct server_id pid, int msg_type,
- const struct data_blob *data,
+ const DATA_BLOB *data,
struct messaging_backend *backend);
void *private_data;
};
@@ -138,12 +137,12 @@ NTSTATUS messaging_register(struct messaging_context *msg_ctx,
void *private_data,
uint32_t msg_type,
struct server_id server_id,
- struct data_blob *data));
+ DATA_BLOB *data));
void messaging_deregister(struct messaging_context *ctx, uint32_t msg_type,
void *private_data);
NTSTATUS messaging_send(struct messaging_context *msg_ctx,
struct server_id server,
- uint32_t msg_type, const struct data_blob *data);
+ uint32_t msg_type, const DATA_BLOB *data);
NTSTATUS messaging_send_buf(struct messaging_context *msg_ctx,
struct server_id server, uint32_t msg_type,
const uint8 *buf, size_t len);
diff --git a/source3/include/module.h b/source3/include/module.h
index 20dbaba6b4..52245e01d2 100644
--- a/source3/include/module.h
+++ b/source3/include/module.h
@@ -23,6 +23,7 @@
/* Module support */
typedef NTSTATUS (init_module_function) (void);
+NTSTATUS init_samba_module(void);
typedef int smb_event_id_t;
#define SMB_EVENT_ID_INVALID (-1)
diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h
index a7d46e72d8..496d87e2db 100644
--- a/source3/include/nameserv.h
+++ b/source3/include/nameserv.h
@@ -208,7 +208,7 @@ struct nmb_data {
time_t death_time; /* The time the record must be removed (do not remove if 0). */
time_t refresh_time; /* The time the record should be refreshed. */
- SMB_BIG_UINT id; /* unique id */
+ uint64_t id; /* unique id */
struct in_addr wins_ip; /* the adress of the wins server this record comes from */
int wins_flags; /* similar to the netbios flags but different ! */
@@ -606,7 +606,7 @@ typedef struct _WINS_RECORD {
char type;
int nb_flags;
int wins_flags;
- SMB_BIG_UINT id;
+ uint64_t id;
int num_ips;
struct in_addr ip[25];
struct in_addr wins_ip;
diff --git a/source3/include/ndr.h b/source3/include/ndr.h
deleted file mode 100644
index a416866ef2..0000000000
--- a/source3/include/ndr.h
+++ /dev/null
@@ -1 +0,0 @@
-/* dummy file to deal with pidl autogenerated ndr files */
diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h
index de0a313609..e6c97c69dc 100644
--- a/source3/include/ntdomain.h
+++ b/source3/include/ntdomain.h
@@ -287,63 +287,6 @@ typedef struct pipes_struct {
} pipes_struct;
-typedef struct smb_np_struct {
- struct smb_np_struct *next, *prev;
- int pnum;
- connection_struct *conn;
- uint16 vuid; /* points to the unauthenticated user that opened this pipe. */
- bool open; /* open connection */
- uint16 device_state;
- uint16 priority;
- char *name;
-
- /* When replying to an SMBtrans, this is the maximum amount of
- data that can be sent in the initial reply. */
- int max_trans_reply;
-
- /*
- * NamedPipe state information.
- */
- struct pipes_struct *np_state;
-
- /*
- * NamedPipe functions, to be called to perform
- * Named Pipe transactions on request from an
- * SMB client.
- */
-
- /* call to create a named pipe connection.
- * returns: state information representing the connection.
- * is stored in np_state, above.
- */
- struct pipes_struct *(*namedpipe_create)(
- const char *pipe_name,
- const char *client_address,
- struct auth_serversupplied_info *server_info,
- uint16_t vuid);
-
- /* call to perform a write namedpipe operation
- */
- ssize_t (*namedpipe_write)(struct pipes_struct *p,
- char *data, size_t n);
-
- /* call to perform a read namedpipe operation.
- *
- * NOTE: the only reason that the pipe_outstanding
- * argument is here is because samba does not use
- * the namedpipe_transact function yet: instead,
- * it performs the same as what namedpipe_transact
- * does - a write, followed by a read.
- *
- * when samba is modified to use namedpipe_transact,
- * the pipe_outstanding argument may be removed.
- */
- ssize_t (*namedpipe_read)(struct pipes_struct *p,
- char *data, size_t max_len,
- bool *pipe_outstanding);
-
-} smb_np_struct;
-
struct api_struct {
const char *name;
uint8 opnum;
diff --git a/source3/include/ntlmssp.h b/source3/include/ntlmssp.h
index 3fb41c5613..b014b2170c 100644
--- a/source3/include/ntlmssp.h
+++ b/source3/include/ntlmssp.h
@@ -157,14 +157,14 @@ typedef struct ntlmssp_state
unsigned char recv_sign_key[16];
unsigned char recv_seal_key[16];
- unsigned char send_seal_arc4_state[258];
- unsigned char recv_seal_arc4_state[258];
+ struct arcfour_state send_seal_arc4_state;
+ struct arcfour_state recv_seal_arc4_state;
uint32 ntlm2_send_seq_num;
uint32 ntlm2_recv_seq_num;
/* ntlmv1 */
- unsigned char ntlmv1_arc4_state[258];
+ struct arcfour_state ntlmv1_arc4_state;
uint32 ntlmv1_seq_num;
/* it turns out that we don't always get the
diff --git a/source3/include/ntquotas.h b/source3/include/ntquotas.h
index ed503b3854..9aa8b9139e 100644
--- a/source3/include/ntquotas.h
+++ b/source3/include/ntquotas.h
@@ -47,16 +47,16 @@
#define QUOTAS_4000 0x4000
#define QUOTAS_8000 0x8000
-#define SMB_NTQUOTAS_NO_LIMIT ((SMB_BIG_UINT)(-1))
-#define SMB_NTQUOTAS_NO_ENTRY ((SMB_BIG_UINT)(-2))
-#define SMB_NTQUOTAS_NO_SPACE ((SMB_BIG_UINT)(0))
-#define SMB_NTQUOTAS_1_B (SMB_BIG_UINT)0x0000000000000001
-#define SMB_NTQUOTAS_1KB (SMB_BIG_UINT)0x0000000000000400
-#define SMB_NTQUOTAS_1MB (SMB_BIG_UINT)0x0000000000100000
-#define SMB_NTQUOTAS_1GB (SMB_BIG_UINT)0x0000000040000000
-#define SMB_NTQUOTAS_1TB (SMB_BIG_UINT)0x0000010000000000
-#define SMB_NTQUOTAS_1PB (SMB_BIG_UINT)0x0004000000000000
-#define SMB_NTQUOTAS_1EB (SMB_BIG_UINT)0x1000000000000000
+#define SMB_NTQUOTAS_NO_LIMIT ((uint64_t)(-1))
+#define SMB_NTQUOTAS_NO_ENTRY ((uint64_t)(-2))
+#define SMB_NTQUOTAS_NO_SPACE ((uint64_t)(0))
+#define SMB_NTQUOTAS_1_B (uint64_t)0x0000000000000001
+#define SMB_NTQUOTAS_1KB (uint64_t)0x0000000000000400
+#define SMB_NTQUOTAS_1MB (uint64_t)0x0000000000100000
+#define SMB_NTQUOTAS_1GB (uint64_t)0x0000000040000000
+#define SMB_NTQUOTAS_1TB (uint64_t)0x0000010000000000
+#define SMB_NTQUOTAS_1PB (uint64_t)0x0004000000000000
+#define SMB_NTQUOTAS_1EB (uint64_t)0x1000000000000000
enum SMB_QUOTA_TYPE {
SMB_INVALID_QUOTA_TYPE = -1,
@@ -68,9 +68,9 @@ enum SMB_QUOTA_TYPE {
typedef struct _SMB_NTQUOTA_STRUCT {
enum SMB_QUOTA_TYPE qtype;
- SMB_BIG_UINT usedspace;
- SMB_BIG_UINT softlim;
- SMB_BIG_UINT hardlim;
+ uint64_t usedspace;
+ uint64_t softlim;
+ uint64_t hardlim;
uint32 qflags;
DOM_SID sid;
} SMB_NTQUOTA_STRUCT;
diff --git a/source3/include/packet.h b/source3/include/packet.h
index d5174229ca..05974da8fc 100644
--- a/source3/include/packet.h
+++ b/source3/include/packet.h
@@ -46,10 +46,10 @@ NTSTATUS packet_fd_read_sync(struct packet_context *ctx);
* Otherwise return True and store the callback result in *status
*/
bool packet_handler(struct packet_context *ctx,
- bool (*full_req)(const struct data_blob *data,
+ bool (*full_req)(const DATA_BLOB *data,
size_t *length,
void *private_data),
- NTSTATUS (*callback)(const struct data_blob *data,
+ NTSTATUS (*callback)(const DATA_BLOB *data,
void *private_data),
void *private_data,
NTSTATUS *status);
diff --git a/source3/include/proto.h b/source3/include/proto.h
index fc497b6966..156e66d4dc 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -315,11 +315,6 @@ int afs_syscall( int subcall,
bool afs_settoken_str(const char *token_string);
bool afs_settoken_str(const char *token_string);
-/* The following definitions come from lib/arc4.c */
-
-void smb_arc4_init(unsigned char arc4_state_out[258], const unsigned char *key, size_t keylen);
-void smb_arc4_crypt(unsigned char arc4_state_inout[258], unsigned char *data, size_t len);
-
/* The following definitions come from lib/audit.c */
const char *audit_category_str(uint32 category);
@@ -440,18 +435,6 @@ int connections_forall(int (*fn)(struct db_record *rec,
void *private_data);
bool connections_init(bool rw);
-/* The following definitions come from lib/data_blob.c */
-
-DATA_BLOB data_blob(const void *p, size_t length);
-DATA_BLOB data_blob_talloc(TALLOC_CTX *mem_ctx, const void *p, size_t length);
-void data_blob_free(DATA_BLOB *d);
-void data_blob_clear(DATA_BLOB *d);
-void data_blob_clear_free(DATA_BLOB *d);
-DATA_BLOB data_blob_string_const(const char *str);
-DATA_BLOB data_blob_const(const void *p, size_t length);
-DATA_BLOB data_blob_talloc_zero(TALLOC_CTX *mem_ctx, size_t length);
-_PUBLIC_ char *data_blob_hex_string(TALLOC_CTX *mem_ctx, const DATA_BLOB *blob);
-
/* The following definitions come from lib/dbwrap_util.c */
int32_t dbwrap_fetch_int32(struct db_context *db, const char *keystr);
@@ -491,7 +474,8 @@ void force_check_log_size( void );
bool need_to_check_log_size( void );
void check_log_size( void );
void dbgflush( void );
-bool dbghdr(int level, int cls, const char *file, const char *func, int line);
+bool dbghdrclass(int level, int cls, const char *location, const char *func);
+bool dbghdr(int level, const char *location, const char *func);
TALLOC_CTX *debug_ctx(void);
/* The following definitions come from lib/display_sec.c */
@@ -573,7 +557,7 @@ void pull_file_id_16(char *buf, struct file_id *id);
/* The following definitions come from lib/fsusage.c */
-int sys_fsusage(const char *path, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize);
+int sys_fsusage(const char *path, uint64_t *dfree, uint64_t *dsize);
/* The following definitions come from lib/gencache.c */
@@ -593,8 +577,8 @@ void gencache_unlock_entry( const char *key );
void set_rand_reseed_callback(void (*fn)(int *));
void set_need_random_reseed(void);
-void generate_random_buffer( unsigned char *out, int len);
-char *generate_random_str(size_t len);
+void generate_random_buffer(uint8_t *out, int len);
+char *generate_random_str(TALLOC_CTX *mem_ctx, size_t len);
/* The following definitions come from lib/iconv.c */
@@ -786,12 +770,6 @@ int sys_select_intr(int maxfd, fd_set *readfds, fd_set *writefds, fd_set *errorf
/* The following definitions come from lib/sendfile.c */
ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T offset, size_t count);
-ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T offset, size_t count);
-ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T offset, size_t count);
-ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T offset, size_t count);
-ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T offset, size_t count);
-ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T offset, size_t count);
-ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T offset, size_t count);
/* The following definitions come from lib/server_mutex.c */
@@ -1131,11 +1109,9 @@ void push_dos_date3(uint8_t *buf,int offset,time_t unixdate, int zone_offset);
time_t pull_dos_date(const uint8_t *date_ptr, int zone_offset);
time_t pull_dos_date2(const uint8_t *date_ptr, int zone_offset);
time_t pull_dos_date3(const uint8_t *date_ptr, int zone_offset);
-char *http_timestring(time_t t);
char *timestring(TALLOC_CTX *mem_ctx, time_t t);
const char *nt_time_string(TALLOC_CTX *mem_ctx, NTTIME nt);
NTTIME nttime_from_string(const char *s);
-int64_t usec_time_diff(struct timeval *tv1, struct timeval *tv2);
struct timeval timeval_zero(void);
bool timeval_is_zero(const struct timeval *tv);
struct timeval timeval_current(void);
@@ -1250,10 +1226,12 @@ const char *tmpdir(void);
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);
-bool file_exist(const char *fname,SMB_STRUCT_STAT *sbuf);
+bool file_exist_stat(const char *fname,SMB_STRUCT_STAT *sbuf);
+bool file_exist(const char *fname);
bool socket_exist(const char *fname);
time_t file_modtime(const char *fname);
-bool directory_exist(char *dname,SMB_STRUCT_STAT *st);
+bool directory_exist_stat(char *dname,SMB_STRUCT_STAT *st);
+bool directory_exist(const char *dname);
SMB_OFF_T get_file_size(char *file_name);
char *attrib_string(uint16 mode);
void show_msg(char *buf);
@@ -1281,7 +1259,7 @@ void add_to_large_array(TALLOC_CTX *mem_ctx, size_t element_size,
void *element, void *_array, uint32 *num_elements,
ssize_t *array_size);
void safe_free(void *p);
-char *get_myname(TALLOC_CTX *ctx);
+char *talloc_get_myname(TALLOC_CTX *ctx);
char *get_mydnsdomname(TALLOC_CTX *ctx);
int interpret_protocol(const char *str,int def);
char *automount_lookup(TALLOC_CTX *ctx, const char *user_name);
@@ -1309,6 +1287,7 @@ enum remote_arch_types get_remote_arch(void);
void print_asc(int level, const unsigned char *buf,int len);
void dump_data(int level, const unsigned char *buf1,int len);
void dump_data_pw(const char *msg, const uchar * data, size_t len);
+void dump_data_skip_zeros(int level, const uint8_t *buf, int len);
const char *tab_depth(int level, int depth);
int str_checksum(const char *s);
void zero_free(void *p, size_t size);
@@ -1380,16 +1359,16 @@ const char *strip_hostname(const char *s);
/* The following definitions come from lib/util_file.c */
char *fgets_slash(char *s2,int maxlen,XFILE *f);
-char *fd_load(int fd, size_t *psize, size_t maxsize);
-char *file_load(const char *fname, size_t *size, size_t maxsize);
+char *file_load(const char *fname, size_t *size, size_t maxsize, TALLOC_CTX *mem_ctx);
+char **file_lines_parse(char *p, size_t size, int *numlines, TALLOC_CTX *mem_ctx);
bool unmap_file(void* start, size_t size);
-void *map_file(char *fname, size_t size);
-char **file_lines_load(const char *fname, int *numlines, size_t maxsize);
-char **fd_lines_load(int fd, int *numlines, size_t maxsize);
-char **file_lines_pload(char *syscmd, int *numlines);
+void *map_file(const char *fname, size_t size);
+char **file_lines_load(const char *fname, int *numlines, size_t maxsize, TALLOC_CTX *mem_ctx);
+char **fd_lines_load(int fd, int *numlines, size_t maxsize, TALLOC_CTX *mem_ctx);
+char **file_lines_pload(const char *syscmd, int *numlines);
void file_lines_free(char **lines);
void file_lines_slashcont(char **lines);
-bool file_save(const char *fname, void *packet, size_t length);
+bool file_save(const char *fname, const void *packet, size_t length);
/* The following definitions come from lib/util_nscd.c */
@@ -1629,7 +1608,7 @@ char *alpha_strcpy_fn(const char *fn,
char *StrnCpy_fn(const char *fn, int line,char *dest,const char *src,size_t n);
size_t strhex_to_str(char *buf, size_t buf_len, const char *strhex, size_t strhex_len);
DATA_BLOB strhex_to_data_blob(TALLOC_CTX *mem_ctx, const char *strhex);
-char *hex_encode(TALLOC_CTX *mem_ctx, const unsigned char *buff_in, size_t len);
+char *hex_encode_talloc(TALLOC_CTX *mem_ctx, const unsigned char *buff_in, size_t len);
bool in_list(const char *s, const char *list, bool casesensitive);
void string_free(char **s);
bool string_set(char **dest,const char *src);
@@ -1678,9 +1657,9 @@ char *binary_string_rfc2254(char *buf, int len);
char *binary_string(char *buf, int len);
int fstr_sprintf(fstring s, const char *fmt, ...);
char **str_list_make(TALLOC_CTX *mem_ctx, const char *string, const char *sep);
-bool str_list_copy(TALLOC_CTX *mem_ctx, char ***dest, const char **src);
-bool str_list_compare(char **list1, char **list2);
-int str_list_count( const char **list );
+char **str_list_copy(TALLOC_CTX *mem_ctx, const char **list);
+bool str_list_equal(const char **list1, const char **list2);
+size_t str_list_length( const char * const*list );
bool str_list_sub_basic( char **list, const char *smb_name,
const char *domain_name );
bool str_list_substitute(char **list, const char *pattern, const char *insert);
@@ -1693,7 +1672,7 @@ void rfc1738_unescape(char *buf);
DATA_BLOB base64_decode_data_blob(const char *s);
void base64_decode_inplace(char *s);
char *base64_encode_data_blob(TALLOC_CTX *mem_ctx, DATA_BLOB data);
-SMB_BIG_UINT STR_TO_SMB_BIG_UINT(const char *nptr, const char **entptr);
+uint64_t STR_TO_SMB_BIG_UINT(const char *nptr, const char **entptr);
SMB_OFF_T conv_str_size(const char * str);
void string_append(char **left, const char *right);
bool add_string_to_array(TALLOC_CTX *mem_ctx,
@@ -1779,9 +1758,6 @@ int islower_ascii(int c);
void smb_uuid_pack(const struct GUID uu, UUID_FLAT *ptr);
void smb_uuid_unpack(const UUID_FLAT in, struct GUID *uu);
-void smb_uuid_generate_random(struct GUID *uu);
-const char *smb_uuid_string(TALLOC_CTX *mem_ctx, const struct GUID uu);
-bool smb_string_to_uuid(const char *in, struct GUID* uu);
char *guid_binstring(const struct GUID *guid);
/* The following definitions come from lib/version.c */
@@ -2562,16 +2538,6 @@ _PUBLIC_ void ndr_print_eventlog_WriteClusterEvents(struct ndr_print *ndr, const
_PUBLIC_ void ndr_print_eventlog_GetLogIntormation(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_GetLogIntormation *r);
_PUBLIC_ void ndr_print_eventlog_FlushEventLog(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_FlushEventLog *r);
-/* The following definitions come from librpc/gen_ndr/ndr_initshutdown.c */
-
-_PUBLIC_ void ndr_print_initshutdown_String_sub(struct ndr_print *ndr, const char *name, const struct initshutdown_String_sub *r);
-_PUBLIC_ enum ndr_err_code ndr_push_initshutdown_String(struct ndr_push *ndr, int ndr_flags, const struct initshutdown_String *r);
-_PUBLIC_ enum ndr_err_code ndr_pull_initshutdown_String(struct ndr_pull *ndr, int ndr_flags, struct initshutdown_String *r);
-_PUBLIC_ void ndr_print_initshutdown_String(struct ndr_print *ndr, const char *name, const struct initshutdown_String *r);
-_PUBLIC_ void ndr_print_initshutdown_Init(struct ndr_print *ndr, const char *name, int flags, const struct initshutdown_Init *r);
-_PUBLIC_ void ndr_print_initshutdown_Abort(struct ndr_print *ndr, const char *name, int flags, const struct initshutdown_Abort *r);
-_PUBLIC_ void ndr_print_initshutdown_InitEx(struct ndr_print *ndr, const char *name, int flags, const struct initshutdown_InitEx *r);
-
/* The following definitions come from librpc/gen_ndr/ndr_krb5pac.c */
_PUBLIC_ void ndr_print_PAC_LOGON_NAME(struct ndr_print *ndr, const char *name, const struct PAC_LOGON_NAME *r);
@@ -2665,7 +2631,15 @@ _PUBLIC_ void ndr_print_lsa_PrivilegeSet(struct ndr_print *ndr, const char *name
_PUBLIC_ void ndr_print_lsa_DATA_BUF(struct ndr_print *ndr, const char *name, const struct lsa_DATA_BUF *r);
_PUBLIC_ void ndr_print_lsa_DATA_BUF2(struct ndr_print *ndr, const char *name, const struct lsa_DATA_BUF2 *r);
_PUBLIC_ void ndr_print_lsa_TrustDomInfoEnum(struct ndr_print *ndr, const char *name, enum lsa_TrustDomInfoEnum r);
+_PUBLIC_ enum ndr_err_code ndr_push_lsa_TrustDirection(struct ndr_push *ndr, int ndr_flags, uint32_t r);
+_PUBLIC_ enum ndr_err_code ndr_pull_lsa_TrustDirection(struct ndr_pull *ndr, int ndr_flags, uint32_t *r);
+_PUBLIC_ void ndr_print_lsa_TrustDirection(struct ndr_print *ndr, const char *name, uint32_t r);
+_PUBLIC_ void ndr_print_lsa_TrustType(struct ndr_print *ndr, const char *name, enum lsa_TrustType r);
+_PUBLIC_ enum ndr_err_code ndr_push_lsa_TrustAttributes(struct ndr_push *ndr, int ndr_flags, uint32_t r);
+_PUBLIC_ enum ndr_err_code ndr_pull_lsa_TrustAttributes(struct ndr_pull *ndr, int ndr_flags, uint32_t *r);
+_PUBLIC_ void ndr_print_lsa_TrustAttributes(struct ndr_print *ndr, const char *name, uint32_t r);
_PUBLIC_ void ndr_print_lsa_TrustDomainInfoName(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoName *r);
+_PUBLIC_ void ndr_print_lsa_TrustDomainInfoControllers(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoControllers *r);
_PUBLIC_ void ndr_print_lsa_TrustDomainInfoPosixOffset(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoPosixOffset *r);
_PUBLIC_ void ndr_print_lsa_TrustDomainInfoPassword(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoPassword *r);
_PUBLIC_ void ndr_print_lsa_TrustDomainInfoBasic(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoBasic *r);
@@ -2673,8 +2647,11 @@ _PUBLIC_ void ndr_print_lsa_TrustDomainInfoInfoEx(struct ndr_print *ndr, const c
_PUBLIC_ void ndr_print_lsa_TrustDomainInfoBuffer(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoBuffer *r);
_PUBLIC_ void ndr_print_lsa_TrustDomainInfoAuthInfo(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoAuthInfo *r);
_PUBLIC_ void ndr_print_lsa_TrustDomainInfoFullInfo(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoFullInfo *r);
-_PUBLIC_ void ndr_print_lsa_TrustDomainInfo11(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfo11 *r);
-_PUBLIC_ void ndr_print_lsa_TrustDomainInfoInfoAll(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoInfoAll *r);
+_PUBLIC_ void ndr_print_lsa_TrustDomainInfoAuthInfoInternal(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoAuthInfoInternal *r);
+_PUBLIC_ void ndr_print_lsa_TrustDomainInfoFullInfoInternal(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoFullInfoInternal *r);
+_PUBLIC_ void ndr_print_lsa_TrustDomainInfoInfoEx2Internal(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoInfoEx2Internal *r);
+_PUBLIC_ void ndr_print_lsa_TrustDomainInfoFullInfo2Internal(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoFullInfo2Internal *r);
+_PUBLIC_ void ndr_print_lsa_TrustDomainInfoSupportedEncTypes(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoSupportedEncTypes *r);
_PUBLIC_ void ndr_print_lsa_TrustedDomainInfo(struct ndr_print *ndr, const char *name, const union lsa_TrustedDomainInfo *r);
_PUBLIC_ void ndr_print_lsa_DATA_BUF_PTR(struct ndr_print *ndr, const char *name, const struct lsa_DATA_BUF_PTR *r);
_PUBLIC_ void ndr_print_lsa_RightSet(struct ndr_print *ndr, const char *name, const struct lsa_RightSet *r);
@@ -2848,9 +2825,11 @@ _PUBLIC_ void ndr_print_netr_IdentityInfo(struct ndr_print *ndr, const char *nam
_PUBLIC_ void ndr_print_netr_PasswordInfo(struct ndr_print *ndr, const char *name, const struct netr_PasswordInfo *r);
_PUBLIC_ void ndr_print_netr_ChallengeResponse(struct ndr_print *ndr, const char *name, const struct netr_ChallengeResponse *r);
_PUBLIC_ void ndr_print_netr_NetworkInfo(struct ndr_print *ndr, const char *name, const struct netr_NetworkInfo *r);
-_PUBLIC_ enum ndr_err_code ndr_push_netr_LogonInfo(struct ndr_push *ndr, int ndr_flags, const union netr_LogonInfo *r);
-_PUBLIC_ enum ndr_err_code ndr_pull_netr_LogonInfo(struct ndr_pull *ndr, int ndr_flags, union netr_LogonInfo *r);
-_PUBLIC_ void ndr_print_netr_LogonInfo(struct ndr_print *ndr, const char *name, const union netr_LogonInfo *r);
+_PUBLIC_ void ndr_print_netr_GenericInfo(struct ndr_print *ndr, const char *name, const struct netr_GenericInfo *r);
+_PUBLIC_ void ndr_print_netr_LogonInfoClass(struct ndr_print *ndr, const char *name, enum netr_LogonInfoClass r);
+_PUBLIC_ enum ndr_err_code ndr_push_netr_LogonLevel(struct ndr_push *ndr, int ndr_flags, const union netr_LogonLevel *r);
+_PUBLIC_ enum ndr_err_code ndr_pull_netr_LogonLevel(struct ndr_pull *ndr, int ndr_flags, union netr_LogonLevel *r);
+_PUBLIC_ void ndr_print_netr_LogonLevel(struct ndr_print *ndr, const char *name, const union netr_LogonLevel *r);
_PUBLIC_ enum ndr_err_code ndr_push_netr_UserSessionKey(struct ndr_push *ndr, int ndr_flags, const struct netr_UserSessionKey *r);
_PUBLIC_ enum ndr_err_code ndr_pull_netr_UserSessionKey(struct ndr_pull *ndr, int ndr_flags, struct netr_UserSessionKey *r);
_PUBLIC_ void ndr_print_netr_UserSessionKey(struct ndr_print *ndr, const char *name, const struct netr_UserSessionKey *r);
@@ -2868,6 +2847,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_netr_SamInfo3(struct ndr_pull *ndr, int ndr_
_PUBLIC_ void ndr_print_netr_SamInfo3(struct ndr_print *ndr, const char *name, const struct netr_SamInfo3 *r);
_PUBLIC_ void ndr_print_netr_SamInfo6(struct ndr_print *ndr, const char *name, const struct netr_SamInfo6 *r);
_PUBLIC_ void ndr_print_netr_PacInfo(struct ndr_print *ndr, const char *name, const struct netr_PacInfo *r);
+_PUBLIC_ void ndr_print_netr_GenericInfo2(struct ndr_print *ndr, const char *name, const struct netr_GenericInfo2 *r);
_PUBLIC_ enum ndr_err_code ndr_push_netr_Validation(struct ndr_push *ndr, int ndr_flags, const union netr_Validation *r);
_PUBLIC_ enum ndr_err_code ndr_pull_netr_Validation(struct ndr_pull *ndr, int ndr_flags, union netr_Validation *r);
_PUBLIC_ void ndr_print_netr_Validation(struct ndr_print *ndr, const char *name, const union netr_Validation *r);
@@ -2877,7 +2857,6 @@ _PUBLIC_ void ndr_print_netr_Credential(struct ndr_print *ndr, const char *name,
_PUBLIC_ enum ndr_err_code ndr_push_netr_Authenticator(struct ndr_push *ndr, int ndr_flags, const struct netr_Authenticator *r);
_PUBLIC_ enum ndr_err_code ndr_pull_netr_Authenticator(struct ndr_pull *ndr, int ndr_flags, struct netr_Authenticator *r);
_PUBLIC_ void ndr_print_netr_Authenticator(struct ndr_print *ndr, const char *name, const struct netr_Authenticator *r);
-_PUBLIC_ void ndr_print_netr_LogonLevel(struct ndr_print *ndr, const char *name, enum netr_LogonLevel r);
_PUBLIC_ void ndr_print_netr_DELTA_DELETE_USER(struct ndr_print *ndr, const char *name, const struct netr_DELTA_DELETE_USER *r);
_PUBLIC_ void ndr_print_netr_USER_KEY16(struct ndr_print *ndr, const char *name, const struct netr_USER_KEY16 *r);
_PUBLIC_ void ndr_print_netr_PasswordHistory(struct ndr_print *ndr, const char *name, const struct netr_PasswordHistory *r);
@@ -2925,16 +2904,22 @@ _PUBLIC_ void ndr_print_netr_DsR_DcFlags(struct ndr_print *ndr, const char *name
_PUBLIC_ enum ndr_err_code ndr_push_netr_DsRGetDCNameInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_DsRGetDCNameInfo *r);
_PUBLIC_ enum ndr_err_code ndr_pull_netr_DsRGetDCNameInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_DsRGetDCNameInfo *r);
_PUBLIC_ void ndr_print_netr_DsRGetDCNameInfo(struct ndr_print *ndr, const char *name, const struct netr_DsRGetDCNameInfo *r);
+_PUBLIC_ void ndr_print_netr_TrustFlags(struct ndr_print *ndr, const char *name, uint32_t r);
_PUBLIC_ void ndr_print_netr_BinaryString(struct ndr_print *ndr, const char *name, const struct netr_BinaryString *r);
_PUBLIC_ void ndr_print_netr_DomainQuery1(struct ndr_print *ndr, const char *name, const struct netr_DomainQuery1 *r);
_PUBLIC_ void ndr_print_netr_DomainQuery(struct ndr_print *ndr, const char *name, const union netr_DomainQuery *r);
+_PUBLIC_ void ndr_print_netr_trust_extension(struct ndr_print *ndr, const char *name, const struct netr_trust_extension *r);
+_PUBLIC_ void ndr_print_netr_trust_extension_container(struct ndr_print *ndr, const char *name, const struct netr_trust_extension_container *r);
_PUBLIC_ void ndr_print_netr_DomainTrustInfo(struct ndr_print *ndr, const char *name, const struct netr_DomainTrustInfo *r);
+_PUBLIC_ void ndr_print_netr_LsaPolicyInfo(struct ndr_print *ndr, const char *name, const struct netr_LsaPolicyInfo *r);
+_PUBLIC_ enum ndr_err_code ndr_push_netr_WorkstationFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r);
+_PUBLIC_ enum ndr_err_code ndr_pull_netr_WorkstationFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r);
+_PUBLIC_ void ndr_print_netr_WorkstationFlags(struct ndr_print *ndr, const char *name, uint32_t r);
_PUBLIC_ void ndr_print_netr_DomainInfo1(struct ndr_print *ndr, const char *name, const struct netr_DomainInfo1 *r);
_PUBLIC_ void ndr_print_netr_DomainInfo(struct ndr_print *ndr, const char *name, const union netr_DomainInfo *r);
_PUBLIC_ void ndr_print_netr_CryptPassword(struct ndr_print *ndr, const char *name, const struct netr_CryptPassword *r);
_PUBLIC_ void ndr_print_netr_DsRAddressToSitenamesWCtr(struct ndr_print *ndr, const char *name, const struct netr_DsRAddressToSitenamesWCtr *r);
_PUBLIC_ void ndr_print_netr_DsRAddress(struct ndr_print *ndr, const char *name, const struct netr_DsRAddress *r);
-_PUBLIC_ void ndr_print_netr_TrustFlags(struct ndr_print *ndr, const char *name, uint32_t r);
_PUBLIC_ void ndr_print_netr_TrustType(struct ndr_print *ndr, const char *name, enum netr_TrustType r);
_PUBLIC_ void ndr_print_netr_TrustAttributes(struct ndr_print *ndr, const char *name, uint32_t r);
_PUBLIC_ void ndr_print_netr_DomainTrust(struct ndr_print *ndr, const char *name, const struct netr_DomainTrust *r);
@@ -3088,15 +3073,15 @@ _PUBLIC_ enum ndr_err_code ndr_push_samr_PasswordProperties(struct ndr_push *ndr
_PUBLIC_ enum ndr_err_code ndr_pull_samr_PasswordProperties(struct ndr_pull *ndr, int ndr_flags, uint32_t *r);
_PUBLIC_ void ndr_print_samr_PasswordProperties(struct ndr_print *ndr, const char *name, uint32_t r);
_PUBLIC_ void ndr_print_samr_DomInfo1(struct ndr_print *ndr, const char *name, const struct samr_DomInfo1 *r);
-_PUBLIC_ void ndr_print_samr_DomInfo2(struct ndr_print *ndr, const char *name, const struct samr_DomInfo2 *r);
+_PUBLIC_ void ndr_print_samr_DomGeneralInformation(struct ndr_print *ndr, const char *name, const struct samr_DomGeneralInformation *r);
_PUBLIC_ void ndr_print_samr_DomInfo3(struct ndr_print *ndr, const char *name, const struct samr_DomInfo3 *r);
-_PUBLIC_ void ndr_print_samr_DomInfo4(struct ndr_print *ndr, const char *name, const struct samr_DomInfo4 *r);
+_PUBLIC_ void ndr_print_samr_DomOEMInformation(struct ndr_print *ndr, const char *name, const struct samr_DomOEMInformation *r);
_PUBLIC_ void ndr_print_samr_DomInfo5(struct ndr_print *ndr, const char *name, const struct samr_DomInfo5 *r);
_PUBLIC_ void ndr_print_samr_DomInfo6(struct ndr_print *ndr, const char *name, const struct samr_DomInfo6 *r);
_PUBLIC_ void ndr_print_samr_DomInfo7(struct ndr_print *ndr, const char *name, const struct samr_DomInfo7 *r);
_PUBLIC_ void ndr_print_samr_DomInfo8(struct ndr_print *ndr, const char *name, const struct samr_DomInfo8 *r);
_PUBLIC_ void ndr_print_samr_DomInfo9(struct ndr_print *ndr, const char *name, const struct samr_DomInfo9 *r);
-_PUBLIC_ void ndr_print_samr_DomInfo11(struct ndr_print *ndr, const char *name, const struct samr_DomInfo11 *r);
+_PUBLIC_ void ndr_print_samr_DomGeneralInformation2(struct ndr_print *ndr, const char *name, const struct samr_DomGeneralInformation2 *r);
_PUBLIC_ void ndr_print_samr_DomInfo12(struct ndr_print *ndr, const char *name, const struct samr_DomInfo12 *r);
_PUBLIC_ void ndr_print_samr_DomInfo13(struct ndr_print *ndr, const char *name, const struct samr_DomInfo13 *r);
_PUBLIC_ void ndr_print_samr_DomainInfo(struct ndr_print *ndr, const char *name, const union samr_DomainInfo *r);
@@ -3697,15 +3682,6 @@ _PUBLIC_ void ndr_print_wkssvc_NetrRemoveAlternateComputerName(struct ndr_print
_PUBLIC_ void ndr_print_wkssvc_NetrSetPrimaryComputername(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrSetPrimaryComputername *r);
_PUBLIC_ void ndr_print_wkssvc_NetrEnumerateComputerNames(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrEnumerateComputerNames *r);
-/* The following definitions come from librpc/gen_ndr/ndr_xattr.c */
-
-_PUBLIC_ enum ndr_err_code ndr_push_tdb_xattr(struct ndr_push *ndr, int ndr_flags, const struct tdb_xattr *r);
-_PUBLIC_ enum ndr_err_code ndr_pull_tdb_xattr(struct ndr_pull *ndr, int ndr_flags, struct tdb_xattr *r);
-_PUBLIC_ void ndr_print_tdb_xattr(struct ndr_print *ndr, const char *name, const struct tdb_xattr *r);
-_PUBLIC_ enum ndr_err_code ndr_push_tdb_xattrs(struct ndr_push *ndr, int ndr_flags, const struct tdb_xattrs *r);
-_PUBLIC_ enum ndr_err_code ndr_pull_tdb_xattrs(struct ndr_pull *ndr, int ndr_flags, struct tdb_xattrs *r);
-_PUBLIC_ void ndr_print_tdb_xattrs(struct ndr_print *ndr, const char *name, const struct tdb_xattrs *r);
-
/* The following definitions come from librpc/gen_ndr/srv_dfs.c */
void netdfs_get_pipe_fns(struct api_struct **fns, int *n_fns);
@@ -3776,9 +3752,7 @@ NTSTATUS rpc_wkssvc_init(void);
_PUBLIC_ size_t ndr_align_size(uint32_t offset, size_t n);
_PUBLIC_ struct ndr_pull *ndr_pull_init_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience);
_PUBLIC_ enum ndr_err_code ndr_pull_advance(struct ndr_pull *ndr, uint32_t size);
-_PUBLIC_ void ndr_pull_save(struct ndr_pull *ndr, struct ndr_pull_save *save);
-_PUBLIC_ void ndr_pull_restore(struct ndr_pull *ndr, struct ndr_pull_save *save);
-_PUBLIC_ struct ndr_push *ndr_push_init_ctx(TALLOC_CTX *mem_ctx);
+_PUBLIC_ struct ndr_push *ndr_push_init_ctx(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience);
_PUBLIC_ DATA_BLOB ndr_push_blob(struct ndr_push *ndr);
_PUBLIC_ enum ndr_err_code ndr_push_expand(struct ndr_push *ndr, uint32_t extra_size);
_PUBLIC_ void ndr_print_debug_helper(struct ndr_print *ndr, const char *format, ...) _PRINTF_ATTRIBUTE(2,3);
@@ -3840,13 +3814,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_struct_blob(const DATA_BLOB *blob, TALLOC_CT
_PUBLIC_ enum ndr_err_code ndr_pull_struct_blob_all(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx,
struct smb_iconv_convenience *iconv_convenience,
void *p, ndr_pull_flags_fn_t fn);
-_PUBLIC_ enum ndr_err_code ndr_pull_union_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p,
- uint32_t level, ndr_pull_flags_fn_t fn);
-_PUBLIC_ enum ndr_err_code ndr_pull_union_blob_all(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p,
- uint32_t level, ndr_pull_flags_fn_t fn);
_PUBLIC_ enum ndr_err_code ndr_push_struct_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, const void *p, ndr_push_flags_fn_t fn);
-_PUBLIC_ enum ndr_err_code ndr_push_union_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p,
- uint32_t level, ndr_push_flags_fn_t fn);
_PUBLIC_ size_t ndr_size_struct(const void *p, int flags, ndr_push_flags_fn_t push);
_PUBLIC_ size_t ndr_size_union(const void *p, int flags, uint32_t level, ndr_push_flags_fn_t push);
_PUBLIC_ uint32_t ndr_push_get_relative_base_offset(struct ndr_push *ndr);
@@ -3902,8 +3870,6 @@ _PUBLIC_ enum ndr_err_code ndr_pull_align(struct ndr_pull *ndr, size_t size);
_PUBLIC_ enum ndr_err_code ndr_push_bytes(struct ndr_push *ndr, const uint8_t *data, uint32_t n);
_PUBLIC_ enum ndr_err_code ndr_push_zero(struct ndr_push *ndr, uint32_t n);
_PUBLIC_ enum ndr_err_code ndr_push_array_uint8(struct ndr_push *ndr, int ndr_flags, const uint8_t *data, uint32_t n);
-_PUBLIC_ void ndr_push_save(struct ndr_push *ndr, struct ndr_push_save *save);
-_PUBLIC_ void ndr_push_restore(struct ndr_push *ndr, struct ndr_push_save *save);
_PUBLIC_ enum ndr_err_code ndr_push_unique_ptr(struct ndr_push *ndr, const void *p);
_PUBLIC_ enum ndr_err_code ndr_push_full_ptr(struct ndr_push *ndr, const void *p);
_PUBLIC_ enum ndr_err_code ndr_push_ref_ptr(struct ndr_push *ndr);
@@ -4275,13 +4241,13 @@ bool cli_lock(struct cli_state *cli, int fnum,
uint32 offset, uint32 len, int timeout, enum brl_type lock_type);
bool cli_unlock(struct cli_state *cli, int fnum, uint32 offset, uint32 len);
bool cli_lock64(struct cli_state *cli, int fnum,
- SMB_BIG_UINT offset, SMB_BIG_UINT len, int timeout, enum brl_type lock_type);
-bool cli_unlock64(struct cli_state *cli, int fnum, SMB_BIG_UINT offset, SMB_BIG_UINT len);
+ uint64_t offset, uint64_t len, int timeout, enum brl_type lock_type);
+bool cli_unlock64(struct cli_state *cli, int fnum, uint64_t offset, uint64_t len);
bool cli_posix_lock(struct cli_state *cli, int fnum,
- SMB_BIG_UINT offset, SMB_BIG_UINT len,
+ uint64_t offset, uint64_t len,
bool wait_lock, enum brl_type lock_type);
-bool cli_posix_unlock(struct cli_state *cli, int fnum, SMB_BIG_UINT offset, SMB_BIG_UINT len);
-bool cli_posix_getlock(struct cli_state *cli, int fnum, SMB_BIG_UINT *poffset, SMB_BIG_UINT *plen);
+bool cli_posix_unlock(struct cli_state *cli, int fnum, uint64_t offset, uint64_t len);
+bool cli_posix_getlock(struct cli_state *cli, int fnum, uint64_t *poffset, uint64_t *plen);
bool cli_getattrE(struct cli_state *cli, int fd,
uint16 *attr, SMB_OFF_T *size,
time_t *change_time,
@@ -5133,20 +5099,20 @@ const char *lock_type_name(enum brl_type lock_type);
const char *lock_flav_name(enum brl_flavour lock_flav);
bool is_locked(files_struct *fsp,
uint32 smbpid,
- SMB_BIG_UINT count,
- SMB_BIG_UINT offset,
+ uint64_t count,
+ uint64_t offset,
enum brl_type lock_type);
NTSTATUS query_lock(files_struct *fsp,
uint32 *psmbpid,
- SMB_BIG_UINT *pcount,
- SMB_BIG_UINT *poffset,
+ uint64_t *pcount,
+ uint64_t *poffset,
enum brl_type *plock_type,
enum brl_flavour lock_flav);
struct byte_range_lock *do_lock(struct messaging_context *msg_ctx,
files_struct *fsp,
uint32 lock_pid,
- SMB_BIG_UINT count,
- SMB_BIG_UINT offset,
+ uint64_t count,
+ uint64_t offset,
enum brl_type lock_type,
enum brl_flavour lock_flav,
bool blocking_lock,
@@ -5155,13 +5121,13 @@ struct byte_range_lock *do_lock(struct messaging_context *msg_ctx,
NTSTATUS do_unlock(struct messaging_context *msg_ctx,
files_struct *fsp,
uint32 lock_pid,
- SMB_BIG_UINT count,
- SMB_BIG_UINT offset,
+ uint64_t count,
+ uint64_t offset,
enum brl_flavour lock_flav);
NTSTATUS do_lock_cancel(files_struct *fsp,
uint32 lock_pid,
- SMB_BIG_UINT count,
- SMB_BIG_UINT offset,
+ uint64_t count,
+ uint64_t offset,
enum brl_flavour lock_flav);
void locking_close_file(struct messaging_context *msg_ctx,
files_struct *fsp);
@@ -5213,8 +5179,8 @@ int share_mode_forall(void (*fn)(const struct share_mode_entry *, const char *,
/* The following definitions come from locking/posix.c */
bool is_posix_locked(files_struct *fsp,
- SMB_BIG_UINT *pu_offset,
- SMB_BIG_UINT *pu_count,
+ uint64_t *pu_offset,
+ uint64_t *pu_count,
enum brl_type *plock_type,
enum brl_flavour lock_flav);
bool posix_locking_init(bool read_only);
@@ -5222,28 +5188,28 @@ bool posix_locking_end(void);
void reduce_windows_lock_ref_count(files_struct *fsp, unsigned int dcount);
int fd_close_posix(struct files_struct *fsp);
bool set_posix_lock_windows_flavour(files_struct *fsp,
- SMB_BIG_UINT u_offset,
- SMB_BIG_UINT u_count,
+ uint64_t u_offset,
+ uint64_t u_count,
enum brl_type lock_type,
const struct lock_context *lock_ctx,
const struct lock_struct *plocks,
int num_locks,
int *errno_ret);
bool release_posix_lock_windows_flavour(files_struct *fsp,
- SMB_BIG_UINT u_offset,
- SMB_BIG_UINT u_count,
+ uint64_t u_offset,
+ uint64_t u_count,
enum brl_type deleted_lock_type,
const struct lock_context *lock_ctx,
const struct lock_struct *plocks,
int num_locks);
bool set_posix_lock_posix_flavour(files_struct *fsp,
- SMB_BIG_UINT u_offset,
- SMB_BIG_UINT u_count,
+ uint64_t u_offset,
+ uint64_t u_count,
enum brl_type lock_type,
int *errno_ret);
bool release_posix_lock_posix_flavour(files_struct *fsp,
- SMB_BIG_UINT u_offset,
- SMB_BIG_UINT u_count,
+ uint64_t u_offset,
+ uint64_t u_count,
const struct lock_context *lock_ctx,
const struct lock_struct *plocks,
int num_locks);
@@ -6600,7 +6566,8 @@ bool sysv_cache_reload(void);
/* The following definitions come from printing/printfsp.c */
-NTSTATUS print_fsp_open(connection_struct *conn, const char *fname,
+NTSTATUS print_fsp_open(struct smb_request *req, connection_struct *conn,
+ const char *fname,
uint16_t current_vuid, files_struct **result);
void print_fsp_end(files_struct *fsp, enum file_close_type close_type);
@@ -7201,8 +7168,6 @@ WERROR rpccli_spoolss_rffpcnex(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
WERROR rpccli_svcctl_enumerate_services( struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
POLICY_HND *hSCM, uint32 type, uint32 state,
uint32 *returned, ENUM_SERVICES_STATUS **service_array );
-WERROR rpccli_svcctl_query_config(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
- POLICY_HND *hService, SERVICE_CONFIG *config );
/* The following definitions come from rpc_client/init_lsa.c */
@@ -7327,22 +7292,22 @@ void init_samr_DomInfo1(struct samr_DomInfo1 *r,
uint32_t password_properties,
int64_t max_password_age,
int64_t min_password_age);
-void init_samr_DomInfo2(struct samr_DomInfo2 *r,
- NTTIME force_logoff_time,
- const char *comment,
- const char *domain_name,
- const char *primary,
- uint64_t sequence_num,
- uint32_t unknown2,
- enum samr_Role role,
- uint32_t unknown3,
- uint32_t num_users,
- uint32_t num_groups,
- uint32_t num_aliases);
+void init_samr_DomGeneralInformation(struct samr_DomGeneralInformation *r,
+ NTTIME force_logoff_time,
+ const char *oem_information,
+ const char *domain_name,
+ const char *primary,
+ uint64_t sequence_num,
+ uint32_t unknown2,
+ enum samr_Role role,
+ uint32_t unknown3,
+ uint32_t num_users,
+ uint32_t num_groups,
+ uint32_t num_aliases);
void init_samr_DomInfo3(struct samr_DomInfo3 *r,
NTTIME force_logoff_time);
-void init_samr_DomInfo4(struct samr_DomInfo4 *r,
- const char *comment);
+void init_samr_DomOEMInformation(struct samr_DomOEMInformation *r,
+ const char *oem_information);
void init_samr_DomInfo5(struct samr_DomInfo5 *r,
const char *domain_name);
void init_samr_DomInfo6(struct samr_DomInfo6 *r,
@@ -8195,11 +8160,8 @@ bool convert_port_data_1( NT_PORT_DATA_1 *port1, RPC_BUFFER *buf ) ;
bool svcctl_io_enum_services_status( const char *desc, ENUM_SERVICES_STATUS *enum_status, RPC_BUFFER *buffer, int depth );
bool svcctl_io_service_status_process( const char *desc, SERVICE_STATUS_PROCESS *status, RPC_BUFFER *buffer, int depth );
uint32 svcctl_sizeof_enum_services_status( ENUM_SERVICES_STATUS *status );
-uint32 svcctl_sizeof_service_config( SERVICE_CONFIG *config );
bool svcctl_io_q_enum_services_status(const char *desc, SVCCTL_Q_ENUM_SERVICES_STATUS *q_u, prs_struct *ps, int depth);
bool svcctl_io_r_enum_services_status(const char *desc, SVCCTL_R_ENUM_SERVICES_STATUS *r_u, prs_struct *ps, int depth);
-bool svcctl_io_q_query_service_config(const char *desc, SVCCTL_Q_QUERY_SERVICE_CONFIG *q_u, prs_struct *ps, int depth);
-bool svcctl_io_r_query_service_config(const char *desc, SVCCTL_R_QUERY_SERVICE_CONFIG *r_u, prs_struct *ps, int depth);
bool svcctl_io_q_query_service_config2(const char *desc, SVCCTL_Q_QUERY_SERVICE_CONFIG2 *q_u, prs_struct *ps, int depth);
void init_service_description_buffer(SERVICE_DESCRIPTION *desc, const char *service_desc );
bool svcctl_io_service_description( const char *desc, SERVICE_DESCRIPTION *description, RPC_BUFFER *buffer, int depth );
@@ -8718,26 +8680,16 @@ bool api_pipe_request(pipes_struct *p);
pipes_struct *get_first_internal_pipe(void);
pipes_struct *get_next_internal_pipe(pipes_struct *p);
void set_pipe_handle_offset(int max_open_files);
-void reset_chain_p(void);
void init_rpc_pipe_hnd(void);
-smb_np_struct *open_rpc_pipe_p(const char *pipe_name,
- connection_struct *conn, uint16 vuid);
-ssize_t write_to_pipe(smb_np_struct *p, char *data, size_t n);
-ssize_t read_from_pipe(smb_np_struct *p, char *data, size_t n,
- bool *is_data_outstanding);
-bool wait_rpc_pipe_hnd_state(smb_np_struct *p, uint16 priority);
-bool set_rpc_pipe_hnd_state(smb_np_struct *p, uint16 device_state);
-bool close_rpc_pipe_hnd(smb_np_struct *p);
-void pipe_close_conn(connection_struct *conn);
-smb_np_struct *get_rpc_pipe_p(uint16 pnum);
-smb_np_struct *get_rpc_pipe(int pnum);
-struct pipes_struct *make_internal_rpc_pipe_p(const char *pipe_name,
- const char *client_address,
- struct auth_serversupplied_info *server_info,
- uint16_t vuid);
-ssize_t read_from_internal_pipe(struct pipes_struct *p, char *data, size_t n,
- bool *is_data_outstanding);
-ssize_t write_to_internal_pipe(struct pipes_struct *p, char *data, size_t n);
+
+bool fsp_is_np(struct files_struct *fsp);
+NTSTATUS np_open(struct smb_request *smb_req, struct connection_struct *conn,
+ const char *name, struct files_struct **pfsp);
+NTSTATUS np_write(struct files_struct *fsp, uint8_t *data, size_t len,
+ ssize_t *nwritten);
+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 */
@@ -9135,7 +9087,6 @@ WERROR _svcctl_ControlService(pipes_struct *p,
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_config( pipes_struct *p, SVCCTL_Q_QUERY_SERVICE_CONFIG *q_u, SVCCTL_R_QUERY_SERVICE_CONFIG *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);
@@ -9358,16 +9309,16 @@ bool push_blocking_lock_request( struct byte_range_lock *br_lck,
uint32 lock_pid,
enum brl_type lock_type,
enum brl_flavour lock_flav,
- SMB_BIG_UINT offset,
- SMB_BIG_UINT count,
+ uint64_t offset,
+ uint64_t count,
uint32 blocking_pid);
void cancel_pending_lock_requests_by_fid(files_struct *fsp, struct byte_range_lock *br_lck);
void remove_pending_lock_requests_by_mid(int mid);
bool blocking_lock_was_deferred(int mid);
bool blocking_lock_cancel(files_struct *fsp,
uint32 lock_pid,
- SMB_BIG_UINT offset,
- SMB_BIG_UINT count,
+ uint64_t offset,
+ uint64_t count,
enum brl_flavour lock_flav,
unsigned char locktype,
NTSTATUS err);
@@ -9396,7 +9347,8 @@ NTSTATUS change_oem_password(struct samu *hnd, char *old_passwd, char *new_passw
/* The following definitions come from smbd/close.c */
void set_close_write_time(struct files_struct *fsp, struct timespec ts);
-NTSTATUS close_file(files_struct *fsp, enum file_close_type close_type);
+NTSTATUS close_file(struct smb_request *req, files_struct *fsp,
+ enum file_close_type close_type);
void msg_close_file(struct messaging_context *msg_ctx,
void *private_data,
uint32_t msg_type,
@@ -9429,19 +9381,17 @@ int count_all_current_connections(void);
bool claim_connection(connection_struct *conn, const char *name,
uint32 msg_flags);
bool register_message_flags(bool doreg, uint32 msg_flags);
-bool store_pipe_opendb( smb_np_struct *p );
-bool delete_pipe_opendb( smb_np_struct *p );
/* The following definitions come from smbd/dfree.c */
-SMB_BIG_UINT sys_disk_free(connection_struct *conn, const char *path, bool small_query,
- SMB_BIG_UINT *bsize,SMB_BIG_UINT *dfree,SMB_BIG_UINT *dsize);
-SMB_BIG_UINT get_dfree_info(connection_struct *conn,
+uint64_t sys_disk_free(connection_struct *conn, const char *path, bool small_query,
+ uint64_t *bsize,uint64_t *dfree,uint64_t *dsize);
+uint64_t get_dfree_info(connection_struct *conn,
const char *path,
bool small_query,
- SMB_BIG_UINT *bsize,
- SMB_BIG_UINT *dfree,
- SMB_BIG_UINT *dsize);
+ uint64_t *bsize,
+ uint64_t *dfree,
+ uint64_t *dsize);
/* The following definitions come from smbd/dir.c */
@@ -9555,13 +9505,13 @@ void reply_unix_error(struct smb_request *req, uint8 defclass, uint32 defcode,
/* The following definitions come from smbd/fake_file.c */
enum FAKE_FILE_TYPE is_fake_file(const char *fname);
-NTSTATUS open_fake_file(connection_struct *conn,
+NTSTATUS open_fake_file(struct smb_request *req, connection_struct *conn,
uint16_t current_vuid,
enum FAKE_FILE_TYPE fake_file_type,
const char *fname,
uint32 access_mask,
files_struct **result);
-NTSTATUS close_fake_file(files_struct *fsp);
+NTSTATUS close_fake_file(struct smb_request *req, files_struct *fsp);
/* The following definitions come from smbd/file_access.c */
@@ -9602,7 +9552,8 @@ NTSTATUS check_name(connection_struct *conn, const char *name);
/* The following definitions come from smbd/files.c */
-NTSTATUS file_new(connection_struct *conn, files_struct **result);
+NTSTATUS file_new(struct smb_request *req, connection_struct *conn,
+ files_struct **result);
void file_close_conn(connection_struct *conn);
void file_close_pid(uint16 smbpid, int vuid);
void file_init(void);
@@ -9615,15 +9566,12 @@ files_struct *file_find_di_first(struct file_id id);
files_struct *file_find_di_next(files_struct *start_fsp);
files_struct *file_find_print(void);
void file_sync_all(connection_struct *conn);
-void file_free(files_struct *fsp);
+void file_free(struct smb_request *req, files_struct *fsp);
files_struct *file_fnum(uint16 fnum);
-files_struct *file_fsp(uint16 fid);
-void file_chain_reset(void);
-NTSTATUS dup_file_fsp(files_struct *fsp,
- uint32 access_mask,
- uint32 share_access,
- uint32 create_options,
- files_struct **result);
+files_struct *file_fsp(struct smb_request *req, uint16 fid);
+NTSTATUS dup_file_fsp(struct smb_request *req, files_struct *fsp,
+ uint32 access_mask, uint32 share_access,
+ uint32 create_options, files_struct **result);
/* The following definitions come from smbd/ipc.c */
@@ -9815,9 +9763,10 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
/* Information (FILE_EXISTS etc.) */
int *pinfo,
files_struct **result);
-NTSTATUS open_file_fchmod(connection_struct *conn, const char *fname,
+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(files_struct *fsp);
+NTSTATUS close_file_fchmod(struct smb_request *req, files_struct *fsp);
NTSTATUS open_directory(connection_struct *conn,
struct smb_request *req,
const char *fname,
@@ -9844,7 +9793,7 @@ NTSTATUS create_file_unixpath(connection_struct *conn,
uint32_t create_options,
uint32_t file_attributes,
uint32_t oplock_request,
- SMB_BIG_UINT allocation_size,
+ uint64_t allocation_size,
struct security_descriptor *sd,
struct ea_list *ea_list,
@@ -9861,7 +9810,7 @@ NTSTATUS create_file(connection_struct *conn,
uint32_t create_options,
uint32_t file_attributes,
uint32_t oplock_request,
- SMB_BIG_UINT allocation_size,
+ uint64_t allocation_size,
struct security_descriptor *sd,
struct ea_list *ea_list,
@@ -9988,18 +9937,18 @@ void smbd_process(void);
/* The following definitions come from smbd/quotas.c */
-bool disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize);
-bool disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize);
+bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize);
+bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize);
bool disk_quotas(const char *path,
- SMB_BIG_UINT *bsize,
- SMB_BIG_UINT *dfree,
- SMB_BIG_UINT *dsize);
-bool disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize);
-bool disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize);
-bool disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize);
-bool disk_quotas_vxfs(const char *name, char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize);
-bool disk_quotas(const char *path,SMB_BIG_UINT *bsize,SMB_BIG_UINT *dfree,SMB_BIG_UINT *dsize);
-bool disk_quotas(const char *path,SMB_BIG_UINT *bsize,SMB_BIG_UINT *dfree,SMB_BIG_UINT *dsize);
+ uint64_t *bsize,
+ uint64_t *dfree,
+ uint64_t *dsize);
+bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize);
+bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize);
+bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize);
+bool disk_quotas_vxfs(const char *name, char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize);
+bool disk_quotas(const char *path,uint64_t *bsize,uint64_t *dfree,uint64_t *dsize);
+bool disk_quotas(const char *path,uint64_t *bsize,uint64_t *dfree,uint64_t *dsize);
/* The following definitions come from smbd/reply.c */
@@ -10109,8 +10058,8 @@ NTSTATUS copy_file(TALLOC_CTX *ctx,
bool target_is_directory);
void reply_copy(struct smb_request *req);
uint32 get_lock_pid( char *data, int data_offset, bool large_file_format);
-SMB_BIG_UINT get_lock_count( char *data, int data_offset, bool large_file_format);
-SMB_BIG_UINT get_lock_offset( char *data, int data_offset, bool large_file_format, bool *err);
+uint64_t get_lock_count( char *data, int data_offset, bool large_file_format);
+uint64_t get_lock_offset( char *data, int data_offset, bool large_file_format, bool *err);
void reply_lockingX(struct smb_request *req);
void reply_readbmpx(struct smb_request *req);
void reply_readbs(struct smb_request *req);
@@ -10228,8 +10177,8 @@ int sys_statvfs(const char *path, vfs_statvfs_struct *statbuf);
/* The following definitions come from smbd/trans2.c */
-SMB_BIG_UINT smb_roundup(connection_struct *conn, SMB_BIG_UINT val);
-SMB_BIG_UINT get_allocation_size(connection_struct *conn, files_struct *fsp, const SMB_STRUCT_STAT *sbuf);
+uint64_t smb_roundup(connection_struct *conn, uint64_t val);
+uint64_t get_allocation_size(connection_struct *conn, files_struct *fsp, const SMB_STRUCT_STAT *sbuf);
NTSTATUS get_ea_value(TALLOC_CTX *mem_ctx, connection_struct *conn,
files_struct *fsp, const char *fname,
const char *ea_name, struct ea_struct *pea);
@@ -10313,7 +10262,7 @@ ssize_t vfs_pwrite_data(struct smb_request *req,
const char *buffer,
size_t N,
SMB_OFF_T offset);
-int vfs_allocate_file_space(files_struct *fsp, SMB_BIG_UINT len);
+int vfs_allocate_file_space(files_struct *fsp, uint64_t len);
int vfs_set_filelen(files_struct *fsp, SMB_OFF_T len);
int vfs_fill_sparse(files_struct *fsp, SMB_OFF_T len);
SMB_OFF_T vfs_transfer_file(files_struct *in, files_struct *out, SMB_OFF_T n);
diff --git a/source3/include/rbtree.h b/source3/include/rbtree.h
deleted file mode 100644
index 1cfd3463a0..0000000000
--- a/source3/include/rbtree.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- Red Black Trees
- (C) 1999 Andrea Arcangeli <andrea@suse.de>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- linux/include/linux/rbtree.h
-
- To use rbtrees you'll have to implement your own insert and search cores.
- This will avoid us to use callbacks and to drop drammatically performances.
- I know it's not the cleaner way, but in C (not in C++) to get
- performances and genericity...
-
- Some example of insert and search follows here. The search is a plain
- normal search over an ordered tree. The insert instead must be implemented
- int two steps: as first thing the code must insert the element in
- order as a red leaf in the tree, then the support library function
- rb_insert_color() must be called. Such function will do the
- not trivial work to rebalance the rbtree if necessary.
-
------------------------------------------------------------------------
-static inline struct page * rb_search_page_cache(struct inode * inode,
- unsigned long offset)
-{
- struct rb_node * n = inode->i_rb_page_cache.rb_node;
- struct page * page;
-
- while (n)
- {
- page = rb_entry(n, struct page, rb_page_cache);
-
- if (offset < page->offset)
- n = n->rb_left;
- else if (offset > page->offset)
- n = n->rb_right;
- else
- return page;
- }
- return NULL;
-}
-
-static inline struct page * __rb_insert_page_cache(struct inode * inode,
- unsigned long offset,
- struct rb_node * node)
-{
- struct rb_node ** p = &inode->i_rb_page_cache.rb_node;
- struct rb_node * parent = NULL;
- struct page * page;
-
- while (*p)
- {
- parent = *p;
- page = rb_entry(parent, struct page, rb_page_cache);
-
- if (offset < page->offset)
- p = &(*p)->rb_left;
- else if (offset > page->offset)
- p = &(*p)->rb_right;
- else
- return page;
- }
-
- rb_link_node(node, parent, p);
-
- return NULL;
-}
-
-static inline struct page * rb_insert_page_cache(struct inode * inode,
- unsigned long offset,
- struct rb_node * node)
-{
- struct page * ret;
- if ((ret = __rb_insert_page_cache(inode, offset, node)))
- goto out;
- rb_insert_color(node, &inode->i_rb_page_cache);
- out:
- return ret;
-}
------------------------------------------------------------------------
-*/
-
-#ifndef _LINUX_RBTREE_H
-#define _LINUX_RBTREE_H
-
-struct rb_node
-{
- unsigned long rb_parent_color;
- struct rb_node *rb_right;
- struct rb_node *rb_left;
-};
-
-struct rb_root
-{
- struct rb_node *rb_node;
-};
-
-
-#define RB_ROOT (struct rb_root) { NULL, }
-
-#if 0
-#define rb_entry(ptr, type, member) container_of(ptr, type, member)
-#endif
-
-void rb_insert_color(struct rb_node *, struct rb_root *);
-void rb_erase(struct rb_node *, struct rb_root *);
-
-/* Find logical next and previous nodes in a tree */
-struct rb_node *rb_next(struct rb_node *);
-struct rb_node *rb_prev(struct rb_node *);
-struct rb_node *rb_first(struct rb_root *);
-struct rb_node *rb_last(struct rb_root *);
-
-/* Fast replacement of a single node without remove/rebalance/add/rebalance */
-extern void rb_replace_node(struct rb_node *victim, struct rb_node *new_node,
- struct rb_root *root);
-
-void rb_link_node(struct rb_node * node, struct rb_node * parent,
- struct rb_node ** rb_link);
-
-#endif /* _LINUX_RBTREE_H */
diff --git a/source3/include/rpc_lsa.h b/source3/include/rpc_lsa.h
index b4021afd0a..1dc5ba4a7b 100644
--- a/source3/include/rpc_lsa.h
+++ b/source3/include/rpc_lsa.h
@@ -39,6 +39,7 @@
#define LSA_POLICY_READ ( STANDARD_RIGHTS_READ_ACCESS |\
+ LSA_POLICY_VIEW_LOCAL_INFORMATION |\
LSA_POLICY_VIEW_AUDIT_INFORMATION |\
LSA_POLICY_GET_PRIVATE_INFORMATION)
diff --git a/source3/include/rpc_svcctl.h b/source3/include/rpc_svcctl.h
index aa1d1662c8..0e31a53e32 100644
--- a/source3/include/rpc_svcctl.h
+++ b/source3/include/rpc_svcctl.h
@@ -142,18 +142,6 @@ typedef struct {
} ENUM_SERVICES_STATUS;
typedef struct {
- uint32 service_type;
- uint32 start_type;
- uint32 error_control;
- UNISTR2 *executablepath;
- UNISTR2 *loadordergroup;
- uint32 tag_id;
- UNISTR2 *dependencies;
- UNISTR2 *startname;
- UNISTR2 *displayname;
-} SERVICE_CONFIG;
-
-typedef struct {
uint32 unknown;
UNISTR description;
} SERVICE_DESCRIPTION;
@@ -216,20 +204,6 @@ typedef struct {
typedef struct {
POLICY_HND handle;
- uint32 buffer_size;
-} SVCCTL_Q_QUERY_SERVICE_CONFIG;
-
-typedef struct {
- SERVICE_CONFIG config;
- uint32 needed;
- WERROR status;
-} SVCCTL_R_QUERY_SERVICE_CONFIG;
-
-
-/**************************/
-
-typedef struct {
- POLICY_HND handle;
uint32 level;
uint32 buffer_size;
} SVCCTL_Q_QUERY_SERVICE_CONFIG2;
diff --git a/source3/include/smb.h b/source3/include/smb.h
index ef98b5e1b5..732bef1212 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -174,9 +174,6 @@ typedef uint32 codepoint_t;
/* pipe string names */
#define PIPE_LANMAN "\\PIPE\\LANMAN"
-/* 64 bit time (100usec) since ????? - cifs6.txt, section 3.5, page 30 */
-typedef uint64_t NTTIME;
-
#define MAX_HOURS_LEN 32
#ifndef MAXSUBAUTHS
@@ -249,15 +246,6 @@ struct id_map {
enum id_mapping status;
};
-/* used to hold an arbitrary blob of data */
-typedef struct data_blob {
- uint8 *data;
- size_t length;
- void (*free)(struct data_blob *data_blob);
-} DATA_BLOB;
-
-extern const DATA_BLOB data_blob_null;
-
#include "librpc/gen_ndr/misc.h"
#include "librpc/gen_ndr/security.h"
#include "librpc/ndr/libndr.h"
@@ -372,7 +360,7 @@ typedef struct {
struct fd_handle {
size_t ref_count;
int fd;
- SMB_BIG_UINT position_information;
+ uint64_t position_information;
SMB_OFF_T pos;
uint32 private_options; /* NT Create options, but we only look at
* NTCREATEX_OPTIONS_PRIVATE_DENY_DOS and
@@ -448,7 +436,7 @@ typedef struct files_struct {
unsigned int num_smb_operations;
uint16 rap_print_jobid;
struct file_id file_id;
- SMB_BIG_UINT initial_allocation_size; /* Faked up initial allocation on disk. */
+ uint64_t initial_allocation_size; /* Faked up initial allocation on disk. */
mode_t mode;
uint16 file_pid;
uint16 vuid;
@@ -559,10 +547,10 @@ struct stream_struct {
struct dfree_cached_info {
time_t last_dfree_time;
- SMB_BIG_UINT dfree_ret;
- SMB_BIG_UINT bsize;
- SMB_BIG_UINT dfree;
- SMB_BIG_UINT dsize;
+ uint64_t dfree_ret;
+ uint64_t bsize;
+ uint64_t dfree;
+ uint64_t dsize;
};
struct dptr_struct;
@@ -648,6 +636,7 @@ struct smb_request {
size_t unread_bytes;
bool encrypted;
connection_struct *conn;
+ struct files_struct *chain_fsp;
};
/* Defines for the sent_oplock_break field above. */
diff --git a/source3/include/smbprofile.h b/source3/include/smbprofile.h
index f58a6452bf..8945708ca3 100644
--- a/source3/include/smbprofile.h
+++ b/source3/include/smbprofile.h
@@ -782,7 +782,7 @@ extern bool do_profile_times;
extern clockid_t __profile_clock;
-static inline SMB_BIG_UINT profile_timestamp(void)
+static inline uint64_t profile_timestamp(void)
{
struct timespec ts;
@@ -797,7 +797,7 @@ static inline SMB_BIG_UINT profile_timestamp(void)
#else
-static inline SMB_BIG_UINT profile_timestamp(void)
+static inline uint64_t profile_timestamp(void)
{
struct timeval tv;
GetTimeOfDay(&tv);
@@ -830,14 +830,14 @@ static inline SMB_BIG_UINT profile_timestamp(void)
}
#define START_PROFILE(x) \
- SMB_BIG_UINT __profstamp_##x = 0; \
+ uint64_t __profstamp_##x = 0; \
if (do_profile_flag) { \
__profstamp_##x = do_profile_times ? profile_timestamp() : 0;\
INC_PROFILE_COUNT(x##_count); \
}
#define START_PROFILE_BYTES(x,n) \
- SMB_BIG_UINT __profstamp_##x = 0; \
+ uint64_t __profstamp_##x = 0; \
if (do_profile_flag) { \
__profstamp_##x = do_profile_times ? profile_timestamp() : 0;\
INC_PROFILE_COUNT(x##_count); \
diff --git a/source3/include/sysquotas.h b/source3/include/sysquotas.h
index a0754a3737..71d5e9b264 100644
--- a/source3/include/sysquotas.h
+++ b/source3/include/sysquotas.h
@@ -37,8 +37,8 @@
Some stuff for the sys_quota api.
**************************************************/
-#define SMB_QUOTAS_NO_LIMIT ((SMB_BIG_UINT)(0))
-#define SMB_QUOTAS_NO_SPACE ((SMB_BIG_UINT)(1))
+#define SMB_QUOTAS_NO_LIMIT ((uint64_t)(0))
+#define SMB_QUOTAS_NO_SPACE ((uint64_t)(1))
#define SMB_QUOTAS_SET_NO_LIMIT(dp) \
{\
@@ -58,14 +58,14 @@
typedef struct _SMB_DISK_QUOTA {
enum SMB_QUOTA_TYPE qtype;
- SMB_BIG_UINT bsize;
- SMB_BIG_UINT hardlimit; /* In bsize units. */
- SMB_BIG_UINT softlimit; /* In bsize units. */
- SMB_BIG_UINT curblocks; /* In bsize units. */
- SMB_BIG_UINT ihardlimit; /* inode hard limit. */
- SMB_BIG_UINT isoftlimit; /* inode soft limit. */
- SMB_BIG_UINT curinodes; /* Current used inodes. */
- uint32 qflags;
+ uint64_t bsize;
+ uint64_t hardlimit; /* In bsize units. */
+ uint64_t softlimit; /* In bsize units. */
+ uint64_t curblocks; /* In bsize units. */
+ uint64_t ihardlimit; /* inode hard limit. */
+ uint64_t isoftlimit; /* inode soft limit. */
+ uint64_t curinodes; /* Current used inodes. */
+ uint32_t qflags;
} SMB_DISK_QUOTA;
#ifndef QUOTABLOCK_SIZE
diff --git a/source3/include/util_tdb.h b/source3/include/util_tdb.h
index fcc723c511..107d0b1bd5 100644
--- a/source3/include/util_tdb.h
+++ b/source3/include/util_tdb.h
@@ -48,34 +48,34 @@ struct tdb_validation_status {
typedef int (*tdb_validate_data_func)(TDB_CONTEXT *the_tdb, TDB_DATA kbuf, TDB_DATA dbuf, void *state);
-TDB_DATA make_tdb_data(const uint8 *dptr, size_t dsize);
+TDB_DATA make_tdb_data(const uint8_t *dptr, size_t dsize);
TDB_DATA string_tdb_data(const char *string);
TDB_DATA string_term_tdb_data(const char *string);
TDB_LIST_NODE *tdb_search_keys(struct tdb_context*, const char*);
void tdb_search_list_free(TDB_LIST_NODE*);
-int tdb_chainlock_with_timeout( TDB_CONTEXT *tdb, TDB_DATA key,
+int tdb_chainlock_with_timeout( struct tdb_context *tdb, TDB_DATA key,
unsigned int timeout);
int tdb_lock_bystring(struct tdb_context *tdb, const char *keyval);
-int tdb_lock_bystring_with_timeout(TDB_CONTEXT *tdb, const char *keyval,
+int tdb_lock_bystring_with_timeout(struct tdb_context *tdb, const char *keyval,
int timeout);
void tdb_unlock_bystring(struct tdb_context *tdb, const char *keyval);
int tdb_read_lock_bystring_with_timeout(TDB_CONTEXT *tdb, const char *keyval,
unsigned int timeout);
-void tdb_read_unlock_bystring(TDB_CONTEXT *tdb, const char *keyval);
-
-int32 tdb_fetch_int32_byblob(TDB_CONTEXT *tdb, TDB_DATA key);
-int32 tdb_fetch_int32(struct tdb_context *tdb, const char *keystr);
-bool tdb_store_uint32_byblob(TDB_CONTEXT *tdb, TDB_DATA key, uint32 value);
-bool tdb_store_uint32(struct tdb_context *tdb, const char *keystr, uint32 value);
-int tdb_store_int32_byblob(TDB_CONTEXT *tdb, TDB_DATA key, int32 v);
-int tdb_store_int32(struct tdb_context *tdb, const char *keystr, int32 v);
-bool tdb_fetch_uint32_byblob(TDB_CONTEXT *tdb, TDB_DATA key, uint32 *value);
-bool tdb_fetch_uint32(struct tdb_context *tdb, const char *keystr, uint32 *value);
-int32 tdb_change_int32_atomic(struct tdb_context *tdb, const char *keystr, int32 *oldval, int32 change_val);
-bool tdb_change_uint32_atomic(TDB_CONTEXT *tdb, const char *keystr,
- uint32 *oldval, uint32 change_val);
+void tdb_read_unlock_bystring(struct tdb_context *tdb, const char *keyval);
+
+int32_t tdb_fetch_int32_byblob(struct tdb_context *tdb, TDB_DATA key);
+int32_t tdb_fetch_int32(struct tdb_context *tdb, const char *keystr);
+bool tdb_store_uint32_byblob(struct tdb_context *tdb, TDB_DATA key, uint32_t value);
+bool tdb_store_uint32(struct tdb_context *tdb, const char *keystr, uint32_t value);
+int tdb_store_int32_byblob(struct tdb_context *tdb, TDB_DATA key, int32_t v);
+int tdb_store_int32(struct tdb_context *tdb, const char *keystr, int32_t v);
+bool tdb_fetch_uint32_byblob(struct tdb_context *tdb, TDB_DATA key, uint32_t *value);
+bool tdb_fetch_uint32(struct tdb_context *tdb, const char *keystr, uint32_t *value);
+int32_t tdb_change_int32_atomic(struct tdb_context *tdb, const char *keystr, int32_t *oldval, int32_t change_val);
+bool tdb_change_uint32_atomic(struct tdb_context *tdb, const char *keystr,
+ uint32_t *oldval, uint32_t change_val);
int tdb_store_bystring(struct tdb_context *tdb, const char *keystr, TDB_DATA data, int flags);
int tdb_trans_store_bystring(TDB_CONTEXT *tdb, const char *keystr,
diff --git a/source3/include/vfs.h b/source3/include/vfs.h
index a3d38f6a25..4cedb4a9c6 100644
--- a/source3/include/vfs.h
+++ b/source3/include/vfs.h
@@ -109,8 +109,9 @@
/* Changed to version 23 - remove set_nt_acl call. This can only be done via an
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. */
-#define SMB_VFS_INTERFACE_VERSION 24
+#define SMB_VFS_INTERFACE_VERSION 25
/* to bug old modules which are trying to compile with the old functions */
@@ -282,8 +283,8 @@ struct vfs_ops {
int (*connect_fn)(struct vfs_handle_struct *handle, const char *service, const char *user);
void (*disconnect)(struct vfs_handle_struct *handle);
- SMB_BIG_UINT (*disk_free)(struct vfs_handle_struct *handle, const char *path, bool small_query, SMB_BIG_UINT *bsize,
- SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize);
+ uint64_t (*disk_free)(struct vfs_handle_struct *handle, const char *path, bool small_query, uint64_t *bsize,
+ uint64_t *dfree, uint64_t *dsize);
int (*get_quota)(struct vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt);
int (*set_quota)(struct vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt);
int (*get_shadow_copy_data)(struct vfs_handle_struct *handle, struct files_struct *fsp, SHADOW_COPY_DATA *shadow_copy_data, bool labels);
@@ -625,14 +626,14 @@ typedef struct vfs_statvfs_struct {
if no distinction is made return the same value in each.
*/
- SMB_BIG_UINT TotalBlocks;
- SMB_BIG_UINT BlocksAvail; /* bfree */
- SMB_BIG_UINT UserBlocksAvail; /* bavail */
+ uint64_t TotalBlocks;
+ uint64_t BlocksAvail; /* bfree */
+ uint64_t UserBlocksAvail; /* bavail */
/* For undefined Node fields or FSID return -1 */
- SMB_BIG_UINT TotalFileNodes;
- SMB_BIG_UINT FreeFileNodes;
- SMB_BIG_UINT FsIdentifier; /* fsid */
+ uint64_t TotalFileNodes;
+ uint64_t FreeFileNodes;
+ uint64_t FsIdentifier; /* fsid */
/* NB Namelen comes from FILE_SYSTEM_ATTRIBUTE_INFO call */
/* NB flags can come from FILE_SYSTEM_DEVICE_INFO call */
diff --git a/source3/include/xfile.h b/source3/include/xfile.h
deleted file mode 100644
index ffe4481a64..0000000000
--- a/source3/include/xfile.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- Unix SMB/CIFS implementation.
- stdio replacement
- Copyright (C) Andrew Tridgell 2001
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef _XFILE_H_
-#define _XFILE_H_
-/*
- see xfile.c for explanations
-*/
-
-typedef struct {
- int fd;
- char *buf;
- char *next;
- int bufsize;
- int bufused;
- int open_flags;
- int buftype;
- int flags;
-} XFILE;
-
-extern XFILE *x_stdin, *x_stdout, *x_stderr;
-
-/* buffering type */
-#define X_IOFBF 0
-#define X_IOLBF 1
-#define X_IONBF 2
-
-#define x_getc(f) x_fgetc(f)
-
-int x_vfprintf(XFILE *f, const char *format, va_list ap) PRINTF_ATTRIBUTE(2, 0);
-int x_fprintf(XFILE *f, const char *format, ...) PRINTF_ATTRIBUTE(2, 3);
-#endif /* _XFILE_H_ */
diff --git a/source3/intl/lang_tdb.c b/source3/intl/lang_tdb.c
index 499b9eb87d..ac7e9dda40 100644
--- a/source3/intl/lang_tdb.c
+++ b/source3/intl/lang_tdb.c
@@ -33,14 +33,14 @@ static bool load_msg(const char *msg_file)
char *msgid, *msgstr;
TDB_DATA data;
- lines = file_lines_load(msg_file, &num_lines,0);
+ lines = file_lines_load(msg_file, &num_lines, 0, NULL);
if (!lines) {
return False;
}
if (tdb_lockall(tdb) != 0) {
- file_lines_free(lines);
+ TALLOC_FREE(lines);
return False;
}
@@ -68,7 +68,7 @@ static bool load_msg(const char *msg_file)
}
}
- file_lines_free(lines);
+ TALLOC_FREE(lines);
tdb_unlockall(tdb);
return True;
diff --git a/source3/lib/access.c b/source3/lib/access.c
index 6a445f8139..966d8ce87c 100644
--- a/source3/lib/access.c
+++ b/source3/lib/access.c
@@ -104,7 +104,7 @@ static bool string_match(const char *tok,const char *s)
if (memcache_lookup(
NULL, SINGLETON_CACHE,
- data_blob_string_const("yp_default_domain"),
+ data_blob_string_const_null("yp_default_domain"),
&tmp)) {
SMB_ASSERT(tmp.length > 0);
@@ -116,8 +116,8 @@ static bool string_match(const char *tok,const char *s)
memcache_add(
NULL, SINGLETON_CACHE,
- data_blob_string_const("yp_default_domain"),
- data_blob_string_const(mydomain?mydomain:""));
+ data_blob_string_const_null("yp_default_domain"),
+ data_blob_string_const_null(mydomain?mydomain:""));
}
if (!mydomain) {
diff --git a/source3/lib/arc4.c b/source3/lib/arc4.c
deleted file mode 100644
index af2564b6c0..0000000000
--- a/source3/lib/arc4.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- Unix SMB/CIFS implementation.
-
- An implementation of arc4.
-
- Copyright (C) Jeremy Allison 2005.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "includes.h"
-
-/*****************************************************************
- Initialize state for an arc4 crypt/decrpyt.
- arc4 state is 258 bytes - last 2 bytes are the index bytes.
-*****************************************************************/
-
-void smb_arc4_init(unsigned char arc4_state_out[258], const unsigned char *key, size_t keylen)
-{
- size_t ind;
- unsigned char j = 0;
-
- for (ind = 0; ind < 256; ind++) {
- arc4_state_out[ind] = (unsigned char)ind;
- }
-
- for( ind = 0; ind < 256; ind++) {
- unsigned char tc;
-
- j += (arc4_state_out[ind] + key[ind%keylen]);
-
- tc = arc4_state_out[ind];
- arc4_state_out[ind] = arc4_state_out[j];
- arc4_state_out[j] = tc;
- }
- arc4_state_out[256] = 0;
- arc4_state_out[257] = 0;
-}
-
-/*****************************************************************
- Do the arc4 crypt/decrpyt.
- arc4 state is 258 bytes - last 2 bytes are the index bytes.
-*****************************************************************/
-
-void smb_arc4_crypt(unsigned char arc4_state_inout[258], unsigned char *data, size_t len)
-{
- unsigned char index_i = arc4_state_inout[256];
- unsigned char index_j = arc4_state_inout[257];
- size_t ind;
-
- for( ind = 0; ind < len; ind++) {
- unsigned char tc;
- unsigned char t;
-
- index_i++;
- index_j += arc4_state_inout[index_i];
-
- tc = arc4_state_inout[index_i];
- arc4_state_inout[index_i] = arc4_state_inout[index_j];
- arc4_state_inout[index_j] = tc;
-
- t = arc4_state_inout[index_i] + arc4_state_inout[index_j];
- data[ind] = data[ind] ^ arc4_state_inout[t];
- }
-
- arc4_state_inout[256] = index_i;
- arc4_state_inout[257] = index_j;
-}
diff --git a/source3/lib/charcnv.c b/source3/lib/charcnv.c
index 485212b100..3ec3220900 100644
--- a/source3/lib/charcnv.c
+++ b/source3/lib/charcnv.c
@@ -1166,7 +1166,7 @@ static size_t pull_ascii_base_talloc(TALLOC_CTX *ctx,
int flags)
{
char *dest = NULL;
- size_t converted_size;
+ size_t dest_len;
#ifdef DEVELOPER
/* Ensure we never use the braindead "malloc" varient. */
@@ -1177,6 +1177,10 @@ static size_t pull_ascii_base_talloc(TALLOC_CTX *ctx,
*ppdest = NULL;
+ if (!src_len) {
+ return 0;
+ }
+
if (flags & STR_TERMINATE) {
if (src_len == (size_t)-1) {
src_len = strlen((const char *)src) + 1;
@@ -1194,18 +1198,41 @@ static size_t pull_ascii_base_talloc(TALLOC_CTX *ctx,
(unsigned int)src_len);
smb_panic(msg);
}
+ } else {
+ /* Can't have an unlimited length
+ * non STR_TERMINATE'd.
+ */
+ if (src_len == (size_t)-1) {
+ errno = EINVAL;
+ return 0;
+ }
}
+ /* src_len != -1 here. */
+
if (!convert_string_allocate(ctx, CH_DOS, CH_UNIX, src, src_len, &dest,
- &converted_size, True))
- {
- converted_size = 0;
+ &dest_len, True)) {
+ dest_len = 0;
}
- if (converted_size && dest) {
+ if (dest_len && dest) {
/* Did we already process the terminating zero ? */
- if (dest[converted_size - 1] != 0) {
- dest[converted_size - 1] = 0;
+ if (dest[dest_len-1] != 0) {
+ size_t size = talloc_get_size(dest);
+ /* Have we got space to append the '\0' ? */
+ if (size <= dest_len) {
+ /* No, realloc. */
+ dest = TALLOC_REALLOC_ARRAY(ctx, dest, char,
+ dest_len+1);
+ if (!dest) {
+ /* talloc fail. */
+ dest_len = (size_t)-1;
+ return 0;
+ }
+ }
+ /* Yay - space ! */
+ dest[dest_len] = '\0';
+ dest_len++;
}
} else if (dest) {
dest[0] = 0;
@@ -1562,21 +1589,26 @@ size_t pull_ucs2_base_talloc(TALLOC_CTX *ctx,
if (src_len >= 1024*1024) {
smb_panic("Bad src length in pull_ucs2_base_talloc\n");
}
+ } else {
+ /* Can't have an unlimited length
+ * non STR_TERMINATE'd.
+ */
+ if (src_len == (size_t)-1) {
+ errno = EINVAL;
+ return 0;
+ }
}
+ /* src_len != -1 here. */
+
/* ucs2 is always a multiple of 2 bytes */
- if (src_len != (size_t)-1) {
- src_len &= ~1;
- }
+ src_len &= ~1;
if (!convert_string_talloc(ctx, CH_UTF16LE, CH_UNIX, src, src_len,
(void *)&dest, &dest_len, True)) {
dest_len = 0;
}
- if (src_len == (size_t)-1)
- src_len = dest_len*2;
-
if (dest_len) {
/* Did we already process the terminating zero ? */
if (dest[dest_len-1] != 0) {
diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c
index 5075476e94..10a65c5bcc 100644
--- a/source3/lib/ctdbd_conn.c
+++ b/source3/lib/ctdbd_conn.c
@@ -155,7 +155,7 @@ static NTSTATUS ctdbd_connect(TALLOC_CTX *mem_ctx,
* Do we have a complete ctdb packet in the queue?
*/
-static bool ctdb_req_complete(const struct data_blob *data,
+static bool ctdb_req_complete(const DATA_BLOB *data,
size_t *length,
void *private_data)
{
@@ -220,7 +220,7 @@ struct req_pull_state {
* Pull a ctdb request out of the incoming packet queue
*/
-static NTSTATUS ctdb_req_pull(const struct data_blob *data,
+static NTSTATUS ctdb_req_pull(const DATA_BLOB *data,
void *private_data)
{
struct req_pull_state *state = (struct req_pull_state *)private_data;
@@ -497,7 +497,7 @@ NTSTATUS ctdbd_messaging_connection(TALLOC_CTX *mem_ctx,
/*
* Packet handler to receive and handle a ctdb message
*/
-static NTSTATUS ctdb_handle_message(const struct data_blob *data,
+static NTSTATUS ctdb_handle_message(const DATA_BLOB *data,
void *private_data)
{
struct ctdbd_connection *conn = talloc_get_type_abort(
@@ -1025,7 +1025,7 @@ struct ctdbd_traverse_state {
* Handle a traverse record coming in on the ctdbd connection
*/
-static NTSTATUS ctdb_traverse_handler(const struct data_blob *blob,
+static NTSTATUS ctdb_traverse_handler(const DATA_BLOB *blob,
void *private_data)
{
struct ctdbd_traverse_state *state =
diff --git a/source3/lib/data_blob.c b/source3/lib/data_blob.c
deleted file mode 100644
index 66c5daf363..0000000000
--- a/source3/lib/data_blob.c
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- Unix SMB/CIFS implementation.
- Easy management of byte-length data
- Copyright (C) Andrew Tridgell 2001
- Copyright (C) Andrew Bartlett 2001
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "includes.h"
-
-const DATA_BLOB data_blob_null = { NULL, 0, NULL };
-
-/*******************************************************************
- Free() a data blob.
-*******************************************************************/
-
-static void free_data_blob(DATA_BLOB *d)
-{
- if ((d) && (d->free)) {
- SAFE_FREE(d->data);
- }
-}
-
-/*******************************************************************
- Construct a data blob, must be freed with data_blob_free().
- You can pass NULL for p and get a blank data blob
-*******************************************************************/
-
-DATA_BLOB data_blob(const void *p, size_t length)
-{
- DATA_BLOB ret;
-
- if (!length) {
- ZERO_STRUCT(ret);
- return ret;
- }
-
- if (p) {
- ret.data = (uint8 *)smb_xmemdup(p, length);
- } else {
- ret.data = SMB_XMALLOC_ARRAY(uint8, length);
- }
- ret.length = length;
- ret.free = free_data_blob;
- return ret;
-}
-
-/*******************************************************************
- Construct a data blob, using supplied TALLOC_CTX.
-*******************************************************************/
-
-DATA_BLOB data_blob_talloc(TALLOC_CTX *mem_ctx, const void *p, size_t length)
-{
- DATA_BLOB ret;
-
- if (!length) {
- ZERO_STRUCT(ret);
- return ret;
- }
-
- if (p) {
- ret.data = (uint8 *)TALLOC_MEMDUP(mem_ctx, p, length);
- if (ret.data == NULL)
- smb_panic("data_blob_talloc: TALLOC_MEMDUP failed");
- } else {
- ret.data = (uint8 *)TALLOC(mem_ctx, length);
- if (ret.data == NULL)
- smb_panic("data_blob_talloc: TALLOC failed");
- }
-
- ret.length = length;
- ret.free = NULL;
- return ret;
-}
-
-/*******************************************************************
- Free a data blob.
-*******************************************************************/
-
-void data_blob_free(DATA_BLOB *d)
-{
- if (d) {
- if (d->free) {
- (d->free)(d);
- }
- d->length = 0;
- }
-}
-
-/*******************************************************************
- Clear a DATA_BLOB's contents
-*******************************************************************/
-
-void data_blob_clear(DATA_BLOB *d)
-{
- if (d->data) {
- memset(d->data, 0, d->length);
- }
-}
-
-/*******************************************************************
- Free a data blob and clear its contents
-*******************************************************************/
-
-void data_blob_clear_free(DATA_BLOB *d)
-{
- data_blob_clear(d);
- data_blob_free(d);
-}
-
-/**
- useful for constructing data blobs in test suites, while
- avoiding const warnings
-**/
-DATA_BLOB data_blob_string_const(const char *str)
-{
- DATA_BLOB blob;
- blob.data = CONST_DISCARD(uint8 *, str);
- blob.length = strlen(str) + 1;
- blob.free = NULL;
- return blob;
-}
-
-/**
- * Create a new data blob from const data
- */
-DATA_BLOB data_blob_const(const void *p, size_t length)
-{
- DATA_BLOB blob;
- blob.data = CONST_DISCARD(uint8 *, p);
- blob.length = length;
- blob.free = NULL;
- return blob;
-}
-
-/**
- construct a zero data blob, using supplied TALLOC_CTX.
- use this sparingly as it initialises data - better to initialise
- yourself if you want specific data in the blob
-**/
-DATA_BLOB data_blob_talloc_zero(TALLOC_CTX *mem_ctx, size_t length)
-{
- DATA_BLOB blob = data_blob_talloc(mem_ctx, NULL, length);
- data_blob_clear(&blob);
- return blob;
-}
-
-/**
-print the data_blob as hex string
-**/
-_PUBLIC_ char *data_blob_hex_string(TALLOC_CTX *mem_ctx, const DATA_BLOB *blob)
-{
- int i;
- char *hex_string;
-
- hex_string = talloc_array(mem_ctx, char, (blob->length*2)+1);
- if (!hex_string) {
- return NULL;
- }
-
- for (i = 0; i < blob->length; i++)
- slprintf(&hex_string[i*2], 3, "%02X", blob->data[i]);
-
- hex_string[(blob->length*2)] = '\0';
- return hex_string;
-}
-
-
diff --git a/source3/lib/dbwrap_ctdb.c b/source3/lib/dbwrap_ctdb.c
index 2818634b14..38daa61b33 100644
--- a/source3/lib/dbwrap_ctdb.c
+++ b/source3/lib/dbwrap_ctdb.c
@@ -821,7 +821,7 @@ static int db_ctdb_record_destr(struct db_record* data)
? "Unlocking db %u key %s\n"
: "Unlocking db %u key %.20s\n",
(int)crec->ctdb_ctx->db_id,
- hex_encode(data, (unsigned char *)data->key.dptr,
+ hex_encode_talloc(data, (unsigned char *)data->key.dptr,
data->key.dsize)));
if (tdb_chainunlock(crec->ctdb_ctx->wtdb->tdb, data->key) != 0) {
@@ -871,7 +871,7 @@ static struct db_record *fetch_locked_internal(struct db_ctdb_ctx *ctx,
again:
if (DEBUGLEVEL >= 10) {
- char *keystr = hex_encode(result, key.dptr, key.dsize);
+ char *keystr = hex_encode_talloc(result, key.dptr, key.dsize);
DEBUG(10, (DEBUGLEVEL > 10
? "Locking db %u key %s\n"
: "Locking db %u key %.20s\n",
diff --git a/source3/lib/dbwrap_file.c b/source3/lib/dbwrap_file.c
index e3779de1e4..69ad8e4b20 100644
--- a/source3/lib/dbwrap_file.c
+++ b/source3/lib/dbwrap_file.c
@@ -105,7 +105,7 @@ static struct db_record *db_file_fetch_locked(struct db_context *db,
/* Cut to 8 bits */
file->hash = fsh(key.dptr, key.dsize);
- file->name = hex_encode(file, (unsigned char *)key.dptr, key.dsize);
+ file->name = hex_encode_talloc(file, (unsigned char *)key.dptr, key.dsize);
if (file->name == NULL) {
DEBUG(0, ("hex_encode failed\n"));
TALLOC_FREE(result);
diff --git a/source3/lib/dbwrap_rbt.c b/source3/lib/dbwrap_rbt.c
index b70ce3dfa0..6e09627223 100644
--- a/source3/lib/dbwrap_rbt.c
+++ b/source3/lib/dbwrap_rbt.c
@@ -18,7 +18,7 @@
*/
#include "includes.h"
-#include "rbtree.h"
+#include "../lib/util/rbtree.h"
#define DBWRAP_RBT_ALIGN(_size_) (((_size_)+15)&~15)
diff --git a/source3/lib/dbwrap_tdb.c b/source3/lib/dbwrap_tdb.c
index 7bdadd3770..4860c61ab0 100644
--- a/source3/lib/dbwrap_tdb.c
+++ b/source3/lib/dbwrap_tdb.c
@@ -31,14 +31,14 @@ static int db_tdb_record_destr(struct db_record* data)
struct db_tdb_ctx *ctx =
talloc_get_type_abort(data->private_data, struct db_tdb_ctx);
- /* This hex_encode() call allocates memory on data context. By way how current
+ /* This hex_encode_talloc() call allocates memory on data context. By way how current
__talloc_free() code works, it is OK to allocate in the destructor as
the children of data will be freed after call to the destructor and this
new 'child' will be caught and freed correctly.
*/
DEBUG(10, (DEBUGLEVEL > 10
? "Unlocking key %s\n" : "Unlocking key %.20s\n",
- hex_encode(data, (unsigned char *)data->key.dptr,
+ hex_encode_talloc(data, (unsigned char *)data->key.dptr,
data->key.dsize)));
if (tdb_chainunlock(ctx->wtdb->tdb, data->key) != 0) {
@@ -94,7 +94,7 @@ static struct db_record *db_tdb_fetch_locked(struct db_context *db,
/* Do not accidently allocate/deallocate w/o need when debug level is lower than needed */
if(DEBUGLEVEL >= 10) {
- char *keystr = hex_encode(NULL, (unsigned char*)key.dptr, key.dsize);
+ char *keystr = hex_encode_talloc(NULL, (unsigned char*)key.dptr, key.dsize);
DEBUG(10, (DEBUGLEVEL > 10
? "Locking key %s\n" : "Locking key %.20s\n",
keystr));
diff --git a/source3/lib/debug.c b/source3/lib/debug.c
index d91b55dd23..be2707b595 100644
--- a/source3/lib/debug.c
+++ b/source3/lib/debug.c
@@ -984,7 +984,7 @@ void dbgflush( void )
****************************************************************************/
-bool dbghdr(int level, int cls, const char *file, const char *func, int line)
+bool dbghdrclass(int level, int cls, const char *location, const char *func)
{
/* Ensure we don't lose any real errno value. */
int old_errno = errno;
@@ -1046,10 +1046,10 @@ bool dbghdr(int level, int cls, const char *file, const char *func, int line)
lp_debug_hires_timestamp()),
level, header_str);
} else {
- (void)Debug1( "[%s, %2d%s] %s:%s(%d)\n",
+ (void)Debug1( "[%s, %2d%s] %s(%s)\n",
current_timestring(debug_ctx(),
lp_debug_hires_timestamp()),
- level, header_str, file, func, line );
+ level, header_str, location, func );
}
}
@@ -1057,6 +1057,12 @@ bool dbghdr(int level, int cls, const char *file, const char *func, int line)
return( True );
}
+bool dbghdr(int level, const char *location, const char *func)
+{
+ /* For compatibility with Samba 4, which doesn't have debug classes */
+ return dbghdrclass(level, 0, location, func);
+}
+
/***************************************************************************
Add text to the body of the "current" debug message via the format buffer.
diff --git a/source3/lib/display_sec.c b/source3/lib/display_sec.c
index 5427a8173e..a0d93d6fe7 100644
--- a/source3/lib/display_sec.c
+++ b/source3/lib/display_sec.c
@@ -157,13 +157,13 @@ static void disp_sec_ace_object(struct security_ace_object *object)
{
if (object->flags & SEC_ACE_OBJECT_PRESENT) {
printf("Object type: SEC_ACE_OBJECT_PRESENT\n");
- printf("Object GUID: %s\n", smb_uuid_string(talloc_tos(),
- object->type.type));
+ printf("Object GUID: %s\n", GUID_string(talloc_tos(),
+ &object->type.type));
}
if (object->flags & SEC_ACE_OBJECT_INHERITED_PRESENT) {
printf("Object type: SEC_ACE_OBJECT_INHERITED_PRESENT\n");
- printf("Object GUID: %s\n", smb_uuid_string(talloc_tos(),
- object->inherited_type.inherited_type));
+ printf("Object GUID: %s\n", GUID_string(talloc_tos(),
+ &object->inherited_type.inherited_type));
}
}
diff --git a/source3/lib/dprintf.c b/source3/lib/dprintf.c
index a3bb5be43a..b3c830dd5b 100644
--- a/source3/lib/dprintf.c
+++ b/source3/lib/dprintf.c
@@ -41,7 +41,7 @@
msgstr = lang_msg(format);
if (!msgstr) return -1;
- VA_COPY(ap2, ap);
+ va_copy(ap2, ap);
ret = vasprintf(&p, msgstr, ap2);
diff --git a/source3/lib/events.c b/source3/lib/events.c
index f03138708b..8bbc9497ac 100644
--- a/source3/lib/events.c
+++ b/source3/lib/events.c
@@ -436,7 +436,7 @@ void dump_event_list(struct event_context *event_ctx)
te->event_name,
(unsigned long)te,
(int)evt.tv_sec,
- http_timestring(te->when.tv_sec)));
+ http_timestring(talloc_tos(), te->when.tv_sec)));
}
for (fe = event_ctx->fd_events; fe; fe = fe->next) {
diff --git a/source3/lib/fsusage.c b/source3/lib/fsusage.c
deleted file mode 100644
index 66ffb9f442..0000000000
--- a/source3/lib/fsusage.c
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- Unix SMB/CIFS implementation.
- functions to calculate the free disk space
- Copyright (C) Andrew Tridgell 1998-2000
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "includes.h"
-
-
-/* Return the number of TOSIZE-byte blocks used by
- BLOCKS FROMSIZE-byte blocks, rounding away from zero.
-*/
-static SMB_BIG_UINT adjust_blocks(SMB_BIG_UINT blocks, SMB_BIG_UINT fromsize, SMB_BIG_UINT tosize)
-{
- if (fromsize == tosize) { /* e.g., from 512 to 512 */
- return blocks;
- } else if (fromsize > tosize) { /* e.g., from 2048 to 512 */
- return blocks * (fromsize / tosize);
- } else { /* e.g., from 256 to 512 */
- /* Protect against broken filesystems... */
- if (fromsize == 0) {
- fromsize = tosize;
- }
- return (blocks + 1) / (tosize / fromsize);
- }
-}
-
-/* this does all of the system specific guff to get the free disk space.
- It is derived from code in the GNU fileutils package, but has been
- considerably mangled for use here
-
- results are returned in *dfree and *dsize, in 512 byte units
-*/
-int sys_fsusage(const char *path, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
-{
-#ifdef STAT_STATFS3_OSF1
-#define CONVERT_BLOCKS(B) adjust_blocks ((SMB_BIG_UINT)(B), (SMB_BIG_UINT)fsd.f_fsize, (SMB_BIG_UINT)512)
- struct statfs fsd;
-
- if (statfs (path, &fsd, sizeof (struct statfs)) != 0)
- return -1;
-#endif /* STAT_STATFS3_OSF1 */
-
-#ifdef STAT_STATFS2_FS_DATA /* Ultrix */
-#define CONVERT_BLOCKS(B) adjust_blocks ((SMB_BIG_UINT)(B), (SMB_BIG_UINT)1024, (SMB_BIG_UINT)512)
- struct fs_data fsd;
-
- if (statfs (path, &fsd) != 1)
- return -1;
-
- (*dsize) = CONVERT_BLOCKS (fsd.fd_req.btot);
- (*dfree) = CONVERT_BLOCKS (fsd.fd_req.bfreen);
-#endif /* STAT_STATFS2_FS_DATA */
-
-#ifdef STAT_STATFS2_BSIZE /* 4.3BSD, SunOS 4, HP-UX, AIX */
-#define CONVERT_BLOCKS(B) adjust_blocks ((SMB_BIG_UINT)(B), (SMB_BIG_UINT)fsd.f_bsize, (SMB_BIG_UINT)512)
- struct statfs fsd;
-
- if (statfs (path, &fsd) < 0)
- return -1;
-
-#ifdef STATFS_TRUNCATES_BLOCK_COUNTS
- /* In SunOS 4.1.2, 4.1.3, and 4.1.3_U1, the block counts in the
- struct statfs are truncated to 2GB. These conditions detect that
- truncation, presumably without botching the 4.1.1 case, in which
- the values are not truncated. The correct counts are stored in
- undocumented spare fields. */
- if (fsd.f_blocks == 0x1fffff && fsd.f_spare[0] > 0) {
- fsd.f_blocks = fsd.f_spare[0];
- fsd.f_bfree = fsd.f_spare[1];
- fsd.f_bavail = fsd.f_spare[2];
- }
-#endif /* STATFS_TRUNCATES_BLOCK_COUNTS */
-#endif /* STAT_STATFS2_BSIZE */
-
-
-#ifdef STAT_STATFS2_FSIZE /* 4.4BSD */
-#define CONVERT_BLOCKS(B) adjust_blocks ((SMB_BIG_UINT)(B), (SMB_BIG_UINT)fsd.f_fsize, (SMB_BIG_UINT)512)
-
- struct statfs fsd;
-
- if (statfs (path, &fsd) < 0)
- return -1;
-#endif /* STAT_STATFS2_FSIZE */
-
-#ifdef STAT_STATFS4 /* SVR3, Dynix, Irix, AIX */
-# if _AIX || defined(_CRAY)
-# define CONVERT_BLOCKS(B) adjust_blocks ((SMB_BIG_UINT)(B), (SMB_BIG_UINT)fsd.f_bsize, (SMB_BIG_UINT)512)
-# ifdef _CRAY
-# define f_bavail f_bfree
-# endif
-# else
-# define CONVERT_BLOCKS(B) ((SMB_BIG_UINT)B)
-# ifndef _SEQUENT_ /* _SEQUENT_ is DYNIX/ptx */
-# ifndef DOLPHIN /* DOLPHIN 3.8.alfa/7.18 has f_bavail */
-# define f_bavail f_bfree
-# endif
-# endif
-# endif
-
- struct statfs fsd;
-
- if (statfs (path, &fsd, sizeof fsd, 0) < 0)
- return -1;
- /* Empirically, the block counts on most SVR3 and SVR3-derived
- systems seem to always be in terms of 512-byte blocks,
- no matter what value f_bsize has. */
-
-#endif /* STAT_STATFS4 */
-
-#if defined(STAT_STATVFS) || defined(STAT_STATVFS64) /* SVR4 */
-#if defined HAVE_FRSIZE
-# define CONVERT_BLOCKS(B) \
- adjust_blocks ((SMB_BIG_UINT)(B), fsd.f_frsize ? (SMB_BIG_UINT)fsd.f_frsize : (SMB_BIG_UINT)fsd.f_bsize, (SMB_BIG_UINT)512)
-#else
-# define CONVERT_BLOCKS(B) \
- adjust_blocks ((SMB_BIG_UINT)(B), (SMB_BIG_UINT)fsd.f_bsize, (SMB_BIG_UINT)512)
-#endif
-
-#ifdef STAT_STATVFS64
- struct statvfs64 fsd;
- if (statvfs64(path, &fsd) < 0) return -1;
-#else
- struct statvfs fsd;
- if (statvfs(path, &fsd) < 0) return -1;
-#endif
-
- /* f_frsize isn't guaranteed to be supported. */
-
-#endif /* STAT_STATVFS */
-
-#ifndef CONVERT_BLOCKS
- /* we don't have any dfree code! */
- return -1;
-#else
-#if !defined(STAT_STATFS2_FS_DATA)
- /* !Ultrix */
- (*dsize) = CONVERT_BLOCKS (fsd.f_blocks);
- (*dfree) = CONVERT_BLOCKS (fsd.f_bavail);
-#endif /* not STAT_STATFS2_FS_DATA */
-#endif
-
- return 0;
-}
diff --git a/source3/lib/genrand.c b/source3/lib/genrand.c
index 4590b812c5..076a2fd518 100644
--- a/source3/lib/genrand.c
+++ b/source3/lib/genrand.c
@@ -21,7 +21,7 @@
#include "includes.h"
-static unsigned char smb_arc4_state[258];
+static struct arcfour_state smb_arc4_state;
static uint32 counter;
static bool done_reseed = False;
@@ -89,6 +89,7 @@ static void do_filehash(const char *fname, unsigned char *the_hash)
static int do_reseed(bool use_fd, int fd)
{
unsigned char seed_inbuf[40];
+ DATA_BLOB seed_blob = { seed_inbuf, 40 };
uint32 v1, v2; struct timeval tval; pid_t mypid;
struct passwd *pw;
int reseed_data = 0;
@@ -146,7 +147,7 @@ static int do_reseed(bool use_fd, int fd)
seed_inbuf[i] ^= ((char *)(&reseed_data))[i % sizeof(reseed_data)];
}
- smb_arc4_init(smb_arc4_state, seed_inbuf, sizeof(seed_inbuf));
+ arcfour_init(&smb_arc4_state, &seed_blob);
return -1;
}
@@ -155,7 +156,7 @@ static int do_reseed(bool use_fd, int fd)
Interface to the (hopefully) good crypto random number generator.
********************************************************************/
-void generate_random_buffer( unsigned char *out, int len)
+void generate_random_buffer(uint8_t *out, int len)
{
static int urand_fd = -1;
unsigned char md4_buf[64];
@@ -190,7 +191,7 @@ void generate_random_buffer( unsigned char *out, int len)
while(len > 0) {
int copy_len = len > 16 ? 16 : len;
- smb_arc4_crypt(smb_arc4_state, md4_buf, sizeof(md4_buf));
+ arcfour_crypt_sbox(&smb_arc4_state, md4_buf, sizeof(md4_buf));
mdfour(tmp_buf, md4_buf, sizeof(md4_buf));
memcpy(p, tmp_buf, copy_len);
p += copy_len;
@@ -204,15 +205,11 @@ void generate_random_buffer( unsigned char *out, int len)
static char c_list[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+_-#.,";
-char *generate_random_str(size_t len)
+char *generate_random_str(TALLOC_CTX *mem_ctx, size_t len)
{
- static unsigned char retstr[256];
+ unsigned char *retstr = talloc_zero_array(mem_ctx, unsigned char, len);
size_t i;
- memset(retstr, '\0', sizeof(retstr));
-
- if (len > sizeof(retstr)-1)
- len = sizeof(retstr) -1;
generate_random_buffer( retstr, len);
for (i = 0; i < len; i++)
retstr[i] = c_list[ retstr[i] % (sizeof(c_list)-1) ];
diff --git a/source3/lib/ldb/libldb.m4 b/source3/lib/ldb/libldb.m4
index 845563b4a1..df2075d4e3 100644
--- a/source3/lib/ldb/libldb.m4
+++ b/source3/lib/ldb/libldb.m4
@@ -1,33 +1 @@
SMB_ENABLE(ldb_sqlite3,$with_sqlite3_support)
-
-AC_MSG_CHECKING([for Python])
-
-PYTHON=
-
-AC_ARG_WITH(python,
-[ --with-python=PYTHONNAME build Python libraries],
-[ case "${withval-python}" in
- yes)
- PYTHON=python
- ;;
- no)
- PYTHON=
- ;;
- *)
- PYTHON=${withval-python}
- ;;
- esac ])
-
-if test x"$PYTHON" != "x"; then
- incdir=`python -c 'import sys; print "%s/include/python%d.%d" % (sys.prefix, sys.version_info[[0]], sys.version_info[[1]])'`
- CPPFLAGS="$CPPFLAGS -I $incdir"
-fi
-
-if test x"$PYTHON" != "x"; then
- AC_MSG_RESULT([${withval-python}])
-else
- AC_MSG_RESULT(no)
- SMB_ENABLE(swig_ldb, NO)
-fi
-
-AC_SUBST(PYTHON)
diff --git a/source3/lib/memcache.c b/source3/lib/memcache.c
index e1426bc811..9c892fedfa 100644
--- a/source3/lib/memcache.c
+++ b/source3/lib/memcache.c
@@ -18,7 +18,7 @@
*/
#include "memcache.h"
-#include "rbtree.h"
+#include "../lib/util/rbtree.h"
static struct memcache *global_cache;
diff --git a/source3/lib/netapi/group.c b/source3/lib/netapi/group.c
index c3fccb4840..8dba4b8838 100644
--- a/source3/lib/netapi/group.c
+++ b/source3/lib/netapi/group.c
@@ -1224,7 +1224,7 @@ WERROR NetGroupEnum_r(struct libnetapi_ctx *ctx,
}
if (r->out.total_entries) {
- *r->out.total_entries = domain_info->info2.num_groups;
+ *r->out.total_entries = domain_info->general.num_groups;
}
status = rpccli_samr_QueryDisplayInfo2(pipe_cli,
diff --git a/source3/lib/netapi/localgroup.c b/source3/lib/netapi/localgroup.c
index 25a3427bc1..5e738e1262 100644
--- a/source3/lib/netapi/localgroup.c
+++ b/source3/lib/netapi/localgroup.c
@@ -822,7 +822,7 @@ WERROR NetLocalGroupEnum_r(struct libnetapi_ctx *ctx,
}
if (r->out.total_entries) {
- *r->out.total_entries += builtin_info->info2.num_aliases;
+ *r->out.total_entries += builtin_info->general.num_aliases;
}
status = rpccli_samr_QueryDomainInfo(pipe_cli, ctx,
@@ -835,7 +835,7 @@ WERROR NetLocalGroupEnum_r(struct libnetapi_ctx *ctx,
}
if (r->out.total_entries) {
- *r->out.total_entries += domain_info->info2.num_aliases;
+ *r->out.total_entries += domain_info->general.num_aliases;
}
status = rpccli_samr_EnumDomainAliases(pipe_cli, ctx,
diff --git a/source3/lib/packet.c b/source3/lib/packet.c
index e0486165f3..e4cab6ba87 100644
--- a/source3/lib/packet.c
+++ b/source3/lib/packet.c
@@ -21,7 +21,7 @@
struct packet_context {
int fd;
- struct data_blob in, out;
+ DATA_BLOB in, out;
};
/*
@@ -120,16 +120,16 @@ NTSTATUS packet_fd_read_sync(struct packet_context *ctx)
}
bool packet_handler(struct packet_context *ctx,
- bool (*full_req)(const struct data_blob *data,
+ bool (*full_req)(const DATA_BLOB *data,
size_t *length,
void *private_data),
- NTSTATUS (*callback)(const struct data_blob *data,
+ NTSTATUS (*callback)(const DATA_BLOB *data,
void *private_data),
void *private_data,
NTSTATUS *status)
{
size_t length;
- struct data_blob data;
+ DATA_BLOB data;
if (!full_req(&ctx->in, &length, private_data)) {
return False;
@@ -211,7 +211,7 @@ NTSTATUS packet_send(struct packet_context *ctx, int num_blobs, ...)
va_start(ap, num_blobs);
for (i=0; i<num_blobs; i++) {
size_t tmp;
- struct data_blob blob = va_arg(ap, struct data_blob);
+ DATA_BLOB blob = va_arg(ap, DATA_BLOB);
tmp = len + blob.length;
if (tmp < len) {
@@ -236,7 +236,7 @@ NTSTATUS packet_send(struct packet_context *ctx, int num_blobs, ...)
va_start(ap, num_blobs);
for (i=0; i<num_blobs; i++) {
- struct data_blob blob = va_arg(ap, struct data_blob);
+ DATA_BLOB blob = va_arg(ap, DATA_BLOB);
memcpy(ctx->out.data+ctx->out.length, blob.data, blob.length);
ctx->out.length += blob.length;
diff --git a/source3/lib/rbtree.c b/source3/lib/rbtree.c
deleted file mode 100644
index f6868cab5d..0000000000
--- a/source3/lib/rbtree.c
+++ /dev/null
@@ -1,422 +0,0 @@
-/*
- Red Black Trees
- (C) 1999 Andrea Arcangeli <andrea@suse.de>
- (C) 2002 David Woodhouse <dwmw2@infradead.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- linux/lib/rbtree.c
-*/
-
-#include "includes.h"
-#include "rbtree.h"
-
-#define RB_RED 0
-#define RB_BLACK 1
-
-#define rb_parent(r) ((struct rb_node *)((r)->rb_parent_color & ~3))
-#define rb_color(r) ((r)->rb_parent_color & 1)
-#define rb_is_red(r) (!rb_color(r))
-#define rb_is_black(r) rb_color(r)
-#define rb_set_red(r) do { (r)->rb_parent_color &= ~1; } while (0)
-#define rb_set_black(r) do { (r)->rb_parent_color |= 1; } while (0)
-
-static void rb_set_parent(struct rb_node *rb, struct rb_node *p)
-{
- rb->rb_parent_color = (rb->rb_parent_color & 3) | (unsigned long)p;
-}
-static void rb_set_color(struct rb_node *rb, int color)
-{
- rb->rb_parent_color = (rb->rb_parent_color & ~1) | color;
-}
-
-#define RB_EMPTY_ROOT(root) ((root)->rb_node == NULL)
-#define RB_EMPTY_NODE(node) (rb_parent(node) == node)
-#define RB_CLEAR_NODE(node) (rb_set_parent(node, node))
-
-static void __rb_rotate_left(struct rb_node *node, struct rb_root *root)
-{
- struct rb_node *right = node->rb_right;
- struct rb_node *parent = rb_parent(node);
-
- if ((node->rb_right = right->rb_left))
- rb_set_parent(right->rb_left, node);
- right->rb_left = node;
-
- rb_set_parent(right, parent);
-
- if (parent)
- {
- if (node == parent->rb_left)
- parent->rb_left = right;
- else
- parent->rb_right = right;
- }
- else
- root->rb_node = right;
- rb_set_parent(node, right);
-}
-
-static void __rb_rotate_right(struct rb_node *node, struct rb_root *root)
-{
- struct rb_node *left = node->rb_left;
- struct rb_node *parent = rb_parent(node);
-
- if ((node->rb_left = left->rb_right))
- rb_set_parent(left->rb_right, node);
- left->rb_right = node;
-
- rb_set_parent(left, parent);
-
- if (parent)
- {
- if (node == parent->rb_right)
- parent->rb_right = left;
- else
- parent->rb_left = left;
- }
- else
- root->rb_node = left;
- rb_set_parent(node, left);
-}
-
-void rb_insert_color(struct rb_node *node, struct rb_root *root)
-{
- struct rb_node *parent, *gparent;
-
- while ((parent = rb_parent(node)) && rb_is_red(parent))
- {
- gparent = rb_parent(parent);
-
- if (parent == gparent->rb_left)
- {
- {
- register struct rb_node *uncle = gparent->rb_right;
- if (uncle && rb_is_red(uncle))
- {
- rb_set_black(uncle);
- rb_set_black(parent);
- rb_set_red(gparent);
- node = gparent;
- continue;
- }
- }
-
- if (parent->rb_right == node)
- {
- register struct rb_node *tmp;
- __rb_rotate_left(parent, root);
- tmp = parent;
- parent = node;
- node = tmp;
- }
-
- rb_set_black(parent);
- rb_set_red(gparent);
- __rb_rotate_right(gparent, root);
- } else {
- {
- register struct rb_node *uncle = gparent->rb_left;
- if (uncle && rb_is_red(uncle))
- {
- rb_set_black(uncle);
- rb_set_black(parent);
- rb_set_red(gparent);
- node = gparent;
- continue;
- }
- }
-
- if (parent->rb_left == node)
- {
- register struct rb_node *tmp;
- __rb_rotate_right(parent, root);
- tmp = parent;
- parent = node;
- node = tmp;
- }
-
- rb_set_black(parent);
- rb_set_red(gparent);
- __rb_rotate_left(gparent, root);
- }
- }
-
- rb_set_black(root->rb_node);
-}
-
-static void __rb_erase_color(struct rb_node *node, struct rb_node *parent,
- struct rb_root *root)
-{
- struct rb_node *other;
-
- while ((!node || rb_is_black(node)) && node != root->rb_node)
- {
- if (parent->rb_left == node)
- {
- other = parent->rb_right;
- if (rb_is_red(other))
- {
- rb_set_black(other);
- rb_set_red(parent);
- __rb_rotate_left(parent, root);
- other = parent->rb_right;
- }
- if ((!other->rb_left || rb_is_black(other->rb_left)) &&
- (!other->rb_right || rb_is_black(other->rb_right)))
- {
- rb_set_red(other);
- node = parent;
- parent = rb_parent(node);
- }
- else
- {
- if (!other->rb_right || rb_is_black(other->rb_right))
- {
- struct rb_node *o_left;
- if ((o_left = other->rb_left))
- rb_set_black(o_left);
- rb_set_red(other);
- __rb_rotate_right(other, root);
- other = parent->rb_right;
- }
- rb_set_color(other, rb_color(parent));
- rb_set_black(parent);
- if (other->rb_right)
- rb_set_black(other->rb_right);
- __rb_rotate_left(parent, root);
- node = root->rb_node;
- break;
- }
- }
- else
- {
- other = parent->rb_left;
- if (rb_is_red(other))
- {
- rb_set_black(other);
- rb_set_red(parent);
- __rb_rotate_right(parent, root);
- other = parent->rb_left;
- }
- if ((!other->rb_left || rb_is_black(other->rb_left)) &&
- (!other->rb_right || rb_is_black(other->rb_right)))
- {
- rb_set_red(other);
- node = parent;
- parent = rb_parent(node);
- }
- else
- {
- if (!other->rb_left || rb_is_black(other->rb_left))
- {
- register struct rb_node *o_right;
- if ((o_right = other->rb_right))
- rb_set_black(o_right);
- rb_set_red(other);
- __rb_rotate_left(other, root);
- other = parent->rb_left;
- }
- rb_set_color(other, rb_color(parent));
- rb_set_black(parent);
- if (other->rb_left)
- rb_set_black(other->rb_left);
- __rb_rotate_right(parent, root);
- node = root->rb_node;
- break;
- }
- }
- }
- if (node)
- rb_set_black(node);
-}
-
-void rb_erase(struct rb_node *node, struct rb_root *root)
-{
- struct rb_node *child, *parent;
- int color;
-
- if (!node->rb_left)
- child = node->rb_right;
- else if (!node->rb_right)
- child = node->rb_left;
- else
- {
- struct rb_node *old = node, *left;
-
- node = node->rb_right;
- while ((left = node->rb_left) != NULL)
- node = left;
- child = node->rb_right;
- parent = rb_parent(node);
- color = rb_color(node);
-
- if (child)
- rb_set_parent(child, parent);
- if (parent == old) {
- parent->rb_right = child;
- parent = node;
- } else
- parent->rb_left = child;
-
- node->rb_parent_color = old->rb_parent_color;
- node->rb_right = old->rb_right;
- node->rb_left = old->rb_left;
-
- if (rb_parent(old))
- {
- if (rb_parent(old)->rb_left == old)
- rb_parent(old)->rb_left = node;
- else
- rb_parent(old)->rb_right = node;
- } else
- root->rb_node = node;
-
- rb_set_parent(old->rb_left, node);
- if (old->rb_right)
- rb_set_parent(old->rb_right, node);
- goto color;
- }
-
- parent = rb_parent(node);
- color = rb_color(node);
-
- if (child)
- rb_set_parent(child, parent);
- if (parent)
- {
- if (parent->rb_left == node)
- parent->rb_left = child;
- else
- parent->rb_right = child;
- }
- else
- root->rb_node = child;
-
- color:
- if (color == RB_BLACK)
- __rb_erase_color(child, parent, root);
-}
-
-/*
- * This function returns the first node (in sort order) of the tree.
- */
-struct rb_node *rb_first(struct rb_root *root)
-{
- struct rb_node *n;
-
- n = root->rb_node;
- if (!n)
- return NULL;
- while (n->rb_left)
- n = n->rb_left;
- return n;
-}
-
-struct rb_node *rb_last(struct rb_root *root)
-{
- struct rb_node *n;
-
- n = root->rb_node;
- if (!n)
- return NULL;
- while (n->rb_right)
- n = n->rb_right;
- return n;
-}
-
-struct rb_node *rb_next(struct rb_node *node)
-{
- struct rb_node *parent;
-
- if (rb_parent(node) == node)
- return NULL;
-
- /* If we have a right-hand child, go down and then left as far
- as we can. */
- if (node->rb_right) {
- node = node->rb_right;
- while (node->rb_left)
- node=node->rb_left;
- return node;
- }
-
- /* No right-hand children. Everything down and left is
- smaller than us, so any 'next' node must be in the general
- direction of our parent. Go up the tree; any time the
- ancestor is a right-hand child of its parent, keep going
- up. First time it's a left-hand child of its parent, said
- parent is our 'next' node. */
- while ((parent = rb_parent(node)) && node == parent->rb_right)
- node = parent;
-
- return parent;
-}
-
-struct rb_node *rb_prev(struct rb_node *node)
-{
- struct rb_node *parent;
-
- if (rb_parent(node) == node)
- return NULL;
-
- /* If we have a left-hand child, go down and then right as far
- as we can. */
- if (node->rb_left) {
- node = node->rb_left;
- while (node->rb_right)
- node=node->rb_right;
- return node;
- }
-
- /* No left-hand children. Go up till we find an ancestor which
- is a right-hand child of its parent */
- while ((parent = rb_parent(node)) && node == parent->rb_left)
- node = parent;
-
- return parent;
-}
-
-void rb_replace_node(struct rb_node *victim, struct rb_node *new_node,
- struct rb_root *root)
-{
- struct rb_node *parent = rb_parent(victim);
-
- /* Set the surrounding nodes to point to the replacement */
- if (parent) {
- if (victim == parent->rb_left)
- parent->rb_left = new_node;
- else
- parent->rb_right = new_node;
- } else {
- root->rb_node = new_node;
- }
- if (victim->rb_left)
- rb_set_parent(victim->rb_left, new_node);
- if (victim->rb_right)
- rb_set_parent(victim->rb_right, new_node);
-
- /* Copy the pointers/colour from the victim to the replacement */
- *new_node = *victim;
-}
-
-void rb_link_node(struct rb_node * node, struct rb_node * parent,
- struct rb_node ** rb_link)
-{
- node->rb_parent_color = (unsigned long )parent;
- node->rb_left = node->rb_right = NULL;
-
- *rb_link = node;
-}
diff --git a/source3/lib/select.c b/source3/lib/select.c
index c3da6a9bba..14e59257ba 100644
--- a/source3/lib/select.c
+++ b/source3/lib/select.c
@@ -30,7 +30,7 @@
static pid_t initialised;
static int select_pipe[2];
-static VOLATILE unsigned pipe_written, pipe_read;
+static volatile unsigned pipe_written, pipe_read;
/*******************************************************************
Call this from all Samba signal handlers if you want to avoid a
@@ -161,7 +161,7 @@ int sys_select_intr(int maxfd, fd_set *readfds, fd_set *writefds, fd_set *errorf
errorfds_buf = *errorfds;
if (ptval && (errno == EINTR)) {
struct timeval now_time;
- SMB_BIG_INT tdif;
+ int64_t tdif;
GetTimeOfDay(&now_time);
tdif = usec_time_diff(&end_time, &now_time);
diff --git a/source3/lib/signal.c b/source3/lib/signal.c
deleted file mode 100644
index 4b1c95eb77..0000000000
--- a/source3/lib/signal.c
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- Unix SMB/CIFS implementation.
- signal handling functions
-
- Copyright (C) Andrew Tridgell 1998
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "includes.h"
-
-/****************************************************************************
- Catch child exits and reap the child zombie status.
-****************************************************************************/
-
-static void sig_cld(int signum)
-{
- while (sys_waitpid((pid_t)-1,(int *)NULL, WNOHANG) > 0)
- ;
-
- /*
- * Turns out it's *really* important not to
- * restore the signal handler here if we have real POSIX
- * signal handling. If we do, then we get the signal re-delivered
- * immediately - hey presto - instant loop ! JRA.
- */
-
-#if !defined(HAVE_SIGACTION)
- CatchSignal(SIGCLD, sig_cld);
-#endif
-}
-
-/****************************************************************************
-catch child exits - leave status;
-****************************************************************************/
-
-static void sig_cld_leave_status(int signum)
-{
- /*
- * Turns out it's *really* important not to
- * restore the signal handler here if we have real POSIX
- * signal handling. If we do, then we get the signal re-delivered
- * immediately - hey presto - instant loop ! JRA.
- */
-
-#if !defined(HAVE_SIGACTION)
- CatchSignal(SIGCLD, sig_cld_leave_status);
-#endif
-}
-
-/*******************************************************************
- Block sigs.
-********************************************************************/
-
-void BlockSignals(bool block,int signum)
-{
-#ifdef HAVE_SIGPROCMASK
- sigset_t set;
- sigemptyset(&set);
- sigaddset(&set,signum);
- sigprocmask(block?SIG_BLOCK:SIG_UNBLOCK,&set,NULL);
-#elif defined(HAVE_SIGBLOCK)
- if (block) {
- sigblock(sigmask(signum));
- } else {
- sigsetmask(siggetmask() & ~sigmask(signum));
- }
-#else
- /* yikes! This platform can't block signals? */
- static int done;
- if (!done) {
- DEBUG(0,("WARNING: No signal blocking available\n"));
- done=1;
- }
-#endif
-}
-
-/*******************************************************************
- Catch a signal. This should implement the following semantics:
-
- 1) The handler remains installed after being called.
- 2) The signal should be blocked during handler execution.
-********************************************************************/
-
-void (*CatchSignal(int signum,void (*handler)(int )))(int)
-{
-#ifdef HAVE_SIGACTION
- struct sigaction act;
- struct sigaction oldact;
-
- ZERO_STRUCT(act);
-
- act.sa_handler = handler;
-#ifdef SA_RESTART
- /*
- * We *want* SIGALRM to interrupt a system call.
- */
- if(signum != SIGALRM)
- act.sa_flags = SA_RESTART;
-#endif
- sigemptyset(&act.sa_mask);
- sigaddset(&act.sa_mask,signum);
- sigaction(signum,&act,&oldact);
- return oldact.sa_handler;
-#else /* !HAVE_SIGACTION */
- /* FIXME: need to handle sigvec and systems with broken signal() */
- return signal(signum, handler);
-#endif
-}
-
-/*******************************************************************
- Ignore SIGCLD via whatever means is necessary for this OS.
-********************************************************************/
-
-void CatchChild(void)
-{
- CatchSignal(SIGCLD, sig_cld);
-}
-
-/*******************************************************************
- Catch SIGCLD but leave the child around so it's status can be reaped.
-********************************************************************/
-
-void CatchChildLeaveStatus(void)
-{
- CatchSignal(SIGCLD, sig_cld_leave_status);
-}
diff --git a/source3/lib/smbconf/smbconf_txt.c b/source3/lib/smbconf/smbconf_txt.c
index 1a29f40164..1393a098d5 100644
--- a/source3/lib/smbconf/smbconf_txt.c
+++ b/source3/lib/smbconf/smbconf_txt.c
@@ -183,7 +183,7 @@ static WERROR smbconf_txt_load_file(struct smbconf_ctx *ctx)
WERROR werr;
uint64_t new_csn;
- if (!file_exist(ctx->path, NULL)) {
+ if (!file_exist(ctx->path)) {
return WERR_BADFILE;
}
diff --git a/source3/lib/smbldap.c b/source3/lib/smbldap.c
index 93494d6dad..f5e152bb95 100644
--- a/source3/lib/smbldap.c
+++ b/source3/lib/smbldap.c
@@ -1211,7 +1211,7 @@ static int smbldap_search_ext(struct smbldap_state *ldap_state,
if (ldap_state->last_rebind.tv_sec > 0) {
struct timeval tval;
- SMB_BIG_INT tdiff = 0;
+ int64_t tdiff = 0;
int sleep_time = 0;
ZERO_STRUCT(tval);
diff --git a/source3/lib/sysquotas.c b/source3/lib/sysquotas.c
index 4a2d88abdf..5ee199de22 100644
--- a/source3/lib/sysquotas.c
+++ b/source3/lib/sysquotas.c
@@ -295,7 +295,7 @@ static int command_get_quota(const char *path, enum SMB_QUOTA_TYPE qtype, unid_t
dp->bsize = 1024;
}
- file_lines_free(lines);
+ TALLOC_FREE(lines);
lines = NULL;
DEBUG (3, ("Parsed output of get_quota, ...\n"));
@@ -331,7 +331,7 @@ static int command_get_quota(const char *path, enum SMB_QUOTA_TYPE qtype, unid_t
invalid_param:
- file_lines_free(lines);
+ TALLOC_FREE(lines);
DEBUG(0,("The output of get_quota_command is invalid!\n"));
return -1;
}
@@ -392,7 +392,7 @@ static int command_set_quota(const char *path, enum SMB_QUOTA_TYPE qtype, unid_t
DEBUG (3, ("Read output from set_quota, \"%s\"\n", line));
- file_lines_free(lines);
+ TALLOC_FREE(lines);
return 0;
}
diff --git a/source3/lib/sysquotas_4A.c b/source3/lib/sysquotas_4A.c
index f185bba6df..8a1b12238c 100644
--- a/source3/lib/sysquotas_4A.c
+++ b/source3/lib/sysquotas_4A.c
@@ -89,7 +89,7 @@ int sys_get_vfs_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qt
int ret = -1;
uint32 qflags = 0;
struct dqblk D;
- SMB_BIG_UINT bsize = (SMB_BIG_UINT)QUOTABLOCK_SIZE;
+ uint64_t bsize = (uint64_t)QUOTABLOCK_SIZE;
ZERO_STRUCT(D);
ZERO_STRUCT(*dp);
@@ -162,12 +162,12 @@ int sys_get_vfs_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qt
}
dp->bsize = bsize;
- dp->softlimit = (SMB_BIG_UINT)D.dqb_bsoftlimit;
- dp->hardlimit = (SMB_BIG_UINT)D.dqb_bhardlimit;
- dp->ihardlimit = (SMB_BIG_UINT)D.dqb_ihardlimit;
- dp->isoftlimit = (SMB_BIG_UINT)D.dqb_isoftlimit;
- dp->curinodes = (SMB_BIG_UINT)D.dqb_curinodes;
- dp->curblocks = (SMB_BIG_UINT)D.dqb_curblocks;
+ dp->softlimit = (uint64_t)D.dqb_bsoftlimit;
+ dp->hardlimit = (uint64_t)D.dqb_bhardlimit;
+ dp->ihardlimit = (uint64_t)D.dqb_ihardlimit;
+ dp->isoftlimit = (uint64_t)D.dqb_isoftlimit;
+ dp->curinodes = (uint64_t)D.dqb_curinodes;
+ dp->curblocks = (uint64_t)D.dqb_curblocks;
dp->qflags = qflags;
@@ -184,7 +184,7 @@ int sys_set_vfs_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qt
uint32 qflags = 0;
uint32 oldqflags = 0;
struct dqblk D;
- SMB_BIG_UINT bsize = (SMB_BIG_UINT)QUOTABLOCK_SIZE;
+ uint64_t bsize = (uint64_t)QUOTABLOCK_SIZE;
ZERO_STRUCT(D);
diff --git a/source3/lib/sysquotas_linux.c b/source3/lib/sysquotas_linux.c
index f9a0464086..5720328764 100644
--- a/source3/lib/sysquotas_linux.c
+++ b/source3/lib/sysquotas_linux.c
@@ -41,7 +41,7 @@ static int sys_get_linux_v1_quota(const char *path, const char *bdev, enum SMB_Q
int ret = -1;
uint32 qflags = 0;
struct v1_kern_dqblk D;
- SMB_BIG_UINT bsize = (SMB_BIG_UINT)QUOTABLOCK_SIZE;
+ uint64_t bsize = (uint64_t)QUOTABLOCK_SIZE;
ZERO_STRUCT(D);
@@ -88,12 +88,12 @@ static int sys_get_linux_v1_quota(const char *path, const char *bdev, enum SMB_Q
}
dp->bsize = bsize;
- dp->softlimit = (SMB_BIG_UINT)D.dqb_bsoftlimit;
- dp->hardlimit = (SMB_BIG_UINT)D.dqb_bhardlimit;
- dp->ihardlimit = (SMB_BIG_UINT)D.dqb_ihardlimit;
- dp->isoftlimit = (SMB_BIG_UINT)D.dqb_isoftlimit;
- dp->curinodes = (SMB_BIG_UINT)D.dqb_curinodes;
- dp->curblocks = (SMB_BIG_UINT)D.dqb_curblocks;
+ dp->softlimit = (uint64_t)D.dqb_bsoftlimit;
+ dp->hardlimit = (uint64_t)D.dqb_bhardlimit;
+ dp->ihardlimit = (uint64_t)D.dqb_ihardlimit;
+ dp->isoftlimit = (uint64_t)D.dqb_isoftlimit;
+ dp->curinodes = (uint64_t)D.dqb_curinodes;
+ dp->curblocks = (uint64_t)D.dqb_curblocks;
dp->qflags = qflags;
@@ -110,7 +110,7 @@ static int sys_set_linux_v1_quota(const char *path, const char *bdev, enum SMB_Q
uint32 qflags = 0;
uint32 oldqflags = 0;
struct v1_kern_dqblk D;
- SMB_BIG_UINT bsize = (SMB_BIG_UINT)QUOTABLOCK_SIZE;
+ uint64_t bsize = (uint64_t)QUOTABLOCK_SIZE;
ZERO_STRUCT(D);
@@ -175,7 +175,7 @@ static int sys_get_linux_v2_quota(const char *path, const char *bdev, enum SMB_Q
int ret = -1;
uint32 qflags = 0;
struct v2_kern_dqblk D;
- SMB_BIG_UINT bsize = (SMB_BIG_UINT)QUOTABLOCK_SIZE;
+ uint64_t bsize = (uint64_t)QUOTABLOCK_SIZE;
ZERO_STRUCT(D);
@@ -222,12 +222,12 @@ static int sys_get_linux_v2_quota(const char *path, const char *bdev, enum SMB_Q
}
dp->bsize = bsize;
- dp->softlimit = (SMB_BIG_UINT)D.dqb_bsoftlimit;
- dp->hardlimit = (SMB_BIG_UINT)D.dqb_bhardlimit;
- dp->ihardlimit = (SMB_BIG_UINT)D.dqb_ihardlimit;
- dp->isoftlimit = (SMB_BIG_UINT)D.dqb_isoftlimit;
- dp->curinodes = (SMB_BIG_UINT)D.dqb_curinodes;
- dp->curblocks = (SMB_BIG_UINT)D.dqb_curspace/bsize;
+ dp->softlimit = (uint64_t)D.dqb_bsoftlimit;
+ dp->hardlimit = (uint64_t)D.dqb_bhardlimit;
+ dp->ihardlimit = (uint64_t)D.dqb_ihardlimit;
+ dp->isoftlimit = (uint64_t)D.dqb_isoftlimit;
+ dp->curinodes = (uint64_t)D.dqb_curinodes;
+ dp->curblocks = (uint64_t)D.dqb_curspace/bsize;
dp->qflags = qflags;
@@ -244,7 +244,7 @@ static int sys_set_linux_v2_quota(const char *path, const char *bdev, enum SMB_Q
uint32 qflags = 0;
uint32 oldqflags = 0;
struct v2_kern_dqblk D;
- SMB_BIG_UINT bsize = (SMB_BIG_UINT)QUOTABLOCK_SIZE;
+ uint64_t bsize = (uint64_t)QUOTABLOCK_SIZE;
ZERO_STRUCT(D);
@@ -309,7 +309,7 @@ static int sys_get_linux_gen_quota(const char *path, const char *bdev, enum SMB_
int ret = -1;
uint32 qflags = 0;
struct if_dqblk D;
- SMB_BIG_UINT bsize = (SMB_BIG_UINT)QUOTABLOCK_SIZE;
+ uint64_t bsize = (uint64_t)QUOTABLOCK_SIZE;
ZERO_STRUCT(D);
@@ -356,12 +356,12 @@ static int sys_get_linux_gen_quota(const char *path, const char *bdev, enum SMB_
}
dp->bsize = bsize;
- dp->softlimit = (SMB_BIG_UINT)D.dqb_bsoftlimit;
- dp->hardlimit = (SMB_BIG_UINT)D.dqb_bhardlimit;
- dp->ihardlimit = (SMB_BIG_UINT)D.dqb_ihardlimit;
- dp->isoftlimit = (SMB_BIG_UINT)D.dqb_isoftlimit;
- dp->curinodes = (SMB_BIG_UINT)D.dqb_curinodes;
- dp->curblocks = (SMB_BIG_UINT)D.dqb_curspace/bsize;
+ dp->softlimit = (uint64_t)D.dqb_bsoftlimit;
+ dp->hardlimit = (uint64_t)D.dqb_bhardlimit;
+ dp->ihardlimit = (uint64_t)D.dqb_ihardlimit;
+ dp->isoftlimit = (uint64_t)D.dqb_isoftlimit;
+ dp->curinodes = (uint64_t)D.dqb_curinodes;
+ dp->curblocks = (uint64_t)D.dqb_curspace/bsize;
dp->qflags = qflags;
@@ -378,7 +378,7 @@ static int sys_set_linux_gen_quota(const char *path, const char *bdev, enum SMB_
uint32 qflags = 0;
uint32 oldqflags = 0;
struct if_dqblk D;
- SMB_BIG_UINT bsize = (SMB_BIG_UINT)QUOTABLOCK_SIZE;
+ uint64_t bsize = (uint64_t)QUOTABLOCK_SIZE;
ZERO_STRUCT(D);
diff --git a/source3/lib/sysquotas_xfs.c b/source3/lib/sysquotas_xfs.c
index 30538c167b..1e438e9a6d 100644
--- a/source3/lib/sysquotas_xfs.c
+++ b/source3/lib/sysquotas_xfs.c
@@ -76,7 +76,7 @@ int sys_get_xfs_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qt
{
int ret = -1;
uint32 qflags = 0;
- SMB_BIG_UINT bsize = (SMB_BIG_UINT)BBSIZE;
+ uint64_t bsize = (uint64_t)BBSIZE;
struct fs_disk_quota D;
struct fs_quota_stat F;
ZERO_STRUCT(D);
@@ -145,12 +145,12 @@ int sys_get_xfs_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qt
}
dp->bsize = bsize;
- dp->softlimit = (SMB_BIG_UINT)D.d_blk_softlimit;
- dp->hardlimit = (SMB_BIG_UINT)D.d_blk_hardlimit;
- dp->ihardlimit = (SMB_BIG_UINT)D.d_ino_hardlimit;
- dp->isoftlimit = (SMB_BIG_UINT)D.d_ino_softlimit;
- dp->curinodes = (SMB_BIG_UINT)D.d_icount;
- dp->curblocks = (SMB_BIG_UINT)D.d_bcount;
+ dp->softlimit = (uint64_t)D.d_blk_softlimit;
+ dp->hardlimit = (uint64_t)D.d_blk_hardlimit;
+ dp->ihardlimit = (uint64_t)D.d_ino_hardlimit;
+ dp->isoftlimit = (uint64_t)D.d_ino_softlimit;
+ dp->curinodes = (uint64_t)D.d_icount;
+ dp->curblocks = (uint64_t)D.d_bcount;
dp->qflags = qflags;
return ret;
@@ -163,7 +163,7 @@ int sys_set_xfs_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qt
{
int ret = -1;
uint32 qflags = 0;
- SMB_BIG_UINT bsize = (SMB_BIG_UINT)BBSIZE;
+ uint64_t bsize = (uint64_t)BBSIZE;
struct fs_disk_quota D;
struct fs_quota_stat F;
int q_on = 0;
diff --git a/source3/lib/time.c b/source3/lib/time.c
index 8cefef6e23..c4aa7d01b3 100644
--- a/source3/lib/time.c
+++ b/source3/lib/time.c
@@ -38,112 +38,12 @@
#define NTTIME_INFINITY (NTTIME)0x8000000000000000LL
-/***************************************************************************
- External access to time_t_min and time_t_max.
-****************************************************************************/
-
-time_t get_time_t_max(void)
-{
- return TIME_T_MAX;
-}
-
-/***************************************************************************
- A gettimeofday wrapper.
-****************************************************************************/
-
-void GetTimeOfDay(struct timeval *tval)
-{
-#ifdef HAVE_GETTIMEOFDAY_TZ
- gettimeofday(tval,NULL);
-#else
- gettimeofday(tval);
-#endif
-}
-
#if (SIZEOF_LONG == 8)
#define TIME_FIXUP_CONSTANT_INT 11644473600L
#elif (SIZEOF_LONG_LONG == 8)
#define TIME_FIXUP_CONSTANT_INT 11644473600LL
#endif
-/****************************************************************************
- Interpret an 8 byte "filetime" structure to a time_t
- It's originally in "100ns units since jan 1st 1601"
-
- An 8 byte value of 0xffffffffffffffff will be returned as a timespec of
-
- tv_sec = 0
- tv_nsec = 0;
-
- Returns GMT.
-****************************************************************************/
-
-time_t nt_time_to_unix(NTTIME nt)
-{
- return convert_timespec_to_time_t(nt_time_to_unix_timespec(&nt));
-}
-
-/****************************************************************************
- Put a 8 byte filetime from a time_t. Uses GMT.
-****************************************************************************/
-
-void unix_to_nt_time(NTTIME *nt, time_t t)
-{
- uint64_t t2;
-
- if (t == (time_t)-1) {
- *nt = (NTTIME)-1LL;
- return;
- }
-
- if (t == TIME_T_MAX) {
- *nt = 0x7fffffffffffffffLL;
- return;
- }
-
- if (t == 0) {
- *nt = 0;
- return;
- }
-
- t2 = t;
- t2 += TIME_FIXUP_CONSTANT_INT;
- t2 *= 1000*1000*10;
-
- *nt = t2;
-}
-
-/****************************************************************************
- Check if it's a null unix time.
-****************************************************************************/
-
-bool null_time(time_t t)
-{
- return t == 0 ||
- t == (time_t)0xFFFFFFFF ||
- t == (time_t)-1;
-}
-
-/****************************************************************************
- Check if it's a null NTTIME.
-****************************************************************************/
-
-bool null_nttime(NTTIME t)
-{
- return t == 0 || t == (NTTIME)-1;
-}
-
-/****************************************************************************
- Check if it's a null timespec.
-****************************************************************************/
-
-bool null_timespec(struct timespec ts)
-{
- return ts.tv_sec == 0 ||
- ts.tv_sec == (time_t)0xFFFFFFFF ||
- ts.tv_sec == (time_t)-1;
-}
-
/*******************************************************************
create a 16 bit dos packed date
********************************************************************/
@@ -193,183 +93,6 @@ static uint32_t make_dos_date(time_t unixdate, int zone_offset)
}
/**
-put a dos date into a buffer (time/date format)
-This takes GMT time and puts local time in the buffer
-**/
-void push_dos_date(uint8_t *buf, int offset, time_t unixdate, int zone_offset)
-{
- uint32_t x = make_dos_date(unixdate, zone_offset);
- SIVAL(buf,offset,x);
-}
-
-/**
-put a dos date into a buffer (date/time format)
-This takes GMT time and puts local time in the buffer
-**/
-void push_dos_date2(uint8_t *buf,int offset,time_t unixdate, int zone_offset)
-{
- uint32_t x;
- x = make_dos_date(unixdate, zone_offset);
- x = ((x&0xFFFF)<<16) | ((x&0xFFFF0000)>>16);
- SIVAL(buf,offset,x);
-}
-
-/**
-put a dos 32 bit "unix like" date into a buffer. This routine takes
-GMT and converts it to LOCAL time before putting it (most SMBs assume
-localtime for this sort of date)
-**/
-void push_dos_date3(uint8_t *buf,int offset,time_t unixdate, int zone_offset)
-{
- if (!null_time(unixdate)) {
- unixdate -= zone_offset;
- }
- SIVAL(buf,offset,unixdate);
-}
-
-/*******************************************************************
- interpret a 32 bit dos packed date/time to some parameters
-********************************************************************/
-static void interpret_dos_date(uint32_t date,int *year,int *month,int *day,int *hour,int *minute,int *second)
-{
- uint32_t p0,p1,p2,p3;
-
- p0=date&0xFF; p1=((date&0xFF00)>>8)&0xFF;
- p2=((date&0xFF0000)>>16)&0xFF; p3=((date&0xFF000000)>>24)&0xFF;
-
- *second = 2*(p0 & 0x1F);
- *minute = ((p0>>5)&0xFF) + ((p1&0x7)<<3);
- *hour = (p1>>3)&0xFF;
- *day = (p2&0x1F);
- *month = ((p2>>5)&0xFF) + ((p3&0x1)<<3) - 1;
- *year = ((p3>>1)&0xFF) + 80;
-}
-
-/**
- create a unix date (int GMT) from a dos date (which is actually in
- localtime)
-**/
-time_t pull_dos_date(const uint8_t *date_ptr, int zone_offset)
-{
- uint32_t dos_date=0;
- struct tm t;
- time_t ret;
-
- dos_date = IVAL(date_ptr,0);
-
- if (dos_date == 0) return (time_t)0;
-
- interpret_dos_date(dos_date,&t.tm_year,&t.tm_mon,
- &t.tm_mday,&t.tm_hour,&t.tm_min,&t.tm_sec);
- t.tm_isdst = -1;
-
- ret = timegm(&t);
-
- ret += zone_offset;
-
- return ret;
-}
-
-/**
-like make_unix_date() but the words are reversed
-**/
-time_t pull_dos_date2(const uint8_t *date_ptr, int zone_offset)
-{
- uint32_t x,x2;
-
- x = IVAL(date_ptr,0);
- x2 = ((x&0xFFFF)<<16) | ((x&0xFFFF0000)>>16);
- SIVAL(&x,0,x2);
-
- return pull_dos_date((const uint8_t *)&x, zone_offset);
-}
-
-/**
- create a unix GMT date from a dos date in 32 bit "unix like" format
- these generally arrive as localtimes, with corresponding DST
-**/
-time_t pull_dos_date3(const uint8_t *date_ptr, int zone_offset)
-{
- time_t t = (time_t)IVAL(date_ptr,0);
- if (!null_time(t)) {
- t += zone_offset;
- }
- return t;
-}
-
-/***************************************************************************
- Return a HTTP/1.0 time string.
-***************************************************************************/
-
-char *http_timestring(time_t t)
-{
- fstring buf;
- struct tm *tm = localtime(&t);
-
- if (t == TIME_T_MAX) {
- fstrcpy(buf, "never");
- } else if (!tm) {
- fstr_sprintf(buf, "%ld seconds since the Epoch", (long)t);
- } else {
-#ifndef HAVE_STRFTIME
- const char *asct = asctime(tm);
- fstrcpy(buf, asct ? asct : "unknown");
- }
- if(buf[strlen(buf)-1] == '\n') {
- buf[strlen(buf)-1] = 0;
-#else /* !HAVE_STRFTIME */
- strftime(buf, sizeof(buf)-1, "%a, %d %b %Y %H:%M:%S %Z", tm);
-#endif /* !HAVE_STRFTIME */
- }
- return talloc_strdup(talloc_tos(), buf);
-}
-
-
-/**
- Return the date and time as a string
-**/
-char *timestring(TALLOC_CTX *mem_ctx, time_t t)
-{
- char *TimeBuf;
- char tempTime[80];
- struct tm *tm;
-
- tm = localtime(&t);
- if (!tm) {
- return talloc_asprintf(mem_ctx,
- "%ld seconds since the Epoch",
- (long)t);
- }
-
-#ifdef HAVE_STRFTIME
- /* some versions of gcc complain about using %c. This is a bug
- in the gcc warning, not a bug in this code. See a recent
- strftime() manual page for details.
- */
- strftime(tempTime,sizeof(tempTime)-1,"%c %Z",tm);
- TimeBuf = talloc_strdup(mem_ctx, tempTime);
-#else
- TimeBuf = talloc_strdup(mem_ctx, asctime(tm));
-#endif
-
- return TimeBuf;
-}
-
-/**
- return a talloced string representing a NTTIME for human consumption
-*/
-const char *nt_time_string(TALLOC_CTX *mem_ctx, NTTIME nt)
-{
- time_t t;
- if (nt == 0) {
- return "NTTIME(0)";
- }
- t = nt_time_to_unix(nt);
- return timestring(mem_ctx, t);
-}
-
-
-/**
parse a nttime as a large integer in a string and return a NTTIME
*/
NTTIME nttime_from_string(const char *s)
@@ -377,190 +100,6 @@ NTTIME nttime_from_string(const char *s)
return strtoull(s, NULL, 0);
}
-/**
- return (tv1 - tv2) in microseconds
-*/
-int64_t usec_time_diff(struct timeval *tv1, struct timeval *tv2)
-{
- int64_t sec_diff = tv1->tv_sec - tv2->tv_sec;
- return (sec_diff * 1000000) + (int64_t)(tv1->tv_usec - tv2->tv_usec);
-}
-
-
-/**
- return a zero timeval
-*/
-struct timeval timeval_zero(void)
-{
- struct timeval tv;
- tv.tv_sec = 0;
- tv.tv_usec = 0;
- return tv;
-}
-
-/**
- return True if a timeval is zero
-*/
-bool timeval_is_zero(const struct timeval *tv)
-{
- return tv->tv_sec == 0 && tv->tv_usec == 0;
-}
-
-/**
- return a timeval for the current time
-*/
-struct timeval timeval_current(void)
-{
- struct timeval tv;
- GetTimeOfDay(&tv);
- return tv;
-}
-
-/**
- return a timeval struct with the given elements
-*/
-struct timeval timeval_set(uint32_t secs, uint32_t usecs)
-{
- struct timeval tv;
- tv.tv_sec = secs;
- tv.tv_usec = usecs;
- return tv;
-}
-
-
-/**
- return a timeval ofs microseconds after tv
-*/
-struct timeval timeval_add(const struct timeval *tv,
- uint32_t secs, uint32_t usecs)
-{
- struct timeval tv2 = *tv;
- const unsigned int million = 1000000;
- tv2.tv_sec += secs;
- tv2.tv_usec += usecs;
- tv2.tv_sec += tv2.tv_usec / million;
- tv2.tv_usec = tv2.tv_usec % million;
- return tv2;
-}
-
-/**
- return the sum of two timeval structures
-*/
-struct timeval timeval_sum(const struct timeval *tv1,
- const struct timeval *tv2)
-{
- return timeval_add(tv1, tv2->tv_sec, tv2->tv_usec);
-}
-
-/**
- return a timeval secs/usecs into the future
-*/
-struct timeval timeval_current_ofs(uint32_t secs, uint32_t usecs)
-{
- struct timeval tv = timeval_current();
- return timeval_add(&tv, secs, usecs);
-}
-
-/**
- compare two timeval structures.
- Return -1 if tv1 < tv2
- Return 0 if tv1 == tv2
- Return 1 if tv1 > tv2
-*/
-int timeval_compare(const struct timeval *tv1, const struct timeval *tv2)
-{
- if (tv1->tv_sec > tv2->tv_sec) return 1;
- if (tv1->tv_sec < tv2->tv_sec) return -1;
- if (tv1->tv_usec > tv2->tv_usec) return 1;
- if (tv1->tv_usec < tv2->tv_usec) return -1;
- return 0;
-}
-
-/**
- return True if a timer is in the past
-*/
-bool timeval_expired(const struct timeval *tv)
-{
- struct timeval tv2 = timeval_current();
- if (tv2.tv_sec > tv->tv_sec) return True;
- if (tv2.tv_sec < tv->tv_sec) return False;
- return (tv2.tv_usec >= tv->tv_usec);
-}
-
-/**
- return the number of seconds elapsed between two times
-*/
-double timeval_elapsed2(const struct timeval *tv1, const struct timeval *tv2)
-{
- return (tv2->tv_sec - tv1->tv_sec) +
- (tv2->tv_usec - tv1->tv_usec)*1.0e-6;
-}
-
-/**
- return the number of seconds elapsed since a given time
-*/
-double timeval_elapsed(const struct timeval *tv)
-{
- struct timeval tv2 = timeval_current();
- return timeval_elapsed2(tv, &tv2);
-}
-
-/**
- return the lesser of two timevals
-*/
-struct timeval timeval_min(const struct timeval *tv1,
- const struct timeval *tv2)
-{
- if (tv1->tv_sec < tv2->tv_sec) return *tv1;
- if (tv1->tv_sec > tv2->tv_sec) return *tv2;
- if (tv1->tv_usec < tv2->tv_usec) return *tv1;
- return *tv2;
-}
-
-/**
- return the greater of two timevals
-*/
-struct timeval timeval_max(const struct timeval *tv1,
- const struct timeval *tv2)
-{
- if (tv1->tv_sec > tv2->tv_sec) return *tv1;
- if (tv1->tv_sec < tv2->tv_sec) return *tv2;
- if (tv1->tv_usec > tv2->tv_usec) return *tv1;
- return *tv2;
-}
-
-/**
- return the difference between two timevals as a timeval
- if tv1 comes after tv2, then return a zero timeval
- (this is *tv2 - *tv1)
-*/
-struct timeval timeval_until(const struct timeval *tv1,
- const struct timeval *tv2)
-{
- struct timeval t;
- if (timeval_compare(tv1, tv2) >= 0) {
- return timeval_zero();
- }
- t.tv_sec = tv2->tv_sec - tv1->tv_sec;
- if (tv1->tv_usec > tv2->tv_usec) {
- t.tv_sec--;
- t.tv_usec = 1000000 - (tv1->tv_usec - tv2->tv_usec);
- } else {
- t.tv_usec = tv2->tv_usec - tv1->tv_usec;
- }
- return t;
-}
-
-
-/**
- convert a timeval to a NTTIME
-*/
-NTTIME timeval_to_nttime(const struct timeval *tv)
-{
- return 10*(tv->tv_usec +
- ((TIME_FIXUP_CONSTANT_INT + (uint64_t)tv->tv_sec) * 1000000));
-}
-
/**************************************************************
Handle conversions between time_t and uint32, taking care to
preserve the "special" values.
@@ -592,44 +131,8 @@ time_t convert_uint32_to_time_t(uint32 u)
return (time_t)u;
}
-/*******************************************************************
- Yield the difference between *A and *B, in seconds, ignoring leap seconds.
-********************************************************************/
-
-static int tm_diff(struct tm *a, struct tm *b)
-{
- int ay = a->tm_year + (1900 - 1);
- int by = b->tm_year + (1900 - 1);
- int intervening_leap_days =
- (ay/4 - by/4) - (ay/100 - by/100) + (ay/400 - by/400);
- int years = ay - by;
- int days = 365*years + intervening_leap_days + (a->tm_yday - b->tm_yday);
- int hours = 24*days + (a->tm_hour - b->tm_hour);
- int minutes = 60*hours + (a->tm_min - b->tm_min);
- int seconds = 60*minutes + (a->tm_sec - b->tm_sec);
-
- return seconds;
-}
-
int extra_time_offset=0;
-/*******************************************************************
- Return the UTC offset in seconds west of UTC, or 0 if it cannot be determined.
-********************************************************************/
-
-int get_time_zone(time_t t)
-{
- struct tm *tm = gmtime(&t);
- struct tm tm_utc;
- if (!tm)
- return 0;
- tm_utc = *tm;
- tm = localtime(&t);
- if (!tm)
- return 0;
- return tm_diff(&tm_utc,tm)+60*extra_time_offset;
-}
-
/****************************************************************************
Check if NTTIME is 0.
****************************************************************************/
@@ -1084,24 +587,6 @@ time_t srv_make_unix_date3(const void *date_ptr)
return make_unix_date3(date_ptr, server_zone_offset);
}
-time_t convert_timespec_to_time_t(struct timespec ts)
-{
- /* 1 ns == 1,000,000,000 - one thousand millionths of a second.
- increment if it's greater than 500 millionth of a second. */
- if (ts.tv_nsec > 500000000) {
- return ts.tv_sec + 1;
- }
- return ts.tv_sec;
-}
-
-struct timespec convert_time_t_to_timespec(time_t t)
-{
- struct timespec ts;
- ts.tv_sec = t;
- ts.tv_nsec = 0;
- return ts;
-}
-
/****************************************************************************
Convert a normalized timeval to a timespec.
****************************************************************************/
@@ -1222,49 +707,6 @@ time_t cli_make_unix_date3(struct cli_state *cli, const void *date_ptr)
return make_unix_date3(date_ptr, cli->serverzone);
}
-/* Large integer version. */
-struct timespec nt_time_to_unix_timespec(NTTIME *nt)
-{
- int64 d;
- struct timespec ret;
-
- if (*nt == 0 || *nt == (int64)-1) {
- ret.tv_sec = 0;
- ret.tv_nsec = 0;
- return ret;
- }
-
- d = (int64)*nt;
- /* d is now in 100ns units, since jan 1st 1601".
- Save off the ns fraction. */
-
- /*
- * Take the last seven decimal digits and multiply by 100.
- * to convert from 100ns units to 1ns units.
- */
- ret.tv_nsec = (long) ((d % (1000 * 1000 * 10)) * 100);
-
- /* Convert to seconds */
- d /= 1000*1000*10;
-
- /* Now adjust by 369 years to make the secs since 1970 */
- d -= TIME_FIXUP_CONSTANT_INT;
-
- if (d <= (int64)TIME_T_MIN) {
- ret.tv_sec = TIME_T_MIN;
- ret.tv_nsec = 0;
- return ret;
- }
-
- if (d >= (int64)TIME_T_MAX) {
- ret.tv_sec = TIME_T_MAX;
- ret.tv_nsec = 0;
- return ret;
- }
-
- ret.tv_sec = (time_t)d;
- return ret;
-}
/****************************************************************************
Check if two NTTIMEs are the same.
****************************************************************************/
diff --git a/source3/lib/util.c b/source3/lib/util.c
index ec43ea7037..92b818b0aa 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -439,19 +439,6 @@ bool set_cmdline_auth_info_machine_account_creds(void)
return true;
}
-/**************************************************************************n
- Find a suitable temporary directory. The result should be copied immediately
- as it may be overwritten by a subsequent call.
-****************************************************************************/
-
-const char *tmpdir(void)
-{
- char *p;
- if ((p = getenv("TMPDIR")))
- return p;
- return "/tmp";
-}
-
/****************************************************************************
Add a gid to an array of gids if it's not already there.
****************************************************************************/
@@ -540,7 +527,7 @@ const char *get_numlist(const char *p, uint32 **num, int *count)
Check if a file exists - call vfs_file_exist for samba files.
********************************************************************/
-bool file_exist(const char *fname,SMB_STRUCT_STAT *sbuf)
+bool file_exist_stat(const char *fname,SMB_STRUCT_STAT *sbuf)
{
SMB_STRUCT_STAT st;
if (!sbuf)
@@ -566,24 +553,10 @@ bool socket_exist(const char *fname)
}
/*******************************************************************
- Check a files mod time.
-********************************************************************/
-
-time_t file_modtime(const char *fname)
-{
- SMB_STRUCT_STAT st;
-
- if (sys_stat(fname,&st) != 0)
- return(0);
-
- return(st.st_mtime);
-}
-
-/*******************************************************************
Check if a directory exists.
********************************************************************/
-bool directory_exist(char *dname,SMB_STRUCT_STAT *st)
+bool directory_exist_stat(char *dname,SMB_STRUCT_STAT *st)
{
SMB_STRUCT_STAT st2;
bool ret;
@@ -927,36 +900,6 @@ ssize_t write_data_at_offset(int fd, const char *buffer, size_t N, SMB_OFF_T pos
#endif
}
-/****************************************************************************
- Set a fd into blocking/nonblocking mode. Uses POSIX O_NONBLOCK if available,
- else
- if SYSV use O_NDELAY
- if BSD use FNDELAY
-****************************************************************************/
-
-int set_blocking(int fd, bool set)
-{
- int val;
-#ifdef O_NONBLOCK
-#define FLAG_TO_SET O_NONBLOCK
-#else
-#ifdef SYSV
-#define FLAG_TO_SET O_NDELAY
-#else /* BSD */
-#define FLAG_TO_SET FNDELAY
-#endif
-#endif
-
- if((val = sys_fcntl_long(fd, F_GETFL, 0)) == -1)
- return -1;
- if(set) /* Turn blocking on - ie. clear nonblock flag */
- val &= ~FLAG_TO_SET;
- else
- val |= FLAG_TO_SET;
- return sys_fcntl_long( fd, F_SETFL, val);
-#undef FLAG_TO_SET
-}
-
/*******************************************************************
Sleep for a specified number of milliseconds.
********************************************************************/
@@ -1130,26 +1073,6 @@ static void *realloc_(void *ptr, size_t size)
#endif /* PARANOID_MALLOC_CHECKER */
/****************************************************************************
- Type-safe malloc.
-****************************************************************************/
-
-void *malloc_array(size_t el_size, unsigned int count)
-{
- if (count >= MAX_ALLOC_SIZE/el_size) {
- return NULL;
- }
-
- if (el_size == 0 || count == 0) {
- return NULL;
- }
-#if defined(PARANOID_MALLOC_CHECKER)
- return malloc_(el_size*count);
-#else
- return malloc(el_size*count);
-#endif
-}
-
-/****************************************************************************
Type-safe memalign
****************************************************************************/
@@ -1250,21 +1173,6 @@ void *Realloc(void *p, size_t size, bool free_old_on_error)
}
/****************************************************************************
- Type-safe realloc.
-****************************************************************************/
-
-void *realloc_array(void *p, size_t el_size, unsigned int count, bool free_old_on_error)
-{
- if (count >= MAX_ALLOC_SIZE/el_size) {
- if (free_old_on_error) {
- SAFE_FREE(p);
- }
- return NULL;
- }
- return Realloc(p, el_size*count, free_old_on_error);
-}
-
-/****************************************************************************
(Hopefully) efficient array append.
****************************************************************************/
@@ -1334,7 +1242,7 @@ void safe_free(void *p)
Get my own name and IP.
****************************************************************************/
-char *get_myname(TALLOC_CTX *ctx)
+char *talloc_get_myname(TALLOC_CTX *ctx)
{
char *p;
char hostname[HOST_NAME_MAX];
@@ -1549,14 +1457,6 @@ bool process_exists(const struct server_id pid)
#endif
}
-bool process_exists_by_pid(pid_t pid)
-{
- /* Doing kill with a non-positive pid causes messages to be
- * sent to places we don't want. */
- SMB_ASSERT(pid > 0);
- return(kill(pid,0) == 0 || errno != ESRCH);
-}
-
/*******************************************************************
Convert a uid into a user name.
********************************************************************/
@@ -2003,42 +1903,6 @@ void free_namearray(name_compare_entry *name_array)
#define DBGC_CLASS DBGC_LOCKING
/****************************************************************************
- Simple routine to do POSIX file locking. Cruft in NFS and 64->32 bit mapping
- is dealt with in posix.c
- Returns True if the lock was granted, False otherwise.
-****************************************************************************/
-
-bool fcntl_lock(int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type)
-{
- SMB_STRUCT_FLOCK lock;
- int ret;
-
- DEBUG(8,("fcntl_lock fd=%d op=%d offset=%.0f count=%.0f type=%d\n",
- fd,op,(double)offset,(double)count,type));
-
- lock.l_type = type;
- lock.l_whence = SEEK_SET;
- lock.l_start = offset;
- lock.l_len = count;
- lock.l_pid = 0;
-
- ret = sys_fcntl_ptr(fd,op,&lock);
-
- if (ret == -1) {
- int sav = errno;
- DEBUG(3,("fcntl_lock: lock failed at offset %.0f count %.0f op %d type %d (%s)\n",
- (double)offset,(double)count,op,type,strerror(errno)));
- errno = sav;
- return False;
- }
-
- /* everything went OK */
- DEBUG(8,("fcntl_lock: Lock call successful\n"));
-
- return True;
-}
-
-/****************************************************************************
Simple routine to query existing file locks. Cruft in NFS and 64->32 bit mapping
is dealt with in posix.c
Returns True if we have information regarding this lock region (and returns
@@ -2210,57 +2074,6 @@ enum remote_arch_types get_remote_arch(void)
return ra_type;
}
-void print_asc(int level, const unsigned char *buf,int len)
-{
- int i;
- for (i=0;i<len;i++)
- DEBUG(level,("%c", isprint(buf[i])?buf[i]:'.'));
-}
-
-void dump_data(int level, const unsigned char *buf1,int len)
-{
- const unsigned char *buf = (const unsigned char *)buf1;
- int i=0;
- if (len<=0) return;
-
- if (!DEBUGLVL(level)) return;
-
- DEBUGADD(level,("[%03X] ",i));
- for (i=0;i<len;) {
- DEBUGADD(level,("%02X ",(int)buf[i]));
- i++;
- if (i%8 == 0) DEBUGADD(level,(" "));
- if (i%16 == 0) {
- print_asc(level,&buf[i-16],8); DEBUGADD(level,(" "));
- print_asc(level,&buf[i-8],8); DEBUGADD(level,("\n"));
- if (i<len) DEBUGADD(level,("[%03X] ",i));
- }
- }
- if (i%16) {
- int n;
- n = 16 - (i%16);
- DEBUGADD(level,(" "));
- if (n>8) DEBUGADD(level,(" "));
- while (n--) DEBUGADD(level,(" "));
- n = MIN(8,i%16);
- print_asc(level,&buf[i-(i%16)],n); DEBUGADD(level,( " " ));
- n = (i%16) - n;
- if (n>0) print_asc(level,&buf[i-n],n);
- DEBUGADD(level,("\n"));
- }
-}
-
-void dump_data_pw(const char *msg, const uchar * data, size_t len)
-{
-#ifdef DEBUG_PASSWORD
- DEBUG(11, ("%s", msg));
- if (data != NULL && len > 0)
- {
- dump_data(11, data, len);
- }
-#endif
-}
-
const char *tab_depth(int level, int depth)
{
if( CHECK_DEBUGLVL(level) ) {
@@ -2425,78 +2238,6 @@ void *smb_xmalloc_array(size_t size, unsigned int count)
return p;
}
-/**
- Memdup with smb_panic on fail.
-**/
-
-void *smb_xmemdup(const void *p, size_t size)
-{
- void *p2;
- p2 = SMB_XMALLOC_ARRAY(unsigned char,size);
- memcpy(p2, p, size);
- return p2;
-}
-
-/**
- strdup that aborts on malloc fail.
-**/
-
-char *smb_xstrdup(const char *s)
-{
-#if defined(PARANOID_MALLOC_CHECKER)
-#ifdef strdup
-#undef strdup
-#endif
-#endif
-
-#ifndef HAVE_STRDUP
-#define strdup rep_strdup
-#endif
-
- char *s1 = strdup(s);
-#if defined(PARANOID_MALLOC_CHECKER)
-#ifdef strdup
-#undef strdup
-#endif
-#define strdup(s) __ERROR_DONT_USE_STRDUP_DIRECTLY
-#endif
- if (!s1) {
- smb_panic("smb_xstrdup: malloc failed");
- }
- return s1;
-
-}
-
-/**
- strndup that aborts on malloc fail.
-**/
-
-char *smb_xstrndup(const char *s, size_t n)
-{
-#if defined(PARANOID_MALLOC_CHECKER)
-#ifdef strndup
-#undef strndup
-#endif
-#endif
-
-#if (defined(BROKEN_STRNDUP) || !defined(HAVE_STRNDUP))
-#undef HAVE_STRNDUP
-#define strndup rep_strndup
-#endif
-
- char *s1 = strndup(s, n);
-#if defined(PARANOID_MALLOC_CHECKER)
-#ifdef strndup
-#undef strndup
-#endif
-#define strndup(s,n) __ERROR_DONT_USE_STRNDUP_DIRECTLY
-#endif
- if (!s1) {
- smb_panic("smb_xstrndup: malloc failed");
- }
- return s1;
-}
-
/*
vasprintf that aborts on malloc fail
*/
@@ -2506,7 +2247,7 @@ char *smb_xstrndup(const char *s, size_t n)
int n;
va_list ap2;
- VA_COPY(ap2, ap);
+ va_copy(ap2, ap);
n = vasprintf(ptr, format, ap2);
if (n == -1 || ! *ptr) {
@@ -2517,22 +2258,6 @@ char *smb_xstrndup(const char *s, size_t n)
}
/*****************************************************************
- Like strdup but for memory.
-*****************************************************************/
-
-void *memdup(const void *p, size_t size)
-{
- void *p2;
- if (size == 0)
- return NULL;
- p2 = SMB_MALLOC(size);
- if (!p2)
- return NULL;
- memcpy(p2, p, size);
- return p2;
-}
-
-/*****************************************************************
Get local hostname and cache result.
*****************************************************************/
@@ -2542,7 +2267,7 @@ char *myhostname(void)
if (ret == NULL) {
/* This is cached forever so
* use NULL talloc ctx. */
- ret = get_myname(NULL);
+ ret = talloc_get_myname(NULL);
}
return ret;
}
@@ -2561,7 +2286,7 @@ static char *xx_path(const char *name, const char *rootpath)
}
trim_string(fname,"","/");
- if (!directory_exist(fname,NULL)) {
+ if (!directory_exist(fname)) {
mkdir(fname,0755);
}
@@ -2972,25 +2697,6 @@ bool name_to_fqdn(fstring fqdn, const char *name)
}
/**********************************************************************
- Extension to talloc_get_type: Abort on type mismatch
-***********************************************************************/
-
-void *talloc_check_name_abort(const void *ptr, const char *name)
-{
- void *result;
-
- result = talloc_check_name(ptr, name);
- if (result != NULL)
- return result;
-
- DEBUG(0, ("Talloc type mismatch, expected %s, got %s\n",
- name, talloc_get_name(ptr)));
- smb_panic("talloc type mismatch");
- /* Keep the compiler happy */
- return NULL;
-}
-
-/**********************************************************************
Append a DATA_BLOB to a talloc'ed object
***********************************************************************/
diff --git a/source3/lib/util_file.c b/source3/lib/util_file.c
index b628b06cc6..c5a9b7c29a 100644
--- a/source3/lib/util_file.c
+++ b/source3/lib/util_file.c
@@ -19,89 +19,11 @@
#include "includes.h"
-#ifndef MAP_FAILED
-#define MAP_FAILED ((void *)-1)
-#endif
-
-/****************************************************************************
- Read a line from a file with possible \ continuation chars.
- Blanks at the start or end of a line are stripped.
- The string will be allocated if s2 is NULL.
-****************************************************************************/
-
-char *fgets_slash(char *s2,int maxlen,XFILE *f)
-{
- char *s=s2;
- int len = 0;
- int c;
- bool start_of_line = True;
-
- if (x_feof(f)) {
- return(NULL);
- }
-
- if (maxlen <2) {
- return(NULL);
- }
-
- if (!s2) {
- maxlen = MIN(maxlen,8);
- s = (char *)SMB_MALLOC(maxlen);
- }
-
- if (!s) {
- return(NULL);
- }
-
- *s = 0;
-
- while (len < maxlen-1) {
- c = x_getc(f);
- switch (c) {
- case '\r':
- break;
- case '\n':
- while (len > 0 && s[len-1] == ' ') {
- s[--len] = 0;
- }
- if (len > 0 && s[len-1] == '\\') {
- s[--len] = 0;
- start_of_line = True;
- break;
- }
- return(s);
- case EOF:
- if (len <= 0 && !s2) {
- SAFE_FREE(s);
- }
- return(len>0?s:NULL);
- case ' ':
- if (start_of_line) {
- break;
- }
- default:
- start_of_line = False;
- s[len++] = c;
- s[len] = 0;
- }
-
- if (!s2 && len > maxlen-3) {
- maxlen *= 2;
- s = (char *)SMB_REALLOC(s,maxlen);
- if (!s) {
- DEBUG(0,("fgets_slash: failed to expand buffer!\n"));
- return(NULL);
- }
- }
- }
- return(s);
-}
-
-/****************************************************************************
+/**
Load from a pipe into memory.
-****************************************************************************/
+**/
-static char *file_pload(char *syscmd, size_t *size)
+static char *file_pload(const char *syscmd, size_t *size)
{
int fd, n;
char *p;
@@ -143,215 +65,14 @@ static char *file_pload(char *syscmd, size_t *size)
return p;
}
-/****************************************************************************
- Load a file into memory from a fd.
- Truncate at maxsize. If maxsize == 0 - no limit.
-****************************************************************************/
-
-char *fd_load(int fd, size_t *psize, size_t maxsize)
-{
- SMB_STRUCT_STAT sbuf;
- size_t size;
- char *p;
-
- if (sys_fstat(fd, &sbuf) != 0) {
- return NULL;
- }
-
- size = sbuf.st_size;
- if (maxsize) {
- size = MIN(size, maxsize);
- }
-
- p = (char *)SMB_MALLOC(size+1);
- if (!p) {
- return NULL;
- }
-
- if (read(fd, p, size) != size) {
- SAFE_FREE(p);
- return NULL;
- }
- p[size] = 0;
-
- if (psize) {
- *psize = size;
- }
-
- return p;
-}
-
-/****************************************************************************
- Load a file into memory.
-****************************************************************************/
-
-char *file_load(const char *fname, size_t *size, size_t maxsize)
-{
- int fd;
- char *p;
-
- if (!fname || !*fname) {
- return NULL;
- }
-
- fd = open(fname,O_RDONLY);
- if (fd == -1) {
- return NULL;
- }
-
- p = fd_load(fd, size, maxsize);
- close(fd);
- return p;
-}
-
-/*******************************************************************
- unmap or free memory
-*******************************************************************/
-
-bool unmap_file(void* start, size_t size)
-{
-#ifdef HAVE_MMAP
- if ( munmap( start, size ) != 0 ) {
- DEBUG( 1, ("map_file: Failed to unmap address %p "
- "of size %u - %s\n",
- start, (unsigned int)size, strerror(errno) ));
- return False;
- }
- return True;
-#else
- SAFE_FREE( start );
- return True;
-#endif
-}
-
-/*******************************************************************
- mmap (if possible) or read a file.
-********************************************************************/
-
-void *map_file(char *fname, size_t size)
-{
- size_t s2 = 0;
- void *p = NULL;
-#ifdef HAVE_MMAP
- int fd;
- fd = open(fname, O_RDONLY, 0);
- if (fd == -1) {
- DEBUG(2,("map_file: Failed to load %s - %s\n", fname, strerror(errno)));
- return NULL;
- }
- p = mmap(NULL, size, PROT_READ, MAP_SHARED|MAP_FILE, fd, 0);
- close(fd);
- if (p == MAP_FAILED) {
- DEBUG(1,("map_file: Failed to mmap %s - %s\n", fname, strerror(errno)));
- return NULL;
- }
-#endif
- if (!p) {
- p = file_load(fname, &s2, 0);
- if (!p) {
- return NULL;
- }
- if (s2 != size) {
- DEBUG(1,("map_file: incorrect size for %s - got %lu expected %lu\n",
- fname, (unsigned long)s2, (unsigned long)size));
- SAFE_FREE(p);
- return NULL;
- }
- }
- return p;
-}
-
-/****************************************************************************
- Parse a buffer into lines.
-****************************************************************************/
-
-static char **file_lines_parse(char *p, size_t size, int *numlines)
-{
- int i;
- char *s, **ret;
-
- if (!p) {
- return NULL;
- }
-
- for (s = p, i=0; s < p+size; s++) {
- if (s[0] == '\n') i++;
- }
-
- ret = SMB_MALLOC_ARRAY(char *, i+2);
- if (!ret) {
- SAFE_FREE(p);
- return NULL;
- }
- memset(ret, 0, sizeof(ret[0])*(i+2));
-
- ret[0] = p;
- for (s = p, i=0; s < p+size; s++) {
- if (s[0] == '\n') {
- s[0] = 0;
- i++;
- ret[i] = s+1;
- }
- if (s[0] == '\r') {
- s[0] = 0;
- }
- }
-
- /* remove any blank lines at the end */
- while (i > 0 && ret[i-1][0] == 0) {
- i--;
- }
-
- if (numlines) {
- *numlines = i;
- }
-
- return ret;
-}
-
-/****************************************************************************
- Load a file into memory and return an array of pointers to lines in the file
- must be freed with file_lines_free().
-****************************************************************************/
-
-char **file_lines_load(const char *fname, int *numlines, size_t maxsize)
-{
- char *p;
- size_t size = 0;
-
- p = file_load(fname, &size, maxsize);
- if (!p) {
- return NULL;
- }
-
- return file_lines_parse(p, size, numlines);
-}
-
-/****************************************************************************
- Load a fd into memory and return an array of pointers to lines in the file
- must be freed with file_lines_free(). If convert is true calls unix_to_dos on
- the list.
-****************************************************************************/
-char **fd_lines_load(int fd, int *numlines, size_t maxsize)
-{
- char *p;
- size_t size;
- p = fd_load(fd, &size, maxsize);
- if (!p) {
- return NULL;
- }
-
- return file_lines_parse(p, size, numlines);
-}
-
-/****************************************************************************
+/**
Load a pipe into memory and return an array of pointers to lines in the data
must be freed with file_lines_free().
-****************************************************************************/
+**/
-char **file_lines_pload(char *syscmd, int *numlines)
+char **file_lines_pload(const char *syscmd, int *numlines)
{
char *p;
size_t size;
@@ -361,64 +82,5 @@ char **file_lines_pload(char *syscmd, int *numlines)
return NULL;
}
- return file_lines_parse(p, size, numlines);
-}
-
-/****************************************************************************
- Free lines loaded with file_lines_load.
-****************************************************************************/
-
-void file_lines_free(char **lines)
-{
- if (!lines) {
- return;
- }
- SAFE_FREE(lines[0]);
- SAFE_FREE(lines);
-}
-
-/****************************************************************************
- Take a list of lines and modify them to produce a list where \ continues
- a line.
-****************************************************************************/
-
-void file_lines_slashcont(char **lines)
-{
- int i, j;
-
- for (i=0; lines[i];) {
- int len = strlen(lines[i]);
- if (lines[i][len-1] == '\\') {
- lines[i][len-1] = ' ';
- if (lines[i+1]) {
- char *p = &lines[i][len];
- while (p < lines[i+1]) {
- *p++ = ' ';
- }
- for (j = i+1; lines[j]; j++) {
- lines[j] = lines[j+1];
- }
- }
- } else {
- i++;
- }
- }
-}
-
-/****************************************************************************
- Save a lump of data into a file. Mostly used for debugging.
-****************************************************************************/
-
-bool file_save(const char *fname, void *packet, size_t length)
-{
- int fd;
- fd = open(fname, O_WRONLY|O_CREAT|O_TRUNC, 0644);
- if (fd == -1) {
- return False;
- }
- if (write(fd, packet, length) != (size_t)length) {
- return False;
- }
- close(fd);
- return True;
+ return file_lines_parse(p, size, numlines, NULL);
}
diff --git a/source3/lib/util_pw.c b/source3/lib/util_pw.c
index 428378505f..c0d37f1094 100644
--- a/source3/lib/util_pw.c
+++ b/source3/lib/util_pw.c
@@ -47,7 +47,7 @@ struct passwd *getpwnam_alloc(TALLOC_CTX *mem_ctx, const char *name)
struct passwd *temp, *cached;
temp = (struct passwd *)memcache_lookup_talloc(
- NULL, GETPWNAM_CACHE, data_blob_string_const(name));
+ NULL, GETPWNAM_CACHE, data_blob_string_const_null(name));
if (temp != NULL) {
return tcopy_passwd(mem_ctx, temp);
}
@@ -65,7 +65,7 @@ struct passwd *getpwnam_alloc(TALLOC_CTX *mem_ctx, const char *name)
return temp;
}
- memcache_add_talloc(NULL, GETPWNAM_CACHE, data_blob_string_const(name),
+ memcache_add_talloc(NULL, GETPWNAM_CACHE, data_blob_string_const_null(name),
cached);
return tcopy_passwd(mem_ctx, temp);
}
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index e20768ed89..f3dc3fc1d1 100644
--- a/source3/lib/util_sock.c
+++ b/source3/lib/util_sock.c
@@ -1706,7 +1706,7 @@ static bool lookup_nc(struct name_addr_pair *nc)
if (!memcache_lookup(
NULL, SINGLETON_CACHE,
- data_blob_string_const("get_peer_name"),
+ data_blob_string_const_null("get_peer_name"),
&tmp)) {
return false;
}
@@ -1733,7 +1733,7 @@ static void store_nc(const struct name_addr_pair *nc)
memcpy(tmp.data+sizeof(nc->ss), nc->name, namelen+1);
memcache_add(NULL, SINGLETON_CACHE,
- data_blob_string_const("get_peer_name"),
+ data_blob_string_const_null("get_peer_name"),
tmp);
data_blob_free(&tmp);
}
@@ -1945,7 +1945,7 @@ const char *get_mydnsfullname(void)
DATA_BLOB tmp;
if (memcache_lookup(NULL, SINGLETON_CACHE,
- data_blob_string_const("get_mydnsfullname"),
+ data_blob_string_const_null("get_mydnsfullname"),
&tmp)) {
SMB_ASSERT(tmp.length > 0);
return (const char *)tmp.data;
@@ -1989,11 +1989,11 @@ const char *get_mydnsfullname(void)
*/
memcache_add(NULL, SINGLETON_CACHE,
- data_blob_string_const("get_mydnsfullname"),
- data_blob_string_const(res->ai_canonname));
+ data_blob_string_const_null("get_mydnsfullname"),
+ data_blob_string_const_null(res->ai_canonname));
if (!memcache_lookup(NULL, SINGLETON_CACHE,
- data_blob_string_const("get_mydnsfullname"),
+ data_blob_string_const_null("get_mydnsfullname"),
&tmp)) {
tmp = data_blob_talloc(talloc_tos(), res->ai_canonname,
strlen(res->ai_canonname) + 1);
diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c
index 9f952abf10..f6783f10ff 100644
--- a/source3/lib/util_str.c
+++ b/source3/lib/util_str.c
@@ -939,7 +939,7 @@ DATA_BLOB strhex_to_data_blob(TALLOC_CTX *mem_ctx, const char *strhex)
* Routine to print a buffer as HEX digits, into an allocated string.
*/
-char *hex_encode(TALLOC_CTX *mem_ctx, const unsigned char *buff_in, size_t len)
+char *hex_encode_talloc(TALLOC_CTX *mem_ctx, const unsigned char *buff_in, size_t len)
{
int i;
char *hex_buffer;
@@ -1843,136 +1843,6 @@ int fstr_sprintf(fstring s, const char *fmt, ...)
#define S_LIST_ABS 16 /* List Allocation Block Size */
-char **str_list_make(TALLOC_CTX *mem_ctx, const char *string, const char *sep)
-{
- char **list;
- const char *str;
- char *s;
- int num, lsize;
- char *tok;
-
- if (!string || !*string)
- return NULL;
-
- list = TALLOC_ARRAY(mem_ctx, char *, S_LIST_ABS+1);
- if (list == NULL) {
- return NULL;
- }
- lsize = S_LIST_ABS;
-
- s = talloc_strdup(list, string);
- if (s == NULL) {
- DEBUG(0,("str_list_make: Unable to allocate memory"));
- TALLOC_FREE(list);
- return NULL;
- }
- if (!sep) sep = LIST_SEP;
-
- num = 0;
- str = s;
-
- while (next_token_talloc(list, &str, &tok, sep)) {
-
- if (num == lsize) {
- char **tmp;
-
- lsize += S_LIST_ABS;
-
- tmp = TALLOC_REALLOC_ARRAY(mem_ctx, list, char *,
- lsize + 1);
- if (tmp == NULL) {
- DEBUG(0,("str_list_make: "
- "Unable to allocate memory"));
- TALLOC_FREE(list);
- return NULL;
- }
-
- list = tmp;
-
- memset (&list[num], 0,
- ((sizeof(char**)) * (S_LIST_ABS +1)));
- }
-
- list[num] = tok;
- num += 1;
- }
-
- list[num] = NULL;
-
- TALLOC_FREE(s);
- return list;
-}
-
-bool str_list_copy(TALLOC_CTX *mem_ctx, char ***dest, const char **src)
-{
- char **list;
- int i, num;
-
- *dest = NULL;
- if (!src)
- return false;
-
- num = 0;
- while (src[num] != NULL) {
- num += 1;
- }
-
- list = TALLOC_ARRAY(mem_ctx, char *, num+1);
- if (list == NULL) {
- return false;
- }
-
- for (i=0; i<num; i++) {
- list[i] = talloc_strdup(list, src[i]);
- if (list[i] == NULL) {
- TALLOC_FREE(list);
- return false;
- }
- }
- list[i] = NULL;
- *dest = list;
- return true;
-}
-
-/**
- * Return true if all the elements of the list match exactly.
- **/
-bool str_list_compare(char **list1, char **list2)
-{
- int num;
-
- if (!list1 || !list2)
- return (list1 == list2);
-
- for (num = 0; list1[num]; num++) {
- if (!list2[num])
- return false;
- if (!strcsequal(list1[num], list2[num]))
- return false;
- }
- if (list2[num])
- return false; /* if list2 has more elements than list1 fail */
-
- return true;
-}
-
-/******************************************************************************
- *****************************************************************************/
-
-int str_list_count( const char **list )
-{
- int i = 0;
-
- if ( ! list )
- return 0;
-
- /* count the number of list members */
-
- for ( i=0; *list; i++, list++ );
-
- return i;
-}
-
/******************************************************************************
version of standard_sub_basic() for string lists; uses talloc_sub_basic()
for the work
@@ -2386,10 +2256,10 @@ char *base64_encode_data_blob(TALLOC_CTX *mem_ctx, DATA_BLOB data)
}
/* read a SMB_BIG_UINT from a string */
-SMB_BIG_UINT STR_TO_SMB_BIG_UINT(const char *nptr, const char **entptr)
+uint64_t STR_TO_SMB_BIG_UINT(const char *nptr, const char **entptr)
{
- SMB_BIG_UINT val = -1;
+ uint64_t val = -1;
const char *p = nptr;
if (!p) {
@@ -2402,11 +2272,7 @@ SMB_BIG_UINT STR_TO_SMB_BIG_UINT(const char *nptr, const char **entptr)
while (*p && isspace(*p))
p++;
-#ifdef LARGE_SMB_OFF_T
- sscanf(p,"%llu",&val);
-#else /* LARGE_SMB_OFF_T */
- sscanf(p,"%lu",&val);
-#endif /* LARGE_SMB_OFF_T */
+ sscanf(p,"%"PRIu64,&val);
if (entptr) {
while (*p && isdigit(*p))
p++;
diff --git a/source3/lib/util_tdb.c b/source3/lib/util_tdb.c
index 8257232667..bb568bc22e 100644
--- a/source3/lib/util_tdb.c
+++ b/source3/lib/util_tdb.c
@@ -39,28 +39,6 @@ static void gotalarm_sig(void)
gotalarm = 1;
}
-/***************************************************************
- Make a TDB_DATA and keep the const warning in one place
-****************************************************************/
-
-TDB_DATA make_tdb_data(const uint8 *dptr, size_t dsize)
-{
- TDB_DATA ret;
- ret.dptr = CONST_DISCARD(uint8 *, dptr);
- ret.dsize = dsize;
- return ret;
-}
-
-TDB_DATA string_tdb_data(const char *string)
-{
- return make_tdb_data((const uint8 *)string, string ? strlen(string) : 0 );
-}
-
-TDB_DATA string_term_tdb_data(const char *string)
-{
- return make_tdb_data((const uint8 *)string, string ? strlen(string) + 1 : 0);
-}
-
/****************************************************************************
Lock a chain with timeout (in seconds).
****************************************************************************/
@@ -109,17 +87,6 @@ int tdb_chainlock_with_timeout( TDB_CONTEXT *tdb, TDB_DATA key, unsigned int tim
return tdb_chainlock_with_timeout_internal(tdb, key, timeout, F_WRLCK);
}
-/****************************************************************************
- Lock a chain by string. Return -1 if timeout or lock failed.
-****************************************************************************/
-
-int tdb_lock_bystring(TDB_CONTEXT *tdb, const char *keyval)
-{
- TDB_DATA key = string_term_tdb_data(keyval);
-
- return tdb_chainlock(tdb, key);
-}
-
int tdb_lock_bystring_with_timeout(TDB_CONTEXT *tdb, const char *keyval,
int timeout)
{
@@ -129,17 +96,6 @@ int tdb_lock_bystring_with_timeout(TDB_CONTEXT *tdb, const char *keyval,
}
/****************************************************************************
- Unlock a chain by string.
-****************************************************************************/
-
-void tdb_unlock_bystring(TDB_CONTEXT *tdb, const char *keyval)
-{
- TDB_DATA key = string_term_tdb_data(keyval);
-
- tdb_chainunlock(tdb, key);
-}
-
-/****************************************************************************
Read lock a chain by string. Return -1 if timeout or lock failed.
****************************************************************************/
@@ -150,155 +106,8 @@ int tdb_read_lock_bystring_with_timeout(TDB_CONTEXT *tdb, const char *keyval, un
return tdb_chainlock_with_timeout_internal(tdb, key, timeout, F_RDLCK);
}
-/****************************************************************************
- Read unlock a chain by string.
-****************************************************************************/
-
-void tdb_read_unlock_bystring(TDB_CONTEXT *tdb, const char *keyval)
-{
- TDB_DATA key = string_term_tdb_data(keyval);
-
- tdb_chainunlock_read(tdb, key);
-}
-
-
-/****************************************************************************
- Fetch a int32 value by a arbitrary blob key, return -1 if not found.
- Output is int32 in native byte order.
-****************************************************************************/
-
-int32 tdb_fetch_int32_byblob(TDB_CONTEXT *tdb, TDB_DATA key)
-{
- TDB_DATA data;
- int32 ret;
-
- data = tdb_fetch(tdb, key);
- if (!data.dptr || data.dsize != sizeof(int32)) {
- SAFE_FREE(data.dptr);
- return -1;
- }
-
- ret = IVAL(data.dptr,0);
- SAFE_FREE(data.dptr);
- return ret;
-}
-
-/****************************************************************************
- Fetch a int32 value by string key, return -1 if not found.
- Output is int32 in native byte order.
-****************************************************************************/
-
-int32 tdb_fetch_int32(TDB_CONTEXT *tdb, const char *keystr)
-{
- TDB_DATA key = string_term_tdb_data(keystr);
-
- return tdb_fetch_int32_byblob(tdb, key);
-}
-
-/****************************************************************************
- Store a int32 value by an arbitary blob key, return 0 on success, -1 on failure.
- Input is int32 in native byte order. Output in tdb is in little-endian.
-****************************************************************************/
-
-int tdb_store_int32_byblob(TDB_CONTEXT *tdb, TDB_DATA key, int32 v)
-{
- TDB_DATA data;
- int32 v_store;
-
- SIVAL(&v_store,0,v);
- data.dptr = (uint8 *)&v_store;
- data.dsize = sizeof(int32);
-
- return tdb_store(tdb, key, data, TDB_REPLACE);
-}
-
-/****************************************************************************
- Store a int32 value by string key, return 0 on success, -1 on failure.
- Input is int32 in native byte order. Output in tdb is in little-endian.
-****************************************************************************/
-
-int tdb_store_int32(TDB_CONTEXT *tdb, const char *keystr, int32 v)
-{
- TDB_DATA key = string_term_tdb_data(keystr);
-
- return tdb_store_int32_byblob(tdb, key, v);
-}
-
-/****************************************************************************
- Fetch a uint32 value by a arbitrary blob key, return -1 if not found.
- Output is uint32 in native byte order.
-****************************************************************************/
-
-bool tdb_fetch_uint32_byblob(TDB_CONTEXT *tdb, TDB_DATA key, uint32 *value)
-{
- TDB_DATA data;
-
- data = tdb_fetch(tdb, key);
- if (!data.dptr || data.dsize != sizeof(uint32)) {
- SAFE_FREE(data.dptr);
- return False;
- }
-
- *value = IVAL(data.dptr,0);
- SAFE_FREE(data.dptr);
- return True;
-}
-
-/****************************************************************************
- Fetch a uint32 value by string key, return -1 if not found.
- Output is uint32 in native byte order.
-****************************************************************************/
-
-bool tdb_fetch_uint32(TDB_CONTEXT *tdb, const char *keystr, uint32 *value)
-{
- TDB_DATA key = string_term_tdb_data(keystr);
-
- return tdb_fetch_uint32_byblob(tdb, key, value);
-}
-
-/****************************************************************************
- Store a uint32 value by an arbitary blob key, return 0 on success, -1 on failure.
- Input is uint32 in native byte order. Output in tdb is in little-endian.
-****************************************************************************/
-
-bool tdb_store_uint32_byblob(TDB_CONTEXT *tdb, TDB_DATA key, uint32 value)
-{
- TDB_DATA data;
- uint32 v_store;
- bool ret = True;
-
- SIVAL(&v_store, 0, value);
- data.dptr = (uint8 *)&v_store;
- data.dsize = sizeof(uint32);
- if (tdb_store(tdb, key, data, TDB_REPLACE) == -1)
- ret = False;
- return ret;
-}
-
-/****************************************************************************
- Store a uint32 value by string key, return 0 on success, -1 on failure.
- Input is uint32 in native byte order. Output in tdb is in little-endian.
-****************************************************************************/
-
-bool tdb_store_uint32(TDB_CONTEXT *tdb, const char *keystr, uint32 value)
-{
- TDB_DATA key = string_term_tdb_data(keystr);
-
- return tdb_store_uint32_byblob(tdb, key, value);
-}
-/****************************************************************************
- Store a buffer by a null terminated string key. Return 0 on success, -1
- on failure.
-****************************************************************************/
-
-int tdb_store_bystring(TDB_CONTEXT *tdb, const char *keystr, TDB_DATA data, int flags)
-{
- TDB_DATA key = string_term_tdb_data(keystr);
-
- return tdb_store(tdb, key, data, flags);
-}
int tdb_trans_store_bystring(TDB_CONTEXT *tdb, const char *keystr,
TDB_DATA data, int flags)
@@ -309,112 +118,6 @@ int tdb_trans_store_bystring(TDB_CONTEXT *tdb, const char *keystr,
}
/****************************************************************************
- Fetch a buffer using a null terminated string key. Don't forget to call
- free() on the result dptr.
-****************************************************************************/
-
-TDB_DATA tdb_fetch_bystring(TDB_CONTEXT *tdb, const char *keystr)
-{
- TDB_DATA key = string_term_tdb_data(keystr);
-
- return tdb_fetch(tdb, key);
-}
-
-/****************************************************************************
- Delete an entry using a null terminated string key.
-****************************************************************************/
-
-int tdb_delete_bystring(TDB_CONTEXT *tdb, const char *keystr)
-{
- TDB_DATA key = string_term_tdb_data(keystr);
-
- return tdb_delete(tdb, key);
-}
-
-/****************************************************************************
- Atomic integer change. Returns old value. To create, set initial value in *oldval.
-****************************************************************************/
-
-int32 tdb_change_int32_atomic(TDB_CONTEXT *tdb, const char *keystr, int32 *oldval, int32 change_val)
-{
- int32 val;
- int32 ret = -1;
-
- if (tdb_lock_bystring(tdb, keystr) == -1)
- return -1;
-
- if ((val = tdb_fetch_int32(tdb, keystr)) == -1) {
- /* The lookup failed */
- if (tdb_error(tdb) != TDB_ERR_NOEXIST) {
- /* but not because it didn't exist */
- goto err_out;
- }
-
- /* Start with 'old' value */
- val = *oldval;
-
- } else {
- /* It worked, set return value (oldval) to tdb data */
- *oldval = val;
- }
-
- /* Increment value for storage and return next time */
- val += change_val;
-
- if (tdb_store_int32(tdb, keystr, val) == -1)
- goto err_out;
-
- ret = 0;
-
- err_out:
-
- tdb_unlock_bystring(tdb, keystr);
- return ret;
-}
-
-/****************************************************************************
- Atomic unsigned integer change. Returns old value. To create, set initial value in *oldval.
-****************************************************************************/
-
-bool tdb_change_uint32_atomic(TDB_CONTEXT *tdb, const char *keystr, uint32 *oldval, uint32 change_val)
-{
- uint32 val;
- bool ret = False;
-
- if (tdb_lock_bystring(tdb, keystr) == -1)
- return False;
-
- if (!tdb_fetch_uint32(tdb, keystr, &val)) {
- /* It failed */
- if (tdb_error(tdb) != TDB_ERR_NOEXIST) {
- /* and not because it didn't exist */
- goto err_out;
- }
-
- /* Start with 'old' value */
- val = *oldval;
-
- } else {
- /* it worked, set return value (oldval) to tdb data */
- *oldval = val;
-
- }
-
- /* get a new value to store */
- val += change_val;
-
- if (!tdb_store_uint32(tdb, keystr, val))
- goto err_out;
-
- ret = True;
-
- err_out:
-
- tdb_unlock_bystring(tdb, keystr);
- return ret;
-}
-
-/****************************************************************************
Useful pair of routines for packing/unpacking data consisting of
integers and strings.
****************************************************************************/
diff --git a/source3/lib/util_uuid.c b/source3/lib/util_uuid.c
index 3a8f7b3f4f..c681b66d34 100644
--- a/source3/lib/util_uuid.c
+++ b/source3/lib/util_uuid.c
@@ -20,12 +20,6 @@
#include "includes.h"
-/*
- * Offset between 15-Oct-1582 and 1-Jan-70
- */
-#define TIME_OFFSET_HIGH 0x01B21DD2
-#define TIME_OFFSET_LOW 0x13814000
-
void smb_uuid_pack(const struct GUID uu, UUID_FLAT *ptr)
{
SIVAL(ptr->info, 0, uu.time_low);
@@ -44,78 +38,6 @@ void smb_uuid_unpack(const UUID_FLAT in, struct GUID *uu)
memcpy(uu->node, in.info+10, 6);
}
-void smb_uuid_generate_random(struct GUID *uu)
-{
- UUID_FLAT tmp;
-
- generate_random_buffer(tmp.info, sizeof(tmp.info));
- smb_uuid_unpack(tmp, uu);
-
- uu->clock_seq[0] = (uu->clock_seq[0] & 0x3F) | 0x80;
- uu->time_hi_and_version = (uu->time_hi_and_version & 0x0FFF) | 0x4000;
-}
-
-const char *smb_uuid_string(TALLOC_CTX *mem_ctx, const struct GUID uu)
-{
- char *result;
-
- result = talloc_asprintf(
- mem_ctx,
- "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
- uu.time_low, uu.time_mid, uu.time_hi_and_version,
- uu.clock_seq[0], uu.clock_seq[1],
- uu.node[0], uu.node[1], uu.node[2],
- uu.node[3], uu.node[4], uu.node[5]);
-
- SMB_ASSERT(result != NULL);
- return result;
-}
-
-bool smb_string_to_uuid(const char *in, struct GUID* uu)
-{
- bool ret = False;
- const char *ptr = in;
- char *end = (char *)in;
- int i;
- unsigned v1, v2;
-
- if (!in || !uu) goto out;
-
- uu->time_low = strtoul(ptr, &end, 16);
- if ((end - ptr) != 8 || *end != '-') goto out;
- ptr = (end + 1);
-
- uu->time_mid = strtoul(ptr, &end, 16);
- if ((end - ptr) != 4 || *end != '-') goto out;
- ptr = (end + 1);
-
- uu->time_hi_and_version = strtoul(ptr, &end, 16);
- if ((end - ptr) != 4 || *end != '-') goto out;
- ptr = (end + 1);
-
- if (sscanf(ptr, "%02x%02x", &v1, &v2) != 2) {
- goto out;
- }
- uu->clock_seq[0] = v1;
- uu->clock_seq[1] = v2;
- ptr += 4;
-
- if (*ptr != '-') goto out;
- ptr++;
-
- for (i = 0; i < 6; i++) {
- if (sscanf(ptr, "%02x", &v1) != 1) {
- goto out;
- }
- uu->node[i] = v1;
- ptr += 2;
- }
-
- ret = True;
-out:
- return ret;
-}
-
/*****************************************************************
Return the binary string representation of a GUID.
Caller must free.
diff --git a/source3/lib/xfile.c b/source3/lib/xfile.c
deleted file mode 100644
index e44a92d34d..0000000000
--- a/source3/lib/xfile.c
+++ /dev/null
@@ -1,417 +0,0 @@
-/*
- Unix SMB/CIFS implementation.
- stdio replacement
- Copyright (C) Andrew Tridgell 2001
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-/*
- stdio is very convenient, but on some systems the file descriptor
- in FILE* is 8 bits, so it fails when more than 255 files are open.
-
- XFILE replaces stdio. It is less efficient, but at least it works
- when you have lots of files open
-
- The main restriction on XFILE is that it doesn't support seeking,
- and doesn't support O_RDWR. That keeps the code simple.
-*/
-
-#include "includes.h"
-
-#define XBUFSIZE BUFSIZ
-
-static XFILE _x_stdin = { 0, NULL, NULL, XBUFSIZE, 0, O_RDONLY, X_IOFBF, 0 };
-static XFILE _x_stdout = { 1, NULL, NULL, XBUFSIZE, 0, O_WRONLY, X_IOLBF, 0 };
-static XFILE _x_stderr = { 2, NULL, NULL, 0, 0, O_WRONLY, X_IONBF, 0 };
-
-XFILE *x_stdin = &_x_stdin;
-XFILE *x_stdout = &_x_stdout;
-XFILE *x_stderr = &_x_stderr;
-
-#define X_FLAG_EOF 1
-#define X_FLAG_ERROR 2
-#define X_FLAG_EINVAL 3
-
-/* simulate setvbuf() */
-int x_setvbuf(XFILE *f, char *buf, int mode, size_t size)
-{
- if (x_fflush(f) != 0) return -1;
- if (f->bufused) return -1;
-
- /* on files being read full buffering is the only option */
- if ((f->open_flags & O_ACCMODE) == O_RDONLY) {
- mode = X_IOFBF;
- }
-
- /* destroy any earlier buffer */
- SAFE_FREE(f->buf);
- f->buf = 0;
- f->bufsize = 0;
- f->next = NULL;
- f->bufused = 0;
- f->buftype = mode;
-
- if (f->buftype == X_IONBF) return 0;
-
- /* if buffering then we need some size */
- if (size == 0) size = XBUFSIZE;
-
- f->bufsize = size;
- f->bufused = 0;
-
- return 0;
-}
-
-/* allocate the buffer */
-static int x_allocate_buffer(XFILE *f)
-{
- if (f->buf) return 1;
- if (f->bufsize == 0) return 0;
- f->buf = (char *)SMB_MALLOC(f->bufsize);
- if (!f->buf) return 0;
- f->next = f->buf;
- return 1;
-}
-
-
-/* this looks more like open() than fopen(), but that is quite deliberate.
- I want programmers to *think* about O_EXCL, O_CREAT etc not just
- get them magically added
-*/
-XFILE *x_fopen(const char *fname, int flags, mode_t mode)
-{
- XFILE *ret;
-
- ret = SMB_MALLOC_P(XFILE);
- if (!ret) {
- return NULL;
- }
-
- memset(ret, 0, sizeof(XFILE));
-
- if ((flags & O_ACCMODE) == O_RDWR) {
- /* we don't support RDWR in XFILE - use file
- descriptors instead */
- SAFE_FREE(ret);
- errno = EINVAL;
- return NULL;
- }
-
- ret->open_flags = flags;
-
- ret->fd = sys_open(fname, flags, mode);
- if (ret->fd == -1) {
- SAFE_FREE(ret);
- return NULL;
- }
-
- x_setvbuf(ret, NULL, X_IOFBF, XBUFSIZE);
-
- return ret;
-}
-
-XFILE *x_fdup(const XFILE *f)
-{
- XFILE *ret;
- int fd;
-
- fd = dup(x_fileno(f));
- if (fd < 0) {
- return NULL;
- }
-
- ret = SMB_CALLOC_ARRAY(XFILE, 1);
- if (!ret) {
- close(fd);
- return NULL;
- }
-
- ret->fd = fd;
- ret->open_flags = f->open_flags;
- x_setvbuf(ret, NULL, X_IOFBF, XBUFSIZE);
- return ret;
-}
-
-/* simulate fclose() */
-int x_fclose(XFILE *f)
-{
- int ret;
-
- /* make sure we flush any buffered data */
- (void)x_fflush(f);
-
- ret = close(f->fd);
- f->fd = -1;
- if (f->buf) {
- /* make sure data can't leak into a later malloc */
- memset(f->buf, 0, f->bufsize);
- SAFE_FREE(f->buf);
- }
- /* check the file descriptor given to the function is NOT one of the static
- * descriptor of this libreary or we will free unallocated memory
- * --sss */
- if (f != x_stdin && f != x_stdout && f != x_stderr) {
- SAFE_FREE(f);
- }
- return ret;
-}
-
-/* simulate fwrite() */
-size_t x_fwrite(const void *p, size_t size, size_t nmemb, XFILE *f)
-{
- ssize_t ret;
- size_t total=0;
-
- /* we might be writing unbuffered */
- if (f->buftype == X_IONBF ||
- (!f->buf && !x_allocate_buffer(f))) {
- ret = write(f->fd, p, size*nmemb);
- if (ret == -1) return -1;
- return ret/size;
- }
-
-
- while (total < size*nmemb) {
- size_t n = f->bufsize - f->bufused;
- n = MIN(n, (size*nmemb)-total);
-
- if (n == 0) {
- /* it's full, flush it */
- if (x_fflush(f) != 0) {
- return -1;
- }
- continue;
- }
-
- memcpy(f->buf + f->bufused, total+(const char *)p, n);
- f->bufused += n;
- total += n;
- }
-
- /* when line buffered we need to flush at the last linefeed. This can
- flush a bit more than necessary, but that is harmless */
- if (f->buftype == X_IOLBF && f->bufused) {
- int i;
- for (i=(size*nmemb)-1; i>=0; i--) {
- if (*(i+(const char *)p) == '\n') {
- if (x_fflush(f) != 0) {
- return -1;
- }
- break;
- }
- }
- }
-
- return total/size;
-}
-
-/* thank goodness for asprintf() */
- int x_vfprintf(XFILE *f, const char *format, va_list ap)
-{
- char *p;
- int len, ret;
- va_list ap2;
-
- VA_COPY(ap2, ap);
-
- len = vasprintf(&p, format, ap2);
- if (len <= 0) {
- va_end(ap2);
- return len;
- }
- ret = x_fwrite(p, 1, len, f);
- SAFE_FREE(p);
-
- va_end(ap2);
-
- return ret;
-}
-
- int x_fprintf(XFILE *f, const char *format, ...)
-{
- va_list ap;
- int ret;
-
- va_start(ap, format);
- ret = x_vfprintf(f, format, ap);
- va_end(ap);
- return ret;
-}
-
-/* at least fileno() is simple! */
-int x_fileno(const XFILE *f)
-{
- return f->fd;
-}
-
-/* simulate fflush() */
-int x_fflush(XFILE *f)
-{
- int ret;
-
- if (f->flags & X_FLAG_ERROR) return -1;
-
- if (f->bufused == 0 || !f->buf) return 0;
-
- if ((f->open_flags & O_ACCMODE) != O_WRONLY) {
- errno = EINVAL;
- return -1;
- }
-
- ret = write(f->fd, f->buf, f->bufused);
- if (ret == -1) return -1;
-
- f->bufused -= ret;
- if (f->bufused > 0) {
- f->flags |= X_FLAG_ERROR;
- memmove(f->buf, ret + (char *)f->buf, f->bufused);
- return -1;
- }
-
- return 0;
-}
-
-/* simulate setbuffer() */
-void x_setbuffer(XFILE *f, char *buf, size_t size)
-{
- x_setvbuf(f, buf, buf?X_IOFBF:X_IONBF, size);
-}
-
-/* simulate setbuf() */
-void x_setbuf(XFILE *f, char *buf)
-{
- x_setvbuf(f, buf, buf?X_IOFBF:X_IONBF, XBUFSIZE);
-}
-
-/* simulate setlinebuf() */
-void x_setlinebuf(XFILE *f)
-{
- x_setvbuf(f, NULL, X_IOLBF, 0);
-}
-
-
-/* simulate feof() */
-int x_feof(XFILE *f)
-{
- if (f->flags & X_FLAG_EOF) return 1;
- return 0;
-}
-
-/* simulate ferror() */
-int x_ferror(XFILE *f)
-{
- if (f->flags & X_FLAG_ERROR) return 1;
- return 0;
-}
-
-/* fill the read buffer */
-static void x_fillbuf(XFILE *f)
-{
- int n;
-
- if (f->bufused) return;
-
- if (!f->buf && !x_allocate_buffer(f)) return;
-
- n = read(f->fd, f->buf, f->bufsize);
- if (n <= 0) return;
- f->bufused = n;
- f->next = f->buf;
-}
-
-/* simulate fgetc() */
-int x_fgetc(XFILE *f)
-{
- int ret;
-
- if (f->flags & (X_FLAG_EOF | X_FLAG_ERROR)) return EOF;
-
- if (f->bufused == 0) x_fillbuf(f);
-
- if (f->bufused == 0) {
- f->flags |= X_FLAG_EOF;
- return EOF;
- }
-
- ret = *(unsigned char *)(f->next);
- f->next++;
- f->bufused--;
- return ret;
-}
-
-/* simulate fread */
-size_t x_fread(void *p, size_t size, size_t nmemb, XFILE *f)
-{
- size_t total = 0;
- while (total < size*nmemb) {
- int c = x_fgetc(f);
- if (c == EOF) break;
- (total+(char *)p)[0] = (char)c;
- total++;
- }
- return total/size;
-}
-
-/* simulate fgets() */
-char *x_fgets(char *s, int size, XFILE *stream)
-{
- char *s0 = s;
- int l = size;
- while (l>1) {
- int c = x_fgetc(stream);
- if (c == EOF) break;
- *s++ = (char)c;
- l--;
- if (c == '\n') break;
- }
- if (l==size || x_ferror(stream)) {
- return 0;
- }
- *s = 0;
- return s0;
-}
-
-/* trivial seek, works only for SEEK_SET and SEEK_END if SEEK_CUR is
- * set then an error is returned */
-off_t x_tseek(XFILE *f, off_t offset, int whence)
-{
- if (f->flags & X_FLAG_ERROR)
- return -1;
-
- /* only SEEK_SET and SEEK_END are supported */
- /* SEEK_CUR needs internal offset counter */
- if (whence != SEEK_SET && whence != SEEK_END) {
- f->flags |= X_FLAG_EINVAL;
- errno = EINVAL;
- return -1;
- }
-
- /* empty the buffer */
- switch (f->open_flags & O_ACCMODE) {
- case O_RDONLY:
- f->bufused = 0;
- break;
- case O_WRONLY:
- if (x_fflush(f) != 0)
- return -1;
- break;
- default:
- errno = EINVAL;
- return -1;
- }
-
- f->flags &= ~X_FLAG_EOF;
- return (off_t)sys_lseek(f->fd, offset, whence);
-}
diff --git a/source3/libads/authdata.c b/source3/libads/authdata.c
index 40f051c851..5a7bd24507 100644
--- a/source3/libads/authdata.c
+++ b/source3/libads/authdata.c
@@ -403,12 +403,12 @@ NTSTATUS kerberos_return_pac(TALLOC_CTX *mem_ctx,
DEBUG(10,("got TGT for %s in %s\n", auth_princ, cc));
if (expire_time) {
DEBUGADD(10,("\tvalid until: %s (%d)\n",
- http_timestring(*expire_time),
+ http_timestring(talloc_tos(), *expire_time),
(int)*expire_time));
}
if (renew_till_time) {
DEBUGADD(10,("\trenewable till: %s (%d)\n",
- http_timestring(*renew_till_time),
+ http_timestring(talloc_tos(), *renew_till_time),
(int)*renew_till_time));
}
diff --git a/source3/libads/disp_sec.c b/source3/libads/disp_sec.c
index f4c68638df..a5e04a4a6c 100644
--- a/source3/libads/disp_sec.c
+++ b/source3/libads/disp_sec.c
@@ -114,15 +114,15 @@ static void ads_disp_sec_ace_object(ADS_STRUCT *ads,
{
if (object->flags & SEC_ACE_OBJECT_PRESENT) {
printf("Object type: SEC_ACE_OBJECT_PRESENT\n");
- printf("Object GUID: %s (%s)\n", smb_uuid_string(mem_ctx,
- object->type.type),
+ printf("Object GUID: %s (%s)\n", GUID_string(mem_ctx,
+ &object->type.type),
ads_interprete_guid_from_object(ads, mem_ctx,
&object->type.type));
}
if (object->flags & SEC_ACE_OBJECT_INHERITED_PRESENT) {
printf("Object type: SEC_ACE_OBJECT_INHERITED_PRESENT\n");
- printf("Object GUID: %s (%s)\n", smb_uuid_string(mem_ctx,
- object->inherited_type.inherited_type),
+ printf("Object GUID: %s (%s)\n", GUID_string(mem_ctx,
+ &object->inherited_type.inherited_type),
ads_interprete_guid_from_object(ads, mem_ctx,
&object->inherited_type.inherited_type));
}
diff --git a/source3/libads/krb5_setpw.c b/source3/libads/krb5_setpw.c
index 719f3bd3ec..0ff9f2ba32 100644
--- a/source3/libads/krb5_setpw.c
+++ b/source3/libads/krb5_setpw.c
@@ -285,7 +285,7 @@ static krb5_error_code parse_setpw_reply(krb5_context context,
return KRB5KRB_AP_ERR_MODIFIED;
}
- p = packet->data;
+ p = (char *)packet->data;
/*
** see if it is an error
*/
@@ -368,7 +368,7 @@ static krb5_error_code parse_setpw_reply(krb5_context context,
return KRB5KRB_AP_ERR_MODIFIED;
}
- p = clearresult.data;
+ p = (char *)clearresult.data;
res_code = RSVAL(p, 0);
@@ -687,10 +687,10 @@ kerb_prompter(krb5_context ctx, void *data,
memset(prompts[0].reply->data, 0, prompts[0].reply->length);
if (prompts[0].reply->length > 0) {
if (data) {
- strncpy(prompts[0].reply->data,
+ strncpy((char *)prompts[0].reply->data,
(const char *)data,
prompts[0].reply->length-1);
- prompts[0].reply->length = strlen(prompts[0].reply->data);
+ prompts[0].reply->length = strlen((const char *)prompts[0].reply->data);
} else {
prompts[0].reply->length = 0;
}
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index 40f052281d..2dcd1fd6ae 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -801,7 +801,7 @@ static ADS_STATUS ads_do_paged_search_args(ADS_STRUCT *ads,
int *count, struct berval **cookie)
{
int rc, i, version;
- char *utf8_expr, *utf8_path, **search_attrs;
+ char *utf8_expr, *utf8_path, **search_attrs = NULL;
size_t converted_size;
LDAPControl PagedResults, NoReferrals, ExternalCtrl, *controls[4], **rcontrols;
BerElement *cookie_be = NULL;
@@ -832,7 +832,7 @@ static ADS_STATUS ads_do_paged_search_args(ADS_STRUCT *ads,
else {
/* This would be the utf8-encoded version...*/
/* if (!(search_attrs = ads_push_strvals(ctx, attrs))) */
- if (!(str_list_copy(talloc_tos(), &search_attrs, attrs))) {
+ if (!(search_attrs = str_list_copy(talloc_tos(), attrs))) {
rc = LDAP_NO_MEMORY;
goto done;
}
@@ -1144,7 +1144,7 @@ ADS_STATUS ads_do_search_all_fn(ADS_STRUCT *ads, const char *bind_path,
else {
/* This would be the utf8-encoded version...*/
/* if (!(search_attrs = ads_push_strvals(ctx, attrs))) */
- if (!(str_list_copy(talloc_tos(), &search_attrs, attrs)))
+ if (!(search_attrs = str_list_copy(talloc_tos(), attrs)))
{
DEBUG(1,("ads_do_search: str_list_copy() failed!"));
rc = LDAP_NO_MEMORY;
@@ -2062,7 +2062,7 @@ static void dump_guid(ADS_STRUCT *ads, const char *field, struct berval **values
memcpy(guid.info, values[i]->bv_val, sizeof(guid.info));
smb_uuid_unpack(guid, &tmp);
- printf("%s: %s\n", field, smb_uuid_string(talloc_tos(), tmp));
+ printf("%s: %s\n", field, GUID_string(talloc_tos(), &tmp));
}
}
@@ -3748,7 +3748,7 @@ const char *ads_get_extended_right_name_by_guid(ADS_STRUCT *ads,
}
expr = talloc_asprintf(mem_ctx, "(rightsGuid=%s)",
- smb_uuid_string(mem_ctx, *rights_guid));
+ GUID_string(mem_ctx, rights_guid));
if (!expr) {
goto done;
}
diff --git a/source3/libads/util.c b/source3/libads/util.c
index d23c36f326..9866a15285 100644
--- a/source3/libads/util.c
+++ b/source3/libads/util.c
@@ -33,7 +33,7 @@ ADS_STATUS ads_change_trust_account_password(ADS_STRUCT *ads, char *host_princip
return ADS_ERROR_SYSTEM(ENOENT);
}
- new_password = generate_random_str(DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH);
+ new_password = generate_random_str(talloc_tos(), DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH);
ret = kerberos_set_password(ads->auth.kdc_server, host_principal, password, host_principal, new_password, ads->auth.time_offset);
diff --git a/source3/libgpo/gpext/registry.c b/source3/libgpo/gpext/registry.c
index 188a48ab49..f501498407 100644
--- a/source3/libgpo/gpext/registry.c
+++ b/source3/libgpo/gpext/registry.c
@@ -410,7 +410,7 @@ static NTSTATUS reg_parse_registry(TALLOC_CTX *mem_ctx,
return status;
}
- buf = (uint16 *)file_load(real_filename, &n, 0);
+ buf = (uint16 *)file_load(real_filename, &n, 0, NULL);
if (!buf) {
TALLOC_FREE(reg_file);
return NT_STATUS_CANNOT_LOAD_REGISTRY_FILE;
@@ -455,7 +455,7 @@ static NTSTATUS reg_parse_registry(TALLOC_CTX *mem_ctx,
status = NT_STATUS_OK;
out:
- SAFE_FREE(buf);
+ TALLOC_FREE(buf);
prs_mem_free(&ps);
return status;
diff --git a/source3/libgpo/gpext/security.c b/source3/libgpo/gpext/security.c
index 1d746da37f..6aeb354c41 100644
--- a/source3/libgpo/gpext/security.c
+++ b/source3/libgpo/gpext/security.c
@@ -249,7 +249,7 @@ static struct gp_extension_methods security_methods = {
/****************************************************************
****************************************************************/
-static NTSTATUS gpext_security_init(void)
+NTSTATUS gpext_security_init(void)
{
NTSTATUS status;
diff --git a/source3/libgpo/gpo_ini.c b/source3/libgpo/gpo_ini.c
index 54aaffa477..aa8f7c7770 100644
--- a/source3/libgpo/gpo_ini.c
+++ b/source3/libgpo/gpo_ini.c
@@ -63,7 +63,7 @@ static NTSTATUS convert_file_from_ucs2(TALLOC_CTX *mem_ctx,
return NT_STATUS_INVALID_PARAMETER;
}
- data_in = (uint8 *)file_load(filename_in, &n, 0);
+ data_in = (uint8 *)file_load(filename_in, &n, 0, NULL);
if (!data_in) {
status = NT_STATUS_NO_SUCH_FILE;
goto out;
@@ -116,7 +116,7 @@ static NTSTATUS convert_file_from_ucs2(TALLOC_CTX *mem_ctx,
close(tmp_fd);
}
- SAFE_FREE(data_in);
+ TALLOC_FREE(data_in);
return status;
}
diff --git a/source3/libnet/libnet_dssync.c b/source3/libnet/libnet_dssync.c
index bae03effed..81866c85ba 100644
--- a/source3/libnet/libnet_dssync.c
+++ b/source3/libnet/libnet_dssync.c
@@ -297,7 +297,7 @@ static NTSTATUS libnet_dssync_lookup_nc(TALLOC_CTX *mem_ctx,
req.req1.count = 1;
req.req1.names = names;
req.req1.format_flags = DRSUAPI_DS_NAME_FLAG_NO_FLAGS;
- req.req1.format_offered = DRSUAPI_DS_NAME_FORMAT_UKNOWN;
+ req.req1.format_offered = DRSUAPI_DS_NAME_FORMAT_UNKNOWN;
req.req1.format_desired = DRSUAPI_DS_NAME_FORMAT_FQDN_1779;
status = rpccli_drsuapi_DsCrackNames(ctx->cli, mem_ctx,
@@ -539,17 +539,24 @@ static NTSTATUS libnet_dssync_getncchanges(TALLOC_CTX *mem_ctx,
if (level_out == 1) {
out_level = 1;
ctr1 = &ctr.ctr1;
- } else if (level_out == 2) {
+ } else if (level_out == 2 && ctr.ctr2.mszip1.ts) {
out_level = 1;
- ctr1 = ctr.ctr2.ctr.mszip1.ctr1;
+ ctr1 = &ctr.ctr2.mszip1.ts->ctr1;
} else if (level_out == 6) {
out_level = 6;
ctr6 = &ctr.ctr6;
} else if (level_out == 7
&& ctr.ctr7.level == 6
- && ctr.ctr7.type == DRSUAPI_COMPRESSION_TYPE_MSZIP) {
+ && ctr.ctr7.type == DRSUAPI_COMPRESSION_TYPE_MSZIP
+ && ctr.ctr7.ctr.mszip6.ts) {
out_level = 6;
- ctr6 = ctr.ctr7.ctr.mszip6.ctr6;
+ ctr6 = &ctr.ctr7.ctr.mszip6.ts->ctr6;
+ } else if (level_out == 7
+ && ctr.ctr7.level == 6
+ && ctr.ctr7.type == DRSUAPI_COMPRESSION_TYPE_XPRESS
+ && ctr.ctr7.ctr.xpress6.ts) {
+ out_level = 6;
+ ctr6 = &ctr.ctr7.ctr.xpress6.ts->ctr6;
}
if (out_level == 1) {
diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c
index ab8af0be6b..6935e000dc 100644
--- a/source3/libnet/libnet_join.c
+++ b/source3/libnet/libnet_join.c
@@ -775,7 +775,7 @@ static NTSTATUS libnet_join_joindomain_rpc(TALLOC_CTX *mem_ctx,
ZERO_STRUCT(user_pol);
if (!r->in.machine_password) {
- r->in.machine_password = talloc_strdup(mem_ctx, generate_random_str(DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH));
+ r->in.machine_password = generate_random_str(mem_ctx, DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH);
NT_STATUS_HAVE_NO_MEMORY(r->in.machine_password);
}
diff --git a/source3/librpc/gen_ndr/cli_initshutdown.c b/source3/librpc/gen_ndr/cli_initshutdown.c
index ab48623ee1..bc8ca5b5f1 100644
--- a/source3/librpc/gen_ndr/cli_initshutdown.c
+++ b/source3/librpc/gen_ndr/cli_initshutdown.c
@@ -9,7 +9,7 @@
NTSTATUS rpccli_initshutdown_Init(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
uint16_t *hostname /* [in] [unique] */,
- struct initshutdown_String *message /* [in] [unique] */,
+ struct lsa_StringLarge *message /* [in] [unique] */,
uint32_t timeout /* [in] */,
uint8_t force_apps /* [in] */,
uint8_t do_reboot /* [in] */,
@@ -103,7 +103,7 @@ NTSTATUS rpccli_initshutdown_Abort(struct rpc_pipe_client *cli,
NTSTATUS rpccli_initshutdown_InitEx(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
uint16_t *hostname /* [in] [unique] */,
- struct initshutdown_String *message /* [in] [unique] */,
+ struct lsa_StringLarge *message /* [in] [unique] */,
uint32_t timeout /* [in] */,
uint8_t force_apps /* [in] */,
uint8_t do_reboot /* [in] */,
diff --git a/source3/librpc/gen_ndr/cli_initshutdown.h b/source3/librpc/gen_ndr/cli_initshutdown.h
index c7d2cad664..e2eb9daabe 100644
--- a/source3/librpc/gen_ndr/cli_initshutdown.h
+++ b/source3/librpc/gen_ndr/cli_initshutdown.h
@@ -4,7 +4,7 @@
NTSTATUS rpccli_initshutdown_Init(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
uint16_t *hostname /* [in] [unique] */,
- struct initshutdown_String *message /* [in] [unique] */,
+ struct lsa_StringLarge *message /* [in] [unique] */,
uint32_t timeout /* [in] */,
uint8_t force_apps /* [in] */,
uint8_t do_reboot /* [in] */,
@@ -16,7 +16,7 @@ NTSTATUS rpccli_initshutdown_Abort(struct rpc_pipe_client *cli,
NTSTATUS rpccli_initshutdown_InitEx(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
uint16_t *hostname /* [in] [unique] */,
- struct initshutdown_String *message /* [in] [unique] */,
+ struct lsa_StringLarge *message /* [in] [unique] */,
uint32_t timeout /* [in] */,
uint8_t force_apps /* [in] */,
uint8_t do_reboot /* [in] */,
diff --git a/source3/librpc/gen_ndr/cli_lsa.c b/source3/librpc/gen_ndr/cli_lsa.c
index 4ab27ed04b..15ff462ef6 100644
--- a/source3/librpc/gen_ndr/cli_lsa.c
+++ b/source3/librpc/gen_ndr/cli_lsa.c
@@ -1141,12 +1141,18 @@ NTSTATUS rpccli_lsa_QueryTrustedDomainInfo(struct rpc_pipe_client *cli,
}
NTSTATUS rpccli_lsa_SetInformationTrustedDomain(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx)
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *trustdom_handle /* [in] [ref] */,
+ enum lsa_TrustDomInfoEnum level /* [in] */,
+ union lsa_TrustedDomainInfo *info /* [in] [ref,switch_is(level)] */)
{
struct lsa_SetInformationTrustedDomain r;
NTSTATUS status;
/* In parameters */
+ r.in.trustdom_handle = trustdom_handle;
+ r.in.level = level;
+ r.in.info = info;
if (DEBUGLEVEL >= 10) {
NDR_PRINT_IN_DEBUG(lsa_SetInformationTrustedDomain, &r);
@@ -1706,12 +1712,20 @@ NTSTATUS rpccli_lsa_QueryTrustedDomainInfoBySid(struct rpc_pipe_client *cli,
}
NTSTATUS rpccli_lsa_SetTrustedDomainInfo(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx)
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle /* [in] [ref] */,
+ struct dom_sid2 *dom_sid /* [in] [ref] */,
+ enum lsa_TrustDomInfoEnum level /* [in] */,
+ union lsa_TrustedDomainInfo *info /* [in] [ref,switch_is(level)] */)
{
struct lsa_SetTrustedDomainInfo r;
NTSTATUS status;
/* In parameters */
+ r.in.handle = handle;
+ r.in.dom_sid = dom_sid;
+ r.in.level = level;
+ r.in.info = info;
if (DEBUGLEVEL >= 10) {
NDR_PRINT_IN_DEBUG(lsa_SetTrustedDomainInfo, &r);
@@ -2161,12 +2175,21 @@ NTSTATUS rpccli_lsa_EnumTrustedDomainsEx(struct rpc_pipe_client *cli,
}
NTSTATUS rpccli_lsa_CreateTrustedDomainEx(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx)
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *policy_handle /* [in] [ref] */,
+ struct lsa_TrustDomainInfoInfoEx *info /* [in] [ref] */,
+ struct lsa_TrustDomainInfoAuthInfoInternal *auth_info /* [in] [ref] */,
+ uint32_t access_mask /* [in] */,
+ struct policy_handle *trustdom_handle /* [out] [ref] */)
{
struct lsa_CreateTrustedDomainEx r;
NTSTATUS status;
/* In parameters */
+ r.in.policy_handle = policy_handle;
+ r.in.info = info;
+ r.in.auth_info = auth_info;
+ r.in.access_mask = access_mask;
if (DEBUGLEVEL >= 10) {
NDR_PRINT_IN_DEBUG(lsa_CreateTrustedDomainEx, &r);
@@ -2191,6 +2214,7 @@ NTSTATUS rpccli_lsa_CreateTrustedDomainEx(struct rpc_pipe_client *cli,
}
/* Return variables */
+ *trustdom_handle = *r.out.trustdom_handle;
/* Return result */
return r.out.result;
@@ -2462,8 +2486,8 @@ NTSTATUS rpccli_lsa_LookupNames2(struct rpc_pipe_client *cli,
struct lsa_TransSidArray2 *sids /* [in,out] [ref] */,
enum lsa_LookupNamesLevel level /* [in] */,
uint32_t *count /* [in,out] [ref] */,
- uint32_t unknown1 /* [in] */,
- uint32_t unknown2 /* [in] */)
+ uint32_t lookup_options /* [in] */,
+ uint32_t client_revision /* [in] */)
{
struct lsa_LookupNames2 r;
NTSTATUS status;
@@ -2475,8 +2499,8 @@ NTSTATUS rpccli_lsa_LookupNames2(struct rpc_pipe_client *cli,
r.in.sids = sids;
r.in.level = level;
r.in.count = count;
- r.in.unknown1 = unknown1;
- r.in.unknown2 = unknown2;
+ r.in.lookup_options = lookup_options;
+ r.in.client_revision = client_revision;
if (DEBUGLEVEL >= 10) {
NDR_PRINT_IN_DEBUG(lsa_LookupNames2, &r);
@@ -2510,12 +2534,21 @@ NTSTATUS rpccli_lsa_LookupNames2(struct rpc_pipe_client *cli,
}
NTSTATUS rpccli_lsa_CreateTrustedDomainEx2(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx)
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *policy_handle /* [in] [ref] */,
+ struct lsa_TrustDomainInfoInfoEx *info /* [in] [ref] */,
+ struct lsa_TrustDomainInfoAuthInfoInternal *auth_info /* [in] [ref] */,
+ uint32_t access_mask /* [in] */,
+ struct policy_handle *trustdom_handle /* [out] [ref] */)
{
struct lsa_CreateTrustedDomainEx2 r;
NTSTATUS status;
/* In parameters */
+ r.in.policy_handle = policy_handle;
+ r.in.info = info;
+ r.in.auth_info = auth_info;
+ r.in.access_mask = access_mask;
if (DEBUGLEVEL >= 10) {
NDR_PRINT_IN_DEBUG(lsa_CreateTrustedDomainEx2, &r);
@@ -2540,6 +2573,7 @@ NTSTATUS rpccli_lsa_CreateTrustedDomainEx2(struct rpc_pipe_client *cli,
}
/* Return variables */
+ *trustdom_handle = *r.out.trustdom_handle;
/* Return result */
return r.out.result;
@@ -2842,8 +2876,8 @@ NTSTATUS rpccli_lsa_LookupNames3(struct rpc_pipe_client *cli,
struct lsa_TransSidArray3 *sids /* [in,out] [ref] */,
enum lsa_LookupNamesLevel level /* [in] */,
uint32_t *count /* [in,out] [ref] */,
- uint32_t unknown1 /* [in] */,
- uint32_t unknown2 /* [in] */)
+ uint32_t lookup_options /* [in] */,
+ uint32_t client_revision /* [in] */)
{
struct lsa_LookupNames3 r;
NTSTATUS status;
@@ -2855,8 +2889,8 @@ NTSTATUS rpccli_lsa_LookupNames3(struct rpc_pipe_client *cli,
r.in.sids = sids;
r.in.level = level;
r.in.count = count;
- r.in.unknown1 = unknown1;
- r.in.unknown2 = unknown2;
+ r.in.lookup_options = lookup_options;
+ r.in.client_revision = client_revision;
if (DEBUGLEVEL >= 10) {
NDR_PRINT_IN_DEBUG(lsa_LookupNames3, &r);
@@ -3209,8 +3243,8 @@ NTSTATUS rpccli_lsa_LookupNames4(struct rpc_pipe_client *cli,
struct lsa_TransSidArray3 *sids /* [in,out] [ref] */,
enum lsa_LookupNamesLevel level /* [in] */,
uint32_t *count /* [in,out] [ref] */,
- uint32_t unknown1 /* [in] */,
- uint32_t unknown2 /* [in] */)
+ uint32_t lookup_options /* [in] */,
+ uint32_t client_revision /* [in] */)
{
struct lsa_LookupNames4 r;
NTSTATUS status;
@@ -3221,8 +3255,8 @@ NTSTATUS rpccli_lsa_LookupNames4(struct rpc_pipe_client *cli,
r.in.sids = sids;
r.in.level = level;
r.in.count = count;
- r.in.unknown1 = unknown1;
- r.in.unknown2 = unknown2;
+ r.in.lookup_options = lookup_options;
+ r.in.client_revision = client_revision;
if (DEBUGLEVEL >= 10) {
NDR_PRINT_IN_DEBUG(lsa_LookupNames4, &r);
diff --git a/source3/librpc/gen_ndr/cli_lsa.h b/source3/librpc/gen_ndr/cli_lsa.h
index f3333a091b..d6cb2fc7a7 100644
--- a/source3/librpc/gen_ndr/cli_lsa.h
+++ b/source3/librpc/gen_ndr/cli_lsa.h
@@ -133,7 +133,10 @@ NTSTATUS rpccli_lsa_QueryTrustedDomainInfo(struct rpc_pipe_client *cli,
enum lsa_TrustDomInfoEnum level /* [in] */,
union lsa_TrustedDomainInfo **info /* [out] [ref,switch_is(level)] */);
NTSTATUS rpccli_lsa_SetInformationTrustedDomain(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx);
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *trustdom_handle /* [in] [ref] */,
+ enum lsa_TrustDomInfoEnum level /* [in] */,
+ union lsa_TrustedDomainInfo *info /* [in] [ref,switch_is(level)] */);
NTSTATUS rpccli_lsa_OpenSecret(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
struct policy_handle *handle /* [in] [ref] */,
@@ -201,7 +204,11 @@ NTSTATUS rpccli_lsa_QueryTrustedDomainInfoBySid(struct rpc_pipe_client *cli,
enum lsa_TrustDomInfoEnum level /* [in] */,
union lsa_TrustedDomainInfo **info /* [out] [ref,switch_is(level)] */);
NTSTATUS rpccli_lsa_SetTrustedDomainInfo(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx);
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle /* [in] [ref] */,
+ struct dom_sid2 *dom_sid /* [in] [ref] */,
+ enum lsa_TrustDomInfoEnum level /* [in] */,
+ union lsa_TrustedDomainInfo *info /* [in] [ref,switch_is(level)] */);
NTSTATUS rpccli_lsa_DeleteTrustedDomain(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
struct policy_handle *handle /* [in] [ref] */,
@@ -250,7 +257,12 @@ NTSTATUS rpccli_lsa_EnumTrustedDomainsEx(struct rpc_pipe_client *cli,
struct lsa_DomainListEx *domains /* [out] [ref] */,
uint32_t max_size /* [in] */);
NTSTATUS rpccli_lsa_CreateTrustedDomainEx(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx);
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *policy_handle /* [in] [ref] */,
+ struct lsa_TrustDomainInfoInfoEx *info /* [in] [ref] */,
+ struct lsa_TrustDomainInfoAuthInfoInternal *auth_info /* [in] [ref] */,
+ uint32_t access_mask /* [in] */,
+ struct policy_handle *trustdom_handle /* [out] [ref] */);
NTSTATUS rpccli_lsa_CloseTrustedDomainEx(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
struct policy_handle *handle /* [in,out] [ref] */);
@@ -291,10 +303,15 @@ NTSTATUS rpccli_lsa_LookupNames2(struct rpc_pipe_client *cli,
struct lsa_TransSidArray2 *sids /* [in,out] [ref] */,
enum lsa_LookupNamesLevel level /* [in] */,
uint32_t *count /* [in,out] [ref] */,
- uint32_t unknown1 /* [in] */,
- uint32_t unknown2 /* [in] */);
+ uint32_t lookup_options /* [in] */,
+ uint32_t client_revision /* [in] */);
NTSTATUS rpccli_lsa_CreateTrustedDomainEx2(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx);
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *policy_handle /* [in] [ref] */,
+ struct lsa_TrustDomainInfoInfoEx *info /* [in] [ref] */,
+ struct lsa_TrustDomainInfoAuthInfoInternal *auth_info /* [in] [ref] */,
+ uint32_t access_mask /* [in] */,
+ struct policy_handle *trustdom_handle /* [out] [ref] */);
NTSTATUS rpccli_lsa_CREDRWRITE(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx);
NTSTATUS rpccli_lsa_CREDRREAD(struct rpc_pipe_client *cli,
@@ -320,8 +337,8 @@ NTSTATUS rpccli_lsa_LookupNames3(struct rpc_pipe_client *cli,
struct lsa_TransSidArray3 *sids /* [in,out] [ref] */,
enum lsa_LookupNamesLevel level /* [in] */,
uint32_t *count /* [in,out] [ref] */,
- uint32_t unknown1 /* [in] */,
- uint32_t unknown2 /* [in] */);
+ uint32_t lookup_options /* [in] */,
+ uint32_t client_revision /* [in] */);
NTSTATUS rpccli_lsa_CREDRGETSESSIONTYPES(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx);
NTSTATUS rpccli_lsa_LSARREGISTERAUDITEVENT(struct rpc_pipe_client *cli,
@@ -357,8 +374,8 @@ NTSTATUS rpccli_lsa_LookupNames4(struct rpc_pipe_client *cli,
struct lsa_TransSidArray3 *sids /* [in,out] [ref] */,
enum lsa_LookupNamesLevel level /* [in] */,
uint32_t *count /* [in,out] [ref] */,
- uint32_t unknown1 /* [in] */,
- uint32_t unknown2 /* [in] */);
+ uint32_t lookup_options /* [in] */,
+ uint32_t client_revision /* [in] */);
NTSTATUS rpccli_lsa_LSAROPENPOLICYSCE(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx);
NTSTATUS rpccli_lsa_LSARADTREGISTERSECURITYEVENTSOURCE(struct rpc_pipe_client *cli,
diff --git a/source3/librpc/gen_ndr/cli_netlogon.c b/source3/librpc/gen_ndr/cli_netlogon.c
index d6ac8b9ede..941273bddc 100644
--- a/source3/librpc/gen_ndr/cli_netlogon.c
+++ b/source3/librpc/gen_ndr/cli_netlogon.c
@@ -110,8 +110,8 @@ NTSTATUS rpccli_netr_LogonSamLogon(struct rpc_pipe_client *cli,
const char *computer_name /* [in] [unique,charset(UTF16)] */,
struct netr_Authenticator *credential /* [in] [unique] */,
struct netr_Authenticator *return_authenticator /* [in,out] [unique] */,
- enum netr_LogonLevel logon_level /* [in] */,
- union netr_LogonInfo *logon /* [in] [ref,switch_is(logon_level)] */,
+ enum netr_LogonInfoClass logon_level /* [in] */,
+ union netr_LogonLevel *logon /* [in] [ref,switch_is(logon_level)] */,
uint16_t validation_level /* [in] */,
union netr_Validation *validation /* [out] [ref,switch_is(validation_level)] */,
uint8_t *authoritative /* [out] [ref] */)
@@ -167,8 +167,8 @@ NTSTATUS rpccli_netr_LogonSamLogoff(struct rpc_pipe_client *cli,
const char *computer_name /* [in] [unique,charset(UTF16)] */,
struct netr_Authenticator *credential /* [in] [unique] */,
struct netr_Authenticator *return_authenticator /* [in,out] [unique] */,
- enum netr_LogonLevel logon_level /* [in] */,
- union netr_LogonInfo logon /* [in] [switch_is(logon_level)] */)
+ enum netr_LogonInfoClass logon_level /* [in] */,
+ union netr_LogonLevel logon /* [in] [switch_is(logon_level)] */)
{
struct netr_LogonSamLogoff r;
NTSTATUS status;
@@ -1934,8 +1934,8 @@ NTSTATUS rpccli_netr_LogonSamLogonEx(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
const char *server_name /* [in] [unique,charset(UTF16)] */,
const char *computer_name /* [in] [unique,charset(UTF16)] */,
- enum netr_LogonLevel logon_level /* [in] */,
- union netr_LogonInfo *logon /* [in] [ref,switch_is(logon_level)] */,
+ enum netr_LogonInfoClass logon_level /* [in] */,
+ union netr_LogonLevel *logon /* [in] [ref,switch_is(logon_level)] */,
uint16_t validation_level /* [in] */,
union netr_Validation *validation /* [out] [ref,switch_is(validation_level)] */,
uint8_t *authoritative /* [out] [ref] */,
@@ -2241,8 +2241,8 @@ NTSTATUS rpccli_netr_LogonSamLogonWithFlags(struct rpc_pipe_client *cli,
const char *computer_name /* [in] [unique,charset(UTF16)] */,
struct netr_Authenticator *credential /* [in] [unique] */,
struct netr_Authenticator *return_authenticator /* [in,out] [unique] */,
- enum netr_LogonLevel logon_level /* [in] */,
- union netr_LogonInfo logon /* [in] [switch_is(logon_level)] */,
+ enum netr_LogonInfoClass logon_level /* [in] */,
+ union netr_LogonLevel logon /* [in] [switch_is(logon_level)] */,
uint16_t validation_level /* [in] */,
union netr_Validation *validation /* [out] [ref,switch_is(validation_level)] */,
uint8_t *authoritative /* [out] [ref] */,
diff --git a/source3/librpc/gen_ndr/cli_netlogon.h b/source3/librpc/gen_ndr/cli_netlogon.h
index 2033315a5d..0a0cfdf6e4 100644
--- a/source3/librpc/gen_ndr/cli_netlogon.h
+++ b/source3/librpc/gen_ndr/cli_netlogon.h
@@ -21,8 +21,8 @@ NTSTATUS rpccli_netr_LogonSamLogon(struct rpc_pipe_client *cli,
const char *computer_name /* [in] [unique,charset(UTF16)] */,
struct netr_Authenticator *credential /* [in] [unique] */,
struct netr_Authenticator *return_authenticator /* [in,out] [unique] */,
- enum netr_LogonLevel logon_level /* [in] */,
- union netr_LogonInfo *logon /* [in] [ref,switch_is(logon_level)] */,
+ enum netr_LogonInfoClass logon_level /* [in] */,
+ union netr_LogonLevel *logon /* [in] [ref,switch_is(logon_level)] */,
uint16_t validation_level /* [in] */,
union netr_Validation *validation /* [out] [ref,switch_is(validation_level)] */,
uint8_t *authoritative /* [out] [ref] */);
@@ -32,8 +32,8 @@ NTSTATUS rpccli_netr_LogonSamLogoff(struct rpc_pipe_client *cli,
const char *computer_name /* [in] [unique,charset(UTF16)] */,
struct netr_Authenticator *credential /* [in] [unique] */,
struct netr_Authenticator *return_authenticator /* [in,out] [unique] */,
- enum netr_LogonLevel logon_level /* [in] */,
- union netr_LogonInfo logon /* [in] [switch_is(logon_level)] */);
+ enum netr_LogonInfoClass logon_level /* [in] */,
+ union netr_LogonLevel logon /* [in] [switch_is(logon_level)] */);
NTSTATUS rpccli_netr_ServerReqChallenge(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
const char *server_name /* [in] [unique,charset(UTF16)] */,
@@ -297,8 +297,8 @@ NTSTATUS rpccli_netr_LogonSamLogonEx(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
const char *server_name /* [in] [unique,charset(UTF16)] */,
const char *computer_name /* [in] [unique,charset(UTF16)] */,
- enum netr_LogonLevel logon_level /* [in] */,
- union netr_LogonInfo *logon /* [in] [ref,switch_is(logon_level)] */,
+ enum netr_LogonInfoClass logon_level /* [in] */,
+ union netr_LogonLevel *logon /* [in] [ref,switch_is(logon_level)] */,
uint16_t validation_level /* [in] */,
union netr_Validation *validation /* [out] [ref,switch_is(validation_level)] */,
uint8_t *authoritative /* [out] [ref] */,
@@ -349,8 +349,8 @@ NTSTATUS rpccli_netr_LogonSamLogonWithFlags(struct rpc_pipe_client *cli,
const char *computer_name /* [in] [unique,charset(UTF16)] */,
struct netr_Authenticator *credential /* [in] [unique] */,
struct netr_Authenticator *return_authenticator /* [in,out] [unique] */,
- enum netr_LogonLevel logon_level /* [in] */,
- union netr_LogonInfo logon /* [in] [switch_is(logon_level)] */,
+ enum netr_LogonInfoClass logon_level /* [in] */,
+ union netr_LogonLevel logon /* [in] [switch_is(logon_level)] */,
uint16_t validation_level /* [in] */,
union netr_Validation *validation /* [out] [ref,switch_is(validation_level)] */,
uint8_t *authoritative /* [out] [ref] */,
diff --git a/source3/librpc/gen_ndr/cli_ntsvcs.c b/source3/librpc/gen_ndr/cli_ntsvcs.c
index bc5dba4d91..f8ef7a99ad 100644
--- a/source3/librpc/gen_ndr/cli_ntsvcs.c
+++ b/source3/librpc/gen_ndr/cli_ntsvcs.c
@@ -424,12 +424,19 @@ NTSTATUS rpccli_PNP_EnumerateSubKeys(struct rpc_pipe_client *cli,
NTSTATUS rpccli_PNP_GetDeviceList(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
+ const char *filter /* [in] [unique,charset(UTF16)] */,
+ uint16_t *buffer /* [out] [ref,length_is(*length),size_is(*length)] */,
+ uint32_t *length /* [in,out] [ref] */,
+ uint32_t flags /* [in] */,
WERROR *werror)
{
struct PNP_GetDeviceList r;
NTSTATUS status;
/* In parameters */
+ r.in.filter = filter;
+ r.in.length = length;
+ r.in.flags = flags;
if (DEBUGLEVEL >= 10) {
NDR_PRINT_IN_DEBUG(PNP_GetDeviceList, &r);
@@ -454,6 +461,8 @@ NTSTATUS rpccli_PNP_GetDeviceList(struct rpc_pipe_client *cli,
}
/* Return variables */
+ memcpy(buffer, r.out.buffer, *r.in.length * sizeof(*buffer));
+ *length = *r.out.length;
/* Return result */
if (werror) {
@@ -555,11 +564,11 @@ NTSTATUS rpccli_PNP_GetDeviceRegProp(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
const char *devicepath /* [in] [ref,charset(UTF16)] */,
uint32_t property /* [in] */,
- uint32_t *unknown1 /* [in,out] [ref] */,
+ uint32_t *reg_data_type /* [in,out] [ref] */,
uint8_t *buffer /* [out] [ref,length_is(*buffer_size),size_is(*buffer_size)] */,
uint32_t *buffer_size /* [in,out] [ref] */,
uint32_t *needed /* [in,out] [ref] */,
- uint32_t unknown3 /* [in] */,
+ uint32_t flags /* [in] */,
WERROR *werror)
{
struct PNP_GetDeviceRegProp r;
@@ -568,10 +577,10 @@ NTSTATUS rpccli_PNP_GetDeviceRegProp(struct rpc_pipe_client *cli,
/* In parameters */
r.in.devicepath = devicepath;
r.in.property = property;
- r.in.unknown1 = unknown1;
+ r.in.reg_data_type = reg_data_type;
r.in.buffer_size = buffer_size;
r.in.needed = needed;
- r.in.unknown3 = unknown3;
+ r.in.flags = flags;
if (DEBUGLEVEL >= 10) {
NDR_PRINT_IN_DEBUG(PNP_GetDeviceRegProp, &r);
@@ -596,7 +605,7 @@ NTSTATUS rpccli_PNP_GetDeviceRegProp(struct rpc_pipe_client *cli,
}
/* Return variables */
- *unknown1 = *r.out.unknown1;
+ *reg_data_type = *r.out.reg_data_type;
memcpy(buffer, r.out.buffer, *r.in.buffer_size * sizeof(*buffer));
*buffer_size = *r.out.buffer_size;
*needed = *r.out.needed;
diff --git a/source3/librpc/gen_ndr/cli_ntsvcs.h b/source3/librpc/gen_ndr/cli_ntsvcs.h
index a52a79ecc5..4ed8a401ec 100644
--- a/source3/librpc/gen_ndr/cli_ntsvcs.h
+++ b/source3/librpc/gen_ndr/cli_ntsvcs.h
@@ -36,6 +36,10 @@ NTSTATUS rpccli_PNP_EnumerateSubKeys(struct rpc_pipe_client *cli,
WERROR *werror);
NTSTATUS rpccli_PNP_GetDeviceList(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
+ const char *filter /* [in] [unique,charset(UTF16)] */,
+ uint16_t *buffer /* [out] [ref,length_is(*length),size_is(*length)] */,
+ uint32_t *length /* [in,out] [ref] */,
+ uint32_t flags /* [in] */,
WERROR *werror);
NTSTATUS rpccli_PNP_GetDeviceListSize(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
@@ -50,11 +54,11 @@ NTSTATUS rpccli_PNP_GetDeviceRegProp(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
const char *devicepath /* [in] [ref,charset(UTF16)] */,
uint32_t property /* [in] */,
- uint32_t *unknown1 /* [in,out] [ref] */,
+ uint32_t *reg_data_type /* [in,out] [ref] */,
uint8_t *buffer /* [out] [ref,length_is(*buffer_size),size_is(*buffer_size)] */,
uint32_t *buffer_size /* [in,out] [ref] */,
uint32_t *needed /* [in,out] [ref] */,
- uint32_t unknown3 /* [in] */,
+ uint32_t flags /* [in] */,
WERROR *werror);
NTSTATUS rpccli_PNP_SetDeviceRegProp(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
diff --git a/source3/librpc/gen_ndr/cli_svcctl.c b/source3/librpc/gen_ndr/cli_svcctl.c
index c996c761d5..e5fd4dac87 100644
--- a/source3/librpc/gen_ndr/cli_svcctl.c
+++ b/source3/librpc/gen_ndr/cli_svcctl.c
@@ -858,9 +858,9 @@ NTSTATUS rpccli_svcctl_OpenServiceW(struct rpc_pipe_client *cli,
NTSTATUS rpccli_svcctl_QueryServiceConfigW(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
struct policy_handle *handle /* [in] [ref] */,
- uint8_t *query /* [out] */,
- uint32_t buf_size /* [in] */,
- uint32_t *bytes_needed /* [out] [ref] */,
+ struct QUERY_SERVICE_CONFIG *query /* [out] [ref] */,
+ uint32_t buf_size /* [in] [range(0,8192)] */,
+ uint32_t *bytes_needed /* [out] [ref,range(0,8192)] */,
WERROR *werror)
{
struct svcctl_QueryServiceConfigW r;
@@ -893,7 +893,7 @@ NTSTATUS rpccli_svcctl_QueryServiceConfigW(struct rpc_pipe_client *cli,
}
/* Return variables */
- memcpy(query, r.out.query, r.in.buf_size * sizeof(*query));
+ *query = *r.out.query;
*bytes_needed = *r.out.bytes_needed;
/* Return result */
diff --git a/source3/librpc/gen_ndr/cli_svcctl.h b/source3/librpc/gen_ndr/cli_svcctl.h
index 56f0a2b0e7..02abbadf1e 100644
--- a/source3/librpc/gen_ndr/cli_svcctl.h
+++ b/source3/librpc/gen_ndr/cli_svcctl.h
@@ -127,9 +127,9 @@ NTSTATUS rpccli_svcctl_OpenServiceW(struct rpc_pipe_client *cli,
NTSTATUS rpccli_svcctl_QueryServiceConfigW(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
struct policy_handle *handle /* [in] [ref] */,
- uint8_t *query /* [out] */,
- uint32_t buf_size /* [in] */,
- uint32_t *bytes_needed /* [out] [ref] */,
+ struct QUERY_SERVICE_CONFIG *query /* [out] [ref] */,
+ uint32_t buf_size /* [in] [range(0,8192)] */,
+ uint32_t *bytes_needed /* [out] [ref,range(0,8192)] */,
WERROR *werror);
NTSTATUS rpccli_svcctl_QueryServiceLockStatusW(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
diff --git a/source3/librpc/gen_ndr/cli_winreg.c b/source3/librpc/gen_ndr/cli_winreg.c
index 29f7e50c45..d558a5a185 100644
--- a/source3/librpc/gen_ndr/cli_winreg.c
+++ b/source3/librpc/gen_ndr/cli_winreg.c
@@ -872,9 +872,9 @@ NTSTATUS rpccli_winreg_QueryValue(struct rpc_pipe_client *cli,
struct policy_handle *handle /* [in] [ref] */,
struct winreg_String *value_name /* [in] [ref] */,
enum winreg_Type *type /* [in,out] [unique] */,
- uint8_t *data /* [in,out] [unique,length_is(*value_length),size_is(*data_size)] */,
+ uint8_t *data /* [in,out] [unique,length_is(*data_length),size_is(*data_size)] */,
uint32_t *data_size /* [in,out] [unique] */,
- uint32_t *value_length /* [in,out] [unique] */,
+ uint32_t *data_length /* [in,out] [unique] */,
WERROR *werror)
{
struct winreg_QueryValue r;
@@ -886,7 +886,7 @@ NTSTATUS rpccli_winreg_QueryValue(struct rpc_pipe_client *cli,
r.in.type = type;
r.in.data = data;
r.in.data_size = data_size;
- r.in.value_length = value_length;
+ r.in.data_length = data_length;
if (DEBUGLEVEL >= 10) {
NDR_PRINT_IN_DEBUG(winreg_QueryValue, &r);
@@ -920,8 +920,8 @@ NTSTATUS rpccli_winreg_QueryValue(struct rpc_pipe_client *cli,
if (data_size && r.out.data_size) {
*data_size = *r.out.data_size;
}
- if (value_length && r.out.value_length) {
- *value_length = *r.out.value_length;
+ if (data_length && r.out.data_length) {
+ *data_length = *r.out.data_length;
}
/* Return result */
@@ -1070,7 +1070,7 @@ NTSTATUS rpccli_winreg_SaveKey(struct rpc_pipe_client *cli,
NTSTATUS rpccli_winreg_SetKeySecurity(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
struct policy_handle *handle /* [in] [ref] */,
- uint32_t access_mask /* [in] */,
+ uint32_t sec_info /* [in] */,
struct KeySecurityData *sd /* [in] [ref] */,
WERROR *werror)
{
@@ -1079,7 +1079,7 @@ NTSTATUS rpccli_winreg_SetKeySecurity(struct rpc_pipe_client *cli,
/* In parameters */
r.in.handle = handle;
- r.in.access_mask = access_mask;
+ r.in.sec_info = sec_info;
r.in.sd = sd;
if (DEBUGLEVEL >= 10) {
@@ -1209,7 +1209,7 @@ NTSTATUS rpccli_winreg_UnLoadKey(struct rpc_pipe_client *cli,
NTSTATUS rpccli_winreg_InitiateSystemShutdown(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
uint16_t *hostname /* [in] [unique] */,
- struct initshutdown_String *message /* [in] [unique] */,
+ struct lsa_StringLarge *message /* [in] [unique] */,
uint32_t timeout /* [in] */,
uint8_t force_apps /* [in] */,
uint8_t do_reboot /* [in] */,
@@ -1498,7 +1498,7 @@ NTSTATUS rpccli_winreg_QueryMultipleValues(struct rpc_pipe_client *cli,
NTSTATUS rpccli_winreg_InitiateSystemShutdownEx(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
uint16_t *hostname /* [in] [unique] */,
- struct initshutdown_String *message /* [in] [unique] */,
+ struct lsa_StringLarge *message /* [in] [unique] */,
uint32_t timeout /* [in] */,
uint8_t force_apps /* [in] */,
uint8_t do_reboot /* [in] */,
diff --git a/source3/librpc/gen_ndr/cli_winreg.h b/source3/librpc/gen_ndr/cli_winreg.h
index 793a4ffc5b..ce2bfcd5ec 100644
--- a/source3/librpc/gen_ndr/cli_winreg.h
+++ b/source3/librpc/gen_ndr/cli_winreg.h
@@ -126,9 +126,9 @@ NTSTATUS rpccli_winreg_QueryValue(struct rpc_pipe_client *cli,
struct policy_handle *handle /* [in] [ref] */,
struct winreg_String *value_name /* [in] [ref] */,
enum winreg_Type *type /* [in,out] [unique] */,
- uint8_t *data /* [in,out] [unique,length_is(*value_length),size_is(*data_size)] */,
+ uint8_t *data /* [in,out] [unique,length_is(*data_length),size_is(*data_size)] */,
uint32_t *data_size /* [in,out] [unique] */,
- uint32_t *value_length /* [in,out] [unique] */,
+ uint32_t *data_length /* [in,out] [unique] */,
WERROR *werror);
NTSTATUS rpccli_winreg_ReplaceKey(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
@@ -148,7 +148,7 @@ NTSTATUS rpccli_winreg_SaveKey(struct rpc_pipe_client *cli,
NTSTATUS rpccli_winreg_SetKeySecurity(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
struct policy_handle *handle /* [in] [ref] */,
- uint32_t access_mask /* [in] */,
+ uint32_t sec_info /* [in] */,
struct KeySecurityData *sd /* [in] [ref] */,
WERROR *werror);
NTSTATUS rpccli_winreg_SetValue(struct rpc_pipe_client *cli,
@@ -165,7 +165,7 @@ NTSTATUS rpccli_winreg_UnLoadKey(struct rpc_pipe_client *cli,
NTSTATUS rpccli_winreg_InitiateSystemShutdown(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
uint16_t *hostname /* [in] [unique] */,
- struct initshutdown_String *message /* [in] [unique] */,
+ struct lsa_StringLarge *message /* [in] [unique] */,
uint32_t timeout /* [in] */,
uint8_t force_apps /* [in] */,
uint8_t do_reboot /* [in] */,
@@ -202,7 +202,7 @@ NTSTATUS rpccli_winreg_QueryMultipleValues(struct rpc_pipe_client *cli,
NTSTATUS rpccli_winreg_InitiateSystemShutdownEx(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
uint16_t *hostname /* [in] [unique] */,
- struct initshutdown_String *message /* [in] [unique] */,
+ struct lsa_StringLarge *message /* [in] [unique] */,
uint32_t timeout /* [in] */,
uint8_t force_apps /* [in] */,
uint8_t do_reboot /* [in] */,
diff --git a/source3/librpc/gen_ndr/drsblobs.h b/source3/librpc/gen_ndr/drsblobs.h
index b0ab9aea2a..692746468e 100644
--- a/source3/librpc/gen_ndr/drsblobs.h
+++ b/source3/librpc/gen_ndr/drsblobs.h
@@ -4,12 +4,16 @@
#include "librpc/gen_ndr/drsuapi.h"
#include "librpc/gen_ndr/misc.h"
+#include "librpc/gen_ndr/samr.h"
+#include "librpc/gen_ndr/lsa.h"
#ifndef _HEADER_drsblobs
#define _HEADER_drsblobs
#define SUPPLEMENTAL_CREDENTIALS_PREFIX ( " " )
enum drsuapi_DsAttributeId;
+enum lsa_TrustAuthType;
+
struct replPropertyMetaData1 {
enum drsuapi_DsAttributeId attid;
uint32_t version;
@@ -247,7 +251,7 @@ struct package_PrimaryKerberosBlob {
}/* [public] */;
struct package_PrimaryCLEARTEXTBlob {
- const char * cleartext;/* [flag(LIBNDR_FLAG_STR_NOTERM|LIBNDR_FLAG_REMAINING)] */
+ DATA_BLOB cleartext;/* [flag(LIBNDR_FLAG_REMAINING)] */
}/* [public] */;
struct package_PrimaryWDigestHash {
@@ -263,63 +267,158 @@ struct package_PrimaryWDigestBlob {
struct package_PrimaryWDigestHash *hashes;
}/* [public] */;
-struct trustAuthInOutSecret1 {
- NTTIME time1;
- uint32_t unknown1;
- DATA_BLOB value;
- DATA_BLOB _pad;/* [flag(LIBNDR_FLAG_ALIGN4)] */
+struct AuthInfoNone {
+ uint32_t size;/* [value(0)] */
};
-struct trustAuthInOutCtr1 {
- struct trustAuthInOutSecret1 *value1;/* [relative] */
- struct trustAuthInOutSecret1 *value2;/* [relative] */
+struct AuthInfoNT4Owf {
+ uint32_t size;/* [value(16)] */
+ struct samr_Password password;
};
-struct trustAuthInOutSecret2V1 {
- NTTIME time1;
- uint32_t unknown1;
- DATA_BLOB value;
- NTTIME time2;
- uint32_t unknown2;
- uint32_t unknown3;
- uint32_t unknown4;
- DATA_BLOB _pad;/* [flag(LIBNDR_FLAG_ALIGN4)] */
+struct AuthInfoClear {
+ uint32_t size;
+ uint8_t *password;
};
-struct trustAuthInOutSecret2V2 {
- NTTIME time1;
- uint32_t unknown1;
- DATA_BLOB value;
- NTTIME time2;
- uint32_t unknown2;
- uint32_t unknown3;
- DATA_BLOB _pad;/* [flag(LIBNDR_FLAG_ALIGN4)] */
-};
-
-struct trustAuthInOutCtr2 {
- struct trustAuthInOutSecret2V1 *value1;/* [relative] */
- struct trustAuthInOutSecret2V2 *value2;/* [relative] */
+struct AuthInfoVersion {
+ uint32_t size;/* [value(4)] */
+ uint32_t version;
};
-union trustAuthInOutCtr {
- struct trustAuthInOutCtr1 ctr1;/* [case] */
- struct trustAuthInOutCtr2 ctr2;/* [case(2)] */
+union AuthInfo {
+ struct AuthInfoNone none;/* [case(TRUST_AUTH_TYPE_NONE)] */
+ struct AuthInfoNT4Owf nt4owf;/* [case(TRUST_AUTH_TYPE_NT4OWF)] */
+ struct AuthInfoClear clear;/* [case(TRUST_AUTH_TYPE_CLEAR)] */
+ struct AuthInfoVersion version;/* [case(TRUST_AUTH_TYPE_VERSION)] */
}/* [nodiscriminant] */;
-struct trustAuthInOutBlob {
- uint32_t version;
- union trustAuthInOutCtr ctr;/* [switch_is(version)] */
+struct AuthenticationInformation {
+ NTTIME LastUpdateTime;
+ enum lsa_TrustAuthType AuthType;
+ union AuthInfo AuthInfo;/* [switch_is(AuthType)] */
+ DATA_BLOB _pad;/* [flag(LIBNDR_FLAG_ALIGN4)] */
}/* [public] */;
+struct AuthenticationInformationArray {
+ struct AuthenticationInformation *array;/* [size_is] */
+}/* [noprint,nopush,nopull] */;
+
+struct trustAuthInOutBlob {
+ uint32_t count;
+ struct AuthenticationInformationArray *current;/* [relative] */
+ struct AuthenticationInformationArray *previous;/* [relative] */
+}/* [noprint,gensize,nopull,public,nopush] */;
+
+struct trustCurrentPasswords {
+ uint32_t count;
+ struct AuthenticationInformation **current;/* [relative] */
+}/* [gensize,public] */;
+
+struct trustDomainPasswords {
+ uint8_t confounder[512];
+ struct trustCurrentPasswords outgoing;/* [subcontext_size(outgoing_size),subcontext(0)] */
+ struct trustCurrentPasswords incoming;/* [subcontext_size(incoming_size),subcontext(0)] */
+ uint32_t outgoing_size;/* [value(ndr_size_trustCurrentPasswords(&outgoing,ndr->flags))] */
+ uint32_t incoming_size;/* [value(ndr_size_trustCurrentPasswords(&incoming,ndr->flags))] */
+}/* [public,nopull] */;
+
struct DsCompressedChunk {
uint32_t marker;
DATA_BLOB data;
}/* [public] */;
-struct DsCompressedBlob {
- struct DsCompressedChunk chunks[5];
+struct ExtendedErrorAString {
+ uint16_t __size;
+ const char *string;/* [unique,charset(DOS),size_is(__size)] */
+};
+
+struct ExtendedErrorUString {
+ uint16_t __size;
+ const char *string;/* [unique,charset(UTF16),size_is(__size)] */
+};
+
+struct ExtendedErrorBlob {
+ uint16_t length;
+ uint8_t *data;/* [unique,size_is(length)] */
+};
+
+enum ExtendedErrorComputerNamePresent
+#ifndef USE_UINT_ENUMS
+ {
+ EXTENDED_ERROR_COMPUTER_NAME_PRESENT=1,
+ EXTENDED_ERROR_COMPUTER_NAME_NOT_PRESENT=2
+}
+#else
+ { __donnot_use_enum_ExtendedErrorComputerNamePresent=0x7FFFFFFF}
+#define EXTENDED_ERROR_COMPUTER_NAME_PRESENT ( 1 )
+#define EXTENDED_ERROR_COMPUTER_NAME_NOT_PRESENT ( 2 )
+#endif
+;
+
+union ExtendedErrorComputerNameU {
+ struct ExtendedErrorUString name;/* [case(EXTENDED_ERROR_COMPUTER_NAME_PRESENT)] */
+}/* [switch_type(ExtendedErrorComputerNamePresent)] */;
+
+struct ExtendedErrorComputerName {
+ enum ExtendedErrorComputerNamePresent present;
+ union ExtendedErrorComputerNameU n;/* [switch_is(present)] */
+};
+
+enum ExtendedErrorParamType
+#ifndef USE_UINT_ENUMS
+ {
+ EXTENDED_ERROR_PARAM_TYPE_ASCII_STRING=1,
+ EXTENDED_ERROR_PARAM_TYPE_UNICODE_STRING=2,
+ EXTENDED_ERROR_PARAM_TYPE_UINT32=3,
+ EXTENDED_ERROR_PARAM_TYPE_UINT16=4,
+ EXTENDED_ERROR_PARAM_TYPE_UINT64=5,
+ EXTENDED_ERROR_PARAM_TYPE_NONE=6,
+ EXTENDED_ERROR_PARAM_TYPE_BLOB=7
+}
+#else
+ { __donnot_use_enum_ExtendedErrorParamType=0x7FFFFFFF}
+#define EXTENDED_ERROR_PARAM_TYPE_ASCII_STRING ( 1 )
+#define EXTENDED_ERROR_PARAM_TYPE_UNICODE_STRING ( 2 )
+#define EXTENDED_ERROR_PARAM_TYPE_UINT32 ( 3 )
+#define EXTENDED_ERROR_PARAM_TYPE_UINT16 ( 4 )
+#define EXTENDED_ERROR_PARAM_TYPE_UINT64 ( 5 )
+#define EXTENDED_ERROR_PARAM_TYPE_NONE ( 6 )
+#define EXTENDED_ERROR_PARAM_TYPE_BLOB ( 7 )
+#endif
+;
+
+union ExtendedErrorParamU {
+ struct ExtendedErrorAString a_string;/* [case(EXTENDED_ERROR_PARAM_TYPE_ASCII_STRING)] */
+ struct ExtendedErrorUString u_string;/* [case(EXTENDED_ERROR_PARAM_TYPE_UNICODE_STRING)] */
+ uint32_t uint32;/* [case(EXTENDED_ERROR_PARAM_TYPE_UINT32)] */
+ uint16_t uint16;/* [case(EXTENDED_ERROR_PARAM_TYPE_UINT16)] */
+ uint64_t uint64;/* [case(EXTENDED_ERROR_PARAM_TYPE_UINT64)] */
+ struct ExtendedErrorBlob blob;/* [case(EXTENDED_ERROR_PARAM_TYPE_BLOB)] */
+}/* [switch_type(ExtendedErrorParamType)] */;
+
+struct ExtendedErrorParam {
+ enum ExtendedErrorParamType type;
+ union ExtendedErrorParamU p;/* [switch_is(type)] */
+};
+
+struct ExtendedErrorInfo {
+ struct ExtendedErrorInfo *next;/* [unique] */
+ struct ExtendedErrorComputerName computer_name;
+ uint64_t pid;
+ NTTIME time;
+ uint32_t generating_component;
+ WERROR status;
+ uint16_t detection_location;
+ uint16_t flags;
+ uint16_t num_params;
+ struct ExtendedErrorParam *params;/* [size_is(num_params)] */
}/* [public] */;
+struct ExtendedErrorInfoPtr {
+ struct ExtendedErrorInfo *info;/* [unique] */
+};
+
struct decode_replPropertyMetaData {
struct {
@@ -417,9 +516,17 @@ struct decode_trustAuthInOut {
};
-struct decode_DsCompressed {
+struct decode_trustDomainPasswords {
+ struct {
+ struct trustDomainPasswords blob;
+ } in;
+
+};
+
+
+struct decode_ExtendedErrorInfo {
struct {
- struct DsCompressedBlob blob;
+ struct ExtendedErrorInfoPtr ptr;/* [subcontext(0xFFFFFC01)] */
} in;
};
diff --git a/source3/librpc/gen_ndr/drsuapi.h b/source3/librpc/gen_ndr/drsuapi.h
index 049c2bf4b1..ba01e8f226 100644
--- a/source3/librpc/gen_ndr/drsuapi.h
+++ b/source3/librpc/gen_ndr/drsuapi.h
@@ -575,29 +575,37 @@ struct drsuapi_DsGetNCChangesCtr6 {
WERROR drs_error;
}/* [gensize,public] */;
+struct drsuapi_DsGetNCChangesCtr1TS {
+ struct drsuapi_DsGetNCChangesCtr1 ctr1;/* [subcontext(0xFFFFFC01)] */
+}/* [public] */;
+
+struct drsuapi_DsGetNCChangesCtr6TS {
+ struct drsuapi_DsGetNCChangesCtr6 ctr6;/* [subcontext(0xFFFFFC01)] */
+}/* [public] */;
+
struct drsuapi_DsGetNCChangesMSZIPCtr1 {
uint32_t decompressed_length;
uint32_t compressed_length;
- struct drsuapi_DsGetNCChangesCtr1 *ctr1;/* [unique,compression(NDR_COMPRESSION_MSZIP,compressed_length,decompressed_length),subcontext_size(compressed_length),subcontext(4)] */
-};
+ struct drsuapi_DsGetNCChangesCtr1TS *ts;/* [unique,compression(NDR_COMPRESSION_MSZIP,compressed_length,decompressed_length),subcontext_size(compressed_length),subcontext(4)] */
+}/* [nopush] */;
struct drsuapi_DsGetNCChangesMSZIPCtr6 {
uint32_t decompressed_length;
uint32_t compressed_length;
- struct drsuapi_DsGetNCChangesCtr6 *ctr6;/* [unique,compression(NDR_COMPRESSION_MSZIP,compressed_length,decompressed_length),subcontext_size(compressed_length),subcontext(4)] */
-};
+ struct drsuapi_DsGetNCChangesCtr6TS *ts;/* [unique,compression(NDR_COMPRESSION_MSZIP,compressed_length,decompressed_length),subcontext_size(compressed_length),subcontext(4)] */
+}/* [nopush] */;
struct drsuapi_DsGetNCChangesXPRESSCtr1 {
uint32_t decompressed_length;
uint32_t compressed_length;
- struct drsuapi_DsGetNCChangesCtr1 *ctr1;/* [unique,compression(NDR_COMPRESSION_XPRESS,compressed_length,decompressed_length),subcontext_size(compressed_length),subcontext(4)] */
-};
+ struct drsuapi_DsGetNCChangesCtr1TS *ts;/* [unique,compression(NDR_COMPRESSION_XPRESS,compressed_length,decompressed_length),subcontext_size(compressed_length),subcontext(4)] */
+}/* [nopush] */;
struct drsuapi_DsGetNCChangesXPRESSCtr6 {
uint32_t decompressed_length;
uint32_t compressed_length;
- struct drsuapi_DsGetNCChangesCtr6 *ctr6;/* [unique,compression(NDR_COMPRESSION_XPRESS,compressed_length,decompressed_length),subcontext_size(compressed_length),subcontext(4)] */
-};
+ struct drsuapi_DsGetNCChangesCtr6TS *ts;/* [unique,compression(NDR_COMPRESSION_XPRESS,compressed_length,decompressed_length),subcontext_size(compressed_length),subcontext(4)] */
+}/* [nopush] */;
enum drsuapi_DsGetNCChangesCompressionType
#ifndef USE_UINT_ENUMS
@@ -620,7 +628,7 @@ union drsuapi_DsGetNCChangesCompressedCtr {
}/* [nodiscriminant,flag(LIBNDR_PRINT_ARRAY_HEX)] */;
struct drsuapi_DsGetNCChangesCtr2 {
- union drsuapi_DsGetNCChangesCompressedCtr ctr;/* [switch_is(1|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16))] */
+ struct drsuapi_DsGetNCChangesMSZIPCtr1 mszip1;
};
struct drsuapi_DsGetNCChangesCtr7 {
@@ -790,7 +798,7 @@ enum drsuapi_DsNameFlags
enum drsuapi_DsNameFormat
#ifndef USE_UINT_ENUMS
{
- DRSUAPI_DS_NAME_FORMAT_UKNOWN=0,
+ DRSUAPI_DS_NAME_FORMAT_UNKNOWN=0,
DRSUAPI_DS_NAME_FORMAT_FQDN_1779=1,
DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT=2,
DRSUAPI_DS_NAME_FORMAT_DISPLAY=3,
@@ -804,7 +812,7 @@ enum drsuapi_DsNameFormat
}
#else
{ __donnot_use_enum_drsuapi_DsNameFormat=0x7FFFFFFF}
-#define DRSUAPI_DS_NAME_FORMAT_UKNOWN ( 0 )
+#define DRSUAPI_DS_NAME_FORMAT_UNKNOWN ( 0 )
#define DRSUAPI_DS_NAME_FORMAT_FQDN_1779 ( 1 )
#define DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT ( 2 )
#define DRSUAPI_DS_NAME_FORMAT_DISPLAY ( 3 )
@@ -889,7 +897,7 @@ union drsuapi_DsWriteAccountSpnResult {
struct drsuapi_DsRemoveDSServerRequest1 {
const char *server_dn;/* [unique,charset(UTF16)] */
const char *domain_dn;/* [unique,charset(UTF16)] */
- uint32_t unknown;
+ uint32_t commit;
};
union drsuapi_DsRemoveDSServerRequest {
@@ -897,7 +905,7 @@ union drsuapi_DsRemoveDSServerRequest {
}/* [switch_type(int32)] */;
struct drsuapi_DsRemoveDSServerResult1 {
- WERROR status;
+ uint32_t last_dc_in_domain;
};
union drsuapi_DsRemoveDSServerResult {
diff --git a/source3/librpc/gen_ndr/epmapper.h b/source3/librpc/gen_ndr/epmapper.h
index 7689ee54a6..4b75261a02 100644
--- a/source3/librpc/gen_ndr/epmapper.h
+++ b/source3/librpc/gen_ndr/epmapper.h
@@ -227,7 +227,9 @@ struct epm_twr_t {
struct epm_entry_t {
struct GUID object;
struct epm_twr_t *tower;/* [ptr] */
- const char * annotation;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_LEN4)] */
+ uint32_t __annotation_offset;/* [value(0)] */
+ uint32_t __annotation_length;/* [value(strlen(annotation)+1)] */
+ const char *annotation;/* [charset(DOS)] */
};
struct rpc_if_id_t {
diff --git a/source3/librpc/gen_ndr/initshutdown.h b/source3/librpc/gen_ndr/initshutdown.h
index 3f2384641b..014e2fe689 100644
--- a/source3/librpc/gen_ndr/initshutdown.h
+++ b/source3/librpc/gen_ndr/initshutdown.h
@@ -6,22 +6,11 @@
#ifndef _HEADER_initshutdown
#define _HEADER_initshutdown
-struct initshutdown_String_sub {
- uint32_t name_size;/* [value(strlen_m_term(name))] */
- const char * name;/* [flag(LIBNDR_FLAG_STR_LEN4|LIBNDR_FLAG_STR_NOTERM)] */
-};
-
-struct initshutdown_String {
- uint16_t name_len;/* [value(strlen_m(name->name)*2)] */
- uint16_t name_size;/* [value(strlen_m_term(name->name)*2)] */
- struct initshutdown_String_sub *name;/* [unique] */
-}/* [public] */;
-
struct initshutdown_Init {
struct {
uint16_t *hostname;/* [unique] */
- struct initshutdown_String *message;/* [unique] */
+ struct lsa_StringLarge *message;/* [unique] */
uint32_t timeout;
uint8_t force_apps;
uint8_t do_reboot;
@@ -49,7 +38,7 @@ struct initshutdown_Abort {
struct initshutdown_InitEx {
struct {
uint16_t *hostname;/* [unique] */
- struct initshutdown_String *message;/* [unique] */
+ struct lsa_StringLarge *message;/* [unique] */
uint32_t timeout;
uint8_t force_apps;
uint8_t do_reboot;
diff --git a/source3/librpc/gen_ndr/lsa.h b/source3/librpc/gen_ndr/lsa.h
index b37d7a1c41..bcf6dd665e 100644
--- a/source3/librpc/gen_ndr/lsa.h
+++ b/source3/librpc/gen_ndr/lsa.h
@@ -12,6 +12,9 @@
#define MAX_REF_DOMAINS ( LSA_REF_DOMAIN_LIST_MULTIPLIER )
#define MAX_LOOKUP_SIDS ( 0x5000 )
#define LSA_ENUM_TRUST_DOMAIN_EX_MULTIPLIER ( 82 )
+#define LSA_CLIENT_REVISION_NO_DNS ( 0x00000001 )
+#define LSA_CLIENT_REVISION_DNS ( 0x00000002 )
+#define LSA_LOOKUP_OPTIONS_NO_ISOLATED ( 0x80000000 )
struct lsa_String {
uint16_t length;/* [value(2*strlen_m(string))] */
uint16_t size;/* [value(2*strlen_m(string))] */
@@ -219,7 +222,8 @@ enum lsa_PolicyInfo
LSA_POLICY_INFO_DB=9,
LSA_POLICY_INFO_AUDIT_FULL_SET=10,
LSA_POLICY_INFO_AUDIT_FULL_QUERY=11,
- LSA_POLICY_INFO_DNS=12
+ LSA_POLICY_INFO_DNS=12,
+ LSA_POLICY_INFO_DNS_INT=13
}
#else
{ __donnot_use_enum_lsa_PolicyInfo=0x7FFFFFFF}
@@ -235,6 +239,7 @@ enum lsa_PolicyInfo
#define LSA_POLICY_INFO_AUDIT_FULL_SET ( 10 )
#define LSA_POLICY_INFO_AUDIT_FULL_QUERY ( 11 )
#define LSA_POLICY_INFO_DNS ( 12 )
+#define LSA_POLICY_INFO_DNS_INT ( 13 )
#endif
;
@@ -321,7 +326,8 @@ enum lsa_LookupNamesLevel
LSA_LOOKUP_NAMES_PRIMARY_DOMAIN_ONLY=3,
LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY=4,
LSA_LOOKUP_NAMES_FOREST_TRUSTS_ONLY=5,
- LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2=6
+ LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2=6,
+ LSA_LOOKUP_NAMES_RODC_REFERRAL_TO_FULL_DC=7
}
#else
{ __donnot_use_enum_lsa_LookupNamesLevel=0x7FFFFFFF}
@@ -331,6 +337,7 @@ enum lsa_LookupNamesLevel
#define LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY ( 4 )
#define LSA_LOOKUP_NAMES_FOREST_TRUSTS_ONLY ( 5 )
#define LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2 ( 6 )
+#define LSA_LOOKUP_NAMES_RODC_REFERRAL_TO_FULL_DC ( 7 )
#endif
;
@@ -371,35 +378,75 @@ enum lsa_TrustDomInfoEnum
#ifndef USE_UINT_ENUMS
{
LSA_TRUSTED_DOMAIN_INFO_NAME=1,
- LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS_INFO=2,
+ LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS=2,
LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET=3,
LSA_TRUSTED_DOMAIN_INFO_PASSWORD=4,
LSA_TRUSTED_DOMAIN_INFO_BASIC=5,
LSA_TRUSTED_DOMAIN_INFO_INFO_EX=6,
LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO=7,
LSA_TRUSTED_DOMAIN_INFO_FULL_INFO=8,
- LSA_TRUSTED_DOMAIN_INFO_11=11,
- LSA_TRUSTED_DOMAIN_INFO_INFO_ALL=12
+ LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL=9,
+ LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL=10,
+ LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL=11,
+ LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL=12,
+ LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES=13
}
#else
{ __donnot_use_enum_lsa_TrustDomInfoEnum=0x7FFFFFFF}
#define LSA_TRUSTED_DOMAIN_INFO_NAME ( 1 )
-#define LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS_INFO ( 2 )
+#define LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS ( 2 )
#define LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET ( 3 )
#define LSA_TRUSTED_DOMAIN_INFO_PASSWORD ( 4 )
#define LSA_TRUSTED_DOMAIN_INFO_BASIC ( 5 )
#define LSA_TRUSTED_DOMAIN_INFO_INFO_EX ( 6 )
#define LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO ( 7 )
#define LSA_TRUSTED_DOMAIN_INFO_FULL_INFO ( 8 )
-#define LSA_TRUSTED_DOMAIN_INFO_11 ( 11 )
-#define LSA_TRUSTED_DOMAIN_INFO_INFO_ALL ( 12 )
+#define LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL ( 9 )
+#define LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL ( 10 )
+#define LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL ( 11 )
+#define LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL ( 12 )
+#define LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES ( 13 )
#endif
;
+/* bitmap lsa_TrustDirection */
+#define LSA_TRUST_DIRECTION_INBOUND ( 0x00000001 )
+#define LSA_TRUST_DIRECTION_OUTBOUND ( 0x00000002 )
+
+enum lsa_TrustType
+#ifndef USE_UINT_ENUMS
+ {
+ LSA_TRUST_TYPE_DOWNLEVEL=0x00000001,
+ LSA_TRUST_TYPE_UPLEVEL=0x00000002,
+ LSA_TRUST_TYPE_MIT=0x00000003
+}
+#else
+ { __donnot_use_enum_lsa_TrustType=0x7FFFFFFF}
+#define LSA_TRUST_TYPE_DOWNLEVEL ( 0x00000001 )
+#define LSA_TRUST_TYPE_UPLEVEL ( 0x00000002 )
+#define LSA_TRUST_TYPE_MIT ( 0x00000003 )
+#endif
+;
+
+/* bitmap lsa_TrustAttributes */
+#define LSA_TRUST_ATTRIBUTE_NON_TRANSITIVE ( 0x00000001 )
+#define LSA_TRUST_ATTRIBUTE_UPLEVEL_ONLY ( 0x00000002 )
+#define LSA_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN ( 0x00000004 )
+#define LSA_TRUST_ATTRIBUTE_FOREST_TRANSITIVE ( 0x00000008 )
+#define LSA_TRUST_ATTRIBUTE_CROSS_ORGANIZATION ( 0x00000010 )
+#define LSA_TRUST_ATTRIBUTE_WITHIN_FOREST ( 0x00000020 )
+#define LSA_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL ( 0x00000040 )
+#define LSA_TRUST_ATTRIBUTE_USES_RC4_ENCRYPTION ( 0x00000080 )
+
struct lsa_TrustDomainInfoName {
struct lsa_StringLarge netbios_name;
};
+struct lsa_TrustDomainInfoControllers {
+ uint32_t entries;
+ struct lsa_StringLarge *netbios_names;/* [unique,size_is(entries)] */
+};
+
struct lsa_TrustDomainInfoPosixOffset {
uint32_t posix_offset;
};
@@ -419,13 +466,30 @@ struct lsa_TrustDomainInfoInfoEx {
struct lsa_StringLarge netbios_name;
struct dom_sid2 *sid;/* [unique] */
uint32_t trust_direction;
- uint32_t trust_type;
+ enum lsa_TrustType trust_type;
uint32_t trust_attributes;
};
+enum lsa_TrustAuthType
+#ifndef USE_UINT_ENUMS
+ {
+ TRUST_AUTH_TYPE_NONE=0,
+ TRUST_AUTH_TYPE_NT4OWF=1,
+ TRUST_AUTH_TYPE_CLEAR=2,
+ TRUST_AUTH_TYPE_VERSION=3
+}
+#else
+ { __donnot_use_enum_lsa_TrustAuthType=0x7FFFFFFF}
+#define TRUST_AUTH_TYPE_NONE ( 0 )
+#define TRUST_AUTH_TYPE_NT4OWF ( 1 )
+#define TRUST_AUTH_TYPE_CLEAR ( 2 )
+#define TRUST_AUTH_TYPE_VERSION ( 3 )
+#endif
+;
+
struct lsa_TrustDomainInfoBuffer {
NTTIME last_update_time;
- uint32_t secret_type;
+ enum lsa_TrustAuthType AuthType;
struct lsa_DATA_BUF2 data;
};
@@ -444,28 +508,46 @@ struct lsa_TrustDomainInfoFullInfo {
struct lsa_TrustDomainInfoAuthInfo auth_info;
};
-struct lsa_TrustDomainInfo11 {
+struct lsa_TrustDomainInfoAuthInfoInternal {
+ struct lsa_DATA_BUF2 auth_blob;
+};
+
+struct lsa_TrustDomainInfoFullInfoInternal {
struct lsa_TrustDomainInfoInfoEx info_ex;
- struct lsa_DATA_BUF2 data1;
+ struct lsa_TrustDomainInfoPosixOffset posix_offset;
+ struct lsa_TrustDomainInfoAuthInfoInternal auth_info;
};
-struct lsa_TrustDomainInfoInfoAll {
+struct lsa_TrustDomainInfoInfoEx2Internal {
struct lsa_TrustDomainInfoInfoEx info_ex;
- struct lsa_DATA_BUF2 data1;
+ uint32_t forest_trust_length;
+ uint8_t *forest_trust_data;/* [unique,size_is(forest_trust_length)] */
+};
+
+struct lsa_TrustDomainInfoFullInfo2Internal {
+ struct lsa_TrustDomainInfoInfoEx2Internal info;
struct lsa_TrustDomainInfoPosixOffset posix_offset;
struct lsa_TrustDomainInfoAuthInfo auth_info;
};
+struct lsa_TrustDomainInfoSupportedEncTypes {
+ uint32_t enc_types;
+};
+
union lsa_TrustedDomainInfo {
struct lsa_TrustDomainInfoName name;/* [case(LSA_TRUSTED_DOMAIN_INFO_NAME)] */
+ struct lsa_TrustDomainInfoControllers controllers;/* [case(LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS)] */
struct lsa_TrustDomainInfoPosixOffset posix_offset;/* [case(LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET)] */
struct lsa_TrustDomainInfoPassword password;/* [case(LSA_TRUSTED_DOMAIN_INFO_PASSWORD)] */
struct lsa_TrustDomainInfoBasic info_basic;/* [case(LSA_TRUSTED_DOMAIN_INFO_BASIC)] */
struct lsa_TrustDomainInfoInfoEx info_ex;/* [case(LSA_TRUSTED_DOMAIN_INFO_INFO_EX)] */
struct lsa_TrustDomainInfoAuthInfo auth_info;/* [case(LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO)] */
struct lsa_TrustDomainInfoFullInfo full_info;/* [case(LSA_TRUSTED_DOMAIN_INFO_FULL_INFO)] */
- struct lsa_TrustDomainInfo11 info11;/* [case(LSA_TRUSTED_DOMAIN_INFO_11)] */
- struct lsa_TrustDomainInfoInfoAll info_all;/* [case(LSA_TRUSTED_DOMAIN_INFO_INFO_ALL)] */
+ struct lsa_TrustDomainInfoAuthInfoInternal auth_info_internal;/* [case(LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL)] */
+ struct lsa_TrustDomainInfoFullInfoInternal full_info_internal;/* [case(LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL)] */
+ struct lsa_TrustDomainInfoInfoEx2Internal info_ex2_internal;/* [case(LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL)] */
+ struct lsa_TrustDomainInfoFullInfo2Internal full_info2_internal;/* [case(LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL)] */
+ struct lsa_TrustDomainInfoSupportedEncTypes enc_types;/* [case(LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES)] */
}/* [switch_type(lsa_TrustDomInfoEnum)] */;
struct lsa_DATA_BUF_PTR {
@@ -546,7 +628,7 @@ struct lsa_TranslatedSid3 {
enum lsa_SidType sid_type;
struct dom_sid2 *sid;/* [unique] */
uint32_t sid_index;
- uint32_t unknown;
+ uint32_t flags;
};
struct lsa_TransSidArray3 {
@@ -974,6 +1056,12 @@ struct lsa_QueryTrustedDomainInfo {
struct lsa_SetInformationTrustedDomain {
struct {
+ struct policy_handle *trustdom_handle;/* [ref] */
+ enum lsa_TrustDomInfoEnum level;
+ union lsa_TrustedDomainInfo *info;/* [ref,switch_is(level)] */
+ } in;
+
+ struct {
NTSTATUS result;
} out;
@@ -1161,6 +1249,13 @@ struct lsa_QueryTrustedDomainInfoBySid {
struct lsa_SetTrustedDomainInfo {
struct {
+ struct policy_handle *handle;/* [ref] */
+ struct dom_sid2 *dom_sid;/* [ref] */
+ enum lsa_TrustDomInfoEnum level;
+ union lsa_TrustedDomainInfo *info;/* [ref,switch_is(level)] */
+ } in;
+
+ struct {
NTSTATUS result;
} out;
@@ -1303,6 +1398,14 @@ struct lsa_EnumTrustedDomainsEx {
struct lsa_CreateTrustedDomainEx {
struct {
+ struct policy_handle *policy_handle;/* [ref] */
+ struct lsa_TrustDomainInfoInfoEx *info;/* [ref] */
+ struct lsa_TrustDomainInfoAuthInfoInternal *auth_info;/* [ref] */
+ uint32_t access_mask;
+ } in;
+
+ struct {
+ struct policy_handle *trustdom_handle;/* [ref] */
NTSTATUS result;
} out;
@@ -1400,8 +1503,8 @@ struct lsa_LookupNames2 {
uint32_t num_names;/* [range(0,1000)] */
struct lsa_String *names;/* [size_is(num_names)] */
enum lsa_LookupNamesLevel level;
- uint32_t unknown1;
- uint32_t unknown2;
+ uint32_t lookup_options;
+ uint32_t client_revision;
struct lsa_TransSidArray2 *sids;/* [ref] */
uint32_t *count;/* [ref] */
} in;
@@ -1418,6 +1521,14 @@ struct lsa_LookupNames2 {
struct lsa_CreateTrustedDomainEx2 {
struct {
+ struct policy_handle *policy_handle;/* [ref] */
+ struct lsa_TrustDomainInfoInfoEx *info;/* [ref] */
+ struct lsa_TrustDomainInfoAuthInfoInternal *auth_info;/* [ref] */
+ uint32_t access_mask;
+ } in;
+
+ struct {
+ struct policy_handle *trustdom_handle;/* [ref] */
NTSTATUS result;
} out;
@@ -1494,8 +1605,8 @@ struct lsa_LookupNames3 {
uint32_t num_names;/* [range(0,1000)] */
struct lsa_String *names;/* [size_is(num_names)] */
enum lsa_LookupNamesLevel level;
- uint32_t unknown1;
- uint32_t unknown2;
+ uint32_t lookup_options;
+ uint32_t client_revision;
struct lsa_TransSidArray3 *sids;/* [ref] */
uint32_t *count;/* [ref] */
} in;
@@ -1598,8 +1709,8 @@ struct lsa_LookupNames4 {
uint32_t num_names;/* [range(0,1000)] */
struct lsa_String *names;/* [size_is(num_names)] */
enum lsa_LookupNamesLevel level;
- uint32_t unknown1;
- uint32_t unknown2;
+ uint32_t lookup_options;
+ uint32_t client_revision;
struct lsa_TransSidArray3 *sids;/* [ref] */
uint32_t *count;/* [ref] */
} in;
diff --git a/source3/librpc/gen_ndr/misc.h b/source3/librpc/gen_ndr/misc.h
index 4fa7415db7..b3740faf34 100644
--- a/source3/librpc/gen_ndr/misc.h
+++ b/source3/librpc/gen_ndr/misc.h
@@ -26,13 +26,17 @@ struct policy_handle {
enum netr_SchannelType
#ifndef USE_UINT_ENUMS
{
+ SEC_CHAN_NULL=0,
SEC_CHAN_WKSTA=2,
+ SEC_CHAN_DNS_DOMAIN=3,
SEC_CHAN_DOMAIN=4,
SEC_CHAN_BDC=6
}
#else
{ __donnot_use_enum_netr_SchannelType=0x7FFFFFFF}
+#define SEC_CHAN_NULL ( 0 )
#define SEC_CHAN_WKSTA ( 2 )
+#define SEC_CHAN_DNS_DOMAIN ( 3 )
#define SEC_CHAN_DOMAIN ( 4 )
#define SEC_CHAN_BDC ( 6 )
#endif
diff --git a/source3/librpc/gen_ndr/ndr_drsblobs.c b/source3/librpc/gen_ndr/ndr_drsblobs.c
index 41a448cbe3..dd8d77ea15 100644
--- a/source3/librpc/gen_ndr/ndr_drsblobs.c
+++ b/source3/librpc/gen_ndr/ndr_drsblobs.c
@@ -5,6 +5,8 @@
#include "librpc/gen_ndr/ndr_drsuapi.h"
#include "librpc/gen_ndr/ndr_misc.h"
+#include "librpc/gen_ndr/ndr_samr.h"
+#include "librpc/gen_ndr/ndr_lsa.h"
static enum ndr_err_code ndr_push_replPropertyMetaData1(struct ndr_push *ndr, int ndr_flags, const struct replPropertyMetaData1 *r)
{
if (ndr_flags & NDR_SCALARS) {
@@ -2165,10 +2167,10 @@ _PUBLIC_ enum ndr_err_code ndr_push_package_PrimaryCLEARTEXTBlob(struct ndr_push
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_push_align(ndr, 4));
{
- uint32_t _flags_save_string = ndr->flags;
- ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NOTERM|LIBNDR_FLAG_REMAINING);
- NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->cleartext));
- ndr->flags = _flags_save_string;
+ uint32_t _flags_save_DATA_BLOB = ndr->flags;
+ ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
+ NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->cleartext));
+ ndr->flags = _flags_save_DATA_BLOB;
}
}
if (ndr_flags & NDR_BUFFERS) {
@@ -2181,10 +2183,10 @@ _PUBLIC_ enum ndr_err_code ndr_pull_package_PrimaryCLEARTEXTBlob(struct ndr_pull
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_pull_align(ndr, 4));
{
- uint32_t _flags_save_string = ndr->flags;
- ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NOTERM|LIBNDR_FLAG_REMAINING);
- NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->cleartext));
- ndr->flags = _flags_save_string;
+ uint32_t _flags_save_DATA_BLOB = ndr->flags;
+ ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
+ NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->cleartext));
+ ndr->flags = _flags_save_DATA_BLOB;
}
}
if (ndr_flags & NDR_BUFFERS) {
@@ -2196,7 +2198,7 @@ _PUBLIC_ void ndr_print_package_PrimaryCLEARTEXTBlob(struct ndr_print *ndr, cons
{
ndr_print_struct(ndr, name, "package_PrimaryCLEARTEXTBlob");
ndr->depth++;
- ndr_print_string(ndr, "cleartext", r->cleartext);
+ ndr_print_DATA_BLOB(ndr, "cleartext", r->cleartext);
ndr->depth--;
}
@@ -2311,13 +2313,269 @@ _PUBLIC_ void ndr_print_package_PrimaryWDigestBlob(struct ndr_print *ndr, const
ndr->depth--;
}
-static enum ndr_err_code ndr_push_trustAuthInOutSecret1(struct ndr_push *ndr, int ndr_flags, const struct trustAuthInOutSecret1 *r)
+static enum ndr_err_code ndr_push_AuthInfoNone(struct ndr_push *ndr, int ndr_flags, const struct AuthInfoNone *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_AuthInfoNone(struct ndr_pull *ndr, int ndr_flags, struct AuthInfoNone *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_AuthInfoNone(struct ndr_print *ndr, const char *name, const struct AuthInfoNone *r)
+{
+ ndr_print_struct(ndr, name, "AuthInfoNone");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->size);
+ ndr->depth--;
+}
+
+static enum ndr_err_code ndr_push_AuthInfoNT4Owf(struct ndr_push *ndr, int ndr_flags, const struct AuthInfoNT4Owf *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 16));
+ 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;
+}
+
+static enum ndr_err_code ndr_pull_AuthInfoNT4Owf(struct ndr_pull *ndr, int ndr_flags, struct AuthInfoNT4Owf *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size));
+ 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;
+}
+
+_PUBLIC_ void ndr_print_AuthInfoNT4Owf(struct ndr_print *ndr, const char *name, const struct AuthInfoNT4Owf *r)
+{
+ ndr_print_struct(ndr, name, "AuthInfoNT4Owf");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?16:r->size);
+ ndr_print_samr_Password(ndr, "password", &r->password);
+ ndr->depth--;
+}
+
+static enum ndr_err_code ndr_push_AuthInfoClear(struct ndr_push *ndr, int ndr_flags, const struct AuthInfoClear *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size));
+ NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->password, r->size));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_AuthInfoClear(struct ndr_pull *ndr, int ndr_flags, struct AuthInfoClear *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size));
+ NDR_PULL_ALLOC_N(ndr, r->password, r->size);
+ NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->password, r->size));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_AuthInfoClear(struct ndr_print *ndr, const char *name, const struct AuthInfoClear *r)
+{
+ ndr_print_struct(ndr, name, "AuthInfoClear");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "size", r->size);
+ ndr_print_array_uint8(ndr, "password", r->password, r->size);
+ ndr->depth--;
+}
+
+static enum ndr_err_code ndr_push_AuthInfoVersion(struct ndr_push *ndr, int ndr_flags, const struct AuthInfoVersion *r)
{
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_push_align(ndr, 4));
- NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->time1));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1));
- NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->value));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_AuthInfoVersion(struct ndr_pull *ndr, int ndr_flags, struct AuthInfoVersion *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_AuthInfoVersion(struct ndr_print *ndr, const char *name, const struct AuthInfoVersion *r)
+{
+ ndr_print_struct(ndr, name, "AuthInfoVersion");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?4:r->size);
+ ndr_print_uint32(ndr, "version", r->version);
+ ndr->depth--;
+}
+
+static enum ndr_err_code ndr_push_AuthInfo(struct ndr_push *ndr, int ndr_flags, const union AuthInfo *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ int level = ndr_push_get_switch_value(ndr, r);
+ switch (level) {
+ case TRUST_AUTH_TYPE_NONE: {
+ NDR_CHECK(ndr_push_AuthInfoNone(ndr, NDR_SCALARS, &r->none));
+ break; }
+
+ case TRUST_AUTH_TYPE_NT4OWF: {
+ NDR_CHECK(ndr_push_AuthInfoNT4Owf(ndr, NDR_SCALARS, &r->nt4owf));
+ break; }
+
+ case TRUST_AUTH_TYPE_CLEAR: {
+ NDR_CHECK(ndr_push_AuthInfoClear(ndr, NDR_SCALARS, &r->clear));
+ break; }
+
+ case TRUST_AUTH_TYPE_VERSION: {
+ NDR_CHECK(ndr_push_AuthInfoVersion(ndr, NDR_SCALARS, &r->version));
+ break; }
+
+ default:
+ return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
+ }
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ int level = ndr_push_get_switch_value(ndr, r);
+ switch (level) {
+ case TRUST_AUTH_TYPE_NONE:
+ break;
+
+ case TRUST_AUTH_TYPE_NT4OWF:
+ NDR_CHECK(ndr_push_AuthInfoNT4Owf(ndr, NDR_BUFFERS, &r->nt4owf));
+ break;
+
+ case TRUST_AUTH_TYPE_CLEAR:
+ break;
+
+ case TRUST_AUTH_TYPE_VERSION:
+ break;
+
+ default:
+ return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
+ }
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_AuthInfo(struct ndr_pull *ndr, int ndr_flags, union AuthInfo *r)
+{
+ int level;
+ level = ndr_pull_get_switch_value(ndr, r);
+ if (ndr_flags & NDR_SCALARS) {
+ switch (level) {
+ case TRUST_AUTH_TYPE_NONE: {
+ NDR_CHECK(ndr_pull_AuthInfoNone(ndr, NDR_SCALARS, &r->none));
+ break; }
+
+ case TRUST_AUTH_TYPE_NT4OWF: {
+ NDR_CHECK(ndr_pull_AuthInfoNT4Owf(ndr, NDR_SCALARS, &r->nt4owf));
+ break; }
+
+ case TRUST_AUTH_TYPE_CLEAR: {
+ NDR_CHECK(ndr_pull_AuthInfoClear(ndr, NDR_SCALARS, &r->clear));
+ break; }
+
+ case TRUST_AUTH_TYPE_VERSION: {
+ NDR_CHECK(ndr_pull_AuthInfoVersion(ndr, NDR_SCALARS, &r->version));
+ break; }
+
+ default:
+ return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
+ }
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ switch (level) {
+ case TRUST_AUTH_TYPE_NONE:
+ break;
+
+ case TRUST_AUTH_TYPE_NT4OWF:
+ NDR_CHECK(ndr_pull_AuthInfoNT4Owf(ndr, NDR_BUFFERS, &r->nt4owf));
+ break;
+
+ case TRUST_AUTH_TYPE_CLEAR:
+ break;
+
+ case TRUST_AUTH_TYPE_VERSION:
+ break;
+
+ default:
+ return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
+ }
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_AuthInfo(struct ndr_print *ndr, const char *name, const union AuthInfo *r)
+{
+ int level;
+ level = ndr_print_get_switch_value(ndr, r);
+ ndr_print_union(ndr, name, level, "AuthInfo");
+ switch (level) {
+ case TRUST_AUTH_TYPE_NONE:
+ ndr_print_AuthInfoNone(ndr, "none", &r->none);
+ break;
+
+ case TRUST_AUTH_TYPE_NT4OWF:
+ ndr_print_AuthInfoNT4Owf(ndr, "nt4owf", &r->nt4owf);
+ break;
+
+ case TRUST_AUTH_TYPE_CLEAR:
+ ndr_print_AuthInfoClear(ndr, "clear", &r->clear);
+ break;
+
+ case TRUST_AUTH_TYPE_VERSION:
+ ndr_print_AuthInfoVersion(ndr, "version", &r->version);
+ break;
+
+ default:
+ ndr_print_bad_level(ndr, name, level);
+ }
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_AuthenticationInformation(struct ndr_push *ndr, int ndr_flags, const struct AuthenticationInformation *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->LastUpdateTime));
+ NDR_CHECK(ndr_push_lsa_TrustAuthType(ndr, NDR_SCALARS, r->AuthType));
+ NDR_CHECK(ndr_push_set_switch_value(ndr, &r->AuthInfo, r->AuthType));
+ NDR_CHECK(ndr_push_AuthInfo(ndr, NDR_SCALARS, &r->AuthInfo));
{
uint32_t _flags_save_DATA_BLOB = ndr->flags;
ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
@@ -2326,17 +2584,19 @@ static enum ndr_err_code ndr_push_trustAuthInOutSecret1(struct ndr_push *ndr, in
}
}
if (ndr_flags & NDR_BUFFERS) {
+ NDR_CHECK(ndr_push_AuthInfo(ndr, NDR_BUFFERS, &r->AuthInfo));
}
return NDR_ERR_SUCCESS;
}
-static enum ndr_err_code ndr_pull_trustAuthInOutSecret1(struct ndr_pull *ndr, int ndr_flags, struct trustAuthInOutSecret1 *r)
+_PUBLIC_ enum ndr_err_code ndr_pull_AuthenticationInformation(struct ndr_pull *ndr, int ndr_flags, struct AuthenticationInformation *r)
{
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_pull_align(ndr, 4));
- NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->time1));
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1));
- NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->value));
+ NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->LastUpdateTime));
+ NDR_CHECK(ndr_pull_lsa_TrustAuthType(ndr, NDR_SCALARS, &r->AuthType));
+ NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->AuthInfo, r->AuthType));
+ NDR_CHECK(ndr_pull_AuthInfo(ndr, NDR_SCALARS, &r->AuthInfo));
{
uint32_t _flags_save_DATA_BLOB = ndr->flags;
ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
@@ -2345,325 +2605,405 @@ static enum ndr_err_code ndr_pull_trustAuthInOutSecret1(struct ndr_pull *ndr, in
}
}
if (ndr_flags & NDR_BUFFERS) {
+ NDR_CHECK(ndr_pull_AuthInfo(ndr, NDR_BUFFERS, &r->AuthInfo));
}
return NDR_ERR_SUCCESS;
}
-_PUBLIC_ void ndr_print_trustAuthInOutSecret1(struct ndr_print *ndr, const char *name, const struct trustAuthInOutSecret1 *r)
+_PUBLIC_ void ndr_print_AuthenticationInformation(struct ndr_print *ndr, const char *name, const struct AuthenticationInformation *r)
{
- ndr_print_struct(ndr, name, "trustAuthInOutSecret1");
+ ndr_print_struct(ndr, name, "AuthenticationInformation");
ndr->depth++;
- ndr_print_NTTIME(ndr, "time1", r->time1);
- ndr_print_uint32(ndr, "unknown1", r->unknown1);
- ndr_print_DATA_BLOB(ndr, "value", r->value);
+ ndr_print_NTTIME(ndr, "LastUpdateTime", r->LastUpdateTime);
+ ndr_print_lsa_TrustAuthType(ndr, "AuthType", r->AuthType);
+ ndr_print_set_switch_value(ndr, &r->AuthInfo, r->AuthType);
+ ndr_print_AuthInfo(ndr, "AuthInfo", &r->AuthInfo);
ndr_print_DATA_BLOB(ndr, "_pad", r->_pad);
ndr->depth--;
}
-static enum ndr_err_code ndr_push_trustAuthInOutCtr1(struct ndr_push *ndr, int ndr_flags, const struct trustAuthInOutCtr1 *r)
+_PUBLIC_ size_t ndr_size_trustAuthInOutBlob(const struct trustAuthInOutBlob *r, int flags)
{
+ return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_trustAuthInOutBlob);
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_trustCurrentPasswords(struct ndr_push *ndr, int ndr_flags, const struct trustCurrentPasswords *r)
+{
+ uint32_t cntr_current_0;
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_push_align(ndr, 4));
- NDR_CHECK(ndr_push_relative_ptr1(ndr, r->value1));
- NDR_CHECK(ndr_push_relative_ptr1(ndr, r->value2));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
+ for (cntr_current_0 = 0; cntr_current_0 < r->count; cntr_current_0++) {
+ NDR_CHECK(ndr_push_relative_ptr1(ndr, r->current[cntr_current_0]));
+ }
}
if (ndr_flags & NDR_BUFFERS) {
- if (r->value1) {
- NDR_CHECK(ndr_push_relative_ptr2(ndr, r->value1));
- NDR_CHECK(ndr_push_trustAuthInOutSecret1(ndr, NDR_SCALARS, r->value1));
- }
- if (r->value2) {
- NDR_CHECK(ndr_push_relative_ptr2(ndr, r->value2));
- NDR_CHECK(ndr_push_trustAuthInOutSecret1(ndr, NDR_SCALARS, r->value2));
+ 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]));
+ }
}
}
return NDR_ERR_SUCCESS;
}
-static enum ndr_err_code ndr_pull_trustAuthInOutCtr1(struct ndr_pull *ndr, int ndr_flags, struct trustAuthInOutCtr1 *r)
+_PUBLIC_ enum ndr_err_code ndr_pull_trustCurrentPasswords(struct ndr_pull *ndr, int ndr_flags, struct trustCurrentPasswords *r)
{
- uint32_t _ptr_value1;
- TALLOC_CTX *_mem_save_value1_0;
- uint32_t _ptr_value2;
- TALLOC_CTX *_mem_save_value2_0;
+ uint32_t _ptr_current;
+ uint32_t cntr_current_0;
+ TALLOC_CTX *_mem_save_current_0;
+ TALLOC_CTX *_mem_save_current_1;
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_pull_align(ndr, 4));
- NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_value1));
- if (_ptr_value1) {
- NDR_PULL_ALLOC(ndr, r->value1);
- NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->value1, _ptr_value1));
- } else {
- r->value1 = NULL;
- }
- NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_value2));
- if (_ptr_value2) {
- NDR_PULL_ALLOC(ndr, r->value2);
- NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->value2, _ptr_value2));
- } else {
- r->value2 = NULL;
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
+ NDR_PULL_ALLOC_N(ndr, r->current, r->count);
+ _mem_save_current_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->current, 0);
+ for (cntr_current_0 = 0; cntr_current_0 < r->count; cntr_current_0++) {
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_current));
+ if (_ptr_current) {
+ NDR_PULL_ALLOC(ndr, r->current[cntr_current_0]);
+ NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->current[cntr_current_0], _ptr_current));
+ } else {
+ r->current[cntr_current_0] = NULL;
+ }
}
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_current_0, 0);
}
if (ndr_flags & NDR_BUFFERS) {
- if (r->value1) {
- uint32_t _relative_save_offset;
- _relative_save_offset = ndr->offset;
- NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->value1));
- _mem_save_value1_0 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, r->value1, 0);
- NDR_CHECK(ndr_pull_trustAuthInOutSecret1(ndr, NDR_SCALARS, r->value1));
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_value1_0, 0);
- ndr->offset = _relative_save_offset;
- }
- if (r->value2) {
- uint32_t _relative_save_offset;
- _relative_save_offset = ndr->offset;
- NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->value2));
- _mem_save_value2_0 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, r->value2, 0);
- NDR_CHECK(ndr_pull_trustAuthInOutSecret1(ndr, NDR_SCALARS, r->value2));
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_value2_0, 0);
- ndr->offset = _relative_save_offset;
+ _mem_save_current_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->current, 0);
+ for (cntr_current_0 = 0; cntr_current_0 < r->count; cntr_current_0++) {
+ if (r->current[cntr_current_0]) {
+ uint32_t _relative_save_offset;
+ _relative_save_offset = ndr->offset;
+ 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_PULL_SET_MEM_CTX(ndr, _mem_save_current_1, 0);
+ ndr->offset = _relative_save_offset;
+ }
}
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_current_0, 0);
}
return NDR_ERR_SUCCESS;
}
-_PUBLIC_ void ndr_print_trustAuthInOutCtr1(struct ndr_print *ndr, const char *name, const struct trustAuthInOutCtr1 *r)
+_PUBLIC_ void ndr_print_trustCurrentPasswords(struct ndr_print *ndr, const char *name, const struct trustCurrentPasswords *r)
{
- ndr_print_struct(ndr, name, "trustAuthInOutCtr1");
+ uint32_t cntr_current_0;
+ ndr_print_struct(ndr, name, "trustCurrentPasswords");
ndr->depth++;
- ndr_print_ptr(ndr, "value1", r->value1);
- ndr->depth++;
- if (r->value1) {
- ndr_print_trustAuthInOutSecret1(ndr, "value1", r->value1);
- }
- ndr->depth--;
- ndr_print_ptr(ndr, "value2", r->value2);
+ ndr_print_uint32(ndr, "count", r->count);
+ ndr->print(ndr, "%s: ARRAY(%d)", "current", (int)r->count);
ndr->depth++;
- if (r->value2) {
- ndr_print_trustAuthInOutSecret1(ndr, "value2", r->value2);
+ for (cntr_current_0=0;cntr_current_0<r->count;cntr_current_0++) {
+ char *idx_0=NULL;
+ if (asprintf(&idx_0, "[%d]", cntr_current_0) != -1) {
+ ndr_print_ptr(ndr, "current", r->current[cntr_current_0]);
+ ndr->depth++;
+ if (r->current[cntr_current_0]) {
+ ndr_print_AuthenticationInformation(ndr, "current", r->current[cntr_current_0]);
+ }
+ ndr->depth--;
+ free(idx_0);
+ }
}
ndr->depth--;
ndr->depth--;
}
-static enum ndr_err_code ndr_push_trustAuthInOutSecret2V1(struct ndr_push *ndr, int ndr_flags, const struct trustAuthInOutSecret2V1 *r)
+_PUBLIC_ size_t ndr_size_trustCurrentPasswords(const struct trustCurrentPasswords *r, int flags)
+{
+ return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_trustCurrentPasswords);
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_trustDomainPasswords(struct ndr_push *ndr, int ndr_flags, const struct trustDomainPasswords *r)
{
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_push_align(ndr, 4));
- NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->time1));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1));
- NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->value));
- NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->time2));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown3));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown4));
+ NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->confounder, 512));
{
- uint32_t _flags_save_DATA_BLOB = ndr->flags;
- ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
- NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->_pad));
- ndr->flags = _flags_save_DATA_BLOB;
+ struct ndr_push *_ndr_outgoing;
+ NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_outgoing, 0, ndr_size_trustCurrentPasswords(&r->outgoing, ndr->flags)));
+ NDR_CHECK(ndr_push_trustCurrentPasswords(_ndr_outgoing, NDR_SCALARS|NDR_BUFFERS, &r->outgoing));
+ NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_outgoing, 0, ndr_size_trustCurrentPasswords(&r->outgoing, ndr->flags)));
}
+ {
+ struct ndr_push *_ndr_incoming;
+ NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_incoming, 0, ndr_size_trustCurrentPasswords(&r->incoming, ndr->flags)));
+ NDR_CHECK(ndr_push_trustCurrentPasswords(_ndr_incoming, NDR_SCALARS|NDR_BUFFERS, &r->incoming));
+ NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_incoming, 0, ndr_size_trustCurrentPasswords(&r->incoming, ndr->flags)));
+ }
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_trustCurrentPasswords(&r->outgoing, ndr->flags)));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_trustCurrentPasswords(&r->incoming, ndr->flags)));
}
if (ndr_flags & NDR_BUFFERS) {
}
return NDR_ERR_SUCCESS;
}
-static enum ndr_err_code ndr_pull_trustAuthInOutSecret2V1(struct ndr_pull *ndr, int ndr_flags, struct trustAuthInOutSecret2V1 *r)
+_PUBLIC_ void ndr_print_trustDomainPasswords(struct ndr_print *ndr, const char *name, const struct trustDomainPasswords *r)
+{
+ ndr_print_struct(ndr, name, "trustDomainPasswords");
+ ndr->depth++;
+ ndr_print_array_uint8(ndr, "confounder", r->confounder, 512);
+ ndr_print_trustCurrentPasswords(ndr, "outgoing", &r->outgoing);
+ ndr_print_trustCurrentPasswords(ndr, "incoming", &r->incoming);
+ ndr_print_uint32(ndr, "outgoing_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_trustCurrentPasswords(&r->outgoing, ndr->flags):r->outgoing_size);
+ ndr_print_uint32(ndr, "incoming_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_trustCurrentPasswords(&r->incoming, ndr->flags):r->incoming_size);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_DsCompressedChunk(struct ndr_push *ndr, int ndr_flags, const struct DsCompressedChunk *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->marker));
+ NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->data));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_DsCompressedChunk(struct ndr_pull *ndr, int ndr_flags, struct DsCompressedChunk *r)
{
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_pull_align(ndr, 4));
- NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->time1));
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1));
- NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->value));
- NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->time2));
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2));
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown3));
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown4));
- {
- uint32_t _flags_save_DATA_BLOB = ndr->flags;
- ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
- NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->_pad));
- ndr->flags = _flags_save_DATA_BLOB;
- }
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->marker));
+ NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->data));
}
if (ndr_flags & NDR_BUFFERS) {
}
return NDR_ERR_SUCCESS;
}
-_PUBLIC_ void ndr_print_trustAuthInOutSecret2V1(struct ndr_print *ndr, const char *name, const struct trustAuthInOutSecret2V1 *r)
+_PUBLIC_ void ndr_print_DsCompressedChunk(struct ndr_print *ndr, const char *name, const struct DsCompressedChunk *r)
{
- ndr_print_struct(ndr, name, "trustAuthInOutSecret2V1");
+ ndr_print_struct(ndr, name, "DsCompressedChunk");
ndr->depth++;
- ndr_print_NTTIME(ndr, "time1", r->time1);
- ndr_print_uint32(ndr, "unknown1", r->unknown1);
- ndr_print_DATA_BLOB(ndr, "value", r->value);
- ndr_print_NTTIME(ndr, "time2", r->time2);
- ndr_print_uint32(ndr, "unknown2", r->unknown2);
- ndr_print_uint32(ndr, "unknown3", r->unknown3);
- ndr_print_uint32(ndr, "unknown4", r->unknown4);
- ndr_print_DATA_BLOB(ndr, "_pad", r->_pad);
+ ndr_print_uint32(ndr, "marker", r->marker);
+ ndr_print_DATA_BLOB(ndr, "data", r->data);
ndr->depth--;
}
-static enum ndr_err_code ndr_push_trustAuthInOutSecret2V2(struct ndr_push *ndr, int ndr_flags, const struct trustAuthInOutSecret2V2 *r)
+static enum ndr_err_code ndr_push_ExtendedErrorAString(struct ndr_push *ndr, int ndr_flags, const struct ExtendedErrorAString *r)
{
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_push_align(ndr, 4));
- NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->time1));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1));
- NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->value));
- NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->time2));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown3));
- {
- uint32_t _flags_save_DATA_BLOB = ndr->flags;
- ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
- NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->_pad));
- ndr->flags = _flags_save_DATA_BLOB;
- }
+ NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->__size));
+ NDR_CHECK(ndr_push_unique_ptr(ndr, r->string));
}
if (ndr_flags & NDR_BUFFERS) {
+ if (r->string) {
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->__size));
+ NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->string, r->__size, sizeof(uint8_t), CH_DOS));
+ }
}
return NDR_ERR_SUCCESS;
}
-static enum ndr_err_code ndr_pull_trustAuthInOutSecret2V2(struct ndr_pull *ndr, int ndr_flags, struct trustAuthInOutSecret2V2 *r)
+static enum ndr_err_code ndr_pull_ExtendedErrorAString(struct ndr_pull *ndr, int ndr_flags, struct ExtendedErrorAString *r)
{
+ uint32_t _ptr_string;
+ TALLOC_CTX *_mem_save_string_0;
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_pull_align(ndr, 4));
- NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->time1));
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1));
- NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->value));
- NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->time2));
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2));
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown3));
- {
- uint32_t _flags_save_DATA_BLOB = ndr->flags;
- ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
- NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->_pad));
- ndr->flags = _flags_save_DATA_BLOB;
+ NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->__size));
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_string));
+ if (_ptr_string) {
+ NDR_PULL_ALLOC(ndr, r->string);
+ } else {
+ r->string = NULL;
}
}
if (ndr_flags & NDR_BUFFERS) {
+ if (r->string) {
+ _mem_save_string_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->string, 0);
+ NDR_CHECK(ndr_pull_array_size(ndr, &r->string));
+ NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->string, ndr_get_array_size(ndr, &r->string), sizeof(uint8_t), CH_DOS));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_string_0, 0);
+ }
+ if (r->string) {
+ NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->string, r->__size));
+ }
}
return NDR_ERR_SUCCESS;
}
-_PUBLIC_ void ndr_print_trustAuthInOutSecret2V2(struct ndr_print *ndr, const char *name, const struct trustAuthInOutSecret2V2 *r)
+_PUBLIC_ void ndr_print_ExtendedErrorAString(struct ndr_print *ndr, const char *name, const struct ExtendedErrorAString *r)
{
- ndr_print_struct(ndr, name, "trustAuthInOutSecret2V2");
+ ndr_print_struct(ndr, name, "ExtendedErrorAString");
ndr->depth++;
- ndr_print_NTTIME(ndr, "time1", r->time1);
- ndr_print_uint32(ndr, "unknown1", r->unknown1);
- ndr_print_DATA_BLOB(ndr, "value", r->value);
- ndr_print_NTTIME(ndr, "time2", r->time2);
- ndr_print_uint32(ndr, "unknown2", r->unknown2);
- ndr_print_uint32(ndr, "unknown3", r->unknown3);
- ndr_print_DATA_BLOB(ndr, "_pad", r->_pad);
+ ndr_print_uint16(ndr, "__size", r->__size);
+ ndr_print_ptr(ndr, "string", r->string);
+ ndr->depth++;
+ if (r->string) {
+ ndr_print_string(ndr, "string", r->string);
+ }
+ ndr->depth--;
ndr->depth--;
}
-static enum ndr_err_code ndr_push_trustAuthInOutCtr2(struct ndr_push *ndr, int ndr_flags, const struct trustAuthInOutCtr2 *r)
+static enum ndr_err_code ndr_push_ExtendedErrorUString(struct ndr_push *ndr, int ndr_flags, const struct ExtendedErrorUString *r)
{
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_push_align(ndr, 4));
- NDR_CHECK(ndr_push_relative_ptr1(ndr, r->value1));
- NDR_CHECK(ndr_push_relative_ptr1(ndr, r->value2));
+ NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->__size));
+ NDR_CHECK(ndr_push_unique_ptr(ndr, r->string));
}
if (ndr_flags & NDR_BUFFERS) {
- if (r->value1) {
- NDR_CHECK(ndr_push_relative_ptr2(ndr, r->value1));
- NDR_CHECK(ndr_push_trustAuthInOutSecret2V1(ndr, NDR_SCALARS, r->value1));
- }
- if (r->value2) {
- NDR_CHECK(ndr_push_relative_ptr2(ndr, r->value2));
- NDR_CHECK(ndr_push_trustAuthInOutSecret2V2(ndr, NDR_SCALARS, r->value2));
+ if (r->string) {
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->__size));
+ NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->string, r->__size, sizeof(uint16_t), CH_UTF16));
}
}
return NDR_ERR_SUCCESS;
}
-static enum ndr_err_code ndr_pull_trustAuthInOutCtr2(struct ndr_pull *ndr, int ndr_flags, struct trustAuthInOutCtr2 *r)
+static enum ndr_err_code ndr_pull_ExtendedErrorUString(struct ndr_pull *ndr, int ndr_flags, struct ExtendedErrorUString *r)
{
- uint32_t _ptr_value1;
- TALLOC_CTX *_mem_save_value1_0;
- uint32_t _ptr_value2;
- TALLOC_CTX *_mem_save_value2_0;
+ uint32_t _ptr_string;
+ TALLOC_CTX *_mem_save_string_0;
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_pull_align(ndr, 4));
- NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_value1));
- if (_ptr_value1) {
- NDR_PULL_ALLOC(ndr, r->value1);
- NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->value1, _ptr_value1));
- } else {
- r->value1 = NULL;
- }
- NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_value2));
- if (_ptr_value2) {
- NDR_PULL_ALLOC(ndr, r->value2);
- NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->value2, _ptr_value2));
+ NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->__size));
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_string));
+ if (_ptr_string) {
+ NDR_PULL_ALLOC(ndr, r->string);
} else {
- r->value2 = NULL;
+ r->string = NULL;
}
}
if (ndr_flags & NDR_BUFFERS) {
- if (r->value1) {
- uint32_t _relative_save_offset;
- _relative_save_offset = ndr->offset;
- NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->value1));
- _mem_save_value1_0 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, r->value1, 0);
- NDR_CHECK(ndr_pull_trustAuthInOutSecret2V1(ndr, NDR_SCALARS, r->value1));
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_value1_0, 0);
- ndr->offset = _relative_save_offset;
+ if (r->string) {
+ _mem_save_string_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->string, 0);
+ NDR_CHECK(ndr_pull_array_size(ndr, &r->string));
+ NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->string, ndr_get_array_size(ndr, &r->string), sizeof(uint16_t), CH_UTF16));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_string_0, 0);
}
- if (r->value2) {
- uint32_t _relative_save_offset;
- _relative_save_offset = ndr->offset;
- NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->value2));
- _mem_save_value2_0 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, r->value2, 0);
- NDR_CHECK(ndr_pull_trustAuthInOutSecret2V2(ndr, NDR_SCALARS, r->value2));
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_value2_0, 0);
- ndr->offset = _relative_save_offset;
+ if (r->string) {
+ NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->string, r->__size));
}
}
return NDR_ERR_SUCCESS;
}
-_PUBLIC_ void ndr_print_trustAuthInOutCtr2(struct ndr_print *ndr, const char *name, const struct trustAuthInOutCtr2 *r)
+_PUBLIC_ void ndr_print_ExtendedErrorUString(struct ndr_print *ndr, const char *name, const struct ExtendedErrorUString *r)
{
- ndr_print_struct(ndr, name, "trustAuthInOutCtr2");
+ ndr_print_struct(ndr, name, "ExtendedErrorUString");
ndr->depth++;
- ndr_print_ptr(ndr, "value1", r->value1);
+ ndr_print_uint16(ndr, "__size", r->__size);
+ ndr_print_ptr(ndr, "string", r->string);
ndr->depth++;
- if (r->value1) {
- ndr_print_trustAuthInOutSecret2V1(ndr, "value1", r->value1);
+ if (r->string) {
+ ndr_print_string(ndr, "string", r->string);
}
ndr->depth--;
- ndr_print_ptr(ndr, "value2", r->value2);
+ ndr->depth--;
+}
+
+static enum ndr_err_code ndr_push_ExtendedErrorBlob(struct ndr_push *ndr, int ndr_flags, const struct ExtendedErrorBlob *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length));
+ NDR_CHECK(ndr_push_unique_ptr(ndr, r->data));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ if (r->data) {
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length));
+ NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->length));
+ }
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_ExtendedErrorBlob(struct ndr_pull *ndr, int ndr_flags, struct ExtendedErrorBlob *r)
+{
+ uint32_t _ptr_data;
+ TALLOC_CTX *_mem_save_data_0;
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length));
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data));
+ if (_ptr_data) {
+ NDR_PULL_ALLOC(ndr, r->data);
+ } else {
+ r->data = 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));
+ NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_size(ndr, &r->data)));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0);
+ }
+ if (r->data) {
+ NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->length));
+ }
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_ExtendedErrorBlob(struct ndr_print *ndr, const char *name, const struct ExtendedErrorBlob *r)
+{
+ ndr_print_struct(ndr, name, "ExtendedErrorBlob");
ndr->depth++;
- if (r->value2) {
- ndr_print_trustAuthInOutSecret2V2(ndr, "value2", r->value2);
+ ndr_print_uint16(ndr, "length", r->length);
+ ndr_print_ptr(ndr, "data", r->data);
+ ndr->depth++;
+ if (r->data) {
+ ndr_print_array_uint8(ndr, "data", r->data, r->length);
}
ndr->depth--;
ndr->depth--;
}
-static enum ndr_err_code ndr_push_trustAuthInOutCtr(struct ndr_push *ndr, int ndr_flags, const union trustAuthInOutCtr *r)
+static enum ndr_err_code ndr_push_ExtendedErrorComputerNamePresent(struct ndr_push *ndr, int ndr_flags, enum ExtendedErrorComputerNamePresent r)
+{
+ NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r));
+ return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_ExtendedErrorComputerNamePresent(struct ndr_pull *ndr, int ndr_flags, enum ExtendedErrorComputerNamePresent *r)
+{
+ uint16_t v;
+ NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v));
+ *r = v;
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_ExtendedErrorComputerNamePresent(struct ndr_print *ndr, const char *name, enum ExtendedErrorComputerNamePresent r)
+{
+ const char *val = NULL;
+
+ switch (r) {
+ case EXTENDED_ERROR_COMPUTER_NAME_PRESENT: val = "EXTENDED_ERROR_COMPUTER_NAME_PRESENT"; break;
+ case EXTENDED_ERROR_COMPUTER_NAME_NOT_PRESENT: val = "EXTENDED_ERROR_COMPUTER_NAME_NOT_PRESENT"; break;
+ }
+ ndr_print_enum(ndr, name, "ENUM", val, r);
+}
+
+static enum ndr_err_code ndr_push_ExtendedErrorComputerNameU(struct ndr_push *ndr, int ndr_flags, const union ExtendedErrorComputerNameU *r)
{
if (ndr_flags & NDR_SCALARS) {
int level = ndr_push_get_switch_value(ndr, r);
+ NDR_CHECK(ndr_push_ExtendedErrorComputerNamePresent(ndr, NDR_SCALARS, level));
switch (level) {
- case 1: {
- NDR_CHECK(ndr_push_trustAuthInOutCtr1(ndr, NDR_SCALARS, &r->ctr1));
+ case EXTENDED_ERROR_COMPUTER_NAME_PRESENT: {
+ NDR_CHECK(ndr_push_ExtendedErrorUString(ndr, NDR_SCALARS, &r->name));
break; }
- case 2: {
- NDR_CHECK(ndr_push_trustAuthInOutCtr2(ndr, NDR_SCALARS, &r->ctr2));
+ case EXTENDED_ERROR_COMPUTER_NAME_NOT_PRESENT: {
break; }
default:
@@ -2673,12 +3013,11 @@ static enum ndr_err_code ndr_push_trustAuthInOutCtr(struct ndr_push *ndr, int nd
if (ndr_flags & NDR_BUFFERS) {
int level = ndr_push_get_switch_value(ndr, r);
switch (level) {
- case 1:
- NDR_CHECK(ndr_push_trustAuthInOutCtr1(ndr, NDR_BUFFERS, &r->ctr1));
+ case EXTENDED_ERROR_COMPUTER_NAME_PRESENT:
+ NDR_CHECK(ndr_push_ExtendedErrorUString(ndr, NDR_BUFFERS, &r->name));
break;
- case 2:
- NDR_CHECK(ndr_push_trustAuthInOutCtr2(ndr, NDR_BUFFERS, &r->ctr2));
+ case EXTENDED_ERROR_COMPUTER_NAME_NOT_PRESENT:
break;
default:
@@ -2688,18 +3027,22 @@ static enum ndr_err_code ndr_push_trustAuthInOutCtr(struct ndr_push *ndr, int nd
return NDR_ERR_SUCCESS;
}
-static enum ndr_err_code ndr_pull_trustAuthInOutCtr(struct ndr_pull *ndr, int ndr_flags, union trustAuthInOutCtr *r)
+static enum ndr_err_code ndr_pull_ExtendedErrorComputerNameU(struct ndr_pull *ndr, int ndr_flags, union ExtendedErrorComputerNameU *r)
{
int level;
+ uint16_t _level;
level = ndr_pull_get_switch_value(ndr, r);
if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level));
+ if (_level != level) {
+ return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
+ }
switch (level) {
- case 1: {
- NDR_CHECK(ndr_pull_trustAuthInOutCtr1(ndr, NDR_SCALARS, &r->ctr1));
+ case EXTENDED_ERROR_COMPUTER_NAME_PRESENT: {
+ NDR_CHECK(ndr_pull_ExtendedErrorUString(ndr, NDR_SCALARS, &r->name));
break; }
- case 2: {
- NDR_CHECK(ndr_pull_trustAuthInOutCtr2(ndr, NDR_SCALARS, &r->ctr2));
+ case EXTENDED_ERROR_COMPUTER_NAME_NOT_PRESENT: {
break; }
default:
@@ -2708,12 +3051,11 @@ static enum ndr_err_code ndr_pull_trustAuthInOutCtr(struct ndr_pull *ndr, int nd
}
if (ndr_flags & NDR_BUFFERS) {
switch (level) {
- case 1:
- NDR_CHECK(ndr_pull_trustAuthInOutCtr1(ndr, NDR_BUFFERS, &r->ctr1));
+ case EXTENDED_ERROR_COMPUTER_NAME_PRESENT:
+ NDR_CHECK(ndr_pull_ExtendedErrorUString(ndr, NDR_BUFFERS, &r->name));
break;
- case 2:
- NDR_CHECK(ndr_pull_trustAuthInOutCtr2(ndr, NDR_BUFFERS, &r->ctr2));
+ case EXTENDED_ERROR_COMPUTER_NAME_NOT_PRESENT:
break;
default:
@@ -2723,18 +3065,17 @@ static enum ndr_err_code ndr_pull_trustAuthInOutCtr(struct ndr_pull *ndr, int nd
return NDR_ERR_SUCCESS;
}
-_PUBLIC_ void ndr_print_trustAuthInOutCtr(struct ndr_print *ndr, const char *name, const union trustAuthInOutCtr *r)
+_PUBLIC_ void ndr_print_ExtendedErrorComputerNameU(struct ndr_print *ndr, const char *name, const union ExtendedErrorComputerNameU *r)
{
int level;
level = ndr_print_get_switch_value(ndr, r);
- ndr_print_union(ndr, name, level, "trustAuthInOutCtr");
+ ndr_print_union(ndr, name, level, "ExtendedErrorComputerNameU");
switch (level) {
- case 1:
- ndr_print_trustAuthInOutCtr1(ndr, "ctr1", &r->ctr1);
+ case EXTENDED_ERROR_COMPUTER_NAME_PRESENT:
+ ndr_print_ExtendedErrorUString(ndr, "name", &r->name);
break;
- case 2:
- ndr_print_trustAuthInOutCtr2(ndr, "ctr2", &r->ctr2);
+ case EXTENDED_ERROR_COMPUTER_NAME_NOT_PRESENT:
break;
default:
@@ -2742,116 +3083,404 @@ _PUBLIC_ void ndr_print_trustAuthInOutCtr(struct ndr_print *ndr, const char *nam
}
}
-_PUBLIC_ enum ndr_err_code ndr_push_trustAuthInOutBlob(struct ndr_push *ndr, int ndr_flags, const struct trustAuthInOutBlob *r)
+static enum ndr_err_code ndr_push_ExtendedErrorComputerName(struct ndr_push *ndr, int ndr_flags, const struct ExtendedErrorComputerName *r)
{
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_push_align(ndr, 4));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version));
- NDR_CHECK(ndr_push_set_switch_value(ndr, &r->ctr, r->version));
- NDR_CHECK(ndr_push_trustAuthInOutCtr(ndr, NDR_SCALARS, &r->ctr));
+ NDR_CHECK(ndr_push_ExtendedErrorComputerNamePresent(ndr, NDR_SCALARS, r->present));
+ NDR_CHECK(ndr_push_set_switch_value(ndr, &r->n, r->present));
+ NDR_CHECK(ndr_push_ExtendedErrorComputerNameU(ndr, NDR_SCALARS, &r->n));
}
if (ndr_flags & NDR_BUFFERS) {
- NDR_CHECK(ndr_push_trustAuthInOutCtr(ndr, NDR_BUFFERS, &r->ctr));
+ NDR_CHECK(ndr_push_ExtendedErrorComputerNameU(ndr, NDR_BUFFERS, &r->n));
}
return NDR_ERR_SUCCESS;
}
-_PUBLIC_ enum ndr_err_code ndr_pull_trustAuthInOutBlob(struct ndr_pull *ndr, int ndr_flags, struct trustAuthInOutBlob *r)
+static enum ndr_err_code ndr_pull_ExtendedErrorComputerName(struct ndr_pull *ndr, int ndr_flags, struct ExtendedErrorComputerName *r)
{
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_pull_align(ndr, 4));
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
- NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->ctr, r->version));
- NDR_CHECK(ndr_pull_trustAuthInOutCtr(ndr, NDR_SCALARS, &r->ctr));
+ NDR_CHECK(ndr_pull_ExtendedErrorComputerNamePresent(ndr, NDR_SCALARS, &r->present));
+ NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->n, r->present));
+ NDR_CHECK(ndr_pull_ExtendedErrorComputerNameU(ndr, NDR_SCALARS, &r->n));
}
if (ndr_flags & NDR_BUFFERS) {
- NDR_CHECK(ndr_pull_trustAuthInOutCtr(ndr, NDR_BUFFERS, &r->ctr));
+ NDR_CHECK(ndr_pull_ExtendedErrorComputerNameU(ndr, NDR_BUFFERS, &r->n));
}
return NDR_ERR_SUCCESS;
}
-_PUBLIC_ void ndr_print_trustAuthInOutBlob(struct ndr_print *ndr, const char *name, const struct trustAuthInOutBlob *r)
+_PUBLIC_ void ndr_print_ExtendedErrorComputerName(struct ndr_print *ndr, const char *name, const struct ExtendedErrorComputerName *r)
{
- ndr_print_struct(ndr, name, "trustAuthInOutBlob");
+ ndr_print_struct(ndr, name, "ExtendedErrorComputerName");
ndr->depth++;
- ndr_print_uint32(ndr, "version", r->version);
- ndr_print_set_switch_value(ndr, &r->ctr, r->version);
- ndr_print_trustAuthInOutCtr(ndr, "ctr", &r->ctr);
+ ndr_print_ExtendedErrorComputerNamePresent(ndr, "present", r->present);
+ ndr_print_set_switch_value(ndr, &r->n, r->present);
+ ndr_print_ExtendedErrorComputerNameU(ndr, "n", &r->n);
ndr->depth--;
}
-_PUBLIC_ enum ndr_err_code ndr_push_DsCompressedChunk(struct ndr_push *ndr, int ndr_flags, const struct DsCompressedChunk *r)
+static enum ndr_err_code ndr_push_ExtendedErrorParamType(struct ndr_push *ndr, int ndr_flags, enum ExtendedErrorParamType r)
+{
+ NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r));
+ return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_ExtendedErrorParamType(struct ndr_pull *ndr, int ndr_flags, enum ExtendedErrorParamType *r)
+{
+ uint16_t v;
+ NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v));
+ *r = v;
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_ExtendedErrorParamType(struct ndr_print *ndr, const char *name, enum ExtendedErrorParamType r)
+{
+ const char *val = NULL;
+
+ switch (r) {
+ case EXTENDED_ERROR_PARAM_TYPE_ASCII_STRING: val = "EXTENDED_ERROR_PARAM_TYPE_ASCII_STRING"; break;
+ case EXTENDED_ERROR_PARAM_TYPE_UNICODE_STRING: val = "EXTENDED_ERROR_PARAM_TYPE_UNICODE_STRING"; break;
+ case EXTENDED_ERROR_PARAM_TYPE_UINT32: val = "EXTENDED_ERROR_PARAM_TYPE_UINT32"; break;
+ case EXTENDED_ERROR_PARAM_TYPE_UINT16: val = "EXTENDED_ERROR_PARAM_TYPE_UINT16"; break;
+ case EXTENDED_ERROR_PARAM_TYPE_UINT64: val = "EXTENDED_ERROR_PARAM_TYPE_UINT64"; break;
+ case EXTENDED_ERROR_PARAM_TYPE_NONE: val = "EXTENDED_ERROR_PARAM_TYPE_NONE"; break;
+ case EXTENDED_ERROR_PARAM_TYPE_BLOB: val = "EXTENDED_ERROR_PARAM_TYPE_BLOB"; break;
+ }
+ ndr_print_enum(ndr, name, "ENUM", val, r);
+}
+
+static enum ndr_err_code ndr_push_ExtendedErrorParamU(struct ndr_push *ndr, int ndr_flags, const union ExtendedErrorParamU *r)
{
if (ndr_flags & NDR_SCALARS) {
- NDR_CHECK(ndr_push_align(ndr, 4));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->marker));
- NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->data));
+ int level = ndr_push_get_switch_value(ndr, r);
+ NDR_CHECK(ndr_push_ExtendedErrorParamType(ndr, NDR_SCALARS, level));
+ switch (level) {
+ case EXTENDED_ERROR_PARAM_TYPE_ASCII_STRING: {
+ NDR_CHECK(ndr_push_ExtendedErrorAString(ndr, NDR_SCALARS, &r->a_string));
+ break; }
+
+ case EXTENDED_ERROR_PARAM_TYPE_UNICODE_STRING: {
+ NDR_CHECK(ndr_push_ExtendedErrorUString(ndr, NDR_SCALARS, &r->u_string));
+ break; }
+
+ case EXTENDED_ERROR_PARAM_TYPE_UINT32: {
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->uint32));
+ break; }
+
+ case EXTENDED_ERROR_PARAM_TYPE_UINT16: {
+ NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->uint16));
+ break; }
+
+ case EXTENDED_ERROR_PARAM_TYPE_UINT64: {
+ NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->uint64));
+ break; }
+
+ case EXTENDED_ERROR_PARAM_TYPE_NONE: {
+ break; }
+
+ case EXTENDED_ERROR_PARAM_TYPE_BLOB: {
+ NDR_CHECK(ndr_push_ExtendedErrorBlob(ndr, NDR_SCALARS, &r->blob));
+ break; }
+
+ default:
+ return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
+ }
}
if (ndr_flags & NDR_BUFFERS) {
+ int level = ndr_push_get_switch_value(ndr, r);
+ switch (level) {
+ case EXTENDED_ERROR_PARAM_TYPE_ASCII_STRING:
+ NDR_CHECK(ndr_push_ExtendedErrorAString(ndr, NDR_BUFFERS, &r->a_string));
+ break;
+
+ case EXTENDED_ERROR_PARAM_TYPE_UNICODE_STRING:
+ NDR_CHECK(ndr_push_ExtendedErrorUString(ndr, NDR_BUFFERS, &r->u_string));
+ break;
+
+ case EXTENDED_ERROR_PARAM_TYPE_UINT32:
+ break;
+
+ case EXTENDED_ERROR_PARAM_TYPE_UINT16:
+ break;
+
+ case EXTENDED_ERROR_PARAM_TYPE_UINT64:
+ break;
+
+ case EXTENDED_ERROR_PARAM_TYPE_NONE:
+ break;
+
+ case EXTENDED_ERROR_PARAM_TYPE_BLOB:
+ NDR_CHECK(ndr_push_ExtendedErrorBlob(ndr, NDR_BUFFERS, &r->blob));
+ break;
+
+ default:
+ return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
+ }
}
return NDR_ERR_SUCCESS;
}
-_PUBLIC_ enum ndr_err_code ndr_pull_DsCompressedChunk(struct ndr_pull *ndr, int ndr_flags, struct DsCompressedChunk *r)
+static enum ndr_err_code ndr_pull_ExtendedErrorParamU(struct ndr_pull *ndr, int ndr_flags, union ExtendedErrorParamU *r)
{
+ int level;
+ uint16_t _level;
+ level = ndr_pull_get_switch_value(ndr, r);
if (ndr_flags & NDR_SCALARS) {
- NDR_CHECK(ndr_pull_align(ndr, 4));
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->marker));
- NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->data));
+ NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level));
+ if (_level != level) {
+ return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
+ }
+ switch (level) {
+ case EXTENDED_ERROR_PARAM_TYPE_ASCII_STRING: {
+ NDR_CHECK(ndr_pull_ExtendedErrorAString(ndr, NDR_SCALARS, &r->a_string));
+ break; }
+
+ case EXTENDED_ERROR_PARAM_TYPE_UNICODE_STRING: {
+ NDR_CHECK(ndr_pull_ExtendedErrorUString(ndr, NDR_SCALARS, &r->u_string));
+ break; }
+
+ case EXTENDED_ERROR_PARAM_TYPE_UINT32: {
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->uint32));
+ break; }
+
+ case EXTENDED_ERROR_PARAM_TYPE_UINT16: {
+ NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->uint16));
+ break; }
+
+ case EXTENDED_ERROR_PARAM_TYPE_UINT64: {
+ NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->uint64));
+ break; }
+
+ case EXTENDED_ERROR_PARAM_TYPE_NONE: {
+ break; }
+
+ case EXTENDED_ERROR_PARAM_TYPE_BLOB: {
+ NDR_CHECK(ndr_pull_ExtendedErrorBlob(ndr, NDR_SCALARS, &r->blob));
+ break; }
+
+ default:
+ return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
+ }
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ switch (level) {
+ case EXTENDED_ERROR_PARAM_TYPE_ASCII_STRING:
+ NDR_CHECK(ndr_pull_ExtendedErrorAString(ndr, NDR_BUFFERS, &r->a_string));
+ break;
+
+ case EXTENDED_ERROR_PARAM_TYPE_UNICODE_STRING:
+ NDR_CHECK(ndr_pull_ExtendedErrorUString(ndr, NDR_BUFFERS, &r->u_string));
+ break;
+
+ case EXTENDED_ERROR_PARAM_TYPE_UINT32:
+ break;
+
+ case EXTENDED_ERROR_PARAM_TYPE_UINT16:
+ break;
+
+ case EXTENDED_ERROR_PARAM_TYPE_UINT64:
+ break;
+
+ case EXTENDED_ERROR_PARAM_TYPE_NONE:
+ break;
+
+ case EXTENDED_ERROR_PARAM_TYPE_BLOB:
+ NDR_CHECK(ndr_pull_ExtendedErrorBlob(ndr, NDR_BUFFERS, &r->blob));
+ break;
+
+ default:
+ return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
+ }
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_ExtendedErrorParamU(struct ndr_print *ndr, const char *name, const union ExtendedErrorParamU *r)
+{
+ int level;
+ level = ndr_print_get_switch_value(ndr, r);
+ ndr_print_union(ndr, name, level, "ExtendedErrorParamU");
+ switch (level) {
+ case EXTENDED_ERROR_PARAM_TYPE_ASCII_STRING:
+ ndr_print_ExtendedErrorAString(ndr, "a_string", &r->a_string);
+ break;
+
+ case EXTENDED_ERROR_PARAM_TYPE_UNICODE_STRING:
+ ndr_print_ExtendedErrorUString(ndr, "u_string", &r->u_string);
+ break;
+
+ case EXTENDED_ERROR_PARAM_TYPE_UINT32:
+ ndr_print_uint32(ndr, "uint32", r->uint32);
+ break;
+
+ case EXTENDED_ERROR_PARAM_TYPE_UINT16:
+ ndr_print_uint16(ndr, "uint16", r->uint16);
+ break;
+
+ case EXTENDED_ERROR_PARAM_TYPE_UINT64:
+ ndr_print_hyper(ndr, "uint64", r->uint64);
+ break;
+
+ case EXTENDED_ERROR_PARAM_TYPE_NONE:
+ break;
+
+ case EXTENDED_ERROR_PARAM_TYPE_BLOB:
+ ndr_print_ExtendedErrorBlob(ndr, "blob", &r->blob);
+ break;
+
+ default:
+ ndr_print_bad_level(ndr, name, level);
+ }
+}
+
+static enum ndr_err_code ndr_push_ExtendedErrorParam(struct ndr_push *ndr, int ndr_flags, const struct ExtendedErrorParam *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 8));
+ NDR_CHECK(ndr_push_ExtendedErrorParamType(ndr, NDR_SCALARS, r->type));
+ NDR_CHECK(ndr_push_set_switch_value(ndr, &r->p, r->type));
+ NDR_CHECK(ndr_push_ExtendedErrorParamU(ndr, NDR_SCALARS, &r->p));
}
if (ndr_flags & NDR_BUFFERS) {
+ NDR_CHECK(ndr_push_ExtendedErrorParamU(ndr, NDR_BUFFERS, &r->p));
}
return NDR_ERR_SUCCESS;
}
-_PUBLIC_ void ndr_print_DsCompressedChunk(struct ndr_print *ndr, const char *name, const struct DsCompressedChunk *r)
+static enum ndr_err_code ndr_pull_ExtendedErrorParam(struct ndr_pull *ndr, int ndr_flags, struct ExtendedErrorParam *r)
{
- ndr_print_struct(ndr, name, "DsCompressedChunk");
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 8));
+ NDR_CHECK(ndr_pull_ExtendedErrorParamType(ndr, NDR_SCALARS, &r->type));
+ NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->p, r->type));
+ NDR_CHECK(ndr_pull_ExtendedErrorParamU(ndr, NDR_SCALARS, &r->p));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ NDR_CHECK(ndr_pull_ExtendedErrorParamU(ndr, NDR_BUFFERS, &r->p));
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_ExtendedErrorParam(struct ndr_print *ndr, const char *name, const struct ExtendedErrorParam *r)
+{
+ ndr_print_struct(ndr, name, "ExtendedErrorParam");
ndr->depth++;
- ndr_print_uint32(ndr, "marker", r->marker);
- ndr_print_DATA_BLOB(ndr, "data", r->data);
+ ndr_print_ExtendedErrorParamType(ndr, "type", r->type);
+ ndr_print_set_switch_value(ndr, &r->p, r->type);
+ ndr_print_ExtendedErrorParamU(ndr, "p", &r->p);
ndr->depth--;
}
-_PUBLIC_ enum ndr_err_code ndr_push_DsCompressedBlob(struct ndr_push *ndr, int ndr_flags, const struct DsCompressedBlob *r)
+_PUBLIC_ enum ndr_err_code ndr_push_ExtendedErrorInfo(struct ndr_push *ndr, int ndr_flags, const struct ExtendedErrorInfo *r)
{
- uint32_t cntr_chunks_0;
+ uint32_t cntr_params_0;
if (ndr_flags & NDR_SCALARS) {
- NDR_CHECK(ndr_push_align(ndr, 4));
- for (cntr_chunks_0 = 0; cntr_chunks_0 < 5; cntr_chunks_0++) {
- NDR_CHECK(ndr_push_DsCompressedChunk(ndr, NDR_SCALARS, &r->chunks[cntr_chunks_0]));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_params));
+ NDR_CHECK(ndr_push_align(ndr, 8));
+ NDR_CHECK(ndr_push_unique_ptr(ndr, r->next));
+ NDR_CHECK(ndr_push_ExtendedErrorComputerName(ndr, NDR_SCALARS, &r->computer_name));
+ NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->pid));
+ NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->time));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->generating_component));
+ NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->status));
+ NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->detection_location));
+ NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->flags));
+ NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->num_params));
+ for (cntr_params_0 = 0; cntr_params_0 < r->num_params; cntr_params_0++) {
+ NDR_CHECK(ndr_push_ExtendedErrorParam(ndr, NDR_SCALARS, &r->params[cntr_params_0]));
}
}
if (ndr_flags & NDR_BUFFERS) {
+ if (r->next) {
+ NDR_CHECK(ndr_push_ExtendedErrorInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->next));
+ }
+ NDR_CHECK(ndr_push_ExtendedErrorComputerName(ndr, NDR_BUFFERS, &r->computer_name));
+ for (cntr_params_0 = 0; cntr_params_0 < r->num_params; cntr_params_0++) {
+ NDR_CHECK(ndr_push_ExtendedErrorParam(ndr, NDR_BUFFERS, &r->params[cntr_params_0]));
+ }
}
return NDR_ERR_SUCCESS;
}
-_PUBLIC_ enum ndr_err_code ndr_pull_DsCompressedBlob(struct ndr_pull *ndr, int ndr_flags, struct DsCompressedBlob *r)
+_PUBLIC_ enum ndr_err_code ndr_pull_ExtendedErrorInfo(struct ndr_pull *ndr, int ndr_flags, struct ExtendedErrorInfo *r)
{
- uint32_t cntr_chunks_0;
+ uint32_t _ptr_next;
+ TALLOC_CTX *_mem_save_next_0;
+ uint32_t cntr_params_0;
+ TALLOC_CTX *_mem_save_params_0;
if (ndr_flags & NDR_SCALARS) {
- NDR_CHECK(ndr_pull_align(ndr, 4));
- for (cntr_chunks_0 = 0; cntr_chunks_0 < 5; cntr_chunks_0++) {
- NDR_CHECK(ndr_pull_DsCompressedChunk(ndr, NDR_SCALARS, &r->chunks[cntr_chunks_0]));
+ NDR_CHECK(ndr_pull_array_size(ndr, &r->params));
+ NDR_CHECK(ndr_pull_align(ndr, 8));
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_next));
+ if (_ptr_next) {
+ NDR_PULL_ALLOC(ndr, r->next);
+ } else {
+ r->next = NULL;
+ }
+ NDR_CHECK(ndr_pull_ExtendedErrorComputerName(ndr, NDR_SCALARS, &r->computer_name));
+ NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->pid));
+ NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->time));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->generating_component));
+ NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->status));
+ NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->detection_location));
+ NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->flags));
+ NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->num_params));
+ NDR_PULL_ALLOC_N(ndr, r->params, ndr_get_array_size(ndr, &r->params));
+ _mem_save_params_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->params, 0);
+ for (cntr_params_0 = 0; cntr_params_0 < r->num_params; cntr_params_0++) {
+ NDR_CHECK(ndr_pull_ExtendedErrorParam(ndr, NDR_SCALARS, &r->params[cntr_params_0]));
+ }
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_params_0, 0);
+ if (r->params) {
+ NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->params, r->num_params));
}
}
if (ndr_flags & NDR_BUFFERS) {
+ if (r->next) {
+ _mem_save_next_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->next, 0);
+ NDR_CHECK(ndr_pull_ExtendedErrorInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->next));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_next_0, 0);
+ }
+ NDR_CHECK(ndr_pull_ExtendedErrorComputerName(ndr, NDR_BUFFERS, &r->computer_name));
+ _mem_save_params_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->params, 0);
+ for (cntr_params_0 = 0; cntr_params_0 < r->num_params; cntr_params_0++) {
+ NDR_CHECK(ndr_pull_ExtendedErrorParam(ndr, NDR_BUFFERS, &r->params[cntr_params_0]));
+ }
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_params_0, 0);
}
return NDR_ERR_SUCCESS;
}
-_PUBLIC_ void ndr_print_DsCompressedBlob(struct ndr_print *ndr, const char *name, const struct DsCompressedBlob *r)
+_PUBLIC_ void ndr_print_ExtendedErrorInfo(struct ndr_print *ndr, const char *name, const struct ExtendedErrorInfo *r)
{
- uint32_t cntr_chunks_0;
- ndr_print_struct(ndr, name, "DsCompressedBlob");
+ uint32_t cntr_params_0;
+ ndr_print_struct(ndr, name, "ExtendedErrorInfo");
+ ndr->depth++;
+ ndr_print_ptr(ndr, "next", r->next);
ndr->depth++;
- ndr->print(ndr, "%s: ARRAY(%d)", "chunks", (int)5);
+ if (r->next) {
+ ndr_print_ExtendedErrorInfo(ndr, "next", r->next);
+ }
+ ndr->depth--;
+ ndr_print_ExtendedErrorComputerName(ndr, "computer_name", &r->computer_name);
+ ndr_print_hyper(ndr, "pid", r->pid);
+ ndr_print_NTTIME(ndr, "time", r->time);
+ ndr_print_uint32(ndr, "generating_component", r->generating_component);
+ ndr_print_WERROR(ndr, "status", r->status);
+ ndr_print_uint16(ndr, "detection_location", r->detection_location);
+ ndr_print_uint16(ndr, "flags", r->flags);
+ ndr_print_uint16(ndr, "num_params", r->num_params);
+ ndr->print(ndr, "%s: ARRAY(%d)", "params", (int)r->num_params);
ndr->depth++;
- for (cntr_chunks_0=0;cntr_chunks_0<5;cntr_chunks_0++) {
+ for (cntr_params_0=0;cntr_params_0<r->num_params;cntr_params_0++) {
char *idx_0=NULL;
- if (asprintf(&idx_0, "[%d]", cntr_chunks_0) != -1) {
- ndr_print_DsCompressedChunk(ndr, "chunks", &r->chunks[cntr_chunks_0]);
+ if (asprintf(&idx_0, "[%d]", cntr_params_0) != -1) {
+ ndr_print_ExtendedErrorParam(ndr, "params", &r->params[cntr_params_0]);
free(idx_0);
}
}
@@ -2859,6 +3488,57 @@ _PUBLIC_ void ndr_print_DsCompressedBlob(struct ndr_print *ndr, const char *name
ndr->depth--;
}
+static enum ndr_err_code ndr_push_ExtendedErrorInfoPtr(struct ndr_push *ndr, int ndr_flags, const struct ExtendedErrorInfoPtr *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_unique_ptr(ndr, r->info));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ if (r->info) {
+ NDR_CHECK(ndr_push_ExtendedErrorInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->info));
+ }
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_ExtendedErrorInfoPtr(struct ndr_pull *ndr, int ndr_flags, struct ExtendedErrorInfoPtr *r)
+{
+ uint32_t _ptr_info;
+ TALLOC_CTX *_mem_save_info_0;
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
+ if (_ptr_info) {
+ NDR_PULL_ALLOC(ndr, r->info);
+ } else {
+ r->info = NULL;
+ }
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ if (r->info) {
+ _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->info, 0);
+ NDR_CHECK(ndr_pull_ExtendedErrorInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->info));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0);
+ }
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_ExtendedErrorInfoPtr(struct ndr_print *ndr, const char *name, const struct ExtendedErrorInfoPtr *r)
+{
+ ndr_print_struct(ndr, name, "ExtendedErrorInfoPtr");
+ ndr->depth++;
+ ndr_print_ptr(ndr, "info", r->info);
+ ndr->depth++;
+ if (r->info) {
+ ndr_print_ExtendedErrorInfo(ndr, "info", r->info);
+ }
+ ndr->depth--;
+ ndr->depth--;
+}
+
static enum ndr_err_code ndr_push_decode_replPropertyMetaData(struct ndr_push *ndr, int flags, const struct decode_replPropertyMetaData *r)
{
if (flags & NDR_IN) {
@@ -3351,41 +4031,92 @@ _PUBLIC_ void ndr_print_decode_trustAuthInOut(struct ndr_print *ndr, const char
ndr->depth--;
}
-static enum ndr_err_code ndr_push_decode_DsCompressed(struct ndr_push *ndr, int flags, const struct decode_DsCompressed *r)
+static enum ndr_err_code ndr_push_decode_trustDomainPasswords(struct ndr_push *ndr, int flags, const struct decode_trustDomainPasswords *r)
+{
+ if (flags & NDR_IN) {
+ NDR_CHECK(ndr_push_trustDomainPasswords(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.blob));
+ }
+ if (flags & NDR_OUT) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_decode_trustDomainPasswords(struct ndr_pull *ndr, int flags, struct decode_trustDomainPasswords *r)
+{
+ if (flags & NDR_IN) {
+ NDR_CHECK(ndr_pull_trustDomainPasswords(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.blob));
+ }
+ if (flags & NDR_OUT) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_decode_trustDomainPasswords(struct ndr_print *ndr, const char *name, int flags, const struct decode_trustDomainPasswords *r)
+{
+ ndr_print_struct(ndr, name, "decode_trustDomainPasswords");
+ ndr->depth++;
+ if (flags & NDR_SET_VALUES) {
+ ndr->flags |= LIBNDR_PRINT_SET_VALUES;
+ }
+ if (flags & NDR_IN) {
+ ndr_print_struct(ndr, "in", "decode_trustDomainPasswords");
+ ndr->depth++;
+ ndr_print_trustDomainPasswords(ndr, "blob", &r->in.blob);
+ ndr->depth--;
+ }
+ if (flags & NDR_OUT) {
+ ndr_print_struct(ndr, "out", "decode_trustDomainPasswords");
+ ndr->depth++;
+ ndr->depth--;
+ }
+ ndr->depth--;
+}
+
+static enum ndr_err_code ndr_push_decode_ExtendedErrorInfo(struct ndr_push *ndr, int flags, const struct decode_ExtendedErrorInfo *r)
{
if (flags & NDR_IN) {
- NDR_CHECK(ndr_push_DsCompressedBlob(ndr, NDR_SCALARS, &r->in.blob));
+ {
+ struct ndr_push *_ndr_ptr;
+ NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_ptr, 0xFFFFFC01, -1));
+ NDR_CHECK(ndr_push_ExtendedErrorInfoPtr(_ndr_ptr, NDR_SCALARS|NDR_BUFFERS, &r->in.ptr));
+ NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_ptr, 0xFFFFFC01, -1));
+ }
}
if (flags & NDR_OUT) {
}
return NDR_ERR_SUCCESS;
}
-static enum ndr_err_code ndr_pull_decode_DsCompressed(struct ndr_pull *ndr, int flags, struct decode_DsCompressed *r)
+static enum ndr_err_code ndr_pull_decode_ExtendedErrorInfo(struct ndr_pull *ndr, int flags, struct decode_ExtendedErrorInfo *r)
{
if (flags & NDR_IN) {
- NDR_CHECK(ndr_pull_DsCompressedBlob(ndr, NDR_SCALARS, &r->in.blob));
+ {
+ struct ndr_pull *_ndr_ptr;
+ NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_ptr, 0xFFFFFC01, -1));
+ NDR_CHECK(ndr_pull_ExtendedErrorInfoPtr(_ndr_ptr, NDR_SCALARS|NDR_BUFFERS, &r->in.ptr));
+ NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_ptr, 0xFFFFFC01, -1));
+ }
}
if (flags & NDR_OUT) {
}
return NDR_ERR_SUCCESS;
}
-_PUBLIC_ void ndr_print_decode_DsCompressed(struct ndr_print *ndr, const char *name, int flags, const struct decode_DsCompressed *r)
+_PUBLIC_ void ndr_print_decode_ExtendedErrorInfo(struct ndr_print *ndr, const char *name, int flags, const struct decode_ExtendedErrorInfo *r)
{
- ndr_print_struct(ndr, name, "decode_DsCompressed");
+ ndr_print_struct(ndr, name, "decode_ExtendedErrorInfo");
ndr->depth++;
if (flags & NDR_SET_VALUES) {
ndr->flags |= LIBNDR_PRINT_SET_VALUES;
}
if (flags & NDR_IN) {
- ndr_print_struct(ndr, "in", "decode_DsCompressed");
+ ndr_print_struct(ndr, "in", "decode_ExtendedErrorInfo");
ndr->depth++;
- ndr_print_DsCompressedBlob(ndr, "blob", &r->in.blob);
+ ndr_print_ExtendedErrorInfoPtr(ndr, "ptr", &r->in.ptr);
ndr->depth--;
}
if (flags & NDR_OUT) {
- ndr_print_struct(ndr, "out", "decode_DsCompressed");
+ ndr_print_struct(ndr, "out", "decode_ExtendedErrorInfo");
ndr->depth++;
ndr->depth--;
}
@@ -3490,11 +4221,19 @@ static const struct ndr_interface_call drsblobs_calls[] = {
false,
},
{
- "decode_DsCompressed",
- sizeof(struct decode_DsCompressed),
- (ndr_push_flags_fn_t) ndr_push_decode_DsCompressed,
- (ndr_pull_flags_fn_t) ndr_pull_decode_DsCompressed,
- (ndr_print_function_t) ndr_print_decode_DsCompressed,
+ "decode_trustDomainPasswords",
+ sizeof(struct decode_trustDomainPasswords),
+ (ndr_push_flags_fn_t) ndr_push_decode_trustDomainPasswords,
+ (ndr_pull_flags_fn_t) ndr_pull_decode_trustDomainPasswords,
+ (ndr_print_function_t) ndr_print_decode_trustDomainPasswords,
+ false,
+ },
+ {
+ "decode_ExtendedErrorInfo",
+ sizeof(struct decode_ExtendedErrorInfo),
+ (ndr_push_flags_fn_t) ndr_push_decode_ExtendedErrorInfo,
+ (ndr_pull_flags_fn_t) ndr_pull_decode_ExtendedErrorInfo,
+ (ndr_print_function_t) ndr_print_decode_ExtendedErrorInfo,
false,
},
{ NULL, 0, NULL, NULL, NULL, false }
@@ -3526,7 +4265,7 @@ const struct ndr_interface_table ndr_table_drsblobs = {
NDR_DRSBLOBS_VERSION
},
.helpstring = NDR_DRSBLOBS_HELPSTRING,
- .num_calls = 13,
+ .num_calls = 14,
.calls = drsblobs_calls,
.endpoints = &drsblobs_endpoints,
.authservices = &drsblobs_authservices
diff --git a/source3/librpc/gen_ndr/ndr_drsblobs.h b/source3/librpc/gen_ndr/ndr_drsblobs.h
index 171e7e25a1..8a5298874a 100644
--- a/source3/librpc/gen_ndr/ndr_drsblobs.h
+++ b/source3/librpc/gen_ndr/ndr_drsblobs.h
@@ -35,9 +35,11 @@ extern const struct ndr_interface_table ndr_table_drsblobs;
#define NDR_DECODE_TRUSTAUTHINOUT (0x0b)
-#define NDR_DECODE_DSCOMPRESSED (0x0c)
+#define NDR_DECODE_TRUSTDOMAINPASSWORDS (0x0c)
-#define NDR_DRSBLOBS_CALL_COUNT (13)
+#define NDR_DECODE_EXTENDEDERRORINFO (0x0d)
+
+#define NDR_DRSBLOBS_CALL_COUNT (14)
void ndr_print_replPropertyMetaData1(struct ndr_print *ndr, const char *name, const struct replPropertyMetaData1 *r);
void ndr_print_replPropertyMetaDataCtr1(struct ndr_print *ndr, const char *name, const struct replPropertyMetaDataCtr1 *r);
void ndr_print_replPropertyMetaDataCtr(struct ndr_print *ndr, const char *name, const union replPropertyMetaDataCtr *r);
@@ -102,21 +104,44 @@ void ndr_print_package_PrimaryWDigestHash(struct ndr_print *ndr, const char *nam
enum ndr_err_code ndr_push_package_PrimaryWDigestBlob(struct ndr_push *ndr, int ndr_flags, const struct package_PrimaryWDigestBlob *r);
enum ndr_err_code ndr_pull_package_PrimaryWDigestBlob(struct ndr_pull *ndr, int ndr_flags, struct package_PrimaryWDigestBlob *r);
void ndr_print_package_PrimaryWDigestBlob(struct ndr_print *ndr, const char *name, const struct package_PrimaryWDigestBlob *r);
-void ndr_print_trustAuthInOutSecret1(struct ndr_print *ndr, const char *name, const struct trustAuthInOutSecret1 *r);
-void ndr_print_trustAuthInOutCtr1(struct ndr_print *ndr, const char *name, const struct trustAuthInOutCtr1 *r);
-void ndr_print_trustAuthInOutSecret2V1(struct ndr_print *ndr, const char *name, const struct trustAuthInOutSecret2V1 *r);
-void ndr_print_trustAuthInOutSecret2V2(struct ndr_print *ndr, const char *name, const struct trustAuthInOutSecret2V2 *r);
-void ndr_print_trustAuthInOutCtr2(struct ndr_print *ndr, const char *name, const struct trustAuthInOutCtr2 *r);
-void ndr_print_trustAuthInOutCtr(struct ndr_print *ndr, const char *name, const union trustAuthInOutCtr *r);
+void ndr_print_AuthInfoNone(struct ndr_print *ndr, const char *name, const struct AuthInfoNone *r);
+void ndr_print_AuthInfoNT4Owf(struct ndr_print *ndr, const char *name, const struct AuthInfoNT4Owf *r);
+void ndr_print_AuthInfoClear(struct ndr_print *ndr, const char *name, const struct AuthInfoClear *r);
+void ndr_print_AuthInfoVersion(struct ndr_print *ndr, const char *name, const struct AuthInfoVersion *r);
+void ndr_print_AuthInfo(struct ndr_print *ndr, const char *name, const union AuthInfo *r);
+enum ndr_err_code ndr_push_AuthenticationInformation(struct ndr_push *ndr, int ndr_flags, const struct AuthenticationInformation *r);
+enum ndr_err_code ndr_pull_AuthenticationInformation(struct ndr_pull *ndr, int ndr_flags, struct AuthenticationInformation *r);
+void ndr_print_AuthenticationInformation(struct ndr_print *ndr, const char *name, const struct AuthenticationInformation *r);
+enum ndr_err_code ndr_push_AuthenticationInformationArray(struct ndr_push *ndr, int ndr_flags, const struct AuthenticationInformationArray *r);
+enum ndr_err_code ndr_pull_AuthenticationInformationArray(struct ndr_pull *ndr, int ndr_flags, struct AuthenticationInformationArray *r);
+void ndr_print_AuthenticationInformationArray(struct ndr_print *ndr, const char *name, const struct AuthenticationInformationArray *r);
enum ndr_err_code ndr_push_trustAuthInOutBlob(struct ndr_push *ndr, int ndr_flags, const struct trustAuthInOutBlob *r);
enum ndr_err_code ndr_pull_trustAuthInOutBlob(struct ndr_pull *ndr, int ndr_flags, struct trustAuthInOutBlob *r);
void ndr_print_trustAuthInOutBlob(struct ndr_print *ndr, const char *name, const struct trustAuthInOutBlob *r);
+size_t ndr_size_trustAuthInOutBlob(const struct trustAuthInOutBlob *r, int flags);
+enum ndr_err_code ndr_push_trustCurrentPasswords(struct ndr_push *ndr, int ndr_flags, const struct trustCurrentPasswords *r);
+enum ndr_err_code ndr_pull_trustCurrentPasswords(struct ndr_pull *ndr, int ndr_flags, struct trustCurrentPasswords *r);
+void ndr_print_trustCurrentPasswords(struct ndr_print *ndr, const char *name, const struct trustCurrentPasswords *r);
+size_t ndr_size_trustCurrentPasswords(const struct trustCurrentPasswords *r, int flags);
+enum ndr_err_code ndr_push_trustDomainPasswords(struct ndr_push *ndr, int ndr_flags, const struct trustDomainPasswords *r);
+enum ndr_err_code ndr_pull_trustDomainPasswords(struct ndr_pull *ndr, int ndr_flags, struct trustDomainPasswords *r);
+void ndr_print_trustDomainPasswords(struct ndr_print *ndr, const char *name, const struct trustDomainPasswords *r);
enum ndr_err_code ndr_push_DsCompressedChunk(struct ndr_push *ndr, int ndr_flags, const struct DsCompressedChunk *r);
enum ndr_err_code ndr_pull_DsCompressedChunk(struct ndr_pull *ndr, int ndr_flags, struct DsCompressedChunk *r);
void ndr_print_DsCompressedChunk(struct ndr_print *ndr, const char *name, const struct DsCompressedChunk *r);
-enum ndr_err_code ndr_push_DsCompressedBlob(struct ndr_push *ndr, int ndr_flags, const struct DsCompressedBlob *r);
-enum ndr_err_code ndr_pull_DsCompressedBlob(struct ndr_pull *ndr, int ndr_flags, struct DsCompressedBlob *r);
-void ndr_print_DsCompressedBlob(struct ndr_print *ndr, const char *name, const struct DsCompressedBlob *r);
+void ndr_print_ExtendedErrorAString(struct ndr_print *ndr, const char *name, const struct ExtendedErrorAString *r);
+void ndr_print_ExtendedErrorUString(struct ndr_print *ndr, const char *name, const struct ExtendedErrorUString *r);
+void ndr_print_ExtendedErrorBlob(struct ndr_print *ndr, const char *name, const struct ExtendedErrorBlob *r);
+void ndr_print_ExtendedErrorComputerNamePresent(struct ndr_print *ndr, const char *name, enum ExtendedErrorComputerNamePresent r);
+void ndr_print_ExtendedErrorComputerNameU(struct ndr_print *ndr, const char *name, const union ExtendedErrorComputerNameU *r);
+void ndr_print_ExtendedErrorComputerName(struct ndr_print *ndr, const char *name, const struct ExtendedErrorComputerName *r);
+void ndr_print_ExtendedErrorParamType(struct ndr_print *ndr, const char *name, enum ExtendedErrorParamType r);
+void ndr_print_ExtendedErrorParamU(struct ndr_print *ndr, const char *name, const union ExtendedErrorParamU *r);
+void ndr_print_ExtendedErrorParam(struct ndr_print *ndr, const char *name, const struct ExtendedErrorParam *r);
+enum ndr_err_code ndr_push_ExtendedErrorInfo(struct ndr_push *ndr, int ndr_flags, const struct ExtendedErrorInfo *r);
+enum ndr_err_code ndr_pull_ExtendedErrorInfo(struct ndr_pull *ndr, int ndr_flags, struct ExtendedErrorInfo *r);
+void ndr_print_ExtendedErrorInfo(struct ndr_print *ndr, const char *name, const struct ExtendedErrorInfo *r);
+void ndr_print_ExtendedErrorInfoPtr(struct ndr_print *ndr, const char *name, const struct ExtendedErrorInfoPtr *r);
void ndr_print_decode_replPropertyMetaData(struct ndr_print *ndr, const char *name, int flags, const struct decode_replPropertyMetaData *r);
void ndr_print_decode_replUpToDateVector(struct ndr_print *ndr, const char *name, int flags, const struct decode_replUpToDateVector *r);
void ndr_print_decode_repsFromTo(struct ndr_print *ndr, const char *name, int flags, const struct decode_repsFromTo *r);
@@ -129,5 +154,6 @@ void ndr_print_decode_PrimaryKerberos(struct ndr_print *ndr, const char *name, i
void ndr_print_decode_PrimaryCLEARTEXT(struct ndr_print *ndr, const char *name, int flags, const struct decode_PrimaryCLEARTEXT *r);
void ndr_print_decode_PrimaryWDigest(struct ndr_print *ndr, const char *name, int flags, const struct decode_PrimaryWDigest *r);
void ndr_print_decode_trustAuthInOut(struct ndr_print *ndr, const char *name, int flags, const struct decode_trustAuthInOut *r);
-void ndr_print_decode_DsCompressed(struct ndr_print *ndr, const char *name, int flags, const struct decode_DsCompressed *r);
+void ndr_print_decode_trustDomainPasswords(struct ndr_print *ndr, const char *name, int flags, const struct decode_trustDomainPasswords *r);
+void ndr_print_decode_ExtendedErrorInfo(struct ndr_print *ndr, const char *name, int flags, const struct decode_ExtendedErrorInfo *r);
#endif /* _HEADER_NDR_drsblobs */
diff --git a/source3/librpc/gen_ndr/ndr_drsuapi.c b/source3/librpc/gen_ndr/ndr_drsuapi.c
index 38b88f643c..c2a4aee180 100644
--- a/source3/librpc/gen_ndr/ndr_drsuapi.c
+++ b/source3/librpc/gen_ndr/ndr_drsuapi.c
@@ -2823,217 +2823,219 @@ _PUBLIC_ size_t ndr_size_drsuapi_DsGetNCChangesCtr6(const struct drsuapi_DsGetNC
return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsGetNCChangesCtr6);
}
-static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesMSZIPCtr1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesMSZIPCtr1 *r)
+_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr1TS(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr1TS *r)
{
if (ndr_flags & NDR_SCALARS) {
- NDR_CHECK(ndr_push_align(ndr, 4));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->decompressed_length));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->compressed_length));
- NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1));
+ NDR_CHECK(ndr_push_align(ndr, 1));
+ {
+ struct ndr_push *_ndr_ctr1;
+ NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_ctr1, 0xFFFFFC01, -1));
+ NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr1(_ndr_ctr1, NDR_SCALARS|NDR_BUFFERS, &r->ctr1));
+ NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_ctr1, 0xFFFFFC01, -1));
+ }
}
if (ndr_flags & NDR_BUFFERS) {
- if (r->ctr1) {
- {
- struct ndr_push *_ndr_ctr1;
- NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_ctr1, 4, r->compressed_length));
- {
- struct ndr_push *_ndr_ctr1_compressed;
- NDR_CHECK(ndr_push_compression_start(_ndr_ctr1, &_ndr_ctr1_compressed, NDR_COMPRESSION_MSZIP, r->decompressed_length));
- NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr1(_ndr_ctr1_compressed, NDR_SCALARS|NDR_BUFFERS, r->ctr1));
- NDR_CHECK(ndr_push_compression_end(_ndr_ctr1, _ndr_ctr1_compressed, NDR_COMPRESSION_MSZIP, r->decompressed_length));
- }
- NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_ctr1, 4, r->compressed_length));
- }
- }
}
return NDR_ERR_SUCCESS;
}
-static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesMSZIPCtr1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesMSZIPCtr1 *r)
+_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr1TS(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr1TS *r)
{
- uint32_t _ptr_ctr1;
- TALLOC_CTX *_mem_save_ctr1_0;
if (ndr_flags & NDR_SCALARS) {
- NDR_CHECK(ndr_pull_align(ndr, 4));
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->decompressed_length));
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->compressed_length));
- NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr1));
- if (_ptr_ctr1) {
- NDR_PULL_ALLOC(ndr, r->ctr1);
- } else {
- r->ctr1 = NULL;
+ NDR_CHECK(ndr_pull_align(ndr, 1));
+ {
+ struct ndr_pull *_ndr_ctr1;
+ NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_ctr1, 0xFFFFFC01, -1));
+ NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr1(_ndr_ctr1, NDR_SCALARS|NDR_BUFFERS, &r->ctr1));
+ NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_ctr1, 0xFFFFFC01, -1));
}
}
if (ndr_flags & NDR_BUFFERS) {
- if (r->ctr1) {
- _mem_save_ctr1_0 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, r->ctr1, 0);
- {
- struct ndr_pull *_ndr_ctr1;
- NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_ctr1, 4, r->compressed_length));
- {
- struct ndr_pull *_ndr_ctr1_compressed;
- NDR_CHECK(ndr_pull_compression_start(_ndr_ctr1, &_ndr_ctr1_compressed, NDR_COMPRESSION_MSZIP, r->decompressed_length));
- NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr1(_ndr_ctr1_compressed, NDR_SCALARS|NDR_BUFFERS, r->ctr1));
- NDR_CHECK(ndr_pull_compression_end(_ndr_ctr1, _ndr_ctr1_compressed, NDR_COMPRESSION_MSZIP, r->decompressed_length));
- }
- NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_ctr1, 4, r->compressed_length));
- }
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr1_0, 0);
- }
}
return NDR_ERR_SUCCESS;
}
-_PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesMSZIPCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesMSZIPCtr1 *r)
+_PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCtr1TS(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr1TS *r)
{
- ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesMSZIPCtr1");
- ndr->depth++;
- ndr_print_uint32(ndr, "decompressed_length", r->decompressed_length);
- ndr_print_uint32(ndr, "compressed_length", r->compressed_length);
- ndr_print_ptr(ndr, "ctr1", r->ctr1);
+ ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesCtr1TS");
ndr->depth++;
- if (r->ctr1) {
- ndr_print_drsuapi_DsGetNCChangesCtr1(ndr, "ctr1", r->ctr1);
- }
- ndr->depth--;
+ ndr_print_drsuapi_DsGetNCChangesCtr1(ndr, "ctr1", &r->ctr1);
ndr->depth--;
}
-static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesMSZIPCtr6(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesMSZIPCtr6 *r)
+_PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr6TS(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr6TS *r)
{
if (ndr_flags & NDR_SCALARS) {
- NDR_CHECK(ndr_push_align(ndr, 4));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->decompressed_length));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->compressed_length));
- NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr6));
+ NDR_CHECK(ndr_push_align(ndr, 1));
+ {
+ struct ndr_push *_ndr_ctr6;
+ NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_ctr6, 0xFFFFFC01, -1));
+ NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr6(_ndr_ctr6, NDR_SCALARS|NDR_BUFFERS, &r->ctr6));
+ NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_ctr6, 0xFFFFFC01, -1));
+ }
}
if (ndr_flags & NDR_BUFFERS) {
- if (r->ctr6) {
- {
- struct ndr_push *_ndr_ctr6;
- NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_ctr6, 4, r->compressed_length));
- {
- struct ndr_push *_ndr_ctr6_compressed;
- NDR_CHECK(ndr_push_compression_start(_ndr_ctr6, &_ndr_ctr6_compressed, NDR_COMPRESSION_MSZIP, r->decompressed_length));
- NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr6(_ndr_ctr6_compressed, NDR_SCALARS|NDR_BUFFERS, r->ctr6));
- NDR_CHECK(ndr_push_compression_end(_ndr_ctr6, _ndr_ctr6_compressed, NDR_COMPRESSION_MSZIP, r->decompressed_length));
- }
- NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_ctr6, 4, r->compressed_length));
- }
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr6TS(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr6TS *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 1));
+ {
+ struct ndr_pull *_ndr_ctr6;
+ NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_ctr6, 0xFFFFFC01, -1));
+ NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr6(_ndr_ctr6, NDR_SCALARS|NDR_BUFFERS, &r->ctr6));
+ NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_ctr6, 0xFFFFFC01, -1));
}
}
+ if (ndr_flags & NDR_BUFFERS) {
+ }
return NDR_ERR_SUCCESS;
}
-static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesMSZIPCtr6(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesMSZIPCtr6 *r)
+_PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCtr6TS(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr6TS *r)
+{
+ ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesCtr6TS");
+ ndr->depth++;
+ ndr_print_drsuapi_DsGetNCChangesCtr6(ndr, "ctr6", &r->ctr6);
+ ndr->depth--;
+}
+
+static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesMSZIPCtr1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesMSZIPCtr1 *r)
{
- uint32_t _ptr_ctr6;
- TALLOC_CTX *_mem_save_ctr6_0;
+ uint32_t _ptr_ts;
+ TALLOC_CTX *_mem_save_ts_0;
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_pull_align(ndr, 4));
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->decompressed_length));
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->compressed_length));
- NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr6));
- if (_ptr_ctr6) {
- NDR_PULL_ALLOC(ndr, r->ctr6);
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ts));
+ if (_ptr_ts) {
+ NDR_PULL_ALLOC(ndr, r->ts);
} else {
- r->ctr6 = NULL;
+ r->ts = NULL;
}
}
if (ndr_flags & NDR_BUFFERS) {
- if (r->ctr6) {
- _mem_save_ctr6_0 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, r->ctr6, 0);
+ if (r->ts) {
+ _mem_save_ts_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->ts, 0);
{
- struct ndr_pull *_ndr_ctr6;
- NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_ctr6, 4, r->compressed_length));
+ struct ndr_pull *_ndr_ts;
+ NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_ts, 4, r->compressed_length));
{
- struct ndr_pull *_ndr_ctr6_compressed;
- NDR_CHECK(ndr_pull_compression_start(_ndr_ctr6, &_ndr_ctr6_compressed, NDR_COMPRESSION_MSZIP, r->decompressed_length));
- NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr6(_ndr_ctr6_compressed, NDR_SCALARS|NDR_BUFFERS, r->ctr6));
- NDR_CHECK(ndr_pull_compression_end(_ndr_ctr6, _ndr_ctr6_compressed, NDR_COMPRESSION_MSZIP, r->decompressed_length));
+ struct ndr_pull *_ndr_ts_compressed;
+ NDR_CHECK(ndr_pull_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_MSZIP, r->decompressed_length));
+ NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr1TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts));
+ NDR_CHECK(ndr_pull_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_MSZIP, r->decompressed_length));
}
- NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_ctr6, 4, r->compressed_length));
+ NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_ts, 4, r->compressed_length));
}
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr6_0, 0);
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ts_0, 0);
}
}
return NDR_ERR_SUCCESS;
}
-_PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesMSZIPCtr6(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesMSZIPCtr6 *r)
+_PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesMSZIPCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesMSZIPCtr1 *r)
{
- ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesMSZIPCtr6");
+ ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesMSZIPCtr1");
ndr->depth++;
ndr_print_uint32(ndr, "decompressed_length", r->decompressed_length);
ndr_print_uint32(ndr, "compressed_length", r->compressed_length);
- ndr_print_ptr(ndr, "ctr6", r->ctr6);
+ ndr_print_ptr(ndr, "ts", r->ts);
ndr->depth++;
- if (r->ctr6) {
- ndr_print_drsuapi_DsGetNCChangesCtr6(ndr, "ctr6", r->ctr6);
+ if (r->ts) {
+ ndr_print_drsuapi_DsGetNCChangesCtr1TS(ndr, "ts", r->ts);
}
ndr->depth--;
ndr->depth--;
}
-static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesXPRESSCtr1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesXPRESSCtr1 *r)
+static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesMSZIPCtr6(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesMSZIPCtr6 *r)
{
+ uint32_t _ptr_ts;
+ TALLOC_CTX *_mem_save_ts_0;
if (ndr_flags & NDR_SCALARS) {
- NDR_CHECK(ndr_push_align(ndr, 4));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->decompressed_length));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->compressed_length));
- NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1));
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->decompressed_length));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->compressed_length));
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ts));
+ if (_ptr_ts) {
+ NDR_PULL_ALLOC(ndr, r->ts);
+ } else {
+ r->ts = NULL;
+ }
}
if (ndr_flags & NDR_BUFFERS) {
- if (r->ctr1) {
+ if (r->ts) {
+ _mem_save_ts_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->ts, 0);
{
- struct ndr_push *_ndr_ctr1;
- NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_ctr1, 4, r->compressed_length));
+ struct ndr_pull *_ndr_ts;
+ NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_ts, 4, r->compressed_length));
{
- struct ndr_push *_ndr_ctr1_compressed;
- NDR_CHECK(ndr_push_compression_start(_ndr_ctr1, &_ndr_ctr1_compressed, NDR_COMPRESSION_XPRESS, r->decompressed_length));
- NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr1(_ndr_ctr1_compressed, NDR_SCALARS|NDR_BUFFERS, r->ctr1));
- NDR_CHECK(ndr_push_compression_end(_ndr_ctr1, _ndr_ctr1_compressed, NDR_COMPRESSION_XPRESS, r->decompressed_length));
+ struct ndr_pull *_ndr_ts_compressed;
+ NDR_CHECK(ndr_pull_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_MSZIP, r->decompressed_length));
+ NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr6TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts));
+ NDR_CHECK(ndr_pull_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_MSZIP, r->decompressed_length));
}
- NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_ctr1, 4, r->compressed_length));
+ NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_ts, 4, r->compressed_length));
}
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ts_0, 0);
}
}
return NDR_ERR_SUCCESS;
}
+_PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesMSZIPCtr6(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesMSZIPCtr6 *r)
+{
+ ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesMSZIPCtr6");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "decompressed_length", r->decompressed_length);
+ ndr_print_uint32(ndr, "compressed_length", r->compressed_length);
+ ndr_print_ptr(ndr, "ts", r->ts);
+ ndr->depth++;
+ if (r->ts) {
+ ndr_print_drsuapi_DsGetNCChangesCtr6TS(ndr, "ts", r->ts);
+ }
+ ndr->depth--;
+ ndr->depth--;
+}
+
static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesXPRESSCtr1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesXPRESSCtr1 *r)
{
- uint32_t _ptr_ctr1;
- TALLOC_CTX *_mem_save_ctr1_0;
+ uint32_t _ptr_ts;
+ TALLOC_CTX *_mem_save_ts_0;
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_pull_align(ndr, 4));
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->decompressed_length));
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->compressed_length));
- NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr1));
- if (_ptr_ctr1) {
- NDR_PULL_ALLOC(ndr, r->ctr1);
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ts));
+ if (_ptr_ts) {
+ NDR_PULL_ALLOC(ndr, r->ts);
} else {
- r->ctr1 = NULL;
+ r->ts = NULL;
}
}
if (ndr_flags & NDR_BUFFERS) {
- if (r->ctr1) {
- _mem_save_ctr1_0 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, r->ctr1, 0);
+ if (r->ts) {
+ _mem_save_ts_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->ts, 0);
{
- struct ndr_pull *_ndr_ctr1;
- NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_ctr1, 4, r->compressed_length));
+ struct ndr_pull *_ndr_ts;
+ NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_ts, 4, r->compressed_length));
{
- struct ndr_pull *_ndr_ctr1_compressed;
- NDR_CHECK(ndr_pull_compression_start(_ndr_ctr1, &_ndr_ctr1_compressed, NDR_COMPRESSION_XPRESS, r->decompressed_length));
- NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr1(_ndr_ctr1_compressed, NDR_SCALARS|NDR_BUFFERS, r->ctr1));
- NDR_CHECK(ndr_pull_compression_end(_ndr_ctr1, _ndr_ctr1_compressed, NDR_COMPRESSION_XPRESS, r->decompressed_length));
+ struct ndr_pull *_ndr_ts_compressed;
+ NDR_CHECK(ndr_pull_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_XPRESS, r->decompressed_length));
+ NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr1TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts));
+ NDR_CHECK(ndr_pull_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_XPRESS, r->decompressed_length));
}
- NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_ctr1, 4, r->compressed_length));
+ NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_ts, 4, r->compressed_length));
}
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr1_0, 0);
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ts_0, 0);
}
}
return NDR_ERR_SUCCESS;
@@ -3045,72 +3047,46 @@ _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesXPRESSCtr1(struct ndr_print *ndr,
ndr->depth++;
ndr_print_uint32(ndr, "decompressed_length", r->decompressed_length);
ndr_print_uint32(ndr, "compressed_length", r->compressed_length);
- ndr_print_ptr(ndr, "ctr1", r->ctr1);
+ ndr_print_ptr(ndr, "ts", r->ts);
ndr->depth++;
- if (r->ctr1) {
- ndr_print_drsuapi_DsGetNCChangesCtr1(ndr, "ctr1", r->ctr1);
+ if (r->ts) {
+ ndr_print_drsuapi_DsGetNCChangesCtr1TS(ndr, "ts", r->ts);
}
ndr->depth--;
ndr->depth--;
}
-static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesXPRESSCtr6(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesXPRESSCtr6 *r)
-{
- if (ndr_flags & NDR_SCALARS) {
- NDR_CHECK(ndr_push_align(ndr, 4));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->decompressed_length));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->compressed_length));
- NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr6));
- }
- if (ndr_flags & NDR_BUFFERS) {
- if (r->ctr6) {
- {
- struct ndr_push *_ndr_ctr6;
- NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_ctr6, 4, r->compressed_length));
- {
- struct ndr_push *_ndr_ctr6_compressed;
- NDR_CHECK(ndr_push_compression_start(_ndr_ctr6, &_ndr_ctr6_compressed, NDR_COMPRESSION_XPRESS, r->decompressed_length));
- NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr6(_ndr_ctr6_compressed, NDR_SCALARS|NDR_BUFFERS, r->ctr6));
- NDR_CHECK(ndr_push_compression_end(_ndr_ctr6, _ndr_ctr6_compressed, NDR_COMPRESSION_XPRESS, r->decompressed_length));
- }
- NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_ctr6, 4, r->compressed_length));
- }
- }
- }
- return NDR_ERR_SUCCESS;
-}
-
static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesXPRESSCtr6(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesXPRESSCtr6 *r)
{
- uint32_t _ptr_ctr6;
- TALLOC_CTX *_mem_save_ctr6_0;
+ uint32_t _ptr_ts;
+ TALLOC_CTX *_mem_save_ts_0;
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_pull_align(ndr, 4));
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->decompressed_length));
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->compressed_length));
- NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr6));
- if (_ptr_ctr6) {
- NDR_PULL_ALLOC(ndr, r->ctr6);
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ts));
+ if (_ptr_ts) {
+ NDR_PULL_ALLOC(ndr, r->ts);
} else {
- r->ctr6 = NULL;
+ r->ts = NULL;
}
}
if (ndr_flags & NDR_BUFFERS) {
- if (r->ctr6) {
- _mem_save_ctr6_0 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, r->ctr6, 0);
+ if (r->ts) {
+ _mem_save_ts_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->ts, 0);
{
- struct ndr_pull *_ndr_ctr6;
- NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_ctr6, 4, r->compressed_length));
+ struct ndr_pull *_ndr_ts;
+ NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_ts, 4, r->compressed_length));
{
- struct ndr_pull *_ndr_ctr6_compressed;
- NDR_CHECK(ndr_pull_compression_start(_ndr_ctr6, &_ndr_ctr6_compressed, NDR_COMPRESSION_XPRESS, r->decompressed_length));
- NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr6(_ndr_ctr6_compressed, NDR_SCALARS|NDR_BUFFERS, r->ctr6));
- NDR_CHECK(ndr_pull_compression_end(_ndr_ctr6, _ndr_ctr6_compressed, NDR_COMPRESSION_XPRESS, r->decompressed_length));
+ struct ndr_pull *_ndr_ts_compressed;
+ NDR_CHECK(ndr_pull_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_XPRESS, r->decompressed_length));
+ NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr6TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts));
+ NDR_CHECK(ndr_pull_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_XPRESS, r->decompressed_length));
}
- NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_ctr6, 4, r->compressed_length));
+ NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_ts, 4, r->compressed_length));
}
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr6_0, 0);
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ts_0, 0);
}
}
return NDR_ERR_SUCCESS;
@@ -3122,10 +3098,10 @@ _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesXPRESSCtr6(struct ndr_print *ndr,
ndr->depth++;
ndr_print_uint32(ndr, "decompressed_length", r->decompressed_length);
ndr_print_uint32(ndr, "compressed_length", r->compressed_length);
- ndr_print_ptr(ndr, "ctr6", r->ctr6);
+ ndr_print_ptr(ndr, "ts", r->ts);
ndr->depth++;
- if (r->ctr6) {
- ndr_print_drsuapi_DsGetNCChangesCtr6(ndr, "ctr6", r->ctr6);
+ if (r->ts) {
+ ndr_print_drsuapi_DsGetNCChangesCtr6TS(ndr, "ts", r->ts);
}
ndr->depth--;
ndr->depth--;
@@ -3304,11 +3280,10 @@ static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr2(struct ndr_push *nd
{
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_push_align(ndr, 4));
- NDR_CHECK(ndr_push_set_switch_value(ndr, &r->ctr, 1 | (DRSUAPI_COMPRESSION_TYPE_MSZIP << 16)));
- NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCompressedCtr(ndr, NDR_SCALARS, &r->ctr));
+ NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, NDR_SCALARS, &r->mszip1));
}
if (ndr_flags & NDR_BUFFERS) {
- NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCompressedCtr(ndr, NDR_BUFFERS, &r->ctr));
+ NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, NDR_BUFFERS, &r->mszip1));
}
return NDR_ERR_SUCCESS;
}
@@ -3317,11 +3292,10 @@ static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr2(struct ndr_pull *nd
{
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_pull_align(ndr, 4));
- NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->ctr, 1 | (DRSUAPI_COMPRESSION_TYPE_MSZIP << 16)));
- NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCompressedCtr(ndr, NDR_SCALARS, &r->ctr));
+ NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, NDR_SCALARS, &r->mszip1));
}
if (ndr_flags & NDR_BUFFERS) {
- NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCompressedCtr(ndr, NDR_BUFFERS, &r->ctr));
+ NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, NDR_BUFFERS, &r->mszip1));
}
return NDR_ERR_SUCCESS;
}
@@ -3330,8 +3304,7 @@ _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCtr2(struct ndr_print *ndr, const
{
ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesCtr2");
ndr->depth++;
- ndr_print_set_switch_value(ndr, &r->ctr, 1 | (DRSUAPI_COMPRESSION_TYPE_MSZIP << 16));
- ndr_print_drsuapi_DsGetNCChangesCompressedCtr(ndr, "ctr", &r->ctr);
+ ndr_print_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, "mszip1", &r->mszip1);
ndr->depth--;
}
@@ -4741,7 +4714,7 @@ _PUBLIC_ void ndr_print_drsuapi_DsNameFormat(struct ndr_print *ndr, const char *
const char *val = NULL;
switch (r) {
- case DRSUAPI_DS_NAME_FORMAT_UKNOWN: val = "DRSUAPI_DS_NAME_FORMAT_UKNOWN"; break;
+ case DRSUAPI_DS_NAME_FORMAT_UNKNOWN: val = "DRSUAPI_DS_NAME_FORMAT_UNKNOWN"; break;
case DRSUAPI_DS_NAME_FORMAT_FQDN_1779: val = "DRSUAPI_DS_NAME_FORMAT_FQDN_1779"; break;
case DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT: val = "DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT"; break;
case DRSUAPI_DS_NAME_FORMAT_DISPLAY: val = "DRSUAPI_DS_NAME_FORMAT_DISPLAY"; break;
@@ -5609,7 +5582,7 @@ static enum ndr_err_code ndr_push_drsuapi_DsRemoveDSServerRequest1(struct ndr_pu
NDR_CHECK(ndr_push_align(ndr, 4));
NDR_CHECK(ndr_push_unique_ptr(ndr, r->server_dn));
NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain_dn));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->commit));
}
if (ndr_flags & NDR_BUFFERS) {
if (r->server_dn) {
@@ -5648,7 +5621,7 @@ static enum ndr_err_code ndr_pull_drsuapi_DsRemoveDSServerRequest1(struct ndr_pu
} else {
r->domain_dn = NULL;
}
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->commit));
}
if (ndr_flags & NDR_BUFFERS) {
if (r->server_dn) {
@@ -5695,7 +5668,7 @@ _PUBLIC_ void ndr_print_drsuapi_DsRemoveDSServerRequest1(struct ndr_print *ndr,
ndr_print_string(ndr, "domain_dn", r->domain_dn);
}
ndr->depth--;
- ndr_print_uint32(ndr, "unknown", r->unknown);
+ ndr_print_uint32(ndr, "commit", r->commit);
ndr->depth--;
}
@@ -5778,7 +5751,7 @@ static enum ndr_err_code ndr_push_drsuapi_DsRemoveDSServerResult1(struct ndr_pus
{
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_push_align(ndr, 4));
- NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->status));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->last_dc_in_domain));
}
if (ndr_flags & NDR_BUFFERS) {
}
@@ -5789,7 +5762,7 @@ static enum ndr_err_code ndr_pull_drsuapi_DsRemoveDSServerResult1(struct ndr_pul
{
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_pull_align(ndr, 4));
- NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->status));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->last_dc_in_domain));
}
if (ndr_flags & NDR_BUFFERS) {
}
@@ -5800,7 +5773,7 @@ _PUBLIC_ void ndr_print_drsuapi_DsRemoveDSServerResult1(struct ndr_print *ndr, c
{
ndr_print_struct(ndr, name, "drsuapi_DsRemoveDSServerResult1");
ndr->depth++;
- ndr_print_WERROR(ndr, "status", r->status);
+ ndr_print_uint32(ndr, "last_dc_in_domain", r->last_dc_in_domain);
ndr->depth--;
}
diff --git a/source3/librpc/gen_ndr/ndr_drsuapi.h b/source3/librpc/gen_ndr/ndr_drsuapi.h
index 6b6a0b5670..4b5ead467f 100644
--- a/source3/librpc/gen_ndr/ndr_drsuapi.h
+++ b/source3/librpc/gen_ndr/ndr_drsuapi.h
@@ -6,7 +6,7 @@
#ifndef _HEADER_NDR_drsuapi
#define _HEADER_NDR_drsuapi
-#include "librpc/ndr/ndr_drsuapi.h"
+#include "../librpc/ndr/ndr_drsuapi.h"
#define NDR_DRSUAPI_UUID "e3514235-4b06-11d1-ab04-00c04fc2dcd2"
#define NDR_DRSUAPI_VERSION 4.0
#define NDR_DRSUAPI_NAME "drsuapi"
@@ -151,9 +151,19 @@ enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr6(struct ndr_push *ndr, int
enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr6(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr6 *r);
void ndr_print_drsuapi_DsGetNCChangesCtr6(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr6 *r);
size_t ndr_size_drsuapi_DsGetNCChangesCtr6(const struct drsuapi_DsGetNCChangesCtr6 *r, int flags);
+enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr1TS(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr1TS *r);
+enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr1TS(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr1TS *r);
+void ndr_print_drsuapi_DsGetNCChangesCtr1TS(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr1TS *r);
+enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr6TS(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr6TS *r);
+enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr6TS(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr6TS *r);
+void ndr_print_drsuapi_DsGetNCChangesCtr6TS(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr6TS *r);
+enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesMSZIPCtr1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesMSZIPCtr1 *r);
void ndr_print_drsuapi_DsGetNCChangesMSZIPCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesMSZIPCtr1 *r);
+enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesMSZIPCtr6(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesMSZIPCtr6 *r);
void ndr_print_drsuapi_DsGetNCChangesMSZIPCtr6(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesMSZIPCtr6 *r);
+enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesXPRESSCtr1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesXPRESSCtr1 *r);
void ndr_print_drsuapi_DsGetNCChangesXPRESSCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesXPRESSCtr1 *r);
+enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesXPRESSCtr6(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesXPRESSCtr6 *r);
void ndr_print_drsuapi_DsGetNCChangesXPRESSCtr6(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesXPRESSCtr6 *r);
void ndr_print_drsuapi_DsGetNCChangesCompressionType(struct ndr_print *ndr, const char *name, enum drsuapi_DsGetNCChangesCompressionType r);
void ndr_print_drsuapi_DsGetNCChangesCompressedCtr(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetNCChangesCompressedCtr *r);
diff --git a/source3/librpc/gen_ndr/ndr_epmapper.c b/source3/librpc/gen_ndr/ndr_epmapper.c
index b7cead8a21..0f1005dda7 100644
--- a/source3/librpc/gen_ndr/ndr_epmapper.c
+++ b/source3/librpc/gen_ndr/ndr_epmapper.c
@@ -1633,12 +1633,9 @@ static enum ndr_err_code ndr_push_epm_entry_t(struct ndr_push *ndr, int ndr_flag
NDR_CHECK(ndr_push_align(ndr, 4));
NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->object));
NDR_CHECK(ndr_push_full_ptr(ndr, r->tower));
- {
- uint32_t _flags_save_string = ndr->flags;
- ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_LEN4);
- NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->annotation));
- ndr->flags = _flags_save_string;
- }
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen(r->annotation) + 1));
+ NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->annotation, strlen(r->annotation) + 1, sizeof(uint8_t), CH_DOS));
}
if (ndr_flags & NDR_BUFFERS) {
if (r->tower) {
@@ -1661,12 +1658,9 @@ static enum ndr_err_code ndr_pull_epm_entry_t(struct ndr_pull *ndr, int ndr_flag
} else {
r->tower = NULL;
}
- {
- uint32_t _flags_save_string = ndr->flags;
- ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_LEN4);
- NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->annotation));
- ndr->flags = _flags_save_string;
- }
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__annotation_offset));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__annotation_length));
+ NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->annotation, r->__annotation_length, sizeof(uint8_t), CH_DOS));
}
if (ndr_flags & NDR_BUFFERS) {
if (r->tower) {
@@ -1690,6 +1684,8 @@ _PUBLIC_ void ndr_print_epm_entry_t(struct ndr_print *ndr, const char *name, con
ndr_print_epm_twr_t(ndr, "tower", r->tower);
}
ndr->depth--;
+ ndr_print_uint32(ndr, "__annotation_offset", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->__annotation_offset);
+ ndr_print_uint32(ndr, "__annotation_length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen(r->annotation) + 1:r->__annotation_length);
ndr_print_string(ndr, "annotation", r->annotation);
ndr->depth--;
}
diff --git a/source3/librpc/gen_ndr/ndr_initshutdown.c b/source3/librpc/gen_ndr/ndr_initshutdown.c
index 271dac12b0..62a19af3a2 100644
--- a/source3/librpc/gen_ndr/ndr_initshutdown.c
+++ b/source3/librpc/gen_ndr/ndr_initshutdown.c
@@ -4,106 +4,6 @@
#include "librpc/gen_ndr/ndr_initshutdown.h"
#include "librpc/gen_ndr/ndr_lsa.h"
-static enum ndr_err_code ndr_push_initshutdown_String_sub(struct ndr_push *ndr, int ndr_flags, const struct initshutdown_String_sub *r)
-{
- if (ndr_flags & NDR_SCALARS) {
- NDR_CHECK(ndr_push_align(ndr, 4));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m_term(r->name)));
- {
- uint32_t _flags_save_string = ndr->flags;
- ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_LEN4|LIBNDR_FLAG_STR_NOTERM);
- NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->name));
- ndr->flags = _flags_save_string;
- }
- }
- if (ndr_flags & NDR_BUFFERS) {
- }
- return NDR_ERR_SUCCESS;
-}
-
-static enum ndr_err_code ndr_pull_initshutdown_String_sub(struct ndr_pull *ndr, int ndr_flags, struct initshutdown_String_sub *r)
-{
- if (ndr_flags & NDR_SCALARS) {
- NDR_CHECK(ndr_pull_align(ndr, 4));
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->name_size));
- {
- uint32_t _flags_save_string = ndr->flags;
- ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_LEN4|LIBNDR_FLAG_STR_NOTERM);
- NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->name));
- ndr->flags = _flags_save_string;
- }
- }
- if (ndr_flags & NDR_BUFFERS) {
- }
- return NDR_ERR_SUCCESS;
-}
-
-_PUBLIC_ void ndr_print_initshutdown_String_sub(struct ndr_print *ndr, const char *name, const struct initshutdown_String_sub *r)
-{
- ndr_print_struct(ndr, name, "initshutdown_String_sub");
- ndr->depth++;
- ndr_print_uint32(ndr, "name_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m_term(r->name):r->name_size);
- ndr_print_string(ndr, "name", r->name);
- ndr->depth--;
-}
-
-_PUBLIC_ enum ndr_err_code ndr_push_initshutdown_String(struct ndr_push *ndr, int ndr_flags, const struct initshutdown_String *r)
-{
- if (ndr_flags & NDR_SCALARS) {
- NDR_CHECK(ndr_push_align(ndr, 4));
- NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen_m(r->name->name) * 2));
- NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen_m_term(r->name->name) * 2));
- NDR_CHECK(ndr_push_unique_ptr(ndr, r->name));
- }
- if (ndr_flags & NDR_BUFFERS) {
- if (r->name) {
- NDR_CHECK(ndr_push_initshutdown_String_sub(ndr, NDR_SCALARS, r->name));
- }
- }
- return NDR_ERR_SUCCESS;
-}
-
-_PUBLIC_ enum ndr_err_code ndr_pull_initshutdown_String(struct ndr_pull *ndr, int ndr_flags, struct initshutdown_String *r)
-{
- uint32_t _ptr_name;
- TALLOC_CTX *_mem_save_name_0;
- if (ndr_flags & NDR_SCALARS) {
- NDR_CHECK(ndr_pull_align(ndr, 4));
- NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->name_len));
- NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->name_size));
- NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name));
- if (_ptr_name) {
- NDR_PULL_ALLOC(ndr, r->name);
- } else {
- r->name = NULL;
- }
- }
- if (ndr_flags & NDR_BUFFERS) {
- if (r->name) {
- _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, r->name, 0);
- NDR_CHECK(ndr_pull_initshutdown_String_sub(ndr, NDR_SCALARS, r->name));
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0);
- }
- }
- return NDR_ERR_SUCCESS;
-}
-
-_PUBLIC_ void ndr_print_initshutdown_String(struct ndr_print *ndr, const char *name, const struct initshutdown_String *r)
-{
- ndr_print_struct(ndr, name, "initshutdown_String");
- ndr->depth++;
- ndr_print_uint16(ndr, "name_len", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m(r->name->name) * 2:r->name_len);
- ndr_print_uint16(ndr, "name_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m_term(r->name->name) * 2:r->name_size);
- ndr_print_ptr(ndr, "name", r->name);
- ndr->depth++;
- if (r->name) {
- ndr_print_initshutdown_String_sub(ndr, "name", r->name);
- }
- ndr->depth--;
- ndr->depth--;
-}
-
static enum ndr_err_code ndr_push_initshutdown_Init(struct ndr_push *ndr, int flags, const struct initshutdown_Init *r)
{
if (flags & NDR_IN) {
@@ -113,7 +13,7 @@ static enum ndr_err_code ndr_push_initshutdown_Init(struct ndr_push *ndr, int fl
}
NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.message));
if (r->in.message) {
- NDR_CHECK(ndr_push_initshutdown_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.message));
+ NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.message));
}
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.timeout));
NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.force_apps));
@@ -153,7 +53,7 @@ static enum ndr_err_code ndr_pull_initshutdown_Init(struct ndr_pull *ndr, int fl
if (r->in.message) {
_mem_save_message_0 = NDR_PULL_GET_MEM_CTX(ndr);
NDR_PULL_SET_MEM_CTX(ndr, r->in.message, 0);
- NDR_CHECK(ndr_pull_initshutdown_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.message));
+ NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.message));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_message_0, 0);
}
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.timeout));
@@ -185,7 +85,7 @@ _PUBLIC_ void ndr_print_initshutdown_Init(struct ndr_print *ndr, const char *nam
ndr_print_ptr(ndr, "message", r->in.message);
ndr->depth++;
if (r->in.message) {
- ndr_print_initshutdown_String(ndr, "message", r->in.message);
+ ndr_print_lsa_StringLarge(ndr, "message", r->in.message);
}
ndr->depth--;
ndr_print_uint32(ndr, "timeout", r->in.timeout);
@@ -276,7 +176,7 @@ static enum ndr_err_code ndr_push_initshutdown_InitEx(struct ndr_push *ndr, int
}
NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.message));
if (r->in.message) {
- NDR_CHECK(ndr_push_initshutdown_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.message));
+ NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.message));
}
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.timeout));
NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.force_apps));
@@ -317,7 +217,7 @@ static enum ndr_err_code ndr_pull_initshutdown_InitEx(struct ndr_pull *ndr, int
if (r->in.message) {
_mem_save_message_0 = NDR_PULL_GET_MEM_CTX(ndr);
NDR_PULL_SET_MEM_CTX(ndr, r->in.message, 0);
- NDR_CHECK(ndr_pull_initshutdown_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.message));
+ NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.message));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_message_0, 0);
}
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.timeout));
@@ -350,7 +250,7 @@ _PUBLIC_ void ndr_print_initshutdown_InitEx(struct ndr_print *ndr, const char *n
ndr_print_ptr(ndr, "message", r->in.message);
ndr->depth++;
if (r->in.message) {
- ndr_print_initshutdown_String(ndr, "message", r->in.message);
+ ndr_print_lsa_StringLarge(ndr, "message", r->in.message);
}
ndr->depth--;
ndr_print_uint32(ndr, "timeout", r->in.timeout);
diff --git a/source3/librpc/gen_ndr/ndr_initshutdown.h b/source3/librpc/gen_ndr/ndr_initshutdown.h
index 9a19432678..2cb5a530b0 100644
--- a/source3/librpc/gen_ndr/ndr_initshutdown.h
+++ b/source3/librpc/gen_ndr/ndr_initshutdown.h
@@ -18,10 +18,6 @@ extern const struct ndr_interface_table ndr_table_initshutdown;
#define NDR_INITSHUTDOWN_INITEX (0x02)
#define NDR_INITSHUTDOWN_CALL_COUNT (3)
-void ndr_print_initshutdown_String_sub(struct ndr_print *ndr, const char *name, const struct initshutdown_String_sub *r);
-enum ndr_err_code ndr_push_initshutdown_String(struct ndr_push *ndr, int ndr_flags, const struct initshutdown_String *r);
-enum ndr_err_code ndr_pull_initshutdown_String(struct ndr_pull *ndr, int ndr_flags, struct initshutdown_String *r);
-void ndr_print_initshutdown_String(struct ndr_print *ndr, const char *name, const struct initshutdown_String *r);
void ndr_print_initshutdown_Init(struct ndr_print *ndr, const char *name, int flags, const struct initshutdown_Init *r);
void ndr_print_initshutdown_Abort(struct ndr_print *ndr, const char *name, int flags, const struct initshutdown_Abort *r);
void ndr_print_initshutdown_InitEx(struct ndr_print *ndr, const char *name, int flags, const struct initshutdown_InitEx *r);
diff --git a/source3/librpc/gen_ndr/ndr_lsa.c b/source3/librpc/gen_ndr/ndr_lsa.c
index b5dd2a0bc1..ffa4d7df77 100644
--- a/source3/librpc/gen_ndr/ndr_lsa.c
+++ b/source3/librpc/gen_ndr/ndr_lsa.c
@@ -1198,7 +1198,7 @@ static enum ndr_err_code ndr_push_lsa_ModificationInfo(struct ndr_push *ndr, int
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_push_align(ndr, 8));
NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->modified_id));
- NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->db_create_time));
+ NDR_CHECK(ndr_push_NTTIME_hyper(ndr, NDR_SCALARS, r->db_create_time));
}
if (ndr_flags & NDR_BUFFERS) {
}
@@ -1210,7 +1210,7 @@ static enum ndr_err_code ndr_pull_lsa_ModificationInfo(struct ndr_pull *ndr, int
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_pull_align(ndr, 8));
NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->modified_id));
- NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->db_create_time));
+ NDR_CHECK(ndr_pull_NTTIME_hyper(ndr, NDR_SCALARS, &r->db_create_time));
}
if (ndr_flags & NDR_BUFFERS) {
}
@@ -1222,7 +1222,7 @@ _PUBLIC_ void ndr_print_lsa_ModificationInfo(struct ndr_print *ndr, const char *
ndr_print_struct(ndr, name, "lsa_ModificationInfo");
ndr->depth++;
ndr_print_hyper(ndr, "modified_id", r->modified_id);
- ndr_print_NTTIME(ndr, "db_create_time", r->db_create_time);
+ ndr_print_NTTIME_hyper(ndr, "db_create_time", r->db_create_time);
ndr->depth--;
}
@@ -1392,6 +1392,7 @@ _PUBLIC_ void ndr_print_lsa_PolicyInfo(struct ndr_print *ndr, const char *name,
case LSA_POLICY_INFO_AUDIT_FULL_SET: val = "LSA_POLICY_INFO_AUDIT_FULL_SET"; break;
case LSA_POLICY_INFO_AUDIT_FULL_QUERY: val = "LSA_POLICY_INFO_AUDIT_FULL_QUERY"; break;
case LSA_POLICY_INFO_DNS: val = "LSA_POLICY_INFO_DNS"; break;
+ case LSA_POLICY_INFO_DNS_INT: val = "LSA_POLICY_INFO_DNS_INT"; break;
}
ndr_print_enum(ndr, name, "ENUM", val, r);
}
@@ -1450,6 +1451,10 @@ static enum ndr_err_code ndr_push_lsa_PolicyInformation(struct ndr_push *ndr, in
NDR_CHECK(ndr_push_lsa_DnsDomainInfo(ndr, NDR_SCALARS, &r->dns));
break; }
+ case LSA_POLICY_INFO_DNS_INT: {
+ NDR_CHECK(ndr_push_lsa_DnsDomainInfo(ndr, NDR_SCALARS, &r->dns));
+ break; }
+
default:
return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
}
@@ -1499,6 +1504,10 @@ static enum ndr_err_code ndr_push_lsa_PolicyInformation(struct ndr_push *ndr, in
NDR_CHECK(ndr_push_lsa_DnsDomainInfo(ndr, NDR_BUFFERS, &r->dns));
break;
+ case LSA_POLICY_INFO_DNS_INT:
+ NDR_CHECK(ndr_push_lsa_DnsDomainInfo(ndr, NDR_BUFFERS, &r->dns));
+ break;
+
default:
return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
}
@@ -1565,6 +1574,10 @@ static enum ndr_err_code ndr_pull_lsa_PolicyInformation(struct ndr_pull *ndr, in
NDR_CHECK(ndr_pull_lsa_DnsDomainInfo(ndr, NDR_SCALARS, &r->dns));
break; }
+ case LSA_POLICY_INFO_DNS_INT: {
+ NDR_CHECK(ndr_pull_lsa_DnsDomainInfo(ndr, NDR_SCALARS, &r->dns));
+ break; }
+
default:
return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
}
@@ -1613,6 +1626,10 @@ static enum ndr_err_code ndr_pull_lsa_PolicyInformation(struct ndr_pull *ndr, in
NDR_CHECK(ndr_pull_lsa_DnsDomainInfo(ndr, NDR_BUFFERS, &r->dns));
break;
+ case LSA_POLICY_INFO_DNS_INT:
+ NDR_CHECK(ndr_pull_lsa_DnsDomainInfo(ndr, NDR_BUFFERS, &r->dns));
+ break;
+
default:
return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
}
@@ -1674,6 +1691,10 @@ _PUBLIC_ void ndr_print_lsa_PolicyInformation(struct ndr_print *ndr, const char
ndr_print_lsa_DnsDomainInfo(ndr, "dns", &r->dns);
break;
+ case LSA_POLICY_INFO_DNS_INT:
+ ndr_print_lsa_DnsDomainInfo(ndr, "dns", &r->dns);
+ break;
+
default:
ndr_print_bad_level(ndr, name, level);
}
@@ -2174,6 +2195,7 @@ _PUBLIC_ void ndr_print_lsa_LookupNamesLevel(struct ndr_print *ndr, const char *
case LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY: val = "LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY"; break;
case LSA_LOOKUP_NAMES_FOREST_TRUSTS_ONLY: val = "LSA_LOOKUP_NAMES_FOREST_TRUSTS_ONLY"; break;
case LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2: val = "LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2"; break;
+ case LSA_LOOKUP_NAMES_RODC_REFERRAL_TO_FULL_DC: val = "LSA_LOOKUP_NAMES_RODC_REFERRAL_TO_FULL_DC"; break;
}
ndr_print_enum(ndr, name, "ENUM", val, r);
}
@@ -2588,19 +2610,100 @@ _PUBLIC_ void ndr_print_lsa_TrustDomInfoEnum(struct ndr_print *ndr, const char *
switch (r) {
case LSA_TRUSTED_DOMAIN_INFO_NAME: val = "LSA_TRUSTED_DOMAIN_INFO_NAME"; break;
- case LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS_INFO: val = "LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS_INFO"; break;
+ case LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS: val = "LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS"; break;
case LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET: val = "LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET"; break;
case LSA_TRUSTED_DOMAIN_INFO_PASSWORD: val = "LSA_TRUSTED_DOMAIN_INFO_PASSWORD"; break;
case LSA_TRUSTED_DOMAIN_INFO_BASIC: val = "LSA_TRUSTED_DOMAIN_INFO_BASIC"; break;
case LSA_TRUSTED_DOMAIN_INFO_INFO_EX: val = "LSA_TRUSTED_DOMAIN_INFO_INFO_EX"; break;
case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO: val = "LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO"; break;
case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO: val = "LSA_TRUSTED_DOMAIN_INFO_FULL_INFO"; break;
- case LSA_TRUSTED_DOMAIN_INFO_11: val = "LSA_TRUSTED_DOMAIN_INFO_11"; break;
- case LSA_TRUSTED_DOMAIN_INFO_INFO_ALL: val = "LSA_TRUSTED_DOMAIN_INFO_INFO_ALL"; break;
+ case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL: val = "LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL"; break;
+ case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL: val = "LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL"; break;
+ case LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL: val = "LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL"; break;
+ case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL: val = "LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL"; break;
+ case LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES: val = "LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES"; break;
}
ndr_print_enum(ndr, name, "ENUM", val, r);
}
+_PUBLIC_ enum ndr_err_code ndr_push_lsa_TrustDirection(struct ndr_push *ndr, int ndr_flags, uint32_t r)
+{
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_lsa_TrustDirection(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
+{
+ uint32_t v;
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
+ *r = v;
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_lsa_TrustDirection(struct ndr_print *ndr, const char *name, uint32_t r)
+{
+ ndr_print_uint32(ndr, name, r);
+ ndr->depth++;
+ ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_TRUST_DIRECTION_INBOUND", LSA_TRUST_DIRECTION_INBOUND, r);
+ ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_TRUST_DIRECTION_OUTBOUND", LSA_TRUST_DIRECTION_OUTBOUND, r);
+ ndr->depth--;
+}
+
+static enum ndr_err_code ndr_push_lsa_TrustType(struct ndr_push *ndr, int ndr_flags, enum lsa_TrustType r)
+{
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
+ return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_lsa_TrustType(struct ndr_pull *ndr, int ndr_flags, enum lsa_TrustType *r)
+{
+ uint32_t v;
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
+ *r = v;
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_lsa_TrustType(struct ndr_print *ndr, const char *name, enum lsa_TrustType r)
+{
+ const char *val = NULL;
+
+ switch (r) {
+ case LSA_TRUST_TYPE_DOWNLEVEL: val = "LSA_TRUST_TYPE_DOWNLEVEL"; break;
+ case LSA_TRUST_TYPE_UPLEVEL: val = "LSA_TRUST_TYPE_UPLEVEL"; break;
+ case LSA_TRUST_TYPE_MIT: val = "LSA_TRUST_TYPE_MIT"; break;
+ }
+ ndr_print_enum(ndr, name, "ENUM", val, r);
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_lsa_TrustAttributes(struct ndr_push *ndr, int ndr_flags, uint32_t r)
+{
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_lsa_TrustAttributes(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
+{
+ uint32_t v;
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
+ *r = v;
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_lsa_TrustAttributes(struct ndr_print *ndr, const char *name, uint32_t r)
+{
+ ndr_print_uint32(ndr, name, r);
+ ndr->depth++;
+ ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_TRUST_ATTRIBUTE_NON_TRANSITIVE", LSA_TRUST_ATTRIBUTE_NON_TRANSITIVE, r);
+ ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_TRUST_ATTRIBUTE_UPLEVEL_ONLY", LSA_TRUST_ATTRIBUTE_UPLEVEL_ONLY, r);
+ ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN", LSA_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN, r);
+ ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_TRUST_ATTRIBUTE_FOREST_TRANSITIVE", LSA_TRUST_ATTRIBUTE_FOREST_TRANSITIVE, r);
+ ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_TRUST_ATTRIBUTE_CROSS_ORGANIZATION", LSA_TRUST_ATTRIBUTE_CROSS_ORGANIZATION, r);
+ ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_TRUST_ATTRIBUTE_WITHIN_FOREST", LSA_TRUST_ATTRIBUTE_WITHIN_FOREST, r);
+ ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL", LSA_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL, r);
+ ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_TRUST_ATTRIBUTE_USES_RC4_ENCRYPTION", LSA_TRUST_ATTRIBUTE_USES_RC4_ENCRYPTION, r);
+ ndr->depth--;
+}
+
static enum ndr_err_code ndr_push_lsa_TrustDomainInfoName(struct ndr_push *ndr, int ndr_flags, const struct lsa_TrustDomainInfoName *r)
{
if (ndr_flags & NDR_SCALARS) {
@@ -2633,6 +2736,92 @@ _PUBLIC_ void ndr_print_lsa_TrustDomainInfoName(struct ndr_print *ndr, const cha
ndr->depth--;
}
+static enum ndr_err_code ndr_push_lsa_TrustDomainInfoControllers(struct ndr_push *ndr, int ndr_flags, const struct lsa_TrustDomainInfoControllers *r)
+{
+ uint32_t cntr_netbios_names_1;
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->entries));
+ NDR_CHECK(ndr_push_unique_ptr(ndr, r->netbios_names));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ if (r->netbios_names) {
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->entries));
+ for (cntr_netbios_names_1 = 0; cntr_netbios_names_1 < r->entries; cntr_netbios_names_1++) {
+ NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->netbios_names[cntr_netbios_names_1]));
+ }
+ for (cntr_netbios_names_1 = 0; cntr_netbios_names_1 < r->entries; cntr_netbios_names_1++) {
+ NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->netbios_names[cntr_netbios_names_1]));
+ }
+ }
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_lsa_TrustDomainInfoControllers(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustDomainInfoControllers *r)
+{
+ uint32_t _ptr_netbios_names;
+ uint32_t cntr_netbios_names_1;
+ TALLOC_CTX *_mem_save_netbios_names_0;
+ TALLOC_CTX *_mem_save_netbios_names_1;
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->entries));
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_netbios_names));
+ if (_ptr_netbios_names) {
+ NDR_PULL_ALLOC(ndr, r->netbios_names);
+ } else {
+ r->netbios_names = NULL;
+ }
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ if (r->netbios_names) {
+ _mem_save_netbios_names_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->netbios_names, 0);
+ NDR_CHECK(ndr_pull_array_size(ndr, &r->netbios_names));
+ NDR_PULL_ALLOC_N(ndr, r->netbios_names, ndr_get_array_size(ndr, &r->netbios_names));
+ _mem_save_netbios_names_1 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->netbios_names, 0);
+ for (cntr_netbios_names_1 = 0; cntr_netbios_names_1 < r->entries; cntr_netbios_names_1++) {
+ NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->netbios_names[cntr_netbios_names_1]));
+ }
+ for (cntr_netbios_names_1 = 0; cntr_netbios_names_1 < r->entries; cntr_netbios_names_1++) {
+ NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->netbios_names[cntr_netbios_names_1]));
+ }
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_netbios_names_1, 0);
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_netbios_names_0, 0);
+ }
+ if (r->netbios_names) {
+ NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->netbios_names, r->entries));
+ }
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_lsa_TrustDomainInfoControllers(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoControllers *r)
+{
+ uint32_t cntr_netbios_names_1;
+ ndr_print_struct(ndr, name, "lsa_TrustDomainInfoControllers");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "entries", r->entries);
+ ndr_print_ptr(ndr, "netbios_names", r->netbios_names);
+ ndr->depth++;
+ if (r->netbios_names) {
+ ndr->print(ndr, "%s: ARRAY(%d)", "netbios_names", (int)r->entries);
+ ndr->depth++;
+ for (cntr_netbios_names_1=0;cntr_netbios_names_1<r->entries;cntr_netbios_names_1++) {
+ char *idx_1=NULL;
+ if (asprintf(&idx_1, "[%d]", cntr_netbios_names_1) != -1) {
+ ndr_print_lsa_StringLarge(ndr, "netbios_names", &r->netbios_names[cntr_netbios_names_1]);
+ free(idx_1);
+ }
+ }
+ ndr->depth--;
+ }
+ ndr->depth--;
+ ndr->depth--;
+}
+
static enum ndr_err_code ndr_push_lsa_TrustDomainInfoPosixOffset(struct ndr_push *ndr, int ndr_flags, const struct lsa_TrustDomainInfoPosixOffset *r)
{
if (ndr_flags & NDR_SCALARS) {
@@ -2801,9 +2990,9 @@ static enum ndr_err_code ndr_push_lsa_TrustDomainInfoInfoEx(struct ndr_push *ndr
NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->domain_name));
NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->netbios_name));
NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->trust_direction));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->trust_type));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->trust_attributes));
+ NDR_CHECK(ndr_push_lsa_TrustDirection(ndr, NDR_SCALARS, r->trust_direction));
+ NDR_CHECK(ndr_push_lsa_TrustType(ndr, NDR_SCALARS, r->trust_type));
+ NDR_CHECK(ndr_push_lsa_TrustAttributes(ndr, NDR_SCALARS, r->trust_attributes));
}
if (ndr_flags & NDR_BUFFERS) {
NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->domain_name));
@@ -2829,9 +3018,9 @@ static enum ndr_err_code ndr_pull_lsa_TrustDomainInfoInfoEx(struct ndr_pull *ndr
} else {
r->sid = NULL;
}
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->trust_direction));
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->trust_type));
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->trust_attributes));
+ NDR_CHECK(ndr_pull_lsa_TrustDirection(ndr, NDR_SCALARS, &r->trust_direction));
+ NDR_CHECK(ndr_pull_lsa_TrustType(ndr, NDR_SCALARS, &r->trust_type));
+ NDR_CHECK(ndr_pull_lsa_TrustAttributes(ndr, NDR_SCALARS, &r->trust_attributes));
}
if (ndr_flags & NDR_BUFFERS) {
NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->domain_name));
@@ -2858,18 +3047,45 @@ _PUBLIC_ void ndr_print_lsa_TrustDomainInfoInfoEx(struct ndr_print *ndr, const c
ndr_print_dom_sid2(ndr, "sid", r->sid);
}
ndr->depth--;
- ndr_print_uint32(ndr, "trust_direction", r->trust_direction);
- ndr_print_uint32(ndr, "trust_type", r->trust_type);
- ndr_print_uint32(ndr, "trust_attributes", r->trust_attributes);
+ ndr_print_lsa_TrustDirection(ndr, "trust_direction", r->trust_direction);
+ ndr_print_lsa_TrustType(ndr, "trust_type", r->trust_type);
+ ndr_print_lsa_TrustAttributes(ndr, "trust_attributes", r->trust_attributes);
ndr->depth--;
}
+_PUBLIC_ enum ndr_err_code ndr_push_lsa_TrustAuthType(struct ndr_push *ndr, int ndr_flags, enum lsa_TrustAuthType r)
+{
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_lsa_TrustAuthType(struct ndr_pull *ndr, int ndr_flags, enum lsa_TrustAuthType *r)
+{
+ uint32_t v;
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
+ *r = v;
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_lsa_TrustAuthType(struct ndr_print *ndr, const char *name, enum lsa_TrustAuthType r)
+{
+ const char *val = NULL;
+
+ switch (r) {
+ case TRUST_AUTH_TYPE_NONE: val = "TRUST_AUTH_TYPE_NONE"; break;
+ case TRUST_AUTH_TYPE_NT4OWF: val = "TRUST_AUTH_TYPE_NT4OWF"; break;
+ case TRUST_AUTH_TYPE_CLEAR: val = "TRUST_AUTH_TYPE_CLEAR"; break;
+ case TRUST_AUTH_TYPE_VERSION: val = "TRUST_AUTH_TYPE_VERSION"; break;
+ }
+ ndr_print_enum(ndr, name, "ENUM", val, r);
+}
+
static enum ndr_err_code ndr_push_lsa_TrustDomainInfoBuffer(struct ndr_push *ndr, int ndr_flags, const struct lsa_TrustDomainInfoBuffer *r)
{
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_push_align(ndr, 8));
NDR_CHECK(ndr_push_NTTIME_hyper(ndr, NDR_SCALARS, r->last_update_time));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->secret_type));
+ NDR_CHECK(ndr_push_lsa_TrustAuthType(ndr, NDR_SCALARS, r->AuthType));
NDR_CHECK(ndr_push_lsa_DATA_BUF2(ndr, NDR_SCALARS, &r->data));
}
if (ndr_flags & NDR_BUFFERS) {
@@ -2883,7 +3099,7 @@ static enum ndr_err_code ndr_pull_lsa_TrustDomainInfoBuffer(struct ndr_pull *ndr
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_pull_align(ndr, 8));
NDR_CHECK(ndr_pull_NTTIME_hyper(ndr, NDR_SCALARS, &r->last_update_time));
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->secret_type));
+ NDR_CHECK(ndr_pull_lsa_TrustAuthType(ndr, NDR_SCALARS, &r->AuthType));
NDR_CHECK(ndr_pull_lsa_DATA_BUF2(ndr, NDR_SCALARS, &r->data));
}
if (ndr_flags & NDR_BUFFERS) {
@@ -2897,7 +3113,7 @@ _PUBLIC_ void ndr_print_lsa_TrustDomainInfoBuffer(struct ndr_print *ndr, const c
ndr_print_struct(ndr, name, "lsa_TrustDomainInfoBuffer");
ndr->depth++;
ndr_print_NTTIME_hyper(ndr, "last_update_time", r->last_update_time);
- ndr_print_uint32(ndr, "secret_type", r->secret_type);
+ ndr_print_lsa_TrustAuthType(ndr, "AuthType", r->AuthType);
ndr_print_lsa_DATA_BUF2(ndr, "data", &r->data);
ndr->depth--;
}
@@ -3071,88 +3287,213 @@ _PUBLIC_ void ndr_print_lsa_TrustDomainInfoFullInfo(struct ndr_print *ndr, const
ndr->depth--;
}
-static enum ndr_err_code ndr_push_lsa_TrustDomainInfo11(struct ndr_push *ndr, int ndr_flags, const struct lsa_TrustDomainInfo11 *r)
+static enum ndr_err_code ndr_push_lsa_TrustDomainInfoAuthInfoInternal(struct ndr_push *ndr, int ndr_flags, const struct lsa_TrustDomainInfoAuthInfoInternal *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_lsa_DATA_BUF2(ndr, NDR_SCALARS, &r->auth_blob));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ NDR_CHECK(ndr_push_lsa_DATA_BUF2(ndr, NDR_BUFFERS, &r->auth_blob));
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_lsa_TrustDomainInfoAuthInfoInternal(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustDomainInfoAuthInfoInternal *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_lsa_DATA_BUF2(ndr, NDR_SCALARS, &r->auth_blob));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ NDR_CHECK(ndr_pull_lsa_DATA_BUF2(ndr, NDR_BUFFERS, &r->auth_blob));
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_lsa_TrustDomainInfoAuthInfoInternal(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoAuthInfoInternal *r)
+{
+ ndr_print_struct(ndr, name, "lsa_TrustDomainInfoAuthInfoInternal");
+ ndr->depth++;
+ ndr_print_lsa_DATA_BUF2(ndr, "auth_blob", &r->auth_blob);
+ ndr->depth--;
+}
+
+static enum ndr_err_code ndr_push_lsa_TrustDomainInfoFullInfoInternal(struct ndr_push *ndr, int ndr_flags, const struct lsa_TrustDomainInfoFullInfoInternal *r)
{
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_push_align(ndr, 4));
NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx(ndr, NDR_SCALARS, &r->info_ex));
- NDR_CHECK(ndr_push_lsa_DATA_BUF2(ndr, NDR_SCALARS, &r->data1));
+ NDR_CHECK(ndr_push_lsa_TrustDomainInfoPosixOffset(ndr, NDR_SCALARS, &r->posix_offset));
+ NDR_CHECK(ndr_push_lsa_TrustDomainInfoAuthInfoInternal(ndr, NDR_SCALARS, &r->auth_info));
}
if (ndr_flags & NDR_BUFFERS) {
NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx(ndr, NDR_BUFFERS, &r->info_ex));
- NDR_CHECK(ndr_push_lsa_DATA_BUF2(ndr, NDR_BUFFERS, &r->data1));
+ NDR_CHECK(ndr_push_lsa_TrustDomainInfoAuthInfoInternal(ndr, NDR_BUFFERS, &r->auth_info));
}
return NDR_ERR_SUCCESS;
}
-static enum ndr_err_code ndr_pull_lsa_TrustDomainInfo11(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustDomainInfo11 *r)
+static enum ndr_err_code ndr_pull_lsa_TrustDomainInfoFullInfoInternal(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustDomainInfoFullInfoInternal *r)
{
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_pull_align(ndr, 4));
NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx(ndr, NDR_SCALARS, &r->info_ex));
- NDR_CHECK(ndr_pull_lsa_DATA_BUF2(ndr, NDR_SCALARS, &r->data1));
+ NDR_CHECK(ndr_pull_lsa_TrustDomainInfoPosixOffset(ndr, NDR_SCALARS, &r->posix_offset));
+ NDR_CHECK(ndr_pull_lsa_TrustDomainInfoAuthInfoInternal(ndr, NDR_SCALARS, &r->auth_info));
}
if (ndr_flags & NDR_BUFFERS) {
NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx(ndr, NDR_BUFFERS, &r->info_ex));
- NDR_CHECK(ndr_pull_lsa_DATA_BUF2(ndr, NDR_BUFFERS, &r->data1));
+ NDR_CHECK(ndr_pull_lsa_TrustDomainInfoAuthInfoInternal(ndr, NDR_BUFFERS, &r->auth_info));
}
return NDR_ERR_SUCCESS;
}
-_PUBLIC_ void ndr_print_lsa_TrustDomainInfo11(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfo11 *r)
+_PUBLIC_ void ndr_print_lsa_TrustDomainInfoFullInfoInternal(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoFullInfoInternal *r)
{
- ndr_print_struct(ndr, name, "lsa_TrustDomainInfo11");
+ ndr_print_struct(ndr, name, "lsa_TrustDomainInfoFullInfoInternal");
ndr->depth++;
ndr_print_lsa_TrustDomainInfoInfoEx(ndr, "info_ex", &r->info_ex);
- ndr_print_lsa_DATA_BUF2(ndr, "data1", &r->data1);
+ ndr_print_lsa_TrustDomainInfoPosixOffset(ndr, "posix_offset", &r->posix_offset);
+ ndr_print_lsa_TrustDomainInfoAuthInfoInternal(ndr, "auth_info", &r->auth_info);
ndr->depth--;
}
-static enum ndr_err_code ndr_push_lsa_TrustDomainInfoInfoAll(struct ndr_push *ndr, int ndr_flags, const struct lsa_TrustDomainInfoInfoAll *r)
+static enum ndr_err_code ndr_push_lsa_TrustDomainInfoInfoEx2Internal(struct ndr_push *ndr, int ndr_flags, const struct lsa_TrustDomainInfoInfoEx2Internal *r)
{
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_push_align(ndr, 4));
NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx(ndr, NDR_SCALARS, &r->info_ex));
- NDR_CHECK(ndr_push_lsa_DATA_BUF2(ndr, NDR_SCALARS, &r->data1));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->forest_trust_length));
+ NDR_CHECK(ndr_push_unique_ptr(ndr, r->forest_trust_data));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx(ndr, NDR_BUFFERS, &r->info_ex));
+ if (r->forest_trust_data) {
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->forest_trust_length));
+ NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->forest_trust_data, r->forest_trust_length));
+ }
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_lsa_TrustDomainInfoInfoEx2Internal(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustDomainInfoInfoEx2Internal *r)
+{
+ uint32_t _ptr_forest_trust_data;
+ TALLOC_CTX *_mem_save_forest_trust_data_0;
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx(ndr, NDR_SCALARS, &r->info_ex));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->forest_trust_length));
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_forest_trust_data));
+ if (_ptr_forest_trust_data) {
+ NDR_PULL_ALLOC(ndr, r->forest_trust_data);
+ } else {
+ r->forest_trust_data = NULL;
+ }
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx(ndr, NDR_BUFFERS, &r->info_ex));
+ if (r->forest_trust_data) {
+ _mem_save_forest_trust_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->forest_trust_data, 0);
+ NDR_CHECK(ndr_pull_array_size(ndr, &r->forest_trust_data));
+ NDR_PULL_ALLOC_N(ndr, r->forest_trust_data, ndr_get_array_size(ndr, &r->forest_trust_data));
+ NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->forest_trust_data, ndr_get_array_size(ndr, &r->forest_trust_data)));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_forest_trust_data_0, 0);
+ }
+ if (r->forest_trust_data) {
+ NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->forest_trust_data, r->forest_trust_length));
+ }
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_lsa_TrustDomainInfoInfoEx2Internal(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoInfoEx2Internal *r)
+{
+ ndr_print_struct(ndr, name, "lsa_TrustDomainInfoInfoEx2Internal");
+ ndr->depth++;
+ ndr_print_lsa_TrustDomainInfoInfoEx(ndr, "info_ex", &r->info_ex);
+ ndr_print_uint32(ndr, "forest_trust_length", r->forest_trust_length);
+ ndr_print_ptr(ndr, "forest_trust_data", r->forest_trust_data);
+ ndr->depth++;
+ if (r->forest_trust_data) {
+ ndr_print_array_uint8(ndr, "forest_trust_data", r->forest_trust_data, r->forest_trust_length);
+ }
+ ndr->depth--;
+ ndr->depth--;
+}
+
+static enum ndr_err_code ndr_push_lsa_TrustDomainInfoFullInfo2Internal(struct ndr_push *ndr, int ndr_flags, const struct lsa_TrustDomainInfoFullInfo2Internal *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx2Internal(ndr, NDR_SCALARS, &r->info));
NDR_CHECK(ndr_push_lsa_TrustDomainInfoPosixOffset(ndr, NDR_SCALARS, &r->posix_offset));
NDR_CHECK(ndr_push_lsa_TrustDomainInfoAuthInfo(ndr, NDR_SCALARS, &r->auth_info));
}
if (ndr_flags & NDR_BUFFERS) {
- NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx(ndr, NDR_BUFFERS, &r->info_ex));
- NDR_CHECK(ndr_push_lsa_DATA_BUF2(ndr, NDR_BUFFERS, &r->data1));
+ NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx2Internal(ndr, NDR_BUFFERS, &r->info));
NDR_CHECK(ndr_push_lsa_TrustDomainInfoAuthInfo(ndr, NDR_BUFFERS, &r->auth_info));
}
return NDR_ERR_SUCCESS;
}
-static enum ndr_err_code ndr_pull_lsa_TrustDomainInfoInfoAll(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustDomainInfoInfoAll *r)
+static enum ndr_err_code ndr_pull_lsa_TrustDomainInfoFullInfo2Internal(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustDomainInfoFullInfo2Internal *r)
{
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_pull_align(ndr, 4));
- NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx(ndr, NDR_SCALARS, &r->info_ex));
- NDR_CHECK(ndr_pull_lsa_DATA_BUF2(ndr, NDR_SCALARS, &r->data1));
+ NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx2Internal(ndr, NDR_SCALARS, &r->info));
NDR_CHECK(ndr_pull_lsa_TrustDomainInfoPosixOffset(ndr, NDR_SCALARS, &r->posix_offset));
NDR_CHECK(ndr_pull_lsa_TrustDomainInfoAuthInfo(ndr, NDR_SCALARS, &r->auth_info));
}
if (ndr_flags & NDR_BUFFERS) {
- NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx(ndr, NDR_BUFFERS, &r->info_ex));
- NDR_CHECK(ndr_pull_lsa_DATA_BUF2(ndr, NDR_BUFFERS, &r->data1));
+ NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx2Internal(ndr, NDR_BUFFERS, &r->info));
NDR_CHECK(ndr_pull_lsa_TrustDomainInfoAuthInfo(ndr, NDR_BUFFERS, &r->auth_info));
}
return NDR_ERR_SUCCESS;
}
-_PUBLIC_ void ndr_print_lsa_TrustDomainInfoInfoAll(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoInfoAll *r)
+_PUBLIC_ void ndr_print_lsa_TrustDomainInfoFullInfo2Internal(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoFullInfo2Internal *r)
{
- ndr_print_struct(ndr, name, "lsa_TrustDomainInfoInfoAll");
+ ndr_print_struct(ndr, name, "lsa_TrustDomainInfoFullInfo2Internal");
ndr->depth++;
- ndr_print_lsa_TrustDomainInfoInfoEx(ndr, "info_ex", &r->info_ex);
- ndr_print_lsa_DATA_BUF2(ndr, "data1", &r->data1);
+ ndr_print_lsa_TrustDomainInfoInfoEx2Internal(ndr, "info", &r->info);
ndr_print_lsa_TrustDomainInfoPosixOffset(ndr, "posix_offset", &r->posix_offset);
ndr_print_lsa_TrustDomainInfoAuthInfo(ndr, "auth_info", &r->auth_info);
ndr->depth--;
}
+static enum ndr_err_code ndr_push_lsa_TrustDomainInfoSupportedEncTypes(struct ndr_push *ndr, int ndr_flags, const struct lsa_TrustDomainInfoSupportedEncTypes *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_kerb_EncTypes(ndr, NDR_SCALARS, r->enc_types));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_lsa_TrustDomainInfoSupportedEncTypes(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustDomainInfoSupportedEncTypes *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_kerb_EncTypes(ndr, NDR_SCALARS, &r->enc_types));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_lsa_TrustDomainInfoSupportedEncTypes(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoSupportedEncTypes *r)
+{
+ ndr_print_struct(ndr, name, "lsa_TrustDomainInfoSupportedEncTypes");
+ ndr->depth++;
+ ndr_print_kerb_EncTypes(ndr, "enc_types", r->enc_types);
+ ndr->depth--;
+}
+
static enum ndr_err_code ndr_push_lsa_TrustedDomainInfo(struct ndr_push *ndr, int ndr_flags, const union lsa_TrustedDomainInfo *r)
{
if (ndr_flags & NDR_SCALARS) {
@@ -3163,6 +3504,10 @@ static enum ndr_err_code ndr_push_lsa_TrustedDomainInfo(struct ndr_push *ndr, in
NDR_CHECK(ndr_push_lsa_TrustDomainInfoName(ndr, NDR_SCALARS, &r->name));
break; }
+ case LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS: {
+ NDR_CHECK(ndr_push_lsa_TrustDomainInfoControllers(ndr, NDR_SCALARS, &r->controllers));
+ break; }
+
case LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET: {
NDR_CHECK(ndr_push_lsa_TrustDomainInfoPosixOffset(ndr, NDR_SCALARS, &r->posix_offset));
break; }
@@ -3187,12 +3532,24 @@ static enum ndr_err_code ndr_push_lsa_TrustedDomainInfo(struct ndr_push *ndr, in
NDR_CHECK(ndr_push_lsa_TrustDomainInfoFullInfo(ndr, NDR_SCALARS, &r->full_info));
break; }
- case LSA_TRUSTED_DOMAIN_INFO_11: {
- NDR_CHECK(ndr_push_lsa_TrustDomainInfo11(ndr, NDR_SCALARS, &r->info11));
+ case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL: {
+ NDR_CHECK(ndr_push_lsa_TrustDomainInfoAuthInfoInternal(ndr, NDR_SCALARS, &r->auth_info_internal));
+ break; }
+
+ case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL: {
+ NDR_CHECK(ndr_push_lsa_TrustDomainInfoFullInfoInternal(ndr, NDR_SCALARS, &r->full_info_internal));
+ break; }
+
+ case LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL: {
+ NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx2Internal(ndr, NDR_SCALARS, &r->info_ex2_internal));
break; }
- case LSA_TRUSTED_DOMAIN_INFO_INFO_ALL: {
- NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoAll(ndr, NDR_SCALARS, &r->info_all));
+ case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL: {
+ NDR_CHECK(ndr_push_lsa_TrustDomainInfoFullInfo2Internal(ndr, NDR_SCALARS, &r->full_info2_internal));
+ break; }
+
+ case LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES: {
+ NDR_CHECK(ndr_push_lsa_TrustDomainInfoSupportedEncTypes(ndr, NDR_SCALARS, &r->enc_types));
break; }
default:
@@ -3206,6 +3563,10 @@ static enum ndr_err_code ndr_push_lsa_TrustedDomainInfo(struct ndr_push *ndr, in
NDR_CHECK(ndr_push_lsa_TrustDomainInfoName(ndr, NDR_BUFFERS, &r->name));
break;
+ case LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS:
+ NDR_CHECK(ndr_push_lsa_TrustDomainInfoControllers(ndr, NDR_BUFFERS, &r->controllers));
+ break;
+
case LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET:
break;
@@ -3229,12 +3590,23 @@ static enum ndr_err_code ndr_push_lsa_TrustedDomainInfo(struct ndr_push *ndr, in
NDR_CHECK(ndr_push_lsa_TrustDomainInfoFullInfo(ndr, NDR_BUFFERS, &r->full_info));
break;
- case LSA_TRUSTED_DOMAIN_INFO_11:
- NDR_CHECK(ndr_push_lsa_TrustDomainInfo11(ndr, NDR_BUFFERS, &r->info11));
+ case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL:
+ NDR_CHECK(ndr_push_lsa_TrustDomainInfoAuthInfoInternal(ndr, NDR_BUFFERS, &r->auth_info_internal));
+ break;
+
+ case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL:
+ NDR_CHECK(ndr_push_lsa_TrustDomainInfoFullInfoInternal(ndr, NDR_BUFFERS, &r->full_info_internal));
+ break;
+
+ case LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL:
+ NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx2Internal(ndr, NDR_BUFFERS, &r->info_ex2_internal));
+ break;
+
+ case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL:
+ NDR_CHECK(ndr_push_lsa_TrustDomainInfoFullInfo2Internal(ndr, NDR_BUFFERS, &r->full_info2_internal));
break;
- case LSA_TRUSTED_DOMAIN_INFO_INFO_ALL:
- NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoAll(ndr, NDR_BUFFERS, &r->info_all));
+ case LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES:
break;
default:
@@ -3259,6 +3631,10 @@ static enum ndr_err_code ndr_pull_lsa_TrustedDomainInfo(struct ndr_pull *ndr, in
NDR_CHECK(ndr_pull_lsa_TrustDomainInfoName(ndr, NDR_SCALARS, &r->name));
break; }
+ case LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS: {
+ NDR_CHECK(ndr_pull_lsa_TrustDomainInfoControllers(ndr, NDR_SCALARS, &r->controllers));
+ break; }
+
case LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET: {
NDR_CHECK(ndr_pull_lsa_TrustDomainInfoPosixOffset(ndr, NDR_SCALARS, &r->posix_offset));
break; }
@@ -3283,12 +3659,24 @@ static enum ndr_err_code ndr_pull_lsa_TrustedDomainInfo(struct ndr_pull *ndr, in
NDR_CHECK(ndr_pull_lsa_TrustDomainInfoFullInfo(ndr, NDR_SCALARS, &r->full_info));
break; }
- case LSA_TRUSTED_DOMAIN_INFO_11: {
- NDR_CHECK(ndr_pull_lsa_TrustDomainInfo11(ndr, NDR_SCALARS, &r->info11));
+ case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL: {
+ NDR_CHECK(ndr_pull_lsa_TrustDomainInfoAuthInfoInternal(ndr, NDR_SCALARS, &r->auth_info_internal));
+ break; }
+
+ case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL: {
+ NDR_CHECK(ndr_pull_lsa_TrustDomainInfoFullInfoInternal(ndr, NDR_SCALARS, &r->full_info_internal));
break; }
- case LSA_TRUSTED_DOMAIN_INFO_INFO_ALL: {
- NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoAll(ndr, NDR_SCALARS, &r->info_all));
+ case LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL: {
+ NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx2Internal(ndr, NDR_SCALARS, &r->info_ex2_internal));
+ break; }
+
+ case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL: {
+ NDR_CHECK(ndr_pull_lsa_TrustDomainInfoFullInfo2Internal(ndr, NDR_SCALARS, &r->full_info2_internal));
+ break; }
+
+ case LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES: {
+ NDR_CHECK(ndr_pull_lsa_TrustDomainInfoSupportedEncTypes(ndr, NDR_SCALARS, &r->enc_types));
break; }
default:
@@ -3301,6 +3689,10 @@ static enum ndr_err_code ndr_pull_lsa_TrustedDomainInfo(struct ndr_pull *ndr, in
NDR_CHECK(ndr_pull_lsa_TrustDomainInfoName(ndr, NDR_BUFFERS, &r->name));
break;
+ case LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS:
+ NDR_CHECK(ndr_pull_lsa_TrustDomainInfoControllers(ndr, NDR_BUFFERS, &r->controllers));
+ break;
+
case LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET:
break;
@@ -3324,12 +3716,23 @@ static enum ndr_err_code ndr_pull_lsa_TrustedDomainInfo(struct ndr_pull *ndr, in
NDR_CHECK(ndr_pull_lsa_TrustDomainInfoFullInfo(ndr, NDR_BUFFERS, &r->full_info));
break;
- case LSA_TRUSTED_DOMAIN_INFO_11:
- NDR_CHECK(ndr_pull_lsa_TrustDomainInfo11(ndr, NDR_BUFFERS, &r->info11));
+ case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL:
+ NDR_CHECK(ndr_pull_lsa_TrustDomainInfoAuthInfoInternal(ndr, NDR_BUFFERS, &r->auth_info_internal));
+ break;
+
+ case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL:
+ NDR_CHECK(ndr_pull_lsa_TrustDomainInfoFullInfoInternal(ndr, NDR_BUFFERS, &r->full_info_internal));
break;
- case LSA_TRUSTED_DOMAIN_INFO_INFO_ALL:
- NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoAll(ndr, NDR_BUFFERS, &r->info_all));
+ case LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL:
+ NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx2Internal(ndr, NDR_BUFFERS, &r->info_ex2_internal));
+ break;
+
+ case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL:
+ NDR_CHECK(ndr_pull_lsa_TrustDomainInfoFullInfo2Internal(ndr, NDR_BUFFERS, &r->full_info2_internal));
+ break;
+
+ case LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES:
break;
default:
@@ -3349,6 +3752,10 @@ _PUBLIC_ void ndr_print_lsa_TrustedDomainInfo(struct ndr_print *ndr, const char
ndr_print_lsa_TrustDomainInfoName(ndr, "name", &r->name);
break;
+ case LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS:
+ ndr_print_lsa_TrustDomainInfoControllers(ndr, "controllers", &r->controllers);
+ break;
+
case LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET:
ndr_print_lsa_TrustDomainInfoPosixOffset(ndr, "posix_offset", &r->posix_offset);
break;
@@ -3373,12 +3780,24 @@ _PUBLIC_ void ndr_print_lsa_TrustedDomainInfo(struct ndr_print *ndr, const char
ndr_print_lsa_TrustDomainInfoFullInfo(ndr, "full_info", &r->full_info);
break;
- case LSA_TRUSTED_DOMAIN_INFO_11:
- ndr_print_lsa_TrustDomainInfo11(ndr, "info11", &r->info11);
+ case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL:
+ ndr_print_lsa_TrustDomainInfoAuthInfoInternal(ndr, "auth_info_internal", &r->auth_info_internal);
+ break;
+
+ case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL:
+ ndr_print_lsa_TrustDomainInfoFullInfoInternal(ndr, "full_info_internal", &r->full_info_internal);
break;
- case LSA_TRUSTED_DOMAIN_INFO_INFO_ALL:
- ndr_print_lsa_TrustDomainInfoInfoAll(ndr, "info_all", &r->info_all);
+ case LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL:
+ ndr_print_lsa_TrustDomainInfoInfoEx2Internal(ndr, "info_ex2_internal", &r->info_ex2_internal);
+ break;
+
+ case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL:
+ ndr_print_lsa_TrustDomainInfoFullInfo2Internal(ndr, "full_info2_internal", &r->full_info2_internal);
+ break;
+
+ case LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES:
+ ndr_print_lsa_TrustDomainInfoSupportedEncTypes(ndr, "enc_types", &r->enc_types);
break;
default:
@@ -4069,7 +4488,7 @@ static enum ndr_err_code ndr_push_lsa_TranslatedSid3(struct ndr_push *ndr, int n
NDR_CHECK(ndr_push_lsa_SidType(ndr, NDR_SCALARS, r->sid_type));
NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid));
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sid_index));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->flags));
}
if (ndr_flags & NDR_BUFFERS) {
if (r->sid) {
@@ -4093,7 +4512,7 @@ static enum ndr_err_code ndr_pull_lsa_TranslatedSid3(struct ndr_pull *ndr, int n
r->sid = NULL;
}
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sid_index));
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->flags));
}
if (ndr_flags & NDR_BUFFERS) {
if (r->sid) {
@@ -4118,7 +4537,7 @@ _PUBLIC_ void ndr_print_lsa_TranslatedSid3(struct ndr_print *ndr, const char *na
}
ndr->depth--;
ndr_print_uint32(ndr, "sid_index", r->sid_index);
- ndr_print_uint32(ndr, "unknown", r->unknown);
+ ndr_print_uint32(ndr, "flags", r->flags);
ndr->depth--;
}
@@ -7098,6 +7517,16 @@ _PUBLIC_ void ndr_print_lsa_QueryTrustedDomainInfo(struct ndr_print *ndr, const
static enum ndr_err_code ndr_push_lsa_SetInformationTrustedDomain(struct ndr_push *ndr, int flags, const struct lsa_SetInformationTrustedDomain *r)
{
if (flags & NDR_IN) {
+ if (r->in.trustdom_handle == NULL) {
+ return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+ }
+ NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.trustdom_handle));
+ NDR_CHECK(ndr_push_lsa_TrustDomInfoEnum(ndr, NDR_SCALARS, r->in.level));
+ if (r->in.info == NULL) {
+ return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+ }
+ NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.info, r->in.level));
+ NDR_CHECK(ndr_push_lsa_TrustedDomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info));
}
if (flags & NDR_OUT) {
NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
@@ -7107,7 +7536,25 @@ static enum ndr_err_code ndr_push_lsa_SetInformationTrustedDomain(struct ndr_pus
static enum ndr_err_code ndr_pull_lsa_SetInformationTrustedDomain(struct ndr_pull *ndr, int flags, struct lsa_SetInformationTrustedDomain *r)
{
+ TALLOC_CTX *_mem_save_trustdom_handle_0;
+ TALLOC_CTX *_mem_save_info_0;
if (flags & NDR_IN) {
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+ NDR_PULL_ALLOC(ndr, r->in.trustdom_handle);
+ }
+ _mem_save_trustdom_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->in.trustdom_handle, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.trustdom_handle));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trustdom_handle_0, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_lsa_TrustDomInfoEnum(ndr, NDR_SCALARS, &r->in.level));
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+ NDR_PULL_ALLOC(ndr, r->in.info);
+ }
+ _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info, r->in.level));
+ NDR_CHECK(ndr_pull_lsa_TrustedDomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC);
}
if (flags & NDR_OUT) {
NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
@@ -7125,6 +7572,16 @@ _PUBLIC_ void ndr_print_lsa_SetInformationTrustedDomain(struct ndr_print *ndr, c
if (flags & NDR_IN) {
ndr_print_struct(ndr, "in", "lsa_SetInformationTrustedDomain");
ndr->depth++;
+ ndr_print_ptr(ndr, "trustdom_handle", r->in.trustdom_handle);
+ ndr->depth++;
+ ndr_print_policy_handle(ndr, "trustdom_handle", r->in.trustdom_handle);
+ ndr->depth--;
+ ndr_print_lsa_TrustDomInfoEnum(ndr, "level", r->in.level);
+ ndr_print_ptr(ndr, "info", r->in.info);
+ ndr->depth++;
+ ndr_print_set_switch_value(ndr, r->in.info, r->in.level);
+ ndr_print_lsa_TrustedDomainInfo(ndr, "info", r->in.info);
+ ndr->depth--;
ndr->depth--;
}
if (flags & NDR_OUT) {
@@ -8486,6 +8943,20 @@ _PUBLIC_ void ndr_print_lsa_QueryTrustedDomainInfoBySid(struct ndr_print *ndr, c
static enum ndr_err_code ndr_push_lsa_SetTrustedDomainInfo(struct ndr_push *ndr, int flags, const struct lsa_SetTrustedDomainInfo *r)
{
if (flags & NDR_IN) {
+ if (r->in.handle == NULL) {
+ return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+ }
+ NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
+ if (r->in.dom_sid == NULL) {
+ return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+ }
+ NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.dom_sid));
+ NDR_CHECK(ndr_push_lsa_TrustDomInfoEnum(ndr, NDR_SCALARS, r->in.level));
+ if (r->in.info == NULL) {
+ return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+ }
+ NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.info, r->in.level));
+ NDR_CHECK(ndr_push_lsa_TrustedDomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info));
}
if (flags & NDR_OUT) {
NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
@@ -8495,7 +8966,33 @@ static enum ndr_err_code ndr_push_lsa_SetTrustedDomainInfo(struct ndr_push *ndr,
static enum ndr_err_code ndr_pull_lsa_SetTrustedDomainInfo(struct ndr_pull *ndr, int flags, struct lsa_SetTrustedDomainInfo *r)
{
+ TALLOC_CTX *_mem_save_handle_0;
+ TALLOC_CTX *_mem_save_dom_sid_0;
+ TALLOC_CTX *_mem_save_info_0;
if (flags & NDR_IN) {
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+ NDR_PULL_ALLOC(ndr, r->in.handle);
+ }
+ _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+ NDR_PULL_ALLOC(ndr, r->in.dom_sid);
+ }
+ _mem_save_dom_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->in.dom_sid, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.dom_sid));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dom_sid_0, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_lsa_TrustDomInfoEnum(ndr, NDR_SCALARS, &r->in.level));
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+ NDR_PULL_ALLOC(ndr, r->in.info);
+ }
+ _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info, r->in.level));
+ NDR_CHECK(ndr_pull_lsa_TrustedDomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC);
}
if (flags & NDR_OUT) {
NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
@@ -8513,6 +9010,20 @@ _PUBLIC_ void ndr_print_lsa_SetTrustedDomainInfo(struct ndr_print *ndr, const ch
if (flags & NDR_IN) {
ndr_print_struct(ndr, "in", "lsa_SetTrustedDomainInfo");
ndr->depth++;
+ ndr_print_ptr(ndr, "handle", r->in.handle);
+ ndr->depth++;
+ ndr_print_policy_handle(ndr, "handle", r->in.handle);
+ ndr->depth--;
+ ndr_print_ptr(ndr, "dom_sid", r->in.dom_sid);
+ ndr->depth++;
+ ndr_print_dom_sid2(ndr, "dom_sid", r->in.dom_sid);
+ ndr->depth--;
+ ndr_print_lsa_TrustDomInfoEnum(ndr, "level", r->in.level);
+ ndr_print_ptr(ndr, "info", r->in.info);
+ ndr->depth++;
+ ndr_print_set_switch_value(ndr, r->in.info, r->in.level);
+ ndr_print_lsa_TrustedDomainInfo(ndr, "info", r->in.info);
+ ndr->depth--;
ndr->depth--;
}
if (flags & NDR_OUT) {
@@ -9535,8 +10046,25 @@ _PUBLIC_ void ndr_print_lsa_EnumTrustedDomainsEx(struct ndr_print *ndr, const ch
static enum ndr_err_code ndr_push_lsa_CreateTrustedDomainEx(struct ndr_push *ndr, int flags, const struct lsa_CreateTrustedDomainEx *r)
{
if (flags & NDR_IN) {
+ if (r->in.policy_handle == NULL) {
+ return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+ }
+ NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.policy_handle));
+ if (r->in.info == NULL) {
+ return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+ }
+ NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info));
+ if (r->in.auth_info == NULL) {
+ return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+ }
+ NDR_CHECK(ndr_push_lsa_TrustDomainInfoAuthInfoInternal(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.auth_info));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.access_mask));
}
if (flags & NDR_OUT) {
+ if (r->out.trustdom_handle == NULL) {
+ return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+ }
+ NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.trustdom_handle));
NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
}
return NDR_ERR_SUCCESS;
@@ -9544,9 +10072,46 @@ static enum ndr_err_code ndr_push_lsa_CreateTrustedDomainEx(struct ndr_push *ndr
static enum ndr_err_code ndr_pull_lsa_CreateTrustedDomainEx(struct ndr_pull *ndr, int flags, struct lsa_CreateTrustedDomainEx *r)
{
+ TALLOC_CTX *_mem_save_policy_handle_0;
+ TALLOC_CTX *_mem_save_info_0;
+ TALLOC_CTX *_mem_save_auth_info_0;
+ TALLOC_CTX *_mem_save_trustdom_handle_0;
if (flags & NDR_IN) {
+ ZERO_STRUCT(r->out);
+
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+ NDR_PULL_ALLOC(ndr, r->in.policy_handle);
+ }
+ _mem_save_policy_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->in.policy_handle, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.policy_handle));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_policy_handle_0, LIBNDR_FLAG_REF_ALLOC);
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+ NDR_PULL_ALLOC(ndr, r->in.info);
+ }
+ _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC);
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+ NDR_PULL_ALLOC(ndr, r->in.auth_info);
+ }
+ _mem_save_auth_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->in.auth_info, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_lsa_TrustDomainInfoAuthInfoInternal(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.auth_info));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_auth_info_0, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.access_mask));
+ NDR_PULL_ALLOC(ndr, r->out.trustdom_handle);
+ ZERO_STRUCTP(r->out.trustdom_handle);
}
if (flags & NDR_OUT) {
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+ NDR_PULL_ALLOC(ndr, r->out.trustdom_handle);
+ }
+ _mem_save_trustdom_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->out.trustdom_handle, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.trustdom_handle));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trustdom_handle_0, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
}
return NDR_ERR_SUCCESS;
@@ -9562,11 +10127,28 @@ _PUBLIC_ void ndr_print_lsa_CreateTrustedDomainEx(struct ndr_print *ndr, const c
if (flags & NDR_IN) {
ndr_print_struct(ndr, "in", "lsa_CreateTrustedDomainEx");
ndr->depth++;
+ ndr_print_ptr(ndr, "policy_handle", r->in.policy_handle);
+ ndr->depth++;
+ ndr_print_policy_handle(ndr, "policy_handle", r->in.policy_handle);
+ ndr->depth--;
+ ndr_print_ptr(ndr, "info", r->in.info);
+ ndr->depth++;
+ ndr_print_lsa_TrustDomainInfoInfoEx(ndr, "info", r->in.info);
+ ndr->depth--;
+ ndr_print_ptr(ndr, "auth_info", r->in.auth_info);
+ ndr->depth++;
+ ndr_print_lsa_TrustDomainInfoAuthInfoInternal(ndr, "auth_info", r->in.auth_info);
+ ndr->depth--;
+ ndr_print_uint32(ndr, "access_mask", r->in.access_mask);
ndr->depth--;
}
if (flags & NDR_OUT) {
ndr_print_struct(ndr, "out", "lsa_CreateTrustedDomainEx");
ndr->depth++;
+ ndr_print_ptr(ndr, "trustdom_handle", r->out.trustdom_handle);
+ ndr->depth++;
+ ndr_print_policy_handle(ndr, "trustdom_handle", r->out.trustdom_handle);
+ ndr->depth--;
ndr_print_NTSTATUS(ndr, "result", r->out.result);
ndr->depth--;
}
@@ -10178,8 +10760,8 @@ _PUBLIC_ enum ndr_err_code ndr_push_lsa_LookupNames2(struct ndr_push *ndr, int f
return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
}
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.count));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown1));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown2));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.lookup_options));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.client_revision));
}
if (flags & NDR_OUT) {
if (r->out.domains == NULL) {
@@ -10252,8 +10834,8 @@ _PUBLIC_ enum ndr_err_code ndr_pull_lsa_LookupNames2(struct ndr_pull *ndr, int f
NDR_PULL_SET_MEM_CTX(ndr, r->in.count, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.count));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC);
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown1));
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown2));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.lookup_options));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.client_revision));
NDR_PULL_ALLOC(ndr, r->out.domains);
ZERO_STRUCTP(r->out.domains);
NDR_PULL_ALLOC(ndr, r->out.sids);
@@ -10337,8 +10919,8 @@ _PUBLIC_ void ndr_print_lsa_LookupNames2(struct ndr_print *ndr, const char *name
ndr->depth++;
ndr_print_uint32(ndr, "count", *r->in.count);
ndr->depth--;
- ndr_print_uint32(ndr, "unknown1", r->in.unknown1);
- ndr_print_uint32(ndr, "unknown2", r->in.unknown2);
+ ndr_print_uint32(ndr, "lookup_options", r->in.lookup_options);
+ ndr_print_uint32(ndr, "client_revision", r->in.client_revision);
ndr->depth--;
}
if (flags & NDR_OUT) {
@@ -10370,8 +10952,25 @@ _PUBLIC_ void ndr_print_lsa_LookupNames2(struct ndr_print *ndr, const char *name
static enum ndr_err_code ndr_push_lsa_CreateTrustedDomainEx2(struct ndr_push *ndr, int flags, const struct lsa_CreateTrustedDomainEx2 *r)
{
if (flags & NDR_IN) {
+ if (r->in.policy_handle == NULL) {
+ return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+ }
+ NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.policy_handle));
+ if (r->in.info == NULL) {
+ return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+ }
+ NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info));
+ if (r->in.auth_info == NULL) {
+ return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+ }
+ NDR_CHECK(ndr_push_lsa_TrustDomainInfoAuthInfoInternal(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.auth_info));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.access_mask));
}
if (flags & NDR_OUT) {
+ if (r->out.trustdom_handle == NULL) {
+ return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+ }
+ NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.trustdom_handle));
NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
}
return NDR_ERR_SUCCESS;
@@ -10379,9 +10978,46 @@ static enum ndr_err_code ndr_push_lsa_CreateTrustedDomainEx2(struct ndr_push *nd
static enum ndr_err_code ndr_pull_lsa_CreateTrustedDomainEx2(struct ndr_pull *ndr, int flags, struct lsa_CreateTrustedDomainEx2 *r)
{
+ TALLOC_CTX *_mem_save_policy_handle_0;
+ TALLOC_CTX *_mem_save_info_0;
+ TALLOC_CTX *_mem_save_auth_info_0;
+ TALLOC_CTX *_mem_save_trustdom_handle_0;
if (flags & NDR_IN) {
+ ZERO_STRUCT(r->out);
+
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+ NDR_PULL_ALLOC(ndr, r->in.policy_handle);
+ }
+ _mem_save_policy_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->in.policy_handle, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.policy_handle));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_policy_handle_0, LIBNDR_FLAG_REF_ALLOC);
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+ NDR_PULL_ALLOC(ndr, r->in.info);
+ }
+ _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_lsa_TrustDomainInfoInfoEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC);
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+ NDR_PULL_ALLOC(ndr, r->in.auth_info);
+ }
+ _mem_save_auth_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->in.auth_info, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_lsa_TrustDomainInfoAuthInfoInternal(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.auth_info));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_auth_info_0, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.access_mask));
+ NDR_PULL_ALLOC(ndr, r->out.trustdom_handle);
+ ZERO_STRUCTP(r->out.trustdom_handle);
}
if (flags & NDR_OUT) {
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+ NDR_PULL_ALLOC(ndr, r->out.trustdom_handle);
+ }
+ _mem_save_trustdom_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->out.trustdom_handle, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.trustdom_handle));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trustdom_handle_0, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
}
return NDR_ERR_SUCCESS;
@@ -10397,11 +11033,28 @@ _PUBLIC_ void ndr_print_lsa_CreateTrustedDomainEx2(struct ndr_print *ndr, const
if (flags & NDR_IN) {
ndr_print_struct(ndr, "in", "lsa_CreateTrustedDomainEx2");
ndr->depth++;
+ ndr_print_ptr(ndr, "policy_handle", r->in.policy_handle);
+ ndr->depth++;
+ ndr_print_policy_handle(ndr, "policy_handle", r->in.policy_handle);
+ ndr->depth--;
+ ndr_print_ptr(ndr, "info", r->in.info);
+ ndr->depth++;
+ ndr_print_lsa_TrustDomainInfoInfoEx(ndr, "info", r->in.info);
+ ndr->depth--;
+ ndr_print_ptr(ndr, "auth_info", r->in.auth_info);
+ ndr->depth++;
+ ndr_print_lsa_TrustDomainInfoAuthInfoInternal(ndr, "auth_info", r->in.auth_info);
+ ndr->depth--;
+ ndr_print_uint32(ndr, "access_mask", r->in.access_mask);
ndr->depth--;
}
if (flags & NDR_OUT) {
ndr_print_struct(ndr, "out", "lsa_CreateTrustedDomainEx2");
ndr->depth++;
+ ndr_print_ptr(ndr, "trustdom_handle", r->out.trustdom_handle);
+ ndr->depth++;
+ ndr_print_policy_handle(ndr, "trustdom_handle", r->out.trustdom_handle);
+ ndr->depth--;
ndr_print_NTSTATUS(ndr, "result", r->out.result);
ndr->depth--;
}
@@ -10761,8 +11414,8 @@ _PUBLIC_ enum ndr_err_code ndr_push_lsa_LookupNames3(struct ndr_push *ndr, int f
return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
}
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.count));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown1));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown2));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.lookup_options));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.client_revision));
}
if (flags & NDR_OUT) {
if (r->out.domains == NULL) {
@@ -10835,8 +11488,8 @@ _PUBLIC_ enum ndr_err_code ndr_pull_lsa_LookupNames3(struct ndr_pull *ndr, int f
NDR_PULL_SET_MEM_CTX(ndr, r->in.count, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.count));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC);
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown1));
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown2));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.lookup_options));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.client_revision));
NDR_PULL_ALLOC(ndr, r->out.domains);
ZERO_STRUCTP(r->out.domains);
NDR_PULL_ALLOC(ndr, r->out.sids);
@@ -10920,8 +11573,8 @@ _PUBLIC_ void ndr_print_lsa_LookupNames3(struct ndr_print *ndr, const char *name
ndr->depth++;
ndr_print_uint32(ndr, "count", *r->in.count);
ndr->depth--;
- ndr_print_uint32(ndr, "unknown1", r->in.unknown1);
- ndr_print_uint32(ndr, "unknown2", r->in.unknown2);
+ ndr_print_uint32(ndr, "lookup_options", r->in.lookup_options);
+ ndr_print_uint32(ndr, "client_revision", r->in.client_revision);
ndr->depth--;
}
if (flags & NDR_OUT) {
@@ -11507,8 +12160,8 @@ static enum ndr_err_code ndr_push_lsa_LookupNames4(struct ndr_push *ndr, int fla
return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
}
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.count));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown1));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown2));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.lookup_options));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.client_revision));
}
if (flags & NDR_OUT) {
if (r->out.domains == NULL) {
@@ -11573,8 +12226,8 @@ static enum ndr_err_code ndr_pull_lsa_LookupNames4(struct ndr_pull *ndr, int fla
NDR_PULL_SET_MEM_CTX(ndr, r->in.count, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.count));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC);
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown1));
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown2));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.lookup_options));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.client_revision));
NDR_PULL_ALLOC(ndr, r->out.domains);
ZERO_STRUCTP(r->out.domains);
NDR_PULL_ALLOC(ndr, r->out.sids);
@@ -11654,8 +12307,8 @@ _PUBLIC_ void ndr_print_lsa_LookupNames4(struct ndr_print *ndr, const char *name
ndr->depth++;
ndr_print_uint32(ndr, "count", *r->in.count);
ndr->depth--;
- ndr_print_uint32(ndr, "unknown1", r->in.unknown1);
- ndr_print_uint32(ndr, "unknown2", r->in.unknown2);
+ ndr_print_uint32(ndr, "lookup_options", r->in.lookup_options);
+ ndr_print_uint32(ndr, "client_revision", r->in.client_revision);
ndr->depth--;
}
if (flags & NDR_OUT) {
diff --git a/source3/librpc/gen_ndr/ndr_lsa.h b/source3/librpc/gen_ndr/ndr_lsa.h
index a489b5423e..61684d1789 100644
--- a/source3/librpc/gen_ndr/ndr_lsa.h
+++ b/source3/librpc/gen_ndr/ndr_lsa.h
@@ -233,16 +233,30 @@ void ndr_print_lsa_PrivilegeSet(struct ndr_print *ndr, const char *name, const s
void ndr_print_lsa_DATA_BUF(struct ndr_print *ndr, const char *name, const struct lsa_DATA_BUF *r);
void ndr_print_lsa_DATA_BUF2(struct ndr_print *ndr, const char *name, const struct lsa_DATA_BUF2 *r);
void ndr_print_lsa_TrustDomInfoEnum(struct ndr_print *ndr, const char *name, enum lsa_TrustDomInfoEnum r);
+enum ndr_err_code ndr_push_lsa_TrustDirection(struct ndr_push *ndr, int ndr_flags, uint32_t r);
+enum ndr_err_code ndr_pull_lsa_TrustDirection(struct ndr_pull *ndr, int ndr_flags, uint32_t *r);
+void ndr_print_lsa_TrustDirection(struct ndr_print *ndr, const char *name, uint32_t r);
+void ndr_print_lsa_TrustType(struct ndr_print *ndr, const char *name, enum lsa_TrustType r);
+enum ndr_err_code ndr_push_lsa_TrustAttributes(struct ndr_push *ndr, int ndr_flags, uint32_t r);
+enum ndr_err_code ndr_pull_lsa_TrustAttributes(struct ndr_pull *ndr, int ndr_flags, uint32_t *r);
+void ndr_print_lsa_TrustAttributes(struct ndr_print *ndr, const char *name, uint32_t r);
void ndr_print_lsa_TrustDomainInfoName(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoName *r);
+void ndr_print_lsa_TrustDomainInfoControllers(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoControllers *r);
void ndr_print_lsa_TrustDomainInfoPosixOffset(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoPosixOffset *r);
void ndr_print_lsa_TrustDomainInfoPassword(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoPassword *r);
void ndr_print_lsa_TrustDomainInfoBasic(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoBasic *r);
void ndr_print_lsa_TrustDomainInfoInfoEx(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoInfoEx *r);
+enum ndr_err_code ndr_push_lsa_TrustAuthType(struct ndr_push *ndr, int ndr_flags, enum lsa_TrustAuthType r);
+enum ndr_err_code ndr_pull_lsa_TrustAuthType(struct ndr_pull *ndr, int ndr_flags, enum lsa_TrustAuthType *r);
+void ndr_print_lsa_TrustAuthType(struct ndr_print *ndr, const char *name, enum lsa_TrustAuthType r);
void ndr_print_lsa_TrustDomainInfoBuffer(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoBuffer *r);
void ndr_print_lsa_TrustDomainInfoAuthInfo(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoAuthInfo *r);
void ndr_print_lsa_TrustDomainInfoFullInfo(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoFullInfo *r);
-void ndr_print_lsa_TrustDomainInfo11(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfo11 *r);
-void ndr_print_lsa_TrustDomainInfoInfoAll(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoInfoAll *r);
+void ndr_print_lsa_TrustDomainInfoAuthInfoInternal(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoAuthInfoInternal *r);
+void ndr_print_lsa_TrustDomainInfoFullInfoInternal(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoFullInfoInternal *r);
+void ndr_print_lsa_TrustDomainInfoInfoEx2Internal(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoInfoEx2Internal *r);
+void ndr_print_lsa_TrustDomainInfoFullInfo2Internal(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoFullInfo2Internal *r);
+void ndr_print_lsa_TrustDomainInfoSupportedEncTypes(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoSupportedEncTypes *r);
void ndr_print_lsa_TrustedDomainInfo(struct ndr_print *ndr, const char *name, const union lsa_TrustedDomainInfo *r);
void ndr_print_lsa_DATA_BUF_PTR(struct ndr_print *ndr, const char *name, const struct lsa_DATA_BUF_PTR *r);
void ndr_print_lsa_RightSet(struct ndr_print *ndr, const char *name, const struct lsa_RightSet *r);
diff --git a/source3/librpc/gen_ndr/ndr_misc.c b/source3/librpc/gen_ndr/ndr_misc.c
index 56105d499f..22c416a0d7 100644
--- a/source3/librpc/gen_ndr/ndr_misc.c
+++ b/source3/librpc/gen_ndr/ndr_misc.c
@@ -123,7 +123,9 @@ _PUBLIC_ void ndr_print_netr_SchannelType(struct ndr_print *ndr, const char *nam
const char *val = NULL;
switch (r) {
+ case SEC_CHAN_NULL: val = "SEC_CHAN_NULL"; break;
case SEC_CHAN_WKSTA: val = "SEC_CHAN_WKSTA"; break;
+ case SEC_CHAN_DNS_DOMAIN: val = "SEC_CHAN_DNS_DOMAIN"; break;
case SEC_CHAN_DOMAIN: val = "SEC_CHAN_DOMAIN"; break;
case SEC_CHAN_BDC: val = "SEC_CHAN_BDC"; break;
}
diff --git a/source3/librpc/gen_ndr/ndr_netlogon.c b/source3/librpc/gen_ndr/ndr_netlogon.c
index 0bd3d0fd16..169d35e326 100644
--- a/source3/librpc/gen_ndr/ndr_netlogon.c
+++ b/source3/librpc/gen_ndr/ndr_netlogon.c
@@ -538,32 +538,155 @@ _PUBLIC_ void ndr_print_netr_NetworkInfo(struct ndr_print *ndr, const char *name
}
}
-_PUBLIC_ enum ndr_err_code ndr_push_netr_LogonInfo(struct ndr_push *ndr, int ndr_flags, const union netr_LogonInfo *r)
+static enum ndr_err_code ndr_push_netr_GenericInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_GenericInfo *r)
+{
+ {
+ uint32_t _flags_save_STRUCT = ndr->flags;
+ ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_netr_IdentityInfo(ndr, NDR_SCALARS, &r->identity_info));
+ NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->package_name));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length));
+ NDR_CHECK(ndr_push_unique_ptr(ndr, r->data));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ NDR_CHECK(ndr_push_netr_IdentityInfo(ndr, NDR_BUFFERS, &r->identity_info));
+ NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->package_name));
+ if (r->data) {
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length));
+ NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->length));
+ }
+ }
+ ndr->flags = _flags_save_STRUCT;
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_netr_GenericInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_GenericInfo *r)
+{
+ uint32_t _ptr_data;
+ TALLOC_CTX *_mem_save_data_0;
+ {
+ uint32_t _flags_save_STRUCT = ndr->flags;
+ ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr, NDR_SCALARS, &r->identity_info));
+ NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->package_name));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length));
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data));
+ if (_ptr_data) {
+ NDR_PULL_ALLOC(ndr, r->data);
+ } else {
+ r->data = NULL;
+ }
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr, NDR_BUFFERS, &r->identity_info));
+ NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->package_name));
+ 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));
+ NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_size(ndr, &r->data)));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0);
+ }
+ if (r->data) {
+ NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->length));
+ }
+ }
+ ndr->flags = _flags_save_STRUCT;
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_netr_GenericInfo(struct ndr_print *ndr, const char *name, const struct netr_GenericInfo *r)
+{
+ ndr_print_struct(ndr, name, "netr_GenericInfo");
+ {
+ uint32_t _flags_save_STRUCT = ndr->flags;
+ ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
+ ndr->depth++;
+ ndr_print_netr_IdentityInfo(ndr, "identity_info", &r->identity_info);
+ ndr_print_lsa_String(ndr, "package_name", &r->package_name);
+ ndr_print_uint32(ndr, "length", r->length);
+ ndr_print_ptr(ndr, "data", r->data);
+ ndr->depth++;
+ if (r->data) {
+ ndr_print_array_uint8(ndr, "data", r->data, r->length);
+ }
+ ndr->depth--;
+ ndr->depth--;
+ ndr->flags = _flags_save_STRUCT;
+ }
+}
+
+static enum ndr_err_code ndr_push_netr_LogonInfoClass(struct ndr_push *ndr, int ndr_flags, enum netr_LogonInfoClass r)
+{
+ NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r));
+ return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_netr_LogonInfoClass(struct ndr_pull *ndr, int ndr_flags, enum netr_LogonInfoClass *r)
+{
+ uint16_t v;
+ NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v));
+ *r = v;
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_netr_LogonInfoClass(struct ndr_print *ndr, const char *name, enum netr_LogonInfoClass r)
+{
+ const char *val = NULL;
+
+ switch (r) {
+ case NetlogonInteractiveInformation: val = "NetlogonInteractiveInformation"; break;
+ case NetlogonNetworkInformation: val = "NetlogonNetworkInformation"; break;
+ case NetlogonServiceInformation: val = "NetlogonServiceInformation"; break;
+ case NetlogonGenericInformation: val = "NetlogonGenericInformation"; break;
+ case NetlogonInteractiveTransitiveInformation: val = "NetlogonInteractiveTransitiveInformation"; break;
+ case NetlogonNetworkTransitiveInformation: val = "NetlogonNetworkTransitiveInformation"; break;
+ case NetlogonServiceTransitiveInformation: val = "NetlogonServiceTransitiveInformation"; break;
+ }
+ ndr_print_enum(ndr, name, "ENUM", val, r);
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_netr_LogonLevel(struct ndr_push *ndr, int ndr_flags, const union netr_LogonLevel *r)
{
if (ndr_flags & NDR_SCALARS) {
int level = ndr_push_get_switch_value(ndr, r);
- NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level));
+ NDR_CHECK(ndr_push_netr_LogonInfoClass(ndr, NDR_SCALARS, level));
switch (level) {
- case 1: {
+ case NetlogonInteractiveInformation: {
NDR_CHECK(ndr_push_unique_ptr(ndr, r->password));
break; }
- case 2: {
+ case NetlogonNetworkInformation: {
NDR_CHECK(ndr_push_unique_ptr(ndr, r->network));
break; }
- case 3: {
+ case NetlogonServiceInformation: {
NDR_CHECK(ndr_push_unique_ptr(ndr, r->password));
break; }
- case 5: {
+ case NetlogonGenericInformation: {
+ NDR_CHECK(ndr_push_unique_ptr(ndr, r->generic));
+ break; }
+
+ case NetlogonInteractiveTransitiveInformation: {
NDR_CHECK(ndr_push_unique_ptr(ndr, r->password));
break; }
- case 6: {
+ case NetlogonNetworkTransitiveInformation: {
NDR_CHECK(ndr_push_unique_ptr(ndr, r->network));
break; }
+ case NetlogonServiceTransitiveInformation: {
+ NDR_CHECK(ndr_push_unique_ptr(ndr, r->password));
+ break; }
+
default:
return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
}
@@ -571,36 +694,48 @@ _PUBLIC_ enum ndr_err_code ndr_push_netr_LogonInfo(struct ndr_push *ndr, int ndr
if (ndr_flags & NDR_BUFFERS) {
int level = ndr_push_get_switch_value(ndr, r);
switch (level) {
- case 1:
+ case NetlogonInteractiveInformation:
if (r->password) {
NDR_CHECK(ndr_push_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password));
}
break;
- case 2:
+ case NetlogonNetworkInformation:
if (r->network) {
NDR_CHECK(ndr_push_netr_NetworkInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->network));
}
break;
- case 3:
+ case NetlogonServiceInformation:
if (r->password) {
NDR_CHECK(ndr_push_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password));
}
break;
- case 5:
+ case NetlogonGenericInformation:
+ if (r->generic) {
+ NDR_CHECK(ndr_push_netr_GenericInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->generic));
+ }
+ break;
+
+ case NetlogonInteractiveTransitiveInformation:
if (r->password) {
NDR_CHECK(ndr_push_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password));
}
break;
- case 6:
+ case NetlogonNetworkTransitiveInformation:
if (r->network) {
NDR_CHECK(ndr_push_netr_NetworkInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->network));
}
break;
+ case NetlogonServiceTransitiveInformation:
+ if (r->password) {
+ NDR_CHECK(ndr_push_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password));
+ }
+ break;
+
default:
return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
}
@@ -608,12 +743,13 @@ _PUBLIC_ enum ndr_err_code ndr_push_netr_LogonInfo(struct ndr_push *ndr, int ndr
return NDR_ERR_SUCCESS;
}
-_PUBLIC_ enum ndr_err_code ndr_pull_netr_LogonInfo(struct ndr_pull *ndr, int ndr_flags, union netr_LogonInfo *r)
+_PUBLIC_ enum ndr_err_code ndr_pull_netr_LogonLevel(struct ndr_pull *ndr, int ndr_flags, union netr_LogonLevel *r)
{
int level;
uint16_t _level;
TALLOC_CTX *_mem_save_password_0;
TALLOC_CTX *_mem_save_network_0;
+ TALLOC_CTX *_mem_save_generic_0;
level = ndr_pull_get_switch_value(ndr, r);
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level));
@@ -621,7 +757,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_netr_LogonInfo(struct ndr_pull *ndr, int ndr
return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
}
switch (level) {
- case 1: {
+ case NetlogonInteractiveInformation: {
uint32_t _ptr_password;
NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password));
if (_ptr_password) {
@@ -631,7 +767,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_netr_LogonInfo(struct ndr_pull *ndr, int ndr
}
break; }
- case 2: {
+ case NetlogonNetworkInformation: {
uint32_t _ptr_network;
NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_network));
if (_ptr_network) {
@@ -641,7 +777,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_netr_LogonInfo(struct ndr_pull *ndr, int ndr
}
break; }
- case 3: {
+ case NetlogonServiceInformation: {
uint32_t _ptr_password;
NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password));
if (_ptr_password) {
@@ -651,7 +787,17 @@ _PUBLIC_ enum ndr_err_code ndr_pull_netr_LogonInfo(struct ndr_pull *ndr, int ndr
}
break; }
- case 5: {
+ case NetlogonGenericInformation: {
+ uint32_t _ptr_generic;
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_generic));
+ if (_ptr_generic) {
+ NDR_PULL_ALLOC(ndr, r->generic);
+ } else {
+ r->generic = NULL;
+ }
+ break; }
+
+ case NetlogonInteractiveTransitiveInformation: {
uint32_t _ptr_password;
NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password));
if (_ptr_password) {
@@ -661,7 +807,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_netr_LogonInfo(struct ndr_pull *ndr, int ndr
}
break; }
- case 6: {
+ case NetlogonNetworkTransitiveInformation: {
uint32_t _ptr_network;
NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_network));
if (_ptr_network) {
@@ -671,13 +817,23 @@ _PUBLIC_ enum ndr_err_code ndr_pull_netr_LogonInfo(struct ndr_pull *ndr, int ndr
}
break; }
+ case NetlogonServiceTransitiveInformation: {
+ uint32_t _ptr_password;
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password));
+ if (_ptr_password) {
+ NDR_PULL_ALLOC(ndr, r->password);
+ } else {
+ r->password = NULL;
+ }
+ break; }
+
default:
return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
}
}
if (ndr_flags & NDR_BUFFERS) {
switch (level) {
- case 1:
+ case NetlogonInteractiveInformation:
if (r->password) {
_mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr);
NDR_PULL_SET_MEM_CTX(ndr, r->password, 0);
@@ -686,7 +842,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_netr_LogonInfo(struct ndr_pull *ndr, int ndr
}
break;
- case 2:
+ case NetlogonNetworkInformation:
if (r->network) {
_mem_save_network_0 = NDR_PULL_GET_MEM_CTX(ndr);
NDR_PULL_SET_MEM_CTX(ndr, r->network, 0);
@@ -695,7 +851,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_netr_LogonInfo(struct ndr_pull *ndr, int ndr
}
break;
- case 3:
+ case NetlogonServiceInformation:
if (r->password) {
_mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr);
NDR_PULL_SET_MEM_CTX(ndr, r->password, 0);
@@ -704,7 +860,16 @@ _PUBLIC_ enum ndr_err_code ndr_pull_netr_LogonInfo(struct ndr_pull *ndr, int ndr
}
break;
- case 5:
+ case NetlogonGenericInformation:
+ if (r->generic) {
+ _mem_save_generic_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->generic, 0);
+ NDR_CHECK(ndr_pull_netr_GenericInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->generic));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_generic_0, 0);
+ }
+ break;
+
+ case NetlogonInteractiveTransitiveInformation:
if (r->password) {
_mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr);
NDR_PULL_SET_MEM_CTX(ndr, r->password, 0);
@@ -713,7 +878,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_netr_LogonInfo(struct ndr_pull *ndr, int ndr
}
break;
- case 6:
+ case NetlogonNetworkTransitiveInformation:
if (r->network) {
_mem_save_network_0 = NDR_PULL_GET_MEM_CTX(ndr);
NDR_PULL_SET_MEM_CTX(ndr, r->network, 0);
@@ -722,6 +887,15 @@ _PUBLIC_ enum ndr_err_code ndr_pull_netr_LogonInfo(struct ndr_pull *ndr, int ndr
}
break;
+ case NetlogonServiceTransitiveInformation:
+ if (r->password) {
+ _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->password, 0);
+ NDR_CHECK(ndr_pull_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0);
+ }
+ break;
+
default:
return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
}
@@ -729,13 +903,13 @@ _PUBLIC_ enum ndr_err_code ndr_pull_netr_LogonInfo(struct ndr_pull *ndr, int ndr
return NDR_ERR_SUCCESS;
}
-_PUBLIC_ void ndr_print_netr_LogonInfo(struct ndr_print *ndr, const char *name, const union netr_LogonInfo *r)
+_PUBLIC_ void ndr_print_netr_LogonLevel(struct ndr_print *ndr, const char *name, const union netr_LogonLevel *r)
{
int level;
level = ndr_print_get_switch_value(ndr, r);
- ndr_print_union(ndr, name, level, "netr_LogonInfo");
+ ndr_print_union(ndr, name, level, "netr_LogonLevel");
switch (level) {
- case 1:
+ case NetlogonInteractiveInformation:
ndr_print_ptr(ndr, "password", r->password);
ndr->depth++;
if (r->password) {
@@ -744,7 +918,7 @@ _PUBLIC_ void ndr_print_netr_LogonInfo(struct ndr_print *ndr, const char *name,
ndr->depth--;
break;
- case 2:
+ case NetlogonNetworkInformation:
ndr_print_ptr(ndr, "network", r->network);
ndr->depth++;
if (r->network) {
@@ -753,7 +927,7 @@ _PUBLIC_ void ndr_print_netr_LogonInfo(struct ndr_print *ndr, const char *name,
ndr->depth--;
break;
- case 3:
+ case NetlogonServiceInformation:
ndr_print_ptr(ndr, "password", r->password);
ndr->depth++;
if (r->password) {
@@ -762,7 +936,16 @@ _PUBLIC_ void ndr_print_netr_LogonInfo(struct ndr_print *ndr, const char *name,
ndr->depth--;
break;
- case 5:
+ case NetlogonGenericInformation:
+ ndr_print_ptr(ndr, "generic", r->generic);
+ ndr->depth++;
+ if (r->generic) {
+ ndr_print_netr_GenericInfo(ndr, "generic", r->generic);
+ }
+ ndr->depth--;
+ break;
+
+ case NetlogonInteractiveTransitiveInformation:
ndr_print_ptr(ndr, "password", r->password);
ndr->depth++;
if (r->password) {
@@ -771,7 +954,7 @@ _PUBLIC_ void ndr_print_netr_LogonInfo(struct ndr_print *ndr, const char *name,
ndr->depth--;
break;
- case 6:
+ case NetlogonNetworkTransitiveInformation:
ndr_print_ptr(ndr, "network", r->network);
ndr->depth++;
if (r->network) {
@@ -780,6 +963,15 @@ _PUBLIC_ void ndr_print_netr_LogonInfo(struct ndr_print *ndr, const char *name,
ndr->depth--;
break;
+ case NetlogonServiceTransitiveInformation:
+ ndr_print_ptr(ndr, "password", r->password);
+ ndr->depth++;
+ if (r->password) {
+ ndr_print_netr_PasswordInfo(ndr, "password", r->password);
+ }
+ ndr->depth--;
+ break;
+
default:
ndr_print_bad_level(ndr, name, level);
}
@@ -1511,17 +1703,92 @@ _PUBLIC_ void ndr_print_netr_PacInfo(struct ndr_print *ndr, const char *name, co
ndr->depth--;
}
+static enum ndr_err_code ndr_push_netr_GenericInfo2(struct ndr_push *ndr, int ndr_flags, const struct netr_GenericInfo2 *r)
+{
+ {
+ uint32_t _flags_save_STRUCT = ndr->flags;
+ ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length));
+ NDR_CHECK(ndr_push_unique_ptr(ndr, r->data));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ if (r->data) {
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length));
+ NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->length));
+ }
+ }
+ ndr->flags = _flags_save_STRUCT;
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_netr_GenericInfo2(struct ndr_pull *ndr, int ndr_flags, struct netr_GenericInfo2 *r)
+{
+ uint32_t _ptr_data;
+ TALLOC_CTX *_mem_save_data_0;
+ {
+ uint32_t _flags_save_STRUCT = ndr->flags;
+ ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length));
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data));
+ if (_ptr_data) {
+ NDR_PULL_ALLOC(ndr, r->data);
+ } else {
+ r->data = 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));
+ NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_size(ndr, &r->data)));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0);
+ }
+ if (r->data) {
+ NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->length));
+ }
+ }
+ ndr->flags = _flags_save_STRUCT;
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_netr_GenericInfo2(struct ndr_print *ndr, const char *name, const struct netr_GenericInfo2 *r)
+{
+ ndr_print_struct(ndr, name, "netr_GenericInfo2");
+ {
+ uint32_t _flags_save_STRUCT = ndr->flags;
+ ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
+ ndr->depth++;
+ ndr_print_uint32(ndr, "length", r->length);
+ ndr_print_ptr(ndr, "data", r->data);
+ ndr->depth++;
+ if (r->data) {
+ ndr_print_array_uint8(ndr, "data", r->data, r->length);
+ }
+ ndr->depth--;
+ ndr->depth--;
+ ndr->flags = _flags_save_STRUCT;
+ }
+}
+
_PUBLIC_ enum ndr_err_code ndr_push_netr_Validation(struct ndr_push *ndr, int ndr_flags, const union netr_Validation *r)
{
if (ndr_flags & NDR_SCALARS) {
int level = ndr_push_get_switch_value(ndr, r);
NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level));
switch (level) {
- case 2: {
+ case NetlogonValidationSamInfo: {
NDR_CHECK(ndr_push_unique_ptr(ndr, r->sam2));
break; }
- case 3: {
+ case NetlogonValidationSamInfo2: {
NDR_CHECK(ndr_push_unique_ptr(ndr, r->sam3));
break; }
@@ -1529,11 +1796,11 @@ _PUBLIC_ enum ndr_err_code ndr_push_netr_Validation(struct ndr_push *ndr, int nd
NDR_CHECK(ndr_push_unique_ptr(ndr, r->pac));
break; }
- case 5: {
- NDR_CHECK(ndr_push_unique_ptr(ndr, r->pac));
+ case NetlogonValidationGenericInfo2: {
+ NDR_CHECK(ndr_push_unique_ptr(ndr, r->generic));
break; }
- case 6: {
+ case NetlogonValidationSamInfo4: {
NDR_CHECK(ndr_push_unique_ptr(ndr, r->sam6));
break; }
@@ -1544,13 +1811,13 @@ _PUBLIC_ enum ndr_err_code ndr_push_netr_Validation(struct ndr_push *ndr, int nd
if (ndr_flags & NDR_BUFFERS) {
int level = ndr_push_get_switch_value(ndr, r);
switch (level) {
- case 2:
+ case NetlogonValidationSamInfo:
if (r->sam2) {
NDR_CHECK(ndr_push_netr_SamInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam2));
}
break;
- case 3:
+ case NetlogonValidationSamInfo2:
if (r->sam3) {
NDR_CHECK(ndr_push_netr_SamInfo3(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam3));
}
@@ -1562,13 +1829,13 @@ _PUBLIC_ enum ndr_err_code ndr_push_netr_Validation(struct ndr_push *ndr, int nd
}
break;
- case 5:
- if (r->pac) {
- NDR_CHECK(ndr_push_netr_PacInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->pac));
+ case NetlogonValidationGenericInfo2:
+ if (r->generic) {
+ NDR_CHECK(ndr_push_netr_GenericInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->generic));
}
break;
- case 6:
+ case NetlogonValidationSamInfo4:
if (r->sam6) {
NDR_CHECK(ndr_push_netr_SamInfo6(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam6));
}
@@ -1588,6 +1855,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_netr_Validation(struct ndr_pull *ndr, int nd
TALLOC_CTX *_mem_save_sam2_0;
TALLOC_CTX *_mem_save_sam3_0;
TALLOC_CTX *_mem_save_pac_0;
+ TALLOC_CTX *_mem_save_generic_0;
TALLOC_CTX *_mem_save_sam6_0;
level = ndr_pull_get_switch_value(ndr, r);
if (ndr_flags & NDR_SCALARS) {
@@ -1596,7 +1864,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_netr_Validation(struct ndr_pull *ndr, int nd
return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
}
switch (level) {
- case 2: {
+ case NetlogonValidationSamInfo: {
uint32_t _ptr_sam2;
NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sam2));
if (_ptr_sam2) {
@@ -1606,7 +1874,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_netr_Validation(struct ndr_pull *ndr, int nd
}
break; }
- case 3: {
+ case NetlogonValidationSamInfo2: {
uint32_t _ptr_sam3;
NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sam3));
if (_ptr_sam3) {
@@ -1626,17 +1894,17 @@ _PUBLIC_ enum ndr_err_code ndr_pull_netr_Validation(struct ndr_pull *ndr, int nd
}
break; }
- case 5: {
- uint32_t _ptr_pac;
- NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pac));
- if (_ptr_pac) {
- NDR_PULL_ALLOC(ndr, r->pac);
+ case NetlogonValidationGenericInfo2: {
+ uint32_t _ptr_generic;
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_generic));
+ if (_ptr_generic) {
+ NDR_PULL_ALLOC(ndr, r->generic);
} else {
- r->pac = NULL;
+ r->generic = NULL;
}
break; }
- case 6: {
+ case NetlogonValidationSamInfo4: {
uint32_t _ptr_sam6;
NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sam6));
if (_ptr_sam6) {
@@ -1652,7 +1920,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_netr_Validation(struct ndr_pull *ndr, int nd
}
if (ndr_flags & NDR_BUFFERS) {
switch (level) {
- case 2:
+ case NetlogonValidationSamInfo:
if (r->sam2) {
_mem_save_sam2_0 = NDR_PULL_GET_MEM_CTX(ndr);
NDR_PULL_SET_MEM_CTX(ndr, r->sam2, 0);
@@ -1661,7 +1929,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_netr_Validation(struct ndr_pull *ndr, int nd
}
break;
- case 3:
+ case NetlogonValidationSamInfo2:
if (r->sam3) {
_mem_save_sam3_0 = NDR_PULL_GET_MEM_CTX(ndr);
NDR_PULL_SET_MEM_CTX(ndr, r->sam3, 0);
@@ -1679,16 +1947,16 @@ _PUBLIC_ enum ndr_err_code ndr_pull_netr_Validation(struct ndr_pull *ndr, int nd
}
break;
- case 5:
- if (r->pac) {
- _mem_save_pac_0 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, r->pac, 0);
- NDR_CHECK(ndr_pull_netr_PacInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->pac));
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pac_0, 0);
+ case NetlogonValidationGenericInfo2:
+ if (r->generic) {
+ _mem_save_generic_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->generic, 0);
+ NDR_CHECK(ndr_pull_netr_GenericInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->generic));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_generic_0, 0);
}
break;
- case 6:
+ case NetlogonValidationSamInfo4:
if (r->sam6) {
_mem_save_sam6_0 = NDR_PULL_GET_MEM_CTX(ndr);
NDR_PULL_SET_MEM_CTX(ndr, r->sam6, 0);
@@ -1710,7 +1978,7 @@ _PUBLIC_ void ndr_print_netr_Validation(struct ndr_print *ndr, const char *name,
level = ndr_print_get_switch_value(ndr, r);
ndr_print_union(ndr, name, level, "netr_Validation");
switch (level) {
- case 2:
+ case NetlogonValidationSamInfo:
ndr_print_ptr(ndr, "sam2", r->sam2);
ndr->depth++;
if (r->sam2) {
@@ -1719,7 +1987,7 @@ _PUBLIC_ void ndr_print_netr_Validation(struct ndr_print *ndr, const char *name,
ndr->depth--;
break;
- case 3:
+ case NetlogonValidationSamInfo2:
ndr_print_ptr(ndr, "sam3", r->sam3);
ndr->depth++;
if (r->sam3) {
@@ -1737,16 +2005,16 @@ _PUBLIC_ void ndr_print_netr_Validation(struct ndr_print *ndr, const char *name,
ndr->depth--;
break;
- case 5:
- ndr_print_ptr(ndr, "pac", r->pac);
+ case NetlogonValidationGenericInfo2:
+ ndr_print_ptr(ndr, "generic", r->generic);
ndr->depth++;
- if (r->pac) {
- ndr_print_netr_PacInfo(ndr, "pac", r->pac);
+ if (r->generic) {
+ ndr_print_netr_GenericInfo2(ndr, "generic", r->generic);
}
ndr->depth--;
break;
- case 6:
+ case NetlogonValidationSamInfo4:
ndr_print_ptr(ndr, "sam6", r->sam6);
ndr->depth++;
if (r->sam6) {
@@ -1838,31 +2106,6 @@ _PUBLIC_ void ndr_print_netr_Authenticator(struct ndr_print *ndr, const char *na
ndr->depth--;
}
-static enum ndr_err_code ndr_push_netr_LogonLevel(struct ndr_push *ndr, int ndr_flags, enum netr_LogonLevel r)
-{
- NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r));
- return NDR_ERR_SUCCESS;
-}
-
-static enum ndr_err_code ndr_pull_netr_LogonLevel(struct ndr_pull *ndr, int ndr_flags, enum netr_LogonLevel *r)
-{
- uint16_t v;
- NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v));
- *r = v;
- return NDR_ERR_SUCCESS;
-}
-
-_PUBLIC_ void ndr_print_netr_LogonLevel(struct ndr_print *ndr, const char *name, enum netr_LogonLevel r)
-{
- const char *val = NULL;
-
- switch (r) {
- case INTERACTIVE_LOGON_TYPE: val = "INTERACTIVE_LOGON_TYPE"; break;
- case NET_LOGON_TYPE: val = "NET_LOGON_TYPE"; break;
- }
- ndr_print_enum(ndr, name, "ENUM", val, r);
-}
-
static enum ndr_err_code ndr_push_netr_DELTA_DELETE_USER(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_DELETE_USER *r)
{
if (ndr_flags & NDR_SCALARS) {
@@ -2404,7 +2647,7 @@ static enum ndr_err_code ndr_push_netr_DELTA_DOMAIN(struct ndr_push *ndr, int nd
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_push_align(ndr, 4));
NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->domain_name));
- NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->comment));
+ NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->oem_information));
NDR_CHECK(ndr_push_dlong(ndr, NDR_SCALARS, r->force_logoff_time));
NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->min_password_length));
NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->password_history_length));
@@ -2425,7 +2668,7 @@ static enum ndr_err_code ndr_push_netr_DELTA_DOMAIN(struct ndr_push *ndr, int nd
}
if (ndr_flags & NDR_BUFFERS) {
NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->domain_name));
- NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->comment));
+ NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->oem_information));
NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_BUFFERS, &r->account_lockout));
NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
@@ -2440,7 +2683,7 @@ static enum ndr_err_code ndr_pull_netr_DELTA_DOMAIN(struct ndr_pull *ndr, int nd
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_pull_align(ndr, 4));
NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->domain_name));
- NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->comment));
+ NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->oem_information));
NDR_CHECK(ndr_pull_dlong(ndr, NDR_SCALARS, &r->force_logoff_time));
NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->min_password_length));
NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->password_history_length));
@@ -2461,7 +2704,7 @@ static enum ndr_err_code ndr_pull_netr_DELTA_DOMAIN(struct ndr_pull *ndr, int nd
}
if (ndr_flags & NDR_BUFFERS) {
NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->domain_name));
- NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->comment));
+ NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->oem_information));
NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_BUFFERS, &r->account_lockout));
NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
@@ -2476,7 +2719,7 @@ _PUBLIC_ void ndr_print_netr_DELTA_DOMAIN(struct ndr_print *ndr, const char *nam
ndr_print_struct(ndr, name, "netr_DELTA_DOMAIN");
ndr->depth++;
ndr_print_lsa_String(ndr, "domain_name", &r->domain_name);
- ndr_print_lsa_String(ndr, "comment", &r->comment);
+ ndr_print_lsa_String(ndr, "oem_information", &r->oem_information);
ndr_print_dlong(ndr, "force_logoff_time", r->force_logoff_time);
ndr_print_uint16(ndr, "min_password_length", r->min_password_length);
ndr_print_uint16(ndr, "password_history_length", r->password_history_length);
@@ -6366,6 +6609,35 @@ _PUBLIC_ void ndr_print_netr_DsRGetDCNameInfo(struct ndr_print *ndr, const char
ndr->depth--;
}
+static enum ndr_err_code ndr_push_netr_TrustFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
+{
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
+ return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_netr_TrustFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
+{
+ uint32_t v;
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
+ *r = v;
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_netr_TrustFlags(struct ndr_print *ndr, const char *name, uint32_t r)
+{
+ ndr_print_uint32(ndr, name, r);
+ ndr->depth++;
+ ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_IN_FOREST", NETR_TRUST_FLAG_IN_FOREST, r);
+ ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_OUTBOUND", NETR_TRUST_FLAG_OUTBOUND, r);
+ ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_TREEROOT", NETR_TRUST_FLAG_TREEROOT, r);
+ ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_PRIMARY", NETR_TRUST_FLAG_PRIMARY, r);
+ ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_NATIVE", NETR_TRUST_FLAG_NATIVE, r);
+ ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_INBOUND", NETR_TRUST_FLAG_INBOUND, r);
+ ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_MIT_KRB5", NETR_TRUST_FLAG_MIT_KRB5, r);
+ ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_AES", NETR_TRUST_FLAG_AES, r);
+ ndr->depth--;
+}
+
static enum ndr_err_code ndr_push_netr_BinaryString(struct ndr_push *ndr, int ndr_flags, const struct netr_BinaryString *r)
{
uint32_t cntr_data_1;
@@ -6874,10 +7146,115 @@ _PUBLIC_ void ndr_print_netr_DomainQuery(struct ndr_print *ndr, const char *name
}
}
+static enum ndr_err_code ndr_push_netr_trust_extension(struct ndr_push *ndr, int ndr_flags, const struct netr_trust_extension *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 8));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 8));
+ NDR_CHECK(ndr_push_netr_TrustFlags(ndr, NDR_SCALARS, r->flags));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->parent_index));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->trust_type));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->trust_attributes));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_netr_trust_extension(struct ndr_pull *ndr, int ndr_flags, struct netr_trust_extension *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dummy));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size));
+ NDR_CHECK(ndr_pull_netr_TrustFlags(ndr, NDR_SCALARS, &r->flags));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->parent_index));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->trust_type));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->trust_attributes));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_netr_trust_extension(struct ndr_print *ndr, const char *name, const struct netr_trust_extension *r)
+{
+ ndr_print_struct(ndr, name, "netr_trust_extension");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?8:r->length);
+ ndr_print_uint32(ndr, "dummy", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->dummy);
+ ndr_print_uint32(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?8:r->size);
+ ndr_print_netr_TrustFlags(ndr, "flags", r->flags);
+ ndr_print_uint32(ndr, "parent_index", r->parent_index);
+ ndr_print_uint32(ndr, "trust_type", r->trust_type);
+ ndr_print_uint32(ndr, "trust_attributes", r->trust_attributes);
+ ndr->depth--;
+}
+
+static enum ndr_err_code ndr_push_netr_trust_extension_container(struct ndr_push *ndr, int ndr_flags, const struct netr_trust_extension_container *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length));
+ NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length));
+ NDR_CHECK(ndr_push_unique_ptr(ndr, r->info));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ if (r->info) {
+ NDR_CHECK(ndr_push_netr_trust_extension(ndr, NDR_SCALARS, r->info));
+ }
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_netr_trust_extension_container(struct ndr_pull *ndr, int ndr_flags, struct netr_trust_extension_container *r)
+{
+ uint32_t _ptr_info;
+ TALLOC_CTX *_mem_save_info_0;
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length));
+ NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size));
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
+ if (_ptr_info) {
+ NDR_PULL_ALLOC(ndr, r->info);
+ } else {
+ r->info = NULL;
+ }
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ if (r->info) {
+ _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->info, 0);
+ NDR_CHECK(ndr_pull_netr_trust_extension(ndr, NDR_SCALARS, r->info));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0);
+ }
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_netr_trust_extension_container(struct ndr_print *ndr, const char *name, const struct netr_trust_extension_container *r)
+{
+ ndr_print_struct(ndr, name, "netr_trust_extension_container");
+ ndr->depth++;
+ ndr_print_uint16(ndr, "length", r->length);
+ ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->length:r->size);
+ ndr_print_ptr(ndr, "info", r->info);
+ ndr->depth++;
+ if (r->info) {
+ ndr_print_netr_trust_extension(ndr, "info", r->info);
+ }
+ ndr->depth--;
+ ndr->depth--;
+}
+
static enum ndr_err_code ndr_push_netr_DomainTrustInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_DomainTrustInfo *r)
{
- uint32_t cntr_unknown1_0;
- uint32_t cntr_unknown_0;
+ uint32_t cntr_dummystring_0;
+ uint32_t cntr_dummy_0;
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_push_align(ndr, 4));
NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->domainname));
@@ -6885,11 +7262,12 @@ static enum ndr_err_code ndr_push_netr_DomainTrustInfo(struct ndr_push *ndr, int
NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->forest));
NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid));
NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid));
- for (cntr_unknown1_0 = 0; cntr_unknown1_0 < 4; cntr_unknown1_0++) {
- NDR_CHECK(ndr_push_netr_BinaryString(ndr, NDR_SCALARS, &r->unknown1[cntr_unknown1_0]));
+ NDR_CHECK(ndr_push_netr_trust_extension_container(ndr, NDR_SCALARS, &r->trust_extension));
+ for (cntr_dummystring_0 = 0; cntr_dummystring_0 < 3; cntr_dummystring_0++) {
+ NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->dummystring[cntr_dummystring_0]));
}
- for (cntr_unknown_0 = 0; cntr_unknown_0 < 4; cntr_unknown_0++) {
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown[cntr_unknown_0]));
+ for (cntr_dummy_0 = 0; cntr_dummy_0 < 4; cntr_dummy_0++) {
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dummy[cntr_dummy_0]));
}
}
if (ndr_flags & NDR_BUFFERS) {
@@ -6899,8 +7277,9 @@ static enum ndr_err_code ndr_push_netr_DomainTrustInfo(struct ndr_push *ndr, int
if (r->sid) {
NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
}
- for (cntr_unknown1_0 = 0; cntr_unknown1_0 < 4; cntr_unknown1_0++) {
- NDR_CHECK(ndr_push_netr_BinaryString(ndr, NDR_BUFFERS, &r->unknown1[cntr_unknown1_0]));
+ NDR_CHECK(ndr_push_netr_trust_extension_container(ndr, NDR_BUFFERS, &r->trust_extension));
+ for (cntr_dummystring_0 = 0; cntr_dummystring_0 < 3; cntr_dummystring_0++) {
+ NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->dummystring[cntr_dummystring_0]));
}
}
return NDR_ERR_SUCCESS;
@@ -6910,8 +7289,8 @@ static enum ndr_err_code ndr_pull_netr_DomainTrustInfo(struct ndr_pull *ndr, int
{
uint32_t _ptr_sid;
TALLOC_CTX *_mem_save_sid_0;
- uint32_t cntr_unknown1_0;
- uint32_t cntr_unknown_0;
+ uint32_t cntr_dummystring_0;
+ uint32_t cntr_dummy_0;
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_pull_align(ndr, 4));
NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->domainname));
@@ -6924,11 +7303,12 @@ static enum ndr_err_code ndr_pull_netr_DomainTrustInfo(struct ndr_pull *ndr, int
} else {
r->sid = NULL;
}
- for (cntr_unknown1_0 = 0; cntr_unknown1_0 < 4; cntr_unknown1_0++) {
- NDR_CHECK(ndr_pull_netr_BinaryString(ndr, NDR_SCALARS, &r->unknown1[cntr_unknown1_0]));
+ NDR_CHECK(ndr_pull_netr_trust_extension_container(ndr, NDR_SCALARS, &r->trust_extension));
+ for (cntr_dummystring_0 = 0; cntr_dummystring_0 < 3; cntr_dummystring_0++) {
+ NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->dummystring[cntr_dummystring_0]));
}
- for (cntr_unknown_0 = 0; cntr_unknown_0 < 4; cntr_unknown_0++) {
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown[cntr_unknown_0]));
+ for (cntr_dummy_0 = 0; cntr_dummy_0 < 4; cntr_dummy_0++) {
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dummy[cntr_dummy_0]));
}
}
if (ndr_flags & NDR_BUFFERS) {
@@ -6941,8 +7321,9 @@ static enum ndr_err_code ndr_pull_netr_DomainTrustInfo(struct ndr_pull *ndr, int
NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0);
}
- for (cntr_unknown1_0 = 0; cntr_unknown1_0 < 4; cntr_unknown1_0++) {
- NDR_CHECK(ndr_pull_netr_BinaryString(ndr, NDR_BUFFERS, &r->unknown1[cntr_unknown1_0]));
+ NDR_CHECK(ndr_pull_netr_trust_extension_container(ndr, NDR_BUFFERS, &r->trust_extension));
+ for (cntr_dummystring_0 = 0; cntr_dummystring_0 < 3; cntr_dummystring_0++) {
+ NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->dummystring[cntr_dummystring_0]));
}
}
return NDR_ERR_SUCCESS;
@@ -6950,8 +7331,8 @@ static enum ndr_err_code ndr_pull_netr_DomainTrustInfo(struct ndr_pull *ndr, int
_PUBLIC_ void ndr_print_netr_DomainTrustInfo(struct ndr_print *ndr, const char *name, const struct netr_DomainTrustInfo *r)
{
- uint32_t cntr_unknown1_0;
- uint32_t cntr_unknown_0;
+ uint32_t cntr_dummystring_0;
+ uint32_t cntr_dummy_0;
ndr_print_struct(ndr, name, "netr_DomainTrustInfo");
ndr->depth++;
ndr_print_lsa_String(ndr, "domainname", &r->domainname);
@@ -6964,22 +7345,23 @@ _PUBLIC_ void ndr_print_netr_DomainTrustInfo(struct ndr_print *ndr, const char *
ndr_print_dom_sid2(ndr, "sid", r->sid);
}
ndr->depth--;
- ndr->print(ndr, "%s: ARRAY(%d)", "unknown1", (int)4);
+ ndr_print_netr_trust_extension_container(ndr, "trust_extension", &r->trust_extension);
+ ndr->print(ndr, "%s: ARRAY(%d)", "dummystring", (int)3);
ndr->depth++;
- for (cntr_unknown1_0=0;cntr_unknown1_0<4;cntr_unknown1_0++) {
+ for (cntr_dummystring_0=0;cntr_dummystring_0<3;cntr_dummystring_0++) {
char *idx_0=NULL;
- if (asprintf(&idx_0, "[%d]", cntr_unknown1_0) != -1) {
- ndr_print_netr_BinaryString(ndr, "unknown1", &r->unknown1[cntr_unknown1_0]);
+ if (asprintf(&idx_0, "[%d]", cntr_dummystring_0) != -1) {
+ ndr_print_lsa_String(ndr, "dummystring", &r->dummystring[cntr_dummystring_0]);
free(idx_0);
}
}
ndr->depth--;
- ndr->print(ndr, "%s: ARRAY(%d)", "unknown", (int)4);
+ ndr->print(ndr, "%s: ARRAY(%d)", "dummy", (int)4);
ndr->depth++;
- for (cntr_unknown_0=0;cntr_unknown_0<4;cntr_unknown_0++) {
+ for (cntr_dummy_0=0;cntr_dummy_0<4;cntr_dummy_0++) {
char *idx_0=NULL;
- if (asprintf(&idx_0, "[%d]", cntr_unknown_0) != -1) {
- ndr_print_uint32(ndr, "unknown", r->unknown[cntr_unknown_0]);
+ if (asprintf(&idx_0, "[%d]", cntr_dummy_0) != -1) {
+ ndr_print_uint32(ndr, "dummy", r->dummy[cntr_dummy_0]);
free(idx_0);
}
}
@@ -6987,17 +7369,108 @@ _PUBLIC_ void ndr_print_netr_DomainTrustInfo(struct ndr_print *ndr, const char *
ndr->depth--;
}
+static enum ndr_err_code ndr_push_netr_LsaPolicyInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_LsaPolicyInfo *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->policy_size));
+ NDR_CHECK(ndr_push_unique_ptr(ndr, r->policy));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ if (r->policy) {
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->policy_size));
+ NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->policy, r->policy_size));
+ }
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_netr_LsaPolicyInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_LsaPolicyInfo *r)
+{
+ uint32_t _ptr_policy;
+ TALLOC_CTX *_mem_save_policy_0;
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->policy_size));
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_policy));
+ if (_ptr_policy) {
+ NDR_PULL_ALLOC(ndr, r->policy);
+ } else {
+ r->policy = NULL;
+ }
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ if (r->policy) {
+ _mem_save_policy_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->policy, 0);
+ NDR_CHECK(ndr_pull_array_size(ndr, &r->policy));
+ NDR_PULL_ALLOC_N(ndr, r->policy, ndr_get_array_size(ndr, &r->policy));
+ NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->policy, ndr_get_array_size(ndr, &r->policy)));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_policy_0, 0);
+ }
+ if (r->policy) {
+ NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->policy, r->policy_size));
+ }
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_netr_LsaPolicyInfo(struct ndr_print *ndr, const char *name, const struct netr_LsaPolicyInfo *r)
+{
+ ndr_print_struct(ndr, name, "netr_LsaPolicyInfo");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "policy_size", r->policy_size);
+ ndr_print_ptr(ndr, "policy", r->policy);
+ ndr->depth++;
+ if (r->policy) {
+ ndr_print_array_uint8(ndr, "policy", r->policy, r->policy_size);
+ }
+ ndr->depth--;
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_netr_WorkstationFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
+{
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_netr_WorkstationFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
+{
+ uint32_t v;
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
+ *r = v;
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_netr_WorkstationFlags(struct ndr_print *ndr, const char *name, uint32_t r)
+{
+ ndr_print_uint32(ndr, name, r);
+ ndr->depth++;
+ ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_WS_FLAG_HANDLES_INBOUND_TRUSTS", NETR_WS_FLAG_HANDLES_INBOUND_TRUSTS, r);
+ ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_WS_FLAG_HANDLES_SPN_UPDATE", NETR_WS_FLAG_HANDLES_SPN_UPDATE, r);
+ ndr->depth--;
+}
+
static enum ndr_err_code ndr_push_netr_DomainInfo1(struct ndr_push *ndr, int ndr_flags, const struct netr_DomainInfo1 *r)
{
uint32_t cntr_trusts_1;
- uint32_t cntr_unknown_0;
+ uint32_t cntr_dummystring_0;
+ uint32_t cntr_dummy_0;
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_push_align(ndr, 4));
NDR_CHECK(ndr_push_netr_DomainTrustInfo(ndr, NDR_SCALARS, &r->domaininfo));
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_trusts));
NDR_CHECK(ndr_push_unique_ptr(ndr, r->trusts));
- for (cntr_unknown_0 = 0; cntr_unknown_0 < 14; cntr_unknown_0++) {
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown[cntr_unknown_0]));
+ NDR_CHECK(ndr_push_netr_LsaPolicyInfo(ndr, NDR_SCALARS, &r->lsa_policy));
+ NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->dns_hostname));
+ for (cntr_dummystring_0 = 0; cntr_dummystring_0 < 3; cntr_dummystring_0++) {
+ NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->dummystring[cntr_dummystring_0]));
+ }
+ NDR_CHECK(ndr_push_netr_WorkstationFlags(ndr, NDR_SCALARS, r->workstation_flags));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->supported_enc_types));
+ for (cntr_dummy_0 = 0; cntr_dummy_0 < 2; cntr_dummy_0++) {
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dummy[cntr_dummy_0]));
}
}
if (ndr_flags & NDR_BUFFERS) {
@@ -7011,6 +7484,11 @@ static enum ndr_err_code ndr_push_netr_DomainInfo1(struct ndr_push *ndr, int ndr
NDR_CHECK(ndr_push_netr_DomainTrustInfo(ndr, NDR_BUFFERS, &r->trusts[cntr_trusts_1]));
}
}
+ NDR_CHECK(ndr_push_netr_LsaPolicyInfo(ndr, NDR_BUFFERS, &r->lsa_policy));
+ NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->dns_hostname));
+ for (cntr_dummystring_0 = 0; cntr_dummystring_0 < 3; cntr_dummystring_0++) {
+ NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->dummystring[cntr_dummystring_0]));
+ }
}
return NDR_ERR_SUCCESS;
}
@@ -7021,7 +7499,8 @@ static enum ndr_err_code ndr_pull_netr_DomainInfo1(struct ndr_pull *ndr, int ndr
uint32_t cntr_trusts_1;
TALLOC_CTX *_mem_save_trusts_0;
TALLOC_CTX *_mem_save_trusts_1;
- uint32_t cntr_unknown_0;
+ uint32_t cntr_dummystring_0;
+ uint32_t cntr_dummy_0;
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_pull_align(ndr, 4));
NDR_CHECK(ndr_pull_netr_DomainTrustInfo(ndr, NDR_SCALARS, &r->domaininfo));
@@ -7032,8 +7511,15 @@ static enum ndr_err_code ndr_pull_netr_DomainInfo1(struct ndr_pull *ndr, int ndr
} else {
r->trusts = NULL;
}
- for (cntr_unknown_0 = 0; cntr_unknown_0 < 14; cntr_unknown_0++) {
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown[cntr_unknown_0]));
+ NDR_CHECK(ndr_pull_netr_LsaPolicyInfo(ndr, NDR_SCALARS, &r->lsa_policy));
+ NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->dns_hostname));
+ for (cntr_dummystring_0 = 0; cntr_dummystring_0 < 3; cntr_dummystring_0++) {
+ NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->dummystring[cntr_dummystring_0]));
+ }
+ NDR_CHECK(ndr_pull_netr_WorkstationFlags(ndr, NDR_SCALARS, &r->workstation_flags));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->supported_enc_types));
+ for (cntr_dummy_0 = 0; cntr_dummy_0 < 2; cntr_dummy_0++) {
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dummy[cntr_dummy_0]));
}
}
if (ndr_flags & NDR_BUFFERS) {
@@ -7054,6 +7540,11 @@ static enum ndr_err_code ndr_pull_netr_DomainInfo1(struct ndr_pull *ndr, int ndr
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusts_1, 0);
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusts_0, 0);
}
+ NDR_CHECK(ndr_pull_netr_LsaPolicyInfo(ndr, NDR_BUFFERS, &r->lsa_policy));
+ NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->dns_hostname));
+ for (cntr_dummystring_0 = 0; cntr_dummystring_0 < 3; cntr_dummystring_0++) {
+ NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->dummystring[cntr_dummystring_0]));
+ }
if (r->trusts) {
NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->trusts, r->num_trusts));
}
@@ -7064,7 +7555,8 @@ static enum ndr_err_code ndr_pull_netr_DomainInfo1(struct ndr_pull *ndr, int ndr
_PUBLIC_ void ndr_print_netr_DomainInfo1(struct ndr_print *ndr, const char *name, const struct netr_DomainInfo1 *r)
{
uint32_t cntr_trusts_1;
- uint32_t cntr_unknown_0;
+ uint32_t cntr_dummystring_0;
+ uint32_t cntr_dummy_0;
ndr_print_struct(ndr, name, "netr_DomainInfo1");
ndr->depth++;
ndr_print_netr_DomainTrustInfo(ndr, "domaininfo", &r->domaininfo);
@@ -7084,12 +7576,26 @@ _PUBLIC_ void ndr_print_netr_DomainInfo1(struct ndr_print *ndr, const char *name
ndr->depth--;
}
ndr->depth--;
- ndr->print(ndr, "%s: ARRAY(%d)", "unknown", (int)14);
+ ndr_print_netr_LsaPolicyInfo(ndr, "lsa_policy", &r->lsa_policy);
+ ndr_print_lsa_String(ndr, "dns_hostname", &r->dns_hostname);
+ ndr->print(ndr, "%s: ARRAY(%d)", "dummystring", (int)3);
ndr->depth++;
- for (cntr_unknown_0=0;cntr_unknown_0<14;cntr_unknown_0++) {
+ for (cntr_dummystring_0=0;cntr_dummystring_0<3;cntr_dummystring_0++) {
char *idx_0=NULL;
- if (asprintf(&idx_0, "[%d]", cntr_unknown_0) != -1) {
- ndr_print_uint32(ndr, "unknown", r->unknown[cntr_unknown_0]);
+ if (asprintf(&idx_0, "[%d]", cntr_dummystring_0) != -1) {
+ ndr_print_lsa_String(ndr, "dummystring", &r->dummystring[cntr_dummystring_0]);
+ free(idx_0);
+ }
+ }
+ ndr->depth--;
+ ndr_print_netr_WorkstationFlags(ndr, "workstation_flags", r->workstation_flags);
+ ndr_print_uint32(ndr, "supported_enc_types", r->supported_enc_types);
+ ndr->print(ndr, "%s: ARRAY(%d)", "dummy", (int)2);
+ ndr->depth++;
+ for (cntr_dummy_0=0;cntr_dummy_0<2;cntr_dummy_0++) {
+ char *idx_0=NULL;
+ if (asprintf(&idx_0, "[%d]", cntr_dummy_0) != -1) {
+ ndr_print_uint32(ndr, "dummy", r->dummy[cntr_dummy_0]);
free(idx_0);
}
}
@@ -7108,7 +7614,7 @@ static enum ndr_err_code ndr_push_netr_DomainInfo(struct ndr_push *ndr, int ndr_
break; }
case 2: {
- NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1));
+ NDR_CHECK(ndr_push_unique_ptr(ndr, r->info2));
break; }
default:
@@ -7125,8 +7631,8 @@ static enum ndr_err_code ndr_push_netr_DomainInfo(struct ndr_push *ndr, int ndr_
break;
case 2:
- if (r->info1) {
- NDR_CHECK(ndr_push_netr_DomainInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1));
+ if (r->info2) {
+ NDR_CHECK(ndr_push_netr_DomainInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2));
}
break;
@@ -7142,6 +7648,7 @@ static enum ndr_err_code ndr_pull_netr_DomainInfo(struct ndr_pull *ndr, int ndr_
int level;
uint32_t _level;
TALLOC_CTX *_mem_save_info1_0;
+ TALLOC_CTX *_mem_save_info2_0;
level = ndr_pull_get_switch_value(ndr, r);
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
@@ -7160,12 +7667,12 @@ static enum ndr_err_code ndr_pull_netr_DomainInfo(struct ndr_pull *ndr, int ndr_
break; }
case 2: {
- uint32_t _ptr_info1;
- NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1));
- if (_ptr_info1) {
- NDR_PULL_ALLOC(ndr, r->info1);
+ uint32_t _ptr_info2;
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info2));
+ if (_ptr_info2) {
+ NDR_PULL_ALLOC(ndr, r->info2);
} else {
- r->info1 = NULL;
+ r->info2 = NULL;
}
break; }
@@ -7185,11 +7692,11 @@ static enum ndr_err_code ndr_pull_netr_DomainInfo(struct ndr_pull *ndr, int ndr_
break;
case 2:
- if (r->info1) {
- _mem_save_info1_0 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, r->info1, 0);
- NDR_CHECK(ndr_pull_netr_DomainInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1));
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1_0, 0);
+ if (r->info2) {
+ _mem_save_info2_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->info2, 0);
+ NDR_CHECK(ndr_pull_netr_DomainInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info2_0, 0);
}
break;
@@ -7216,10 +7723,10 @@ _PUBLIC_ void ndr_print_netr_DomainInfo(struct ndr_print *ndr, const char *name,
break;
case 2:
- ndr_print_ptr(ndr, "info1", r->info1);
+ ndr_print_ptr(ndr, "info2", r->info2);
ndr->depth++;
- if (r->info1) {
- ndr_print_netr_DomainInfo1(ndr, "info1", r->info1);
+ if (r->info2) {
+ ndr_print_netr_DomainInfo1(ndr, "info2", r->info2);
}
ndr->depth--;
break;
@@ -7423,33 +7930,6 @@ _PUBLIC_ void ndr_print_netr_DsRAddress(struct ndr_print *ndr, const char *name,
ndr->depth--;
}
-static enum ndr_err_code ndr_push_netr_TrustFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
-{
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
- return NDR_ERR_SUCCESS;
-}
-
-static enum ndr_err_code ndr_pull_netr_TrustFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
-{
- uint32_t v;
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
- *r = v;
- return NDR_ERR_SUCCESS;
-}
-
-_PUBLIC_ void ndr_print_netr_TrustFlags(struct ndr_print *ndr, const char *name, uint32_t r)
-{
- ndr_print_uint32(ndr, name, r);
- ndr->depth++;
- ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_IN_FOREST", NETR_TRUST_FLAG_IN_FOREST, r);
- ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_OUTBOUND", NETR_TRUST_FLAG_OUTBOUND, r);
- ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_TREEROOT", NETR_TRUST_FLAG_TREEROOT, r);
- ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_PRIMARY", NETR_TRUST_FLAG_PRIMARY, r);
- ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_NATIVE", NETR_TRUST_FLAG_NATIVE, r);
- ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETR_TRUST_FLAG_INBOUND", NETR_TRUST_FLAG_INBOUND, r);
- ndr->depth--;
-}
-
static enum ndr_err_code ndr_push_netr_TrustType(struct ndr_push *ndr, int ndr_flags, enum netr_TrustType r)
{
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
@@ -8212,12 +8692,12 @@ static enum ndr_err_code ndr_push_netr_LogonSamLogon(struct ndr_push *ndr, int f
if (r->in.return_authenticator) {
NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
}
- NDR_CHECK(ndr_push_netr_LogonLevel(ndr, NDR_SCALARS, r->in.logon_level));
+ NDR_CHECK(ndr_push_netr_LogonInfoClass(ndr, NDR_SCALARS, r->in.logon_level));
if (r->in.logon == NULL) {
return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
}
NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.logon, r->in.logon_level));
- NDR_CHECK(ndr_push_netr_LogonInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.logon));
+ NDR_CHECK(ndr_push_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.logon));
NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.validation_level));
}
if (flags & NDR_OUT) {
@@ -8315,14 +8795,14 @@ static enum ndr_err_code ndr_pull_netr_LogonSamLogon(struct ndr_pull *ndr, int f
NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, 0);
}
- NDR_CHECK(ndr_pull_netr_LogonLevel(ndr, NDR_SCALARS, &r->in.logon_level));
+ NDR_CHECK(ndr_pull_netr_LogonInfoClass(ndr, NDR_SCALARS, &r->in.logon_level));
if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
NDR_PULL_ALLOC(ndr, r->in.logon);
}
_mem_save_logon_0 = NDR_PULL_GET_MEM_CTX(ndr);
NDR_PULL_SET_MEM_CTX(ndr, r->in.logon, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.logon, r->in.logon_level));
- NDR_CHECK(ndr_pull_netr_LogonInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.logon));
+ NDR_CHECK(ndr_pull_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.logon));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_0, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.validation_level));
NDR_PULL_ALLOC(ndr, r->out.validation);
@@ -8397,11 +8877,11 @@ _PUBLIC_ void ndr_print_netr_LogonSamLogon(struct ndr_print *ndr, const char *na
ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator);
}
ndr->depth--;
- ndr_print_netr_LogonLevel(ndr, "logon_level", r->in.logon_level);
+ ndr_print_netr_LogonInfoClass(ndr, "logon_level", r->in.logon_level);
ndr_print_ptr(ndr, "logon", r->in.logon);
ndr->depth++;
ndr_print_set_switch_value(ndr, r->in.logon, r->in.logon_level);
- ndr_print_netr_LogonInfo(ndr, "logon", r->in.logon);
+ ndr_print_netr_LogonLevel(ndr, "logon", r->in.logon);
ndr->depth--;
ndr_print_uint16(ndr, "validation_level", r->in.validation_level);
ndr->depth--;
@@ -8455,9 +8935,9 @@ static enum ndr_err_code ndr_push_netr_LogonSamLogoff(struct ndr_push *ndr, int
if (r->in.return_authenticator) {
NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
}
- NDR_CHECK(ndr_push_netr_LogonLevel(ndr, NDR_SCALARS, r->in.logon_level));
+ NDR_CHECK(ndr_push_netr_LogonInfoClass(ndr, NDR_SCALARS, r->in.logon_level));
NDR_CHECK(ndr_push_set_switch_value(ndr, &r->in.logon, r->in.logon_level));
- NDR_CHECK(ndr_push_netr_LogonInfo(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.logon));
+ NDR_CHECK(ndr_push_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.logon));
}
if (flags & NDR_OUT) {
NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.return_authenticator));
@@ -8542,9 +9022,9 @@ static enum ndr_err_code ndr_pull_netr_LogonSamLogoff(struct ndr_pull *ndr, int
NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, 0);
}
- NDR_CHECK(ndr_pull_netr_LogonLevel(ndr, NDR_SCALARS, &r->in.logon_level));
+ NDR_CHECK(ndr_pull_netr_LogonInfoClass(ndr, NDR_SCALARS, &r->in.logon_level));
NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->in.logon, r->in.logon_level));
- NDR_CHECK(ndr_pull_netr_LogonInfo(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.logon));
+ NDR_CHECK(ndr_pull_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.logon));
}
if (flags & NDR_OUT) {
NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_return_authenticator));
@@ -8598,9 +9078,9 @@ _PUBLIC_ void ndr_print_netr_LogonSamLogoff(struct ndr_print *ndr, const char *n
ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator);
}
ndr->depth--;
- ndr_print_netr_LogonLevel(ndr, "logon_level", r->in.logon_level);
+ ndr_print_netr_LogonInfoClass(ndr, "logon_level", r->in.logon_level);
ndr_print_set_switch_value(ndr, &r->in.logon, r->in.logon_level);
- ndr_print_netr_LogonInfo(ndr, "logon", &r->in.logon);
+ ndr_print_netr_LogonLevel(ndr, "logon", &r->in.logon);
ndr->depth--;
}
if (flags & NDR_OUT) {
@@ -13435,12 +13915,12 @@ static enum ndr_err_code ndr_push_netr_LogonSamLogonEx(struct ndr_push *ndr, int
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));
}
- NDR_CHECK(ndr_push_netr_LogonLevel(ndr, NDR_SCALARS, r->in.logon_level));
+ NDR_CHECK(ndr_push_netr_LogonInfoClass(ndr, NDR_SCALARS, r->in.logon_level));
if (r->in.logon == NULL) {
return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
}
NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.logon, r->in.logon_level));
- NDR_CHECK(ndr_push_netr_LogonInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.logon));
+ NDR_CHECK(ndr_push_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.logon));
NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.validation_level));
if (r->in.flags == NULL) {
return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
@@ -13515,14 +13995,14 @@ static enum ndr_err_code ndr_pull_netr_LogonSamLogonEx(struct ndr_pull *ndr, int
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));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_name_0, 0);
}
- NDR_CHECK(ndr_pull_netr_LogonLevel(ndr, NDR_SCALARS, &r->in.logon_level));
+ NDR_CHECK(ndr_pull_netr_LogonInfoClass(ndr, NDR_SCALARS, &r->in.logon_level));
if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
NDR_PULL_ALLOC(ndr, r->in.logon);
}
_mem_save_logon_0 = NDR_PULL_GET_MEM_CTX(ndr);
NDR_PULL_SET_MEM_CTX(ndr, r->in.logon, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.logon, r->in.logon_level));
- NDR_CHECK(ndr_pull_netr_LogonInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.logon));
+ NDR_CHECK(ndr_pull_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.logon));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_0, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.validation_level));
if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
@@ -13589,11 +14069,11 @@ _PUBLIC_ void ndr_print_netr_LogonSamLogonEx(struct ndr_print *ndr, const char *
ndr_print_string(ndr, "computer_name", r->in.computer_name);
}
ndr->depth--;
- ndr_print_netr_LogonLevel(ndr, "logon_level", r->in.logon_level);
+ ndr_print_netr_LogonInfoClass(ndr, "logon_level", r->in.logon_level);
ndr_print_ptr(ndr, "logon", r->in.logon);
ndr->depth++;
ndr_print_set_switch_value(ndr, r->in.logon, r->in.logon_level);
- ndr_print_netr_LogonInfo(ndr, "logon", r->in.logon);
+ ndr_print_netr_LogonLevel(ndr, "logon", r->in.logon);
ndr->depth--;
ndr_print_uint16(ndr, "validation_level", r->in.validation_level);
ndr_print_ptr(ndr, "flags", r->in.flags);
@@ -14413,9 +14893,9 @@ static enum ndr_err_code ndr_push_netr_LogonSamLogonWithFlags(struct ndr_push *n
if (r->in.return_authenticator) {
NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
}
- NDR_CHECK(ndr_push_netr_LogonLevel(ndr, NDR_SCALARS, r->in.logon_level));
+ NDR_CHECK(ndr_push_netr_LogonInfoClass(ndr, NDR_SCALARS, r->in.logon_level));
NDR_CHECK(ndr_push_set_switch_value(ndr, &r->in.logon, r->in.logon_level));
- NDR_CHECK(ndr_push_netr_LogonInfo(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.logon));
+ NDR_CHECK(ndr_push_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.logon));
NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.validation_level));
if (r->in.flags == NULL) {
return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
@@ -14521,9 +15001,9 @@ static enum ndr_err_code ndr_pull_netr_LogonSamLogonWithFlags(struct ndr_pull *n
NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, 0);
}
- NDR_CHECK(ndr_pull_netr_LogonLevel(ndr, NDR_SCALARS, &r->in.logon_level));
+ NDR_CHECK(ndr_pull_netr_LogonInfoClass(ndr, NDR_SCALARS, &r->in.logon_level));
NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->in.logon, r->in.logon_level));
- NDR_CHECK(ndr_pull_netr_LogonInfo(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.logon));
+ NDR_CHECK(ndr_pull_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.logon));
NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.validation_level));
if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
NDR_PULL_ALLOC(ndr, r->in.flags);
@@ -14613,9 +15093,9 @@ _PUBLIC_ void ndr_print_netr_LogonSamLogonWithFlags(struct ndr_print *ndr, const
ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator);
}
ndr->depth--;
- ndr_print_netr_LogonLevel(ndr, "logon_level", r->in.logon_level);
+ ndr_print_netr_LogonInfoClass(ndr, "logon_level", r->in.logon_level);
ndr_print_set_switch_value(ndr, &r->in.logon, r->in.logon_level);
- ndr_print_netr_LogonInfo(ndr, "logon", &r->in.logon);
+ ndr_print_netr_LogonLevel(ndr, "logon", &r->in.logon);
ndr_print_uint16(ndr, "validation_level", r->in.validation_level);
ndr_print_ptr(ndr, "flags", r->in.flags);
ndr->depth++;
diff --git a/source3/librpc/gen_ndr/ndr_netlogon.h b/source3/librpc/gen_ndr/ndr_netlogon.h
index a9d36aeacb..2a3c0fbf84 100644
--- a/source3/librpc/gen_ndr/ndr_netlogon.h
+++ b/source3/librpc/gen_ndr/ndr_netlogon.h
@@ -118,9 +118,11 @@ void ndr_print_netr_IdentityInfo(struct ndr_print *ndr, const char *name, const
void ndr_print_netr_PasswordInfo(struct ndr_print *ndr, const char *name, const struct netr_PasswordInfo *r);
void ndr_print_netr_ChallengeResponse(struct ndr_print *ndr, const char *name, const struct netr_ChallengeResponse *r);
void ndr_print_netr_NetworkInfo(struct ndr_print *ndr, const char *name, const struct netr_NetworkInfo *r);
-enum ndr_err_code ndr_push_netr_LogonInfo(struct ndr_push *ndr, int ndr_flags, const union netr_LogonInfo *r);
-enum ndr_err_code ndr_pull_netr_LogonInfo(struct ndr_pull *ndr, int ndr_flags, union netr_LogonInfo *r);
-void ndr_print_netr_LogonInfo(struct ndr_print *ndr, const char *name, const union netr_LogonInfo *r);
+void ndr_print_netr_GenericInfo(struct ndr_print *ndr, const char *name, const struct netr_GenericInfo *r);
+void ndr_print_netr_LogonInfoClass(struct ndr_print *ndr, const char *name, enum netr_LogonInfoClass r);
+enum ndr_err_code ndr_push_netr_LogonLevel(struct ndr_push *ndr, int ndr_flags, const union netr_LogonLevel *r);
+enum ndr_err_code ndr_pull_netr_LogonLevel(struct ndr_pull *ndr, int ndr_flags, union netr_LogonLevel *r);
+void ndr_print_netr_LogonLevel(struct ndr_print *ndr, const char *name, const union netr_LogonLevel *r);
enum ndr_err_code ndr_push_netr_UserSessionKey(struct ndr_push *ndr, int ndr_flags, const struct netr_UserSessionKey *r);
enum ndr_err_code ndr_pull_netr_UserSessionKey(struct ndr_pull *ndr, int ndr_flags, struct netr_UserSessionKey *r);
void ndr_print_netr_UserSessionKey(struct ndr_print *ndr, const char *name, const struct netr_UserSessionKey *r);
@@ -138,6 +140,7 @@ enum ndr_err_code ndr_pull_netr_SamInfo3(struct ndr_pull *ndr, int ndr_flags, st
void ndr_print_netr_SamInfo3(struct ndr_print *ndr, const char *name, const struct netr_SamInfo3 *r);
void ndr_print_netr_SamInfo6(struct ndr_print *ndr, const char *name, const struct netr_SamInfo6 *r);
void ndr_print_netr_PacInfo(struct ndr_print *ndr, const char *name, const struct netr_PacInfo *r);
+void ndr_print_netr_GenericInfo2(struct ndr_print *ndr, const char *name, const struct netr_GenericInfo2 *r);
enum ndr_err_code ndr_push_netr_Validation(struct ndr_push *ndr, int ndr_flags, const union netr_Validation *r);
enum ndr_err_code ndr_pull_netr_Validation(struct ndr_pull *ndr, int ndr_flags, union netr_Validation *r);
void ndr_print_netr_Validation(struct ndr_print *ndr, const char *name, const union netr_Validation *r);
@@ -147,7 +150,6 @@ void ndr_print_netr_Credential(struct ndr_print *ndr, const char *name, const st
enum ndr_err_code ndr_push_netr_Authenticator(struct ndr_push *ndr, int ndr_flags, const struct netr_Authenticator *r);
enum ndr_err_code ndr_pull_netr_Authenticator(struct ndr_pull *ndr, int ndr_flags, struct netr_Authenticator *r);
void ndr_print_netr_Authenticator(struct ndr_print *ndr, const char *name, const struct netr_Authenticator *r);
-void ndr_print_netr_LogonLevel(struct ndr_print *ndr, const char *name, enum netr_LogonLevel r);
void ndr_print_netr_DELTA_DELETE_USER(struct ndr_print *ndr, const char *name, const struct netr_DELTA_DELETE_USER *r);
void ndr_print_netr_USER_KEY16(struct ndr_print *ndr, const char *name, const struct netr_USER_KEY16 *r);
void ndr_print_netr_PasswordHistory(struct ndr_print *ndr, const char *name, const struct netr_PasswordHistory *r);
@@ -195,16 +197,22 @@ void ndr_print_netr_DsR_DcFlags(struct ndr_print *ndr, const char *name, uint32_
enum ndr_err_code ndr_push_netr_DsRGetDCNameInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_DsRGetDCNameInfo *r);
enum ndr_err_code ndr_pull_netr_DsRGetDCNameInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_DsRGetDCNameInfo *r);
void ndr_print_netr_DsRGetDCNameInfo(struct ndr_print *ndr, const char *name, const struct netr_DsRGetDCNameInfo *r);
+void ndr_print_netr_TrustFlags(struct ndr_print *ndr, const char *name, uint32_t r);
void ndr_print_netr_BinaryString(struct ndr_print *ndr, const char *name, const struct netr_BinaryString *r);
void ndr_print_netr_DomainQuery1(struct ndr_print *ndr, const char *name, const struct netr_DomainQuery1 *r);
void ndr_print_netr_DomainQuery(struct ndr_print *ndr, const char *name, const union netr_DomainQuery *r);
+void ndr_print_netr_trust_extension(struct ndr_print *ndr, const char *name, const struct netr_trust_extension *r);
+void ndr_print_netr_trust_extension_container(struct ndr_print *ndr, const char *name, const struct netr_trust_extension_container *r);
void ndr_print_netr_DomainTrustInfo(struct ndr_print *ndr, const char *name, const struct netr_DomainTrustInfo *r);
+void ndr_print_netr_LsaPolicyInfo(struct ndr_print *ndr, const char *name, const struct netr_LsaPolicyInfo *r);
+enum ndr_err_code ndr_push_netr_WorkstationFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r);
+enum ndr_err_code ndr_pull_netr_WorkstationFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r);
+void ndr_print_netr_WorkstationFlags(struct ndr_print *ndr, const char *name, uint32_t r);
void ndr_print_netr_DomainInfo1(struct ndr_print *ndr, const char *name, const struct netr_DomainInfo1 *r);
void ndr_print_netr_DomainInfo(struct ndr_print *ndr, const char *name, const union netr_DomainInfo *r);
void ndr_print_netr_CryptPassword(struct ndr_print *ndr, const char *name, const struct netr_CryptPassword *r);
void ndr_print_netr_DsRAddressToSitenamesWCtr(struct ndr_print *ndr, const char *name, const struct netr_DsRAddressToSitenamesWCtr *r);
void ndr_print_netr_DsRAddress(struct ndr_print *ndr, const char *name, const struct netr_DsRAddress *r);
-void ndr_print_netr_TrustFlags(struct ndr_print *ndr, const char *name, uint32_t r);
void ndr_print_netr_TrustType(struct ndr_print *ndr, const char *name, enum netr_TrustType r);
void ndr_print_netr_TrustAttributes(struct ndr_print *ndr, const char *name, uint32_t r);
void ndr_print_netr_DomainTrust(struct ndr_print *ndr, const char *name, const struct netr_DomainTrust *r);
diff --git a/source3/librpc/gen_ndr/ndr_notify.c b/source3/librpc/gen_ndr/ndr_notify.c
index b4be9a8f5a..dfa72d8004 100644
--- a/source3/librpc/gen_ndr/ndr_notify.c
+++ b/source3/librpc/gen_ndr/ndr_notify.c
@@ -3,7 +3,7 @@
#include "includes.h"
#include "librpc/gen_ndr/ndr_notify.h"
-#include "librpc/gen_ndr/ndr_misc.h"
+#include "librpc/gen_ndr/ndr_security.h"
_PUBLIC_ enum ndr_err_code ndr_push_notify_entry(struct ndr_push *ndr, int ndr_flags, const struct notify_entry *r)
{
if (ndr_flags & NDR_SCALARS) {
diff --git a/source3/librpc/gen_ndr/ndr_ntsvcs.c b/source3/librpc/gen_ndr/ndr_ntsvcs.c
index 62acf474ae..35d02a0dcb 100644
--- a/source3/librpc/gen_ndr/ndr_ntsvcs.c
+++ b/source3/librpc/gen_ndr/ndr_ntsvcs.c
@@ -508,9 +508,35 @@ _PUBLIC_ void ndr_print_PNP_EnumerateSubKeys(struct ndr_print *ndr, const char *
static enum ndr_err_code ndr_push_PNP_GetDeviceList(struct ndr_push *ndr, int flags, const struct PNP_GetDeviceList *r)
{
+ uint32_t cntr_buffer_1;
if (flags & NDR_IN) {
+ NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.filter));
+ if (r->in.filter) {
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.filter, CH_UTF16)));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.filter, CH_UTF16)));
+ NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.filter, ndr_charset_length(r->in.filter, CH_UTF16), sizeof(uint16_t), CH_UTF16));
+ }
+ if (r->in.length == NULL) {
+ return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+ }
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.length));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags));
}
if (flags & NDR_OUT) {
+ if (r->out.buffer == NULL) {
+ return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+ }
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.length));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.length));
+ for (cntr_buffer_1 = 0; cntr_buffer_1 < *r->out.length; cntr_buffer_1++) {
+ NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.buffer[cntr_buffer_1]));
+ }
+ if (r->out.length == NULL) {
+ return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+ }
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.length));
NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
}
return NDR_ERR_SUCCESS;
@@ -518,16 +544,81 @@ static enum ndr_err_code ndr_push_PNP_GetDeviceList(struct ndr_push *ndr, int fl
static enum ndr_err_code ndr_pull_PNP_GetDeviceList(struct ndr_pull *ndr, int flags, struct PNP_GetDeviceList *r)
{
+ uint32_t _ptr_filter;
+ uint32_t cntr_buffer_1;
+ TALLOC_CTX *_mem_save_filter_0;
+ TALLOC_CTX *_mem_save_buffer_1;
+ TALLOC_CTX *_mem_save_length_0;
if (flags & NDR_IN) {
+ ZERO_STRUCT(r->out);
+
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_filter));
+ if (_ptr_filter) {
+ NDR_PULL_ALLOC(ndr, r->in.filter);
+ } else {
+ r->in.filter = NULL;
+ }
+ if (r->in.filter) {
+ _mem_save_filter_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->in.filter, 0);
+ NDR_CHECK(ndr_pull_array_size(ndr, &r->in.filter));
+ NDR_CHECK(ndr_pull_array_length(ndr, &r->in.filter));
+ if (ndr_get_array_length(ndr, &r->in.filter) > ndr_get_array_size(ndr, &r->in.filter)) {
+ 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.filter), ndr_get_array_length(ndr, &r->in.filter));
+ }
+ NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.filter), sizeof(uint16_t)));
+ NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.filter, ndr_get_array_length(ndr, &r->in.filter), sizeof(uint16_t), CH_UTF16));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_filter_0, 0);
+ }
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+ NDR_PULL_ALLOC(ndr, r->in.length);
+ }
+ _mem_save_length_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->in.length, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.length));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_length_0, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags));
+ NDR_PULL_ALLOC_N(ndr, r->out.buffer, *r->in.length);
+ memset(r->out.buffer, 0, (*r->in.length) * sizeof(*r->out.buffer));
+ NDR_PULL_ALLOC(ndr, r->out.length);
+ *r->out.length = *r->in.length;
}
if (flags & NDR_OUT) {
+ NDR_CHECK(ndr_pull_array_size(ndr, &r->out.buffer));
+ NDR_CHECK(ndr_pull_array_length(ndr, &r->out.buffer));
+ if (ndr_get_array_length(ndr, &r->out.buffer) > ndr_get_array_size(ndr, &r->out.buffer)) {
+ return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->out.buffer), ndr_get_array_length(ndr, &r->out.buffer));
+ }
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+ NDR_PULL_ALLOC_N(ndr, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer));
+ }
+ _mem_save_buffer_1 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->out.buffer, 0);
+ for (cntr_buffer_1 = 0; cntr_buffer_1 < *r->out.length; cntr_buffer_1++) {
+ NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.buffer[cntr_buffer_1]));
+ }
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_1, 0);
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+ NDR_PULL_ALLOC(ndr, r->out.length);
+ }
+ _mem_save_length_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->out.length, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.length));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_length_0, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
+ if (r->out.buffer) {
+ NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.buffer, *r->out.length));
+ }
+ if (r->out.buffer) {
+ NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->out.buffer, *r->out.length));
+ }
}
return NDR_ERR_SUCCESS;
}
_PUBLIC_ void ndr_print_PNP_GetDeviceList(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetDeviceList *r)
{
+ uint32_t cntr_buffer_1;
ndr_print_struct(ndr, name, "PNP_GetDeviceList");
ndr->depth++;
if (flags & NDR_SET_VALUES) {
@@ -536,11 +627,39 @@ _PUBLIC_ void ndr_print_PNP_GetDeviceList(struct ndr_print *ndr, const char *nam
if (flags & NDR_IN) {
ndr_print_struct(ndr, "in", "PNP_GetDeviceList");
ndr->depth++;
+ ndr_print_ptr(ndr, "filter", r->in.filter);
+ ndr->depth++;
+ if (r->in.filter) {
+ ndr_print_string(ndr, "filter", r->in.filter);
+ }
+ ndr->depth--;
+ ndr_print_ptr(ndr, "length", r->in.length);
+ ndr->depth++;
+ ndr_print_uint32(ndr, "length", *r->in.length);
+ ndr->depth--;
+ ndr_print_uint32(ndr, "flags", r->in.flags);
ndr->depth--;
}
if (flags & NDR_OUT) {
ndr_print_struct(ndr, "out", "PNP_GetDeviceList");
ndr->depth++;
+ ndr_print_ptr(ndr, "buffer", r->out.buffer);
+ ndr->depth++;
+ ndr->print(ndr, "%s: ARRAY(%d)", "buffer", (int)*r->out.length);
+ ndr->depth++;
+ for (cntr_buffer_1=0;cntr_buffer_1<*r->out.length;cntr_buffer_1++) {
+ char *idx_1=NULL;
+ if (asprintf(&idx_1, "[%d]", cntr_buffer_1) != -1) {
+ ndr_print_uint16(ndr, "buffer", r->out.buffer[cntr_buffer_1]);
+ free(idx_1);
+ }
+ }
+ ndr->depth--;
+ ndr->depth--;
+ ndr_print_ptr(ndr, "length", r->out.length);
+ ndr->depth++;
+ ndr_print_uint32(ndr, "length", *r->out.length);
+ ndr->depth--;
ndr_print_WERROR(ndr, "result", r->out.result);
ndr->depth--;
}
@@ -696,10 +815,10 @@ static enum ndr_err_code ndr_push_PNP_GetDeviceRegProp(struct ndr_push *ndr, int
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.devicepath, CH_UTF16)));
NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.devicepath, ndr_charset_length(r->in.devicepath, CH_UTF16), sizeof(uint16_t), CH_UTF16));
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.property));
- if (r->in.unknown1 == NULL) {
+ if (r->in.reg_data_type == NULL) {
return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
}
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.unknown1));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.reg_data_type));
if (r->in.buffer_size == NULL) {
return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
}
@@ -708,13 +827,13 @@ static enum ndr_err_code ndr_push_PNP_GetDeviceRegProp(struct ndr_push *ndr, int
return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
}
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.needed));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown3));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags));
}
if (flags & NDR_OUT) {
- if (r->out.unknown1 == NULL) {
+ if (r->out.reg_data_type == NULL) {
return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
}
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.unknown1));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.reg_data_type));
if (r->out.buffer == NULL) {
return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
}
@@ -737,7 +856,7 @@ static enum ndr_err_code ndr_push_PNP_GetDeviceRegProp(struct ndr_push *ndr, int
static enum ndr_err_code ndr_pull_PNP_GetDeviceRegProp(struct ndr_pull *ndr, int flags, struct PNP_GetDeviceRegProp *r)
{
- TALLOC_CTX *_mem_save_unknown1_0;
+ TALLOC_CTX *_mem_save_reg_data_type_0;
TALLOC_CTX *_mem_save_buffer_size_0;
TALLOC_CTX *_mem_save_needed_0;
if (flags & NDR_IN) {
@@ -752,12 +871,12 @@ static enum ndr_err_code ndr_pull_PNP_GetDeviceRegProp(struct ndr_pull *ndr, int
NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.devicepath, ndr_get_array_length(ndr, &r->in.devicepath), sizeof(uint16_t), CH_UTF16));
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.property));
if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
- NDR_PULL_ALLOC(ndr, r->in.unknown1);
+ NDR_PULL_ALLOC(ndr, r->in.reg_data_type);
}
- _mem_save_unknown1_0 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, r->in.unknown1, LIBNDR_FLAG_REF_ALLOC);
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.unknown1));
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown1_0, LIBNDR_FLAG_REF_ALLOC);
+ _mem_save_reg_data_type_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->in.reg_data_type, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.reg_data_type));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_reg_data_type_0, LIBNDR_FLAG_REF_ALLOC);
if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
NDR_PULL_ALLOC(ndr, r->in.buffer_size);
}
@@ -772,9 +891,9 @@ static enum ndr_err_code ndr_pull_PNP_GetDeviceRegProp(struct ndr_pull *ndr, int
NDR_PULL_SET_MEM_CTX(ndr, r->in.needed, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.needed));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC);
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown3));
- NDR_PULL_ALLOC(ndr, r->out.unknown1);
- *r->out.unknown1 = *r->in.unknown1;
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags));
+ NDR_PULL_ALLOC(ndr, r->out.reg_data_type);
+ *r->out.reg_data_type = *r->in.reg_data_type;
NDR_PULL_ALLOC_N(ndr, r->out.buffer, *r->in.buffer_size);
memset(r->out.buffer, 0, (*r->in.buffer_size) * sizeof(*r->out.buffer));
NDR_PULL_ALLOC(ndr, r->out.buffer_size);
@@ -784,12 +903,12 @@ static enum ndr_err_code ndr_pull_PNP_GetDeviceRegProp(struct ndr_pull *ndr, int
}
if (flags & NDR_OUT) {
if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
- NDR_PULL_ALLOC(ndr, r->out.unknown1);
+ NDR_PULL_ALLOC(ndr, r->out.reg_data_type);
}
- _mem_save_unknown1_0 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, r->out.unknown1, LIBNDR_FLAG_REF_ALLOC);
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.unknown1));
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown1_0, LIBNDR_FLAG_REF_ALLOC);
+ _mem_save_reg_data_type_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->out.reg_data_type, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.reg_data_type));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_reg_data_type_0, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_array_size(ndr, &r->out.buffer));
NDR_CHECK(ndr_pull_array_length(ndr, &r->out.buffer));
if (ndr_get_array_length(ndr, &r->out.buffer) > ndr_get_array_size(ndr, &r->out.buffer)) {
@@ -839,9 +958,9 @@ _PUBLIC_ void ndr_print_PNP_GetDeviceRegProp(struct ndr_print *ndr, const char *
ndr_print_string(ndr, "devicepath", r->in.devicepath);
ndr->depth--;
ndr_print_uint32(ndr, "property", r->in.property);
- ndr_print_ptr(ndr, "unknown1", r->in.unknown1);
+ ndr_print_ptr(ndr, "reg_data_type", r->in.reg_data_type);
ndr->depth++;
- ndr_print_uint32(ndr, "unknown1", *r->in.unknown1);
+ ndr_print_uint32(ndr, "reg_data_type", *r->in.reg_data_type);
ndr->depth--;
ndr_print_ptr(ndr, "buffer_size", r->in.buffer_size);
ndr->depth++;
@@ -851,15 +970,15 @@ _PUBLIC_ void ndr_print_PNP_GetDeviceRegProp(struct ndr_print *ndr, const char *
ndr->depth++;
ndr_print_uint32(ndr, "needed", *r->in.needed);
ndr->depth--;
- ndr_print_uint32(ndr, "unknown3", r->in.unknown3);
+ ndr_print_uint32(ndr, "flags", r->in.flags);
ndr->depth--;
}
if (flags & NDR_OUT) {
ndr_print_struct(ndr, "out", "PNP_GetDeviceRegProp");
ndr->depth++;
- ndr_print_ptr(ndr, "unknown1", r->out.unknown1);
+ ndr_print_ptr(ndr, "reg_data_type", r->out.reg_data_type);
ndr->depth++;
- ndr_print_uint32(ndr, "unknown1", *r->out.unknown1);
+ ndr_print_uint32(ndr, "reg_data_type", *r->out.reg_data_type);
ndr->depth--;
ndr_print_ptr(ndr, "buffer", r->out.buffer);
ndr->depth++;
diff --git a/source3/librpc/gen_ndr/ndr_samr.c b/source3/librpc/gen_ndr/ndr_samr.c
index 9c5a886325..10055aef37 100644
--- a/source3/librpc/gen_ndr/ndr_samr.c
+++ b/source3/librpc/gen_ndr/ndr_samr.c
@@ -406,12 +406,12 @@ _PUBLIC_ void ndr_print_samr_DomInfo1(struct ndr_print *ndr, const char *name, c
ndr->depth--;
}
-static enum ndr_err_code ndr_push_samr_DomInfo2(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo2 *r)
+static enum ndr_err_code ndr_push_samr_DomGeneralInformation(struct ndr_push *ndr, int ndr_flags, const struct samr_DomGeneralInformation *r)
{
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_push_align(ndr, 4));
NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->force_logoff_time));
- NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->comment));
+ NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->oem_information));
NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->domain_name));
NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->primary));
NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->sequence_num));
@@ -423,19 +423,19 @@ static enum ndr_err_code ndr_push_samr_DomInfo2(struct ndr_push *ndr, int ndr_fl
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_aliases));
}
if (ndr_flags & NDR_BUFFERS) {
- NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->comment));
+ NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->oem_information));
NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->domain_name));
NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->primary));
}
return NDR_ERR_SUCCESS;
}
-static enum ndr_err_code ndr_pull_samr_DomInfo2(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo2 *r)
+static enum ndr_err_code ndr_pull_samr_DomGeneralInformation(struct ndr_pull *ndr, int ndr_flags, struct samr_DomGeneralInformation *r)
{
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_pull_align(ndr, 4));
NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->force_logoff_time));
- NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->comment));
+ NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->oem_information));
NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->domain_name));
NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->primary));
NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->sequence_num));
@@ -447,19 +447,19 @@ static enum ndr_err_code ndr_pull_samr_DomInfo2(struct ndr_pull *ndr, int ndr_fl
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_aliases));
}
if (ndr_flags & NDR_BUFFERS) {
- NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->comment));
+ NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->oem_information));
NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->domain_name));
NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->primary));
}
return NDR_ERR_SUCCESS;
}
-_PUBLIC_ void ndr_print_samr_DomInfo2(struct ndr_print *ndr, const char *name, const struct samr_DomInfo2 *r)
+_PUBLIC_ void ndr_print_samr_DomGeneralInformation(struct ndr_print *ndr, const char *name, const struct samr_DomGeneralInformation *r)
{
- ndr_print_struct(ndr, name, "samr_DomInfo2");
+ ndr_print_struct(ndr, name, "samr_DomGeneralInformation");
ndr->depth++;
ndr_print_NTTIME(ndr, "force_logoff_time", r->force_logoff_time);
- ndr_print_lsa_String(ndr, "comment", &r->comment);
+ ndr_print_lsa_String(ndr, "oem_information", &r->oem_information);
ndr_print_lsa_String(ndr, "domain_name", &r->domain_name);
ndr_print_lsa_String(ndr, "primary", &r->primary);
ndr_print_udlong(ndr, "sequence_num", r->sequence_num);
@@ -502,35 +502,35 @@ _PUBLIC_ void ndr_print_samr_DomInfo3(struct ndr_print *ndr, const char *name, c
ndr->depth--;
}
-static enum ndr_err_code ndr_push_samr_DomInfo4(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo4 *r)
+static enum ndr_err_code ndr_push_samr_DomOEMInformation(struct ndr_push *ndr, int ndr_flags, const struct samr_DomOEMInformation *r)
{
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_push_align(ndr, 4));
- NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->comment));
+ NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->oem_information));
}
if (ndr_flags & NDR_BUFFERS) {
- NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->comment));
+ NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->oem_information));
}
return NDR_ERR_SUCCESS;
}
-static enum ndr_err_code ndr_pull_samr_DomInfo4(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo4 *r)
+static enum ndr_err_code ndr_pull_samr_DomOEMInformation(struct ndr_pull *ndr, int ndr_flags, struct samr_DomOEMInformation *r)
{
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_pull_align(ndr, 4));
- NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->comment));
+ NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->oem_information));
}
if (ndr_flags & NDR_BUFFERS) {
- NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->comment));
+ NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->oem_information));
}
return NDR_ERR_SUCCESS;
}
-_PUBLIC_ void ndr_print_samr_DomInfo4(struct ndr_print *ndr, const char *name, const struct samr_DomInfo4 *r)
+_PUBLIC_ void ndr_print_samr_DomOEMInformation(struct ndr_print *ndr, const char *name, const struct samr_DomOEMInformation *r)
{
- ndr_print_struct(ndr, name, "samr_DomInfo4");
+ ndr_print_struct(ndr, name, "samr_DomOEMInformation");
ndr->depth++;
- ndr_print_lsa_String(ndr, "comment", &r->comment);
+ ndr_print_lsa_String(ndr, "oem_information", &r->oem_information);
ndr->depth--;
}
@@ -691,41 +691,41 @@ _PUBLIC_ void ndr_print_samr_DomInfo9(struct ndr_print *ndr, const char *name, c
ndr->depth--;
}
-static enum ndr_err_code ndr_push_samr_DomInfo11(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo11 *r)
+static enum ndr_err_code ndr_push_samr_DomGeneralInformation2(struct ndr_push *ndr, int ndr_flags, const struct samr_DomGeneralInformation2 *r)
{
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_push_align(ndr, 8));
- NDR_CHECK(ndr_push_samr_DomInfo2(ndr, NDR_SCALARS, &r->info2));
+ NDR_CHECK(ndr_push_samr_DomGeneralInformation(ndr, NDR_SCALARS, &r->general));
NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->lockout_duration));
NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->lockout_window));
NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lockout_threshold));
}
if (ndr_flags & NDR_BUFFERS) {
- NDR_CHECK(ndr_push_samr_DomInfo2(ndr, NDR_BUFFERS, &r->info2));
+ NDR_CHECK(ndr_push_samr_DomGeneralInformation(ndr, NDR_BUFFERS, &r->general));
}
return NDR_ERR_SUCCESS;
}
-static enum ndr_err_code ndr_pull_samr_DomInfo11(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo11 *r)
+static enum ndr_err_code ndr_pull_samr_DomGeneralInformation2(struct ndr_pull *ndr, int ndr_flags, struct samr_DomGeneralInformation2 *r)
{
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_pull_align(ndr, 8));
- NDR_CHECK(ndr_pull_samr_DomInfo2(ndr, NDR_SCALARS, &r->info2));
+ NDR_CHECK(ndr_pull_samr_DomGeneralInformation(ndr, NDR_SCALARS, &r->general));
NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->lockout_duration));
NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->lockout_window));
NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lockout_threshold));
}
if (ndr_flags & NDR_BUFFERS) {
- NDR_CHECK(ndr_pull_samr_DomInfo2(ndr, NDR_BUFFERS, &r->info2));
+ NDR_CHECK(ndr_pull_samr_DomGeneralInformation(ndr, NDR_BUFFERS, &r->general));
}
return NDR_ERR_SUCCESS;
}
-_PUBLIC_ void ndr_print_samr_DomInfo11(struct ndr_print *ndr, const char *name, const struct samr_DomInfo11 *r)
+_PUBLIC_ void ndr_print_samr_DomGeneralInformation2(struct ndr_print *ndr, const char *name, const struct samr_DomGeneralInformation2 *r)
{
- ndr_print_struct(ndr, name, "samr_DomInfo11");
+ ndr_print_struct(ndr, name, "samr_DomGeneralInformation2");
ndr->depth++;
- ndr_print_samr_DomInfo2(ndr, "info2", &r->info2);
+ ndr_print_samr_DomGeneralInformation(ndr, "general", &r->general);
ndr_print_hyper(ndr, "lockout_duration", r->lockout_duration);
ndr_print_hyper(ndr, "lockout_window", r->lockout_window);
ndr_print_uint16(ndr, "lockout_threshold", r->lockout_threshold);
@@ -818,7 +818,7 @@ static enum ndr_err_code ndr_push_samr_DomainInfo(struct ndr_push *ndr, int ndr_
break; }
case 2: {
- NDR_CHECK(ndr_push_samr_DomInfo2(ndr, NDR_SCALARS, &r->info2));
+ NDR_CHECK(ndr_push_samr_DomGeneralInformation(ndr, NDR_SCALARS, &r->general));
break; }
case 3: {
@@ -826,7 +826,7 @@ static enum ndr_err_code ndr_push_samr_DomainInfo(struct ndr_push *ndr, int ndr_
break; }
case 4: {
- NDR_CHECK(ndr_push_samr_DomInfo4(ndr, NDR_SCALARS, &r->info4));
+ NDR_CHECK(ndr_push_samr_DomOEMInformation(ndr, NDR_SCALARS, &r->oem));
break; }
case 5: {
@@ -850,7 +850,7 @@ static enum ndr_err_code ndr_push_samr_DomainInfo(struct ndr_push *ndr, int ndr_
break; }
case 11: {
- NDR_CHECK(ndr_push_samr_DomInfo11(ndr, NDR_SCALARS, &r->info11));
+ NDR_CHECK(ndr_push_samr_DomGeneralInformation2(ndr, NDR_SCALARS, &r->general2));
break; }
case 12: {
@@ -872,14 +872,14 @@ static enum ndr_err_code ndr_push_samr_DomainInfo(struct ndr_push *ndr, int ndr_
break;
case 2:
- NDR_CHECK(ndr_push_samr_DomInfo2(ndr, NDR_BUFFERS, &r->info2));
+ NDR_CHECK(ndr_push_samr_DomGeneralInformation(ndr, NDR_BUFFERS, &r->general));
break;
case 3:
break;
case 4:
- NDR_CHECK(ndr_push_samr_DomInfo4(ndr, NDR_BUFFERS, &r->info4));
+ NDR_CHECK(ndr_push_samr_DomOEMInformation(ndr, NDR_BUFFERS, &r->oem));
break;
case 5:
@@ -900,7 +900,7 @@ static enum ndr_err_code ndr_push_samr_DomainInfo(struct ndr_push *ndr, int ndr_
break;
case 11:
- NDR_CHECK(ndr_push_samr_DomInfo11(ndr, NDR_BUFFERS, &r->info11));
+ NDR_CHECK(ndr_push_samr_DomGeneralInformation2(ndr, NDR_BUFFERS, &r->general2));
break;
case 12:
@@ -932,7 +932,7 @@ static enum ndr_err_code ndr_pull_samr_DomainInfo(struct ndr_pull *ndr, int ndr_
break; }
case 2: {
- NDR_CHECK(ndr_pull_samr_DomInfo2(ndr, NDR_SCALARS, &r->info2));
+ NDR_CHECK(ndr_pull_samr_DomGeneralInformation(ndr, NDR_SCALARS, &r->general));
break; }
case 3: {
@@ -940,7 +940,7 @@ static enum ndr_err_code ndr_pull_samr_DomainInfo(struct ndr_pull *ndr, int ndr_
break; }
case 4: {
- NDR_CHECK(ndr_pull_samr_DomInfo4(ndr, NDR_SCALARS, &r->info4));
+ NDR_CHECK(ndr_pull_samr_DomOEMInformation(ndr, NDR_SCALARS, &r->oem));
break; }
case 5: {
@@ -964,7 +964,7 @@ static enum ndr_err_code ndr_pull_samr_DomainInfo(struct ndr_pull *ndr, int ndr_
break; }
case 11: {
- NDR_CHECK(ndr_pull_samr_DomInfo11(ndr, NDR_SCALARS, &r->info11));
+ NDR_CHECK(ndr_pull_samr_DomGeneralInformation2(ndr, NDR_SCALARS, &r->general2));
break; }
case 12: {
@@ -985,14 +985,14 @@ static enum ndr_err_code ndr_pull_samr_DomainInfo(struct ndr_pull *ndr, int ndr_
break;
case 2:
- NDR_CHECK(ndr_pull_samr_DomInfo2(ndr, NDR_BUFFERS, &r->info2));
+ NDR_CHECK(ndr_pull_samr_DomGeneralInformation(ndr, NDR_BUFFERS, &r->general));
break;
case 3:
break;
case 4:
- NDR_CHECK(ndr_pull_samr_DomInfo4(ndr, NDR_BUFFERS, &r->info4));
+ NDR_CHECK(ndr_pull_samr_DomOEMInformation(ndr, NDR_BUFFERS, &r->oem));
break;
case 5:
@@ -1013,7 +1013,7 @@ static enum ndr_err_code ndr_pull_samr_DomainInfo(struct ndr_pull *ndr, int ndr_
break;
case 11:
- NDR_CHECK(ndr_pull_samr_DomInfo11(ndr, NDR_BUFFERS, &r->info11));
+ NDR_CHECK(ndr_pull_samr_DomGeneralInformation2(ndr, NDR_BUFFERS, &r->general2));
break;
case 12:
@@ -1040,7 +1040,7 @@ _PUBLIC_ void ndr_print_samr_DomainInfo(struct ndr_print *ndr, const char *name,
break;
case 2:
- ndr_print_samr_DomInfo2(ndr, "info2", &r->info2);
+ ndr_print_samr_DomGeneralInformation(ndr, "general", &r->general);
break;
case 3:
@@ -1048,7 +1048,7 @@ _PUBLIC_ void ndr_print_samr_DomainInfo(struct ndr_print *ndr, const char *name,
break;
case 4:
- ndr_print_samr_DomInfo4(ndr, "info4", &r->info4);
+ ndr_print_samr_DomOEMInformation(ndr, "oem", &r->oem);
break;
case 5:
@@ -1072,7 +1072,7 @@ _PUBLIC_ void ndr_print_samr_DomainInfo(struct ndr_print *ndr, const char *name,
break;
case 11:
- ndr_print_samr_DomInfo11(ndr, "info11", &r->info11);
+ ndr_print_samr_DomGeneralInformation2(ndr, "general2", &r->general2);
break;
case 12:
diff --git a/source3/librpc/gen_ndr/ndr_samr.h b/source3/librpc/gen_ndr/ndr_samr.h
index c21b5455fb..1f582061f9 100644
--- a/source3/librpc/gen_ndr/ndr_samr.h
+++ b/source3/librpc/gen_ndr/ndr_samr.h
@@ -163,15 +163,15 @@ enum ndr_err_code ndr_push_samr_PasswordProperties(struct ndr_push *ndr, int ndr
enum ndr_err_code ndr_pull_samr_PasswordProperties(struct ndr_pull *ndr, int ndr_flags, uint32_t *r);
void ndr_print_samr_PasswordProperties(struct ndr_print *ndr, const char *name, uint32_t r);
void ndr_print_samr_DomInfo1(struct ndr_print *ndr, const char *name, const struct samr_DomInfo1 *r);
-void ndr_print_samr_DomInfo2(struct ndr_print *ndr, const char *name, const struct samr_DomInfo2 *r);
+void ndr_print_samr_DomGeneralInformation(struct ndr_print *ndr, const char *name, const struct samr_DomGeneralInformation *r);
void ndr_print_samr_DomInfo3(struct ndr_print *ndr, const char *name, const struct samr_DomInfo3 *r);
-void ndr_print_samr_DomInfo4(struct ndr_print *ndr, const char *name, const struct samr_DomInfo4 *r);
+void ndr_print_samr_DomOEMInformation(struct ndr_print *ndr, const char *name, const struct samr_DomOEMInformation *r);
void ndr_print_samr_DomInfo5(struct ndr_print *ndr, const char *name, const struct samr_DomInfo5 *r);
void ndr_print_samr_DomInfo6(struct ndr_print *ndr, const char *name, const struct samr_DomInfo6 *r);
void ndr_print_samr_DomInfo7(struct ndr_print *ndr, const char *name, const struct samr_DomInfo7 *r);
void ndr_print_samr_DomInfo8(struct ndr_print *ndr, const char *name, const struct samr_DomInfo8 *r);
void ndr_print_samr_DomInfo9(struct ndr_print *ndr, const char *name, const struct samr_DomInfo9 *r);
-void ndr_print_samr_DomInfo11(struct ndr_print *ndr, const char *name, const struct samr_DomInfo11 *r);
+void ndr_print_samr_DomGeneralInformation2(struct ndr_print *ndr, const char *name, const struct samr_DomGeneralInformation2 *r);
void ndr_print_samr_DomInfo12(struct ndr_print *ndr, const char *name, const struct samr_DomInfo12 *r);
void ndr_print_samr_DomInfo13(struct ndr_print *ndr, const char *name, const struct samr_DomInfo13 *r);
void ndr_print_samr_DomainInfo(struct ndr_print *ndr, const char *name, const union samr_DomainInfo *r);
diff --git a/source3/librpc/gen_ndr/ndr_security.c b/source3/librpc/gen_ndr/ndr_security.c
index d54fdb2395..de899241ab 100644
--- a/source3/librpc/gen_ndr/ndr_security.c
+++ b/source3/librpc/gen_ndr/ndr_security.c
@@ -1024,3 +1024,29 @@ _PUBLIC_ void ndr_print_security_secinfo(struct ndr_print *ndr, const char *name
ndr->depth--;
}
+_PUBLIC_ enum ndr_err_code ndr_push_kerb_EncTypes(struct ndr_push *ndr, int ndr_flags, uint32_t r)
+{
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_kerb_EncTypes(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
+{
+ uint32_t v;
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
+ *r = v;
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_kerb_EncTypes(struct ndr_print *ndr, const char *name, uint32_t r)
+{
+ ndr_print_uint32(ndr, name, r);
+ ndr->depth++;
+ ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KERB_ENCTYPE_DES_CBC_CRC", KERB_ENCTYPE_DES_CBC_CRC, r);
+ ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KERB_ENCTYPE_DES_CBC_MD5", KERB_ENCTYPE_DES_CBC_MD5, r);
+ ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KERB_ENCTYPE_RC4_HMAC_MD5", KERB_ENCTYPE_RC4_HMAC_MD5, r);
+ ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KERB_ENCTYPE_AES128_CTS_HMAC_SHA1_96", KERB_ENCTYPE_AES128_CTS_HMAC_SHA1_96, r);
+ ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "KERB_ENCTYPE_AES256_CTS_HMAC_SHA1_96", KERB_ENCTYPE_AES256_CTS_HMAC_SHA1_96, r);
+ ndr->depth--;
+}
+
diff --git a/source3/librpc/gen_ndr/ndr_security.h b/source3/librpc/gen_ndr/ndr_security.h
index 79bfd78f51..7a2ff74309 100644
--- a/source3/librpc/gen_ndr/ndr_security.h
+++ b/source3/librpc/gen_ndr/ndr_security.h
@@ -38,4 +38,7 @@ void ndr_print_security_token(struct ndr_print *ndr, const char *name, const str
enum ndr_err_code ndr_push_security_secinfo(struct ndr_push *ndr, int ndr_flags, uint32_t r);
enum ndr_err_code ndr_pull_security_secinfo(struct ndr_pull *ndr, int ndr_flags, uint32_t *r);
void ndr_print_security_secinfo(struct ndr_print *ndr, const char *name, uint32_t r);
+enum ndr_err_code ndr_push_kerb_EncTypes(struct ndr_push *ndr, int ndr_flags, uint32_t r);
+enum ndr_err_code ndr_pull_kerb_EncTypes(struct ndr_pull *ndr, int ndr_flags, uint32_t *r);
+void ndr_print_kerb_EncTypes(struct ndr_print *ndr, const char *name, uint32_t r);
#endif /* _HEADER_NDR_security */
diff --git a/source3/librpc/gen_ndr/ndr_svcctl.c b/source3/librpc/gen_ndr/ndr_svcctl.c
index ec1450b48b..e897ef334b 100644
--- a/source3/librpc/gen_ndr/ndr_svcctl.c
+++ b/source3/librpc/gen_ndr/ndr_svcctl.c
@@ -353,6 +353,215 @@ _PUBLIC_ void ndr_print_svcctl_ServiceAccessMask(struct ndr_print *ndr, const ch
ndr->depth--;
}
+_PUBLIC_ enum ndr_err_code ndr_push_QUERY_SERVICE_CONFIG(struct ndr_push *ndr, int ndr_flags, const struct QUERY_SERVICE_CONFIG *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->service_type));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->start_type));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->error_control));
+ NDR_CHECK(ndr_push_unique_ptr(ndr, r->executablepath));
+ NDR_CHECK(ndr_push_unique_ptr(ndr, r->loadordergroup));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->tag_id));
+ NDR_CHECK(ndr_push_unique_ptr(ndr, r->dependencies));
+ NDR_CHECK(ndr_push_unique_ptr(ndr, r->startname));
+ NDR_CHECK(ndr_push_unique_ptr(ndr, r->displayname));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ if (r->executablepath) {
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->executablepath, CH_UTF16)));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->executablepath, CH_UTF16)));
+ NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->executablepath, ndr_charset_length(r->executablepath, CH_UTF16), sizeof(uint16_t), CH_UTF16));
+ }
+ if (r->loadordergroup) {
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->loadordergroup, CH_UTF16)));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->loadordergroup, CH_UTF16)));
+ NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->loadordergroup, ndr_charset_length(r->loadordergroup, CH_UTF16), sizeof(uint16_t), CH_UTF16));
+ }
+ if (r->dependencies) {
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dependencies, CH_UTF16)));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dependencies, CH_UTF16)));
+ NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dependencies, ndr_charset_length(r->dependencies, CH_UTF16), sizeof(uint16_t), CH_UTF16));
+ }
+ if (r->startname) {
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->startname, CH_UTF16)));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->startname, CH_UTF16)));
+ NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->startname, ndr_charset_length(r->startname, CH_UTF16), sizeof(uint16_t), CH_UTF16));
+ }
+ if (r->displayname) {
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->displayname, CH_UTF16)));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->displayname, CH_UTF16)));
+ NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->displayname, ndr_charset_length(r->displayname, CH_UTF16), sizeof(uint16_t), CH_UTF16));
+ }
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_QUERY_SERVICE_CONFIG(struct ndr_pull *ndr, int ndr_flags, struct QUERY_SERVICE_CONFIG *r)
+{
+ uint32_t _ptr_executablepath;
+ TALLOC_CTX *_mem_save_executablepath_0;
+ uint32_t _ptr_loadordergroup;
+ TALLOC_CTX *_mem_save_loadordergroup_0;
+ uint32_t _ptr_dependencies;
+ TALLOC_CTX *_mem_save_dependencies_0;
+ uint32_t _ptr_startname;
+ TALLOC_CTX *_mem_save_startname_0;
+ uint32_t _ptr_displayname;
+ TALLOC_CTX *_mem_save_displayname_0;
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->service_type));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->start_type));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->error_control));
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_executablepath));
+ if (_ptr_executablepath) {
+ NDR_PULL_ALLOC(ndr, r->executablepath);
+ } else {
+ r->executablepath = NULL;
+ }
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_loadordergroup));
+ if (_ptr_loadordergroup) {
+ NDR_PULL_ALLOC(ndr, r->loadordergroup);
+ } else {
+ r->loadordergroup = NULL;
+ }
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->tag_id));
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dependencies));
+ if (_ptr_dependencies) {
+ NDR_PULL_ALLOC(ndr, r->dependencies);
+ } else {
+ r->dependencies = NULL;
+ }
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_startname));
+ if (_ptr_startname) {
+ NDR_PULL_ALLOC(ndr, r->startname);
+ } else {
+ r->startname = NULL;
+ }
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_displayname));
+ if (_ptr_displayname) {
+ NDR_PULL_ALLOC(ndr, r->displayname);
+ } else {
+ r->displayname = NULL;
+ }
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ if (r->executablepath) {
+ _mem_save_executablepath_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->executablepath, 0);
+ NDR_CHECK(ndr_pull_array_size(ndr, &r->executablepath));
+ NDR_CHECK(ndr_pull_array_length(ndr, &r->executablepath));
+ if (ndr_get_array_length(ndr, &r->executablepath) > ndr_get_array_size(ndr, &r->executablepath)) {
+ return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->executablepath), ndr_get_array_length(ndr, &r->executablepath));
+ }
+ NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->executablepath), sizeof(uint16_t)));
+ NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->executablepath, ndr_get_array_length(ndr, &r->executablepath), sizeof(uint16_t), CH_UTF16));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_executablepath_0, 0);
+ }
+ if (r->loadordergroup) {
+ _mem_save_loadordergroup_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->loadordergroup, 0);
+ NDR_CHECK(ndr_pull_array_size(ndr, &r->loadordergroup));
+ NDR_CHECK(ndr_pull_array_length(ndr, &r->loadordergroup));
+ if (ndr_get_array_length(ndr, &r->loadordergroup) > ndr_get_array_size(ndr, &r->loadordergroup)) {
+ return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->loadordergroup), ndr_get_array_length(ndr, &r->loadordergroup));
+ }
+ NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->loadordergroup), sizeof(uint16_t)));
+ NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->loadordergroup, ndr_get_array_length(ndr, &r->loadordergroup), sizeof(uint16_t), CH_UTF16));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_loadordergroup_0, 0);
+ }
+ if (r->dependencies) {
+ _mem_save_dependencies_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->dependencies, 0);
+ NDR_CHECK(ndr_pull_array_size(ndr, &r->dependencies));
+ NDR_CHECK(ndr_pull_array_length(ndr, &r->dependencies));
+ if (ndr_get_array_length(ndr, &r->dependencies) > ndr_get_array_size(ndr, &r->dependencies)) {
+ return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dependencies), ndr_get_array_length(ndr, &r->dependencies));
+ }
+ NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dependencies), sizeof(uint16_t)));
+ NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dependencies, ndr_get_array_length(ndr, &r->dependencies), sizeof(uint16_t), CH_UTF16));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dependencies_0, 0);
+ }
+ if (r->startname) {
+ _mem_save_startname_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->startname, 0);
+ NDR_CHECK(ndr_pull_array_size(ndr, &r->startname));
+ NDR_CHECK(ndr_pull_array_length(ndr, &r->startname));
+ if (ndr_get_array_length(ndr, &r->startname) > ndr_get_array_size(ndr, &r->startname)) {
+ return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->startname), ndr_get_array_length(ndr, &r->startname));
+ }
+ NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->startname), sizeof(uint16_t)));
+ NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->startname, ndr_get_array_length(ndr, &r->startname), sizeof(uint16_t), CH_UTF16));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_startname_0, 0);
+ }
+ if (r->displayname) {
+ _mem_save_displayname_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->displayname, 0);
+ NDR_CHECK(ndr_pull_array_size(ndr, &r->displayname));
+ NDR_CHECK(ndr_pull_array_length(ndr, &r->displayname));
+ if (ndr_get_array_length(ndr, &r->displayname) > ndr_get_array_size(ndr, &r->displayname)) {
+ return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->displayname), ndr_get_array_length(ndr, &r->displayname));
+ }
+ NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->displayname), sizeof(uint16_t)));
+ NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->displayname, ndr_get_array_length(ndr, &r->displayname), sizeof(uint16_t), CH_UTF16));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_displayname_0, 0);
+ }
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_QUERY_SERVICE_CONFIG(struct ndr_print *ndr, const char *name, const struct QUERY_SERVICE_CONFIG *r)
+{
+ ndr_print_struct(ndr, name, "QUERY_SERVICE_CONFIG");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "service_type", r->service_type);
+ ndr_print_uint32(ndr, "start_type", r->start_type);
+ ndr_print_uint32(ndr, "error_control", r->error_control);
+ ndr_print_ptr(ndr, "executablepath", r->executablepath);
+ ndr->depth++;
+ if (r->executablepath) {
+ ndr_print_string(ndr, "executablepath", r->executablepath);
+ }
+ ndr->depth--;
+ ndr_print_ptr(ndr, "loadordergroup", r->loadordergroup);
+ ndr->depth++;
+ if (r->loadordergroup) {
+ ndr_print_string(ndr, "loadordergroup", r->loadordergroup);
+ }
+ ndr->depth--;
+ ndr_print_uint32(ndr, "tag_id", r->tag_id);
+ ndr_print_ptr(ndr, "dependencies", r->dependencies);
+ ndr->depth++;
+ if (r->dependencies) {
+ ndr_print_string(ndr, "dependencies", r->dependencies);
+ }
+ ndr->depth--;
+ ndr_print_ptr(ndr, "startname", r->startname);
+ ndr->depth++;
+ if (r->startname) {
+ ndr_print_string(ndr, "startname", r->startname);
+ }
+ ndr->depth--;
+ ndr_print_ptr(ndr, "displayname", r->displayname);
+ ndr->depth++;
+ if (r->displayname) {
+ ndr_print_string(ndr, "displayname", r->displayname);
+ }
+ ndr->depth--;
+ ndr->depth--;
+}
+
+_PUBLIC_ size_t ndr_size_QUERY_SERVICE_CONFIG(const struct QUERY_SERVICE_CONFIG *r, int flags)
+{
+ return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_QUERY_SERVICE_CONFIG);
+}
+
static enum ndr_err_code ndr_push_svcctl_CloseServiceHandle(struct ndr_push *ndr, int flags, const struct svcctl_CloseServiceHandle *r)
{
if (flags & NDR_IN) {
@@ -2260,7 +2469,10 @@ static enum ndr_err_code ndr_push_svcctl_QueryServiceConfigW(struct ndr_push *nd
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buf_size));
}
if (flags & NDR_OUT) {
- NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.query, r->in.buf_size));
+ if (r->out.query == NULL) {
+ return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+ }
+ NDR_CHECK(ndr_push_QUERY_SERVICE_CONFIG(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.query));
if (r->out.bytes_needed == NULL) {
return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
}
@@ -2273,6 +2485,7 @@ static enum ndr_err_code ndr_push_svcctl_QueryServiceConfigW(struct ndr_push *nd
static enum ndr_err_code ndr_pull_svcctl_QueryServiceConfigW(struct ndr_pull *ndr, int flags, struct svcctl_QueryServiceConfigW *r)
{
TALLOC_CTX *_mem_save_handle_0;
+ TALLOC_CTX *_mem_save_query_0;
TALLOC_CTX *_mem_save_bytes_needed_0;
if (flags & NDR_IN) {
ZERO_STRUCT(r->out);
@@ -2285,18 +2498,31 @@ static enum ndr_err_code ndr_pull_svcctl_QueryServiceConfigW(struct ndr_pull *nd
NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buf_size));
+ if (r->in.buf_size < 0 || r->in.buf_size > 8192) {
+ return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
+ }
+ NDR_PULL_ALLOC(ndr, r->out.query);
+ ZERO_STRUCTP(r->out.query);
NDR_PULL_ALLOC(ndr, r->out.bytes_needed);
ZERO_STRUCTP(r->out.bytes_needed);
}
if (flags & NDR_OUT) {
- NDR_PULL_ALLOC_N(ndr, r->out.query, r->in.buf_size);
- NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.query, r->in.buf_size));
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+ NDR_PULL_ALLOC(ndr, r->out.query);
+ }
+ _mem_save_query_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->out.query, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_QUERY_SERVICE_CONFIG(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.query));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_query_0, LIBNDR_FLAG_REF_ALLOC);
if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
NDR_PULL_ALLOC(ndr, r->out.bytes_needed);
}
_mem_save_bytes_needed_0 = NDR_PULL_GET_MEM_CTX(ndr);
NDR_PULL_SET_MEM_CTX(ndr, r->out.bytes_needed, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.bytes_needed));
+ if (*r->out.bytes_needed < 0 || *r->out.bytes_needed > 8192) {
+ return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
+ }
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bytes_needed_0, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
}
@@ -2323,7 +2549,10 @@ _PUBLIC_ void ndr_print_svcctl_QueryServiceConfigW(struct ndr_print *ndr, const
if (flags & NDR_OUT) {
ndr_print_struct(ndr, "out", "svcctl_QueryServiceConfigW");
ndr->depth++;
- ndr_print_array_uint8(ndr, "query", r->out.query, r->in.buf_size);
+ ndr_print_ptr(ndr, "query", r->out.query);
+ ndr->depth++;
+ ndr_print_QUERY_SERVICE_CONFIG(ndr, "query", r->out.query);
+ ndr->depth--;
ndr_print_ptr(ndr, "bytes_needed", r->out.bytes_needed);
ndr->depth++;
ndr_print_uint32(ndr, "bytes_needed", *r->out.bytes_needed);
diff --git a/source3/librpc/gen_ndr/ndr_svcctl.h b/source3/librpc/gen_ndr/ndr_svcctl.h
index 4475b08792..0bebd3401a 100644
--- a/source3/librpc/gen_ndr/ndr_svcctl.h
+++ b/source3/librpc/gen_ndr/ndr_svcctl.h
@@ -108,6 +108,10 @@ enum ndr_err_code ndr_pull_svcctl_ServerType(struct ndr_pull *ndr, int ndr_flags
void ndr_print_svcctl_ServerType(struct ndr_print *ndr, const char *name, uint32_t r);
void ndr_print_svcctl_MgrAccessMask(struct ndr_print *ndr, const char *name, uint32_t r);
void ndr_print_svcctl_ServiceAccessMask(struct ndr_print *ndr, const char *name, uint32_t r);
+enum ndr_err_code ndr_push_QUERY_SERVICE_CONFIG(struct ndr_push *ndr, int ndr_flags, const struct QUERY_SERVICE_CONFIG *r);
+enum ndr_err_code ndr_pull_QUERY_SERVICE_CONFIG(struct ndr_pull *ndr, int ndr_flags, struct QUERY_SERVICE_CONFIG *r);
+void ndr_print_QUERY_SERVICE_CONFIG(struct ndr_print *ndr, const char *name, const struct QUERY_SERVICE_CONFIG *r);
+size_t ndr_size_QUERY_SERVICE_CONFIG(const struct QUERY_SERVICE_CONFIG *r, int flags);
void ndr_print_svcctl_CloseServiceHandle(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_CloseServiceHandle *r);
void ndr_print_svcctl_ControlService(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_ControlService *r);
void ndr_print_svcctl_DeleteService(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_DeleteService *r);
diff --git a/source3/librpc/gen_ndr/ndr_winreg.c b/source3/librpc/gen_ndr/ndr_winreg.c
index cc0d800f51..41c9acd7b9 100644
--- a/source3/librpc/gen_ndr/ndr_winreg.c
+++ b/source3/librpc/gen_ndr/ndr_winreg.c
@@ -4,7 +4,6 @@
#include "librpc/gen_ndr/ndr_winreg.h"
#include "librpc/gen_ndr/ndr_lsa.h"
-#include "librpc/gen_ndr/ndr_initshutdown.h"
#include "librpc/gen_ndr/ndr_security.h"
static enum ndr_err_code ndr_push_winreg_AccessMask(struct ndr_push *ndr, int ndr_flags, uint32_t r)
{
@@ -35,13 +34,13 @@ _PUBLIC_ void ndr_print_winreg_AccessMask(struct ndr_print *ndr, const char *nam
ndr->depth--;
}
-static enum ndr_err_code ndr_push_winreg_Type(struct ndr_push *ndr, int ndr_flags, enum winreg_Type r)
+_PUBLIC_ enum ndr_err_code ndr_push_winreg_Type(struct ndr_push *ndr, int ndr_flags, enum winreg_Type r)
{
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
return NDR_ERR_SUCCESS;
}
-static enum ndr_err_code ndr_pull_winreg_Type(struct ndr_pull *ndr, int ndr_flags, enum winreg_Type *r)
+_PUBLIC_ enum ndr_err_code ndr_pull_winreg_Type(struct ndr_pull *ndr, int ndr_flags, enum winreg_Type *r)
{
uint32_t v;
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
@@ -414,6 +413,31 @@ _PUBLIC_ void ndr_print_winreg_ValNameBuf(struct ndr_print *ndr, const char *nam
ndr->depth--;
}
+_PUBLIC_ enum ndr_err_code ndr_push_winreg_NotifyChangeType(struct ndr_push *ndr, int ndr_flags, uint32_t r)
+{
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_winreg_NotifyChangeType(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
+{
+ uint32_t v;
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
+ *r = v;
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_winreg_NotifyChangeType(struct ndr_print *ndr, const char *name, uint32_t r)
+{
+ ndr_print_uint32(ndr, name, r);
+ ndr->depth++;
+ ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "REG_NOTIFY_CHANGE_NAME", REG_NOTIFY_CHANGE_NAME, r);
+ ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "REG_NOTIFY_CHANGE_ATTRIBUTES", REG_NOTIFY_CHANGE_ATTRIBUTES, r);
+ ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "REG_NOTIFY_CHANGE_LAST_SET", REG_NOTIFY_CHANGE_LAST_SET, r);
+ ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "REG_NOTIFY_CHANGE_SECURITY", REG_NOTIFY_CHANGE_SECURITY, r);
+ ndr->depth--;
+}
+
static enum ndr_err_code ndr_push_KeySecurityAttribute(struct ndr_push *ndr, int ndr_flags, const struct KeySecurityAttribute *r)
{
if (ndr_flags & NDR_SCALARS) {
@@ -688,7 +712,7 @@ _PUBLIC_ void ndr_print_winreg_OpenHKCU(struct ndr_print *ndr, const char *name,
ndr->depth--;
}
-static enum ndr_err_code ndr_push_winreg_OpenHKLM(struct ndr_push *ndr, int flags, const struct winreg_OpenHKLM *r)
+_PUBLIC_ enum ndr_err_code ndr_push_winreg_OpenHKLM(struct ndr_push *ndr, int flags, const struct winreg_OpenHKLM *r)
{
if (flags & NDR_IN) {
NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name));
@@ -707,7 +731,7 @@ static enum ndr_err_code ndr_push_winreg_OpenHKLM(struct ndr_push *ndr, int flag
return NDR_ERR_SUCCESS;
}
-static enum ndr_err_code ndr_pull_winreg_OpenHKLM(struct ndr_pull *ndr, int flags, struct winreg_OpenHKLM *r)
+_PUBLIC_ enum ndr_err_code ndr_pull_winreg_OpenHKLM(struct ndr_pull *ndr, int flags, struct winreg_OpenHKLM *r)
{
uint32_t _ptr_system_name;
TALLOC_CTX *_mem_save_system_name_0;
@@ -952,7 +976,7 @@ _PUBLIC_ void ndr_print_winreg_OpenHKU(struct ndr_print *ndr, const char *name,
ndr->depth--;
}
-static enum ndr_err_code ndr_push_winreg_CloseKey(struct ndr_push *ndr, int flags, const struct winreg_CloseKey *r)
+_PUBLIC_ enum ndr_err_code ndr_push_winreg_CloseKey(struct ndr_push *ndr, int flags, const struct winreg_CloseKey *r)
{
if (flags & NDR_IN) {
if (r->in.handle == NULL) {
@@ -970,7 +994,7 @@ static enum ndr_err_code ndr_push_winreg_CloseKey(struct ndr_push *ndr, int flag
return NDR_ERR_SUCCESS;
}
-static enum ndr_err_code ndr_pull_winreg_CloseKey(struct ndr_pull *ndr, int flags, struct winreg_CloseKey *r)
+_PUBLIC_ enum ndr_err_code ndr_pull_winreg_CloseKey(struct ndr_pull *ndr, int flags, struct winreg_CloseKey *r)
{
TALLOC_CTX *_mem_save_handle_0;
if (flags & NDR_IN) {
@@ -1028,7 +1052,7 @@ _PUBLIC_ void ndr_print_winreg_CloseKey(struct ndr_print *ndr, const char *name,
ndr->depth--;
}
-static enum ndr_err_code ndr_push_winreg_CreateKey(struct ndr_push *ndr, int flags, const struct winreg_CreateKey *r)
+_PUBLIC_ enum ndr_err_code ndr_push_winreg_CreateKey(struct ndr_push *ndr, int flags, const struct winreg_CreateKey *r)
{
if (flags & NDR_IN) {
if (r->in.handle == NULL) {
@@ -1062,7 +1086,7 @@ static enum ndr_err_code ndr_push_winreg_CreateKey(struct ndr_push *ndr, int fla
return NDR_ERR_SUCCESS;
}
-static enum ndr_err_code ndr_pull_winreg_CreateKey(struct ndr_pull *ndr, int flags, struct winreg_CreateKey *r)
+_PUBLIC_ enum ndr_err_code ndr_pull_winreg_CreateKey(struct ndr_pull *ndr, int flags, struct winreg_CreateKey *r)
{
uint32_t _ptr_secdesc;
uint32_t _ptr_action_taken;
@@ -1187,7 +1211,7 @@ _PUBLIC_ void ndr_print_winreg_CreateKey(struct ndr_print *ndr, const char *name
ndr->depth--;
}
-static enum ndr_err_code ndr_push_winreg_DeleteKey(struct ndr_push *ndr, int flags, const struct winreg_DeleteKey *r)
+_PUBLIC_ enum ndr_err_code ndr_push_winreg_DeleteKey(struct ndr_push *ndr, int flags, const struct winreg_DeleteKey *r)
{
if (flags & NDR_IN) {
if (r->in.handle == NULL) {
@@ -1202,7 +1226,7 @@ static enum ndr_err_code ndr_push_winreg_DeleteKey(struct ndr_push *ndr, int fla
return NDR_ERR_SUCCESS;
}
-static enum ndr_err_code ndr_pull_winreg_DeleteKey(struct ndr_pull *ndr, int flags, struct winreg_DeleteKey *r)
+_PUBLIC_ enum ndr_err_code ndr_pull_winreg_DeleteKey(struct ndr_pull *ndr, int flags, struct winreg_DeleteKey *r)
{
TALLOC_CTX *_mem_save_handle_0;
if (flags & NDR_IN) {
@@ -1307,7 +1331,7 @@ _PUBLIC_ void ndr_print_winreg_DeleteValue(struct ndr_print *ndr, const char *na
ndr->depth--;
}
-static enum ndr_err_code ndr_push_winreg_EnumKey(struct ndr_push *ndr, int flags, const struct winreg_EnumKey *r)
+_PUBLIC_ enum ndr_err_code ndr_push_winreg_EnumKey(struct ndr_push *ndr, int flags, const struct winreg_EnumKey *r)
{
if (flags & NDR_IN) {
if (r->in.handle == NULL) {
@@ -1346,7 +1370,7 @@ static enum ndr_err_code ndr_push_winreg_EnumKey(struct ndr_push *ndr, int flags
return NDR_ERR_SUCCESS;
}
-static enum ndr_err_code ndr_pull_winreg_EnumKey(struct ndr_pull *ndr, int flags, struct winreg_EnumKey *r)
+_PUBLIC_ enum ndr_err_code ndr_pull_winreg_EnumKey(struct ndr_pull *ndr, int flags, struct winreg_EnumKey *r)
{
uint32_t _ptr_keyclass;
uint32_t _ptr_last_changed_time;
@@ -1494,7 +1518,7 @@ _PUBLIC_ void ndr_print_winreg_EnumKey(struct ndr_print *ndr, const char *name,
ndr->depth--;
}
-static enum ndr_err_code ndr_push_winreg_EnumValue(struct ndr_push *ndr, int flags, const struct winreg_EnumValue *r)
+_PUBLIC_ enum ndr_err_code ndr_push_winreg_EnumValue(struct ndr_push *ndr, int flags, const struct winreg_EnumValue *r)
{
if (flags & NDR_IN) {
if (r->in.handle == NULL) {
@@ -1555,7 +1579,7 @@ static enum ndr_err_code ndr_push_winreg_EnumValue(struct ndr_push *ndr, int fla
return NDR_ERR_SUCCESS;
}
-static enum ndr_err_code ndr_pull_winreg_EnumValue(struct ndr_pull *ndr, int flags, struct winreg_EnumValue *r)
+_PUBLIC_ enum ndr_err_code ndr_pull_winreg_EnumValue(struct ndr_pull *ndr, int flags, struct winreg_EnumValue *r)
{
uint32_t _ptr_type;
uint32_t _ptr_value;
@@ -1809,7 +1833,7 @@ _PUBLIC_ void ndr_print_winreg_EnumValue(struct ndr_print *ndr, const char *name
ndr->depth--;
}
-static enum ndr_err_code ndr_push_winreg_FlushKey(struct ndr_push *ndr, int flags, const struct winreg_FlushKey *r)
+_PUBLIC_ enum ndr_err_code ndr_push_winreg_FlushKey(struct ndr_push *ndr, int flags, const struct winreg_FlushKey *r)
{
if (flags & NDR_IN) {
if (r->in.handle == NULL) {
@@ -1823,7 +1847,7 @@ static enum ndr_err_code ndr_push_winreg_FlushKey(struct ndr_push *ndr, int flag
return NDR_ERR_SUCCESS;
}
-static enum ndr_err_code ndr_pull_winreg_FlushKey(struct ndr_pull *ndr, int flags, struct winreg_FlushKey *r)
+_PUBLIC_ enum ndr_err_code ndr_pull_winreg_FlushKey(struct ndr_pull *ndr, int flags, struct winreg_FlushKey *r)
{
TALLOC_CTX *_mem_save_handle_0;
if (flags & NDR_IN) {
@@ -1866,7 +1890,7 @@ _PUBLIC_ void ndr_print_winreg_FlushKey(struct ndr_print *ndr, const char *name,
ndr->depth--;
}
-static enum ndr_err_code ndr_push_winreg_GetKeySecurity(struct ndr_push *ndr, int flags, const struct winreg_GetKeySecurity *r)
+_PUBLIC_ enum ndr_err_code ndr_push_winreg_GetKeySecurity(struct ndr_push *ndr, int flags, const struct winreg_GetKeySecurity *r)
{
if (flags & NDR_IN) {
if (r->in.handle == NULL) {
@@ -1889,7 +1913,7 @@ static enum ndr_err_code ndr_push_winreg_GetKeySecurity(struct ndr_push *ndr, in
return NDR_ERR_SUCCESS;
}
-static enum ndr_err_code ndr_pull_winreg_GetKeySecurity(struct ndr_pull *ndr, int flags, struct winreg_GetKeySecurity *r)
+_PUBLIC_ enum ndr_err_code ndr_pull_winreg_GetKeySecurity(struct ndr_pull *ndr, int flags, struct winreg_GetKeySecurity *r)
{
TALLOC_CTX *_mem_save_handle_0;
TALLOC_CTX *_mem_save_sd_0;
@@ -2066,7 +2090,7 @@ _PUBLIC_ void ndr_print_winreg_LoadKey(struct ndr_print *ndr, const char *name,
ndr->depth--;
}
-static enum ndr_err_code ndr_push_winreg_NotifyChangeKeyValue(struct ndr_push *ndr, int flags, const struct winreg_NotifyChangeKeyValue *r)
+_PUBLIC_ enum ndr_err_code ndr_push_winreg_NotifyChangeKeyValue(struct ndr_push *ndr, int flags, const struct winreg_NotifyChangeKeyValue *r)
{
if (flags & NDR_IN) {
if (r->in.handle == NULL) {
@@ -2074,7 +2098,7 @@ static enum ndr_err_code ndr_push_winreg_NotifyChangeKeyValue(struct ndr_push *n
}
NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.watch_subtree));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.notify_filter));
+ NDR_CHECK(ndr_push_winreg_NotifyChangeType(ndr, NDR_SCALARS, r->in.notify_filter));
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown));
NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.string1));
NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.string2));
@@ -2086,7 +2110,7 @@ static enum ndr_err_code ndr_push_winreg_NotifyChangeKeyValue(struct ndr_push *n
return NDR_ERR_SUCCESS;
}
-static enum ndr_err_code ndr_pull_winreg_NotifyChangeKeyValue(struct ndr_pull *ndr, int flags, struct winreg_NotifyChangeKeyValue *r)
+_PUBLIC_ enum ndr_err_code ndr_pull_winreg_NotifyChangeKeyValue(struct ndr_pull *ndr, int flags, struct winreg_NotifyChangeKeyValue *r)
{
TALLOC_CTX *_mem_save_handle_0;
if (flags & NDR_IN) {
@@ -2098,7 +2122,7 @@ static enum ndr_err_code ndr_pull_winreg_NotifyChangeKeyValue(struct ndr_pull *n
NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.watch_subtree));
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.notify_filter));
+ NDR_CHECK(ndr_pull_winreg_NotifyChangeType(ndr, NDR_SCALARS, &r->in.notify_filter));
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown));
NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.string1));
NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.string2));
@@ -2125,7 +2149,7 @@ _PUBLIC_ void ndr_print_winreg_NotifyChangeKeyValue(struct ndr_print *ndr, const
ndr_print_policy_handle(ndr, "handle", r->in.handle);
ndr->depth--;
ndr_print_uint8(ndr, "watch_subtree", r->in.watch_subtree);
- ndr_print_uint32(ndr, "notify_filter", r->in.notify_filter);
+ ndr_print_winreg_NotifyChangeType(ndr, "notify_filter", r->in.notify_filter);
ndr_print_uint32(ndr, "unknown", r->in.unknown);
ndr_print_winreg_String(ndr, "string1", &r->in.string1);
ndr_print_winreg_String(ndr, "string2", &r->in.string2);
@@ -2141,7 +2165,7 @@ _PUBLIC_ void ndr_print_winreg_NotifyChangeKeyValue(struct ndr_print *ndr, const
ndr->depth--;
}
-static enum ndr_err_code ndr_push_winreg_OpenKey(struct ndr_push *ndr, int flags, const struct winreg_OpenKey *r)
+_PUBLIC_ enum ndr_err_code ndr_push_winreg_OpenKey(struct ndr_push *ndr, int flags, const struct winreg_OpenKey *r)
{
if (flags & NDR_IN) {
if (r->in.parent_handle == NULL) {
@@ -2162,7 +2186,7 @@ static enum ndr_err_code ndr_push_winreg_OpenKey(struct ndr_push *ndr, int flags
return NDR_ERR_SUCCESS;
}
-static enum ndr_err_code ndr_pull_winreg_OpenKey(struct ndr_pull *ndr, int flags, struct winreg_OpenKey *r)
+_PUBLIC_ enum ndr_err_code ndr_pull_winreg_OpenKey(struct ndr_pull *ndr, int flags, struct winreg_OpenKey *r)
{
TALLOC_CTX *_mem_save_parent_handle_0;
TALLOC_CTX *_mem_save_handle_0;
@@ -2227,7 +2251,7 @@ _PUBLIC_ void ndr_print_winreg_OpenKey(struct ndr_print *ndr, const char *name,
ndr->depth--;
}
-static enum ndr_err_code ndr_push_winreg_QueryInfoKey(struct ndr_push *ndr, int flags, const struct winreg_QueryInfoKey *r)
+_PUBLIC_ enum ndr_err_code ndr_push_winreg_QueryInfoKey(struct ndr_push *ndr, int flags, const struct winreg_QueryInfoKey *r)
{
if (flags & NDR_IN) {
if (r->in.handle == NULL) {
@@ -2281,7 +2305,7 @@ static enum ndr_err_code ndr_push_winreg_QueryInfoKey(struct ndr_push *ndr, int
return NDR_ERR_SUCCESS;
}
-static enum ndr_err_code ndr_pull_winreg_QueryInfoKey(struct ndr_pull *ndr, int flags, struct winreg_QueryInfoKey *r)
+_PUBLIC_ enum ndr_err_code ndr_pull_winreg_QueryInfoKey(struct ndr_pull *ndr, int flags, struct winreg_QueryInfoKey *r)
{
TALLOC_CTX *_mem_save_handle_0;
TALLOC_CTX *_mem_save_classname_0;
@@ -2463,7 +2487,7 @@ _PUBLIC_ void ndr_print_winreg_QueryInfoKey(struct ndr_print *ndr, const char *n
ndr->depth--;
}
-static enum ndr_err_code ndr_push_winreg_QueryValue(struct ndr_push *ndr, int flags, const struct winreg_QueryValue *r)
+_PUBLIC_ enum ndr_err_code ndr_push_winreg_QueryValue(struct ndr_push *ndr, int flags, const struct winreg_QueryValue *r)
{
if (flags & NDR_IN) {
if (r->in.handle == NULL) {
@@ -2482,16 +2506,16 @@ static enum ndr_err_code ndr_push_winreg_QueryValue(struct ndr_push *ndr, int fl
if (r->in.data) {
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.data_size));
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.value_length));
- NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.data, *r->in.value_length));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.data_length));
+ NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.data, *r->in.data_length));
}
NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.data_size));
if (r->in.data_size) {
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.data_size));
}
- NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.value_length));
- if (r->in.value_length) {
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.value_length));
+ NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.data_length));
+ if (r->in.data_length) {
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.data_length));
}
}
if (flags & NDR_OUT) {
@@ -2503,34 +2527,34 @@ static enum ndr_err_code ndr_push_winreg_QueryValue(struct ndr_push *ndr, int fl
if (r->out.data) {
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.data_size));
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.value_length));
- NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.data, *r->out.value_length));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.data_length));
+ NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.data, *r->out.data_length));
}
NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.data_size));
if (r->out.data_size) {
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.data_size));
}
- NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.value_length));
- if (r->out.value_length) {
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.value_length));
+ NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.data_length));
+ if (r->out.data_length) {
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.data_length));
}
NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
}
return NDR_ERR_SUCCESS;
}
-static enum ndr_err_code ndr_pull_winreg_QueryValue(struct ndr_pull *ndr, int flags, struct winreg_QueryValue *r)
+_PUBLIC_ enum ndr_err_code ndr_pull_winreg_QueryValue(struct ndr_pull *ndr, int flags, struct winreg_QueryValue *r)
{
uint32_t _ptr_type;
uint32_t _ptr_data;
uint32_t _ptr_data_size;
- uint32_t _ptr_value_length;
+ uint32_t _ptr_data_length;
TALLOC_CTX *_mem_save_handle_0;
TALLOC_CTX *_mem_save_value_name_0;
TALLOC_CTX *_mem_save_type_0;
TALLOC_CTX *_mem_save_data_0;
TALLOC_CTX *_mem_save_data_size_0;
- TALLOC_CTX *_mem_save_value_length_0;
+ TALLOC_CTX *_mem_save_data_length_0;
if (flags & NDR_IN) {
ZERO_STRUCT(r->out);
@@ -2590,25 +2614,25 @@ static enum ndr_err_code ndr_pull_winreg_QueryValue(struct ndr_pull *ndr, int fl
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.data_size));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_size_0, 0);
}
- NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_value_length));
- if (_ptr_value_length) {
- NDR_PULL_ALLOC(ndr, r->in.value_length);
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data_length));
+ if (_ptr_data_length) {
+ NDR_PULL_ALLOC(ndr, r->in.data_length);
} else {
- r->in.value_length = NULL;
+ r->in.data_length = NULL;
}
- if (r->in.value_length) {
- _mem_save_value_length_0 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, r->in.value_length, 0);
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.value_length));
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_value_length_0, 0);
+ if (r->in.data_length) {
+ _mem_save_data_length_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->in.data_length, 0);
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.data_length));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_length_0, 0);
}
if (r->in.data) {
if (r->in.data_size == NULL) return ndr_pull_error(ndr, NDR_ERR_INVALID_POINTER, "NULL Pointer for size_is()");
NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.data, *r->in.data_size));
}
if (r->in.data) {
- if (r->in.value_length == NULL) return ndr_pull_error(ndr, NDR_ERR_INVALID_POINTER, "NULL Pointer for length_is()");
- NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->in.data, *r->in.value_length));
+ if (r->in.data_length == NULL) return ndr_pull_error(ndr, NDR_ERR_INVALID_POINTER, "NULL Pointer for length_is()");
+ NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->in.data, *r->in.data_length));
}
}
if (flags & NDR_OUT) {
@@ -2654,17 +2678,17 @@ static enum ndr_err_code ndr_pull_winreg_QueryValue(struct ndr_pull *ndr, int fl
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.data_size));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_size_0, 0);
}
- NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_value_length));
- if (_ptr_value_length) {
- NDR_PULL_ALLOC(ndr, r->out.value_length);
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data_length));
+ if (_ptr_data_length) {
+ NDR_PULL_ALLOC(ndr, r->out.data_length);
} else {
- r->out.value_length = NULL;
+ r->out.data_length = NULL;
}
- if (r->out.value_length) {
- _mem_save_value_length_0 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, r->out.value_length, 0);
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.value_length));
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_value_length_0, 0);
+ if (r->out.data_length) {
+ _mem_save_data_length_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->out.data_length, 0);
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.data_length));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_length_0, 0);
}
NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
if (r->out.data) {
@@ -2672,8 +2696,8 @@ static enum ndr_err_code ndr_pull_winreg_QueryValue(struct ndr_pull *ndr, int fl
NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.data, *r->out.data_size));
}
if (r->out.data) {
- if (r->out.value_length == NULL) return ndr_pull_error(ndr, NDR_ERR_INVALID_POINTER, "NULL Pointer for length_is()");
- NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->out.data, *r->out.value_length));
+ if (r->out.data_length == NULL) return ndr_pull_error(ndr, NDR_ERR_INVALID_POINTER, "NULL Pointer for length_is()");
+ NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->out.data, *r->out.data_length));
}
}
return NDR_ERR_SUCCESS;
@@ -2706,8 +2730,8 @@ _PUBLIC_ void ndr_print_winreg_QueryValue(struct ndr_print *ndr, const char *nam
ndr_print_ptr(ndr, "data", r->in.data);
ndr->depth++;
if (r->in.data) {
- if (r->in.value_length == NULL) return;
- ndr_print_array_uint8(ndr, "data", r->in.data, *r->in.value_length);
+ if (r->in.data_length == NULL) return;
+ ndr_print_array_uint8(ndr, "data", r->in.data, *r->in.data_length);
}
ndr->depth--;
ndr_print_ptr(ndr, "data_size", r->in.data_size);
@@ -2716,10 +2740,10 @@ _PUBLIC_ void ndr_print_winreg_QueryValue(struct ndr_print *ndr, const char *nam
ndr_print_uint32(ndr, "data_size", *r->in.data_size);
}
ndr->depth--;
- ndr_print_ptr(ndr, "value_length", r->in.value_length);
+ ndr_print_ptr(ndr, "data_length", r->in.data_length);
ndr->depth++;
- if (r->in.value_length) {
- ndr_print_uint32(ndr, "value_length", *r->in.value_length);
+ if (r->in.data_length) {
+ ndr_print_uint32(ndr, "data_length", *r->in.data_length);
}
ndr->depth--;
ndr->depth--;
@@ -2736,8 +2760,8 @@ _PUBLIC_ void ndr_print_winreg_QueryValue(struct ndr_print *ndr, const char *nam
ndr_print_ptr(ndr, "data", r->out.data);
ndr->depth++;
if (r->out.data) {
- if (r->out.value_length == NULL) return;
- ndr_print_array_uint8(ndr, "data", r->out.data, *r->out.value_length);
+ if (r->out.data_length == NULL) return;
+ ndr_print_array_uint8(ndr, "data", r->out.data, *r->out.data_length);
}
ndr->depth--;
ndr_print_ptr(ndr, "data_size", r->out.data_size);
@@ -2746,10 +2770,10 @@ _PUBLIC_ void ndr_print_winreg_QueryValue(struct ndr_print *ndr, const char *nam
ndr_print_uint32(ndr, "data_size", *r->out.data_size);
}
ndr->depth--;
- ndr_print_ptr(ndr, "value_length", r->out.value_length);
+ ndr_print_ptr(ndr, "data_length", r->out.data_length);
ndr->depth++;
- if (r->out.value_length) {
- ndr_print_uint32(ndr, "value_length", *r->out.value_length);
+ if (r->out.data_length) {
+ ndr_print_uint32(ndr, "data_length", *r->out.data_length);
}
ndr->depth--;
ndr_print_WERROR(ndr, "result", r->out.result);
@@ -2979,7 +3003,7 @@ static enum ndr_err_code ndr_push_winreg_SetKeySecurity(struct ndr_push *ndr, in
return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
}
NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
- NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask));
+ NDR_CHECK(ndr_push_security_secinfo(ndr, NDR_SCALARS, r->in.sec_info));
if (r->in.sd == NULL) {
return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
}
@@ -3003,7 +3027,7 @@ static enum ndr_err_code ndr_pull_winreg_SetKeySecurity(struct ndr_pull *ndr, in
NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
- NDR_CHECK(ndr_pull_winreg_AccessMask(ndr, NDR_SCALARS, &r->in.access_mask));
+ NDR_CHECK(ndr_pull_security_secinfo(ndr, NDR_SCALARS, &r->in.sec_info));
if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
NDR_PULL_ALLOC(ndr, r->in.sd);
}
@@ -3032,7 +3056,7 @@ _PUBLIC_ void ndr_print_winreg_SetKeySecurity(struct ndr_print *ndr, const char
ndr->depth++;
ndr_print_policy_handle(ndr, "handle", r->in.handle);
ndr->depth--;
- ndr_print_winreg_AccessMask(ndr, "access_mask", r->in.access_mask);
+ ndr_print_security_secinfo(ndr, "sec_info", r->in.sec_info);
ndr_print_ptr(ndr, "sd", r->in.sd);
ndr->depth++;
ndr_print_KeySecurityData(ndr, "sd", r->in.sd);
@@ -3181,7 +3205,7 @@ static enum ndr_err_code ndr_push_winreg_InitiateSystemShutdown(struct ndr_push
}
NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.message));
if (r->in.message) {
- NDR_CHECK(ndr_push_initshutdown_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.message));
+ NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.message));
}
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.timeout));
NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.force_apps));
@@ -3221,7 +3245,7 @@ static enum ndr_err_code ndr_pull_winreg_InitiateSystemShutdown(struct ndr_pull
if (r->in.message) {
_mem_save_message_0 = NDR_PULL_GET_MEM_CTX(ndr);
NDR_PULL_SET_MEM_CTX(ndr, r->in.message, 0);
- NDR_CHECK(ndr_pull_initshutdown_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.message));
+ NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.message));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_message_0, 0);
}
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.timeout));
@@ -3253,7 +3277,7 @@ _PUBLIC_ void ndr_print_winreg_InitiateSystemShutdown(struct ndr_print *ndr, con
ndr_print_ptr(ndr, "message", r->in.message);
ndr->depth++;
if (r->in.message) {
- ndr_print_initshutdown_String(ndr, "message", r->in.message);
+ ndr_print_lsa_StringLarge(ndr, "message", r->in.message);
}
ndr->depth--;
ndr_print_uint32(ndr, "timeout", r->in.timeout);
@@ -3335,7 +3359,7 @@ _PUBLIC_ void ndr_print_winreg_AbortSystemShutdown(struct ndr_print *ndr, const
ndr->depth--;
}
-static enum ndr_err_code ndr_push_winreg_GetVersion(struct ndr_push *ndr, int flags, const struct winreg_GetVersion *r)
+_PUBLIC_ enum ndr_err_code ndr_push_winreg_GetVersion(struct ndr_push *ndr, int flags, const struct winreg_GetVersion *r)
{
if (flags & NDR_IN) {
if (r->in.handle == NULL) {
@@ -3353,7 +3377,7 @@ static enum ndr_err_code ndr_push_winreg_GetVersion(struct ndr_push *ndr, int fl
return NDR_ERR_SUCCESS;
}
-static enum ndr_err_code ndr_pull_winreg_GetVersion(struct ndr_pull *ndr, int flags, struct winreg_GetVersion *r)
+_PUBLIC_ enum ndr_err_code ndr_pull_winreg_GetVersion(struct ndr_pull *ndr, int flags, struct winreg_GetVersion *r)
{
TALLOC_CTX *_mem_save_handle_0;
TALLOC_CTX *_mem_save_version_0;
@@ -3588,7 +3612,7 @@ _PUBLIC_ void ndr_print_winreg_OpenHKDD(struct ndr_print *ndr, const char *name,
ndr->depth--;
}
-static enum ndr_err_code ndr_push_winreg_QueryMultipleValues(struct ndr_push *ndr, int flags, const struct winreg_QueryMultipleValues *r)
+_PUBLIC_ enum ndr_err_code ndr_push_winreg_QueryMultipleValues(struct ndr_push *ndr, int flags, const struct winreg_QueryMultipleValues *r)
{
uint32_t cntr_values_1;
if (flags & NDR_IN) {
@@ -3650,7 +3674,7 @@ static enum ndr_err_code ndr_push_winreg_QueryMultipleValues(struct ndr_push *nd
return NDR_ERR_SUCCESS;
}
-static enum ndr_err_code ndr_pull_winreg_QueryMultipleValues(struct ndr_pull *ndr, int flags, struct winreg_QueryMultipleValues *r)
+_PUBLIC_ enum ndr_err_code ndr_pull_winreg_QueryMultipleValues(struct ndr_pull *ndr, int flags, struct winreg_QueryMultipleValues *r)
{
uint32_t cntr_values_1;
uint32_t _ptr_buffer;
@@ -3872,7 +3896,7 @@ static enum ndr_err_code ndr_push_winreg_InitiateSystemShutdownEx(struct ndr_pus
}
NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.message));
if (r->in.message) {
- NDR_CHECK(ndr_push_initshutdown_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.message));
+ NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.message));
}
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.timeout));
NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.force_apps));
@@ -3913,7 +3937,7 @@ static enum ndr_err_code ndr_pull_winreg_InitiateSystemShutdownEx(struct ndr_pul
if (r->in.message) {
_mem_save_message_0 = NDR_PULL_GET_MEM_CTX(ndr);
NDR_PULL_SET_MEM_CTX(ndr, r->in.message, 0);
- NDR_CHECK(ndr_pull_initshutdown_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.message));
+ NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.message));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_message_0, 0);
}
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.timeout));
@@ -3946,7 +3970,7 @@ _PUBLIC_ void ndr_print_winreg_InitiateSystemShutdownEx(struct ndr_print *ndr, c
ndr_print_ptr(ndr, "message", r->in.message);
ndr->depth++;
if (r->in.message) {
- ndr_print_initshutdown_String(ndr, "message", r->in.message);
+ ndr_print_lsa_StringLarge(ndr, "message", r->in.message);
}
ndr->depth--;
ndr_print_uint32(ndr, "timeout", r->in.timeout);
diff --git a/source3/librpc/gen_ndr/ndr_winreg.h b/source3/librpc/gen_ndr/ndr_winreg.h
index c093b0d1e0..ed988638ff 100644
--- a/source3/librpc/gen_ndr/ndr_winreg.h
+++ b/source3/librpc/gen_ndr/ndr_winreg.h
@@ -83,6 +83,8 @@ extern const struct ndr_interface_table ndr_table_winreg;
#define NDR_WINREG_CALL_COUNT (35)
void ndr_print_winreg_AccessMask(struct ndr_print *ndr, const char *name, uint32_t r);
+enum ndr_err_code ndr_push_winreg_Type(struct ndr_push *ndr, int ndr_flags, enum winreg_Type r);
+enum ndr_err_code ndr_pull_winreg_Type(struct ndr_pull *ndr, int ndr_flags, enum winreg_Type *r);
void ndr_print_winreg_Type(struct ndr_print *ndr, const char *name, enum winreg_Type r);
enum ndr_err_code ndr_push_winreg_String(struct ndr_push *ndr, int ndr_flags, const struct winreg_String *r);
enum ndr_err_code ndr_pull_winreg_String(struct ndr_pull *ndr, int ndr_flags, struct winreg_String *r);
@@ -92,25 +94,52 @@ void ndr_print_winreg_SecBuf(struct ndr_print *ndr, const char *name, const stru
void ndr_print_winreg_CreateAction(struct ndr_print *ndr, const char *name, enum winreg_CreateAction r);
void ndr_print_winreg_StringBuf(struct ndr_print *ndr, const char *name, const struct winreg_StringBuf *r);
void ndr_print_winreg_ValNameBuf(struct ndr_print *ndr, const char *name, const struct winreg_ValNameBuf *r);
+enum ndr_err_code ndr_push_winreg_NotifyChangeType(struct ndr_push *ndr, int ndr_flags, uint32_t r);
+enum ndr_err_code ndr_pull_winreg_NotifyChangeType(struct ndr_pull *ndr, int ndr_flags, uint32_t *r);
+void ndr_print_winreg_NotifyChangeType(struct ndr_print *ndr, const char *name, uint32_t r);
void ndr_print_KeySecurityAttribute(struct ndr_print *ndr, const char *name, const struct KeySecurityAttribute *r);
void ndr_print_QueryMultipleValue(struct ndr_print *ndr, const char *name, const struct QueryMultipleValue *r);
void ndr_print_winreg_OpenHKCR(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKCR *r);
void ndr_print_winreg_OpenHKCU(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKCU *r);
+enum ndr_err_code ndr_push_winreg_OpenHKLM(struct ndr_push *ndr, int flags, const struct winreg_OpenHKLM *r);
+enum ndr_err_code ndr_pull_winreg_OpenHKLM(struct ndr_pull *ndr, int flags, struct winreg_OpenHKLM *r);
void ndr_print_winreg_OpenHKLM(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKLM *r);
void ndr_print_winreg_OpenHKPD(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKPD *r);
void ndr_print_winreg_OpenHKU(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKU *r);
+enum ndr_err_code ndr_push_winreg_CloseKey(struct ndr_push *ndr, int flags, const struct winreg_CloseKey *r);
+enum ndr_err_code ndr_pull_winreg_CloseKey(struct ndr_pull *ndr, int flags, struct winreg_CloseKey *r);
void ndr_print_winreg_CloseKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_CloseKey *r);
+enum ndr_err_code ndr_push_winreg_CreateKey(struct ndr_push *ndr, int flags, const struct winreg_CreateKey *r);
+enum ndr_err_code ndr_pull_winreg_CreateKey(struct ndr_pull *ndr, int flags, struct winreg_CreateKey *r);
void ndr_print_winreg_CreateKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_CreateKey *r);
+enum ndr_err_code ndr_push_winreg_DeleteKey(struct ndr_push *ndr, int flags, const struct winreg_DeleteKey *r);
+enum ndr_err_code ndr_pull_winreg_DeleteKey(struct ndr_pull *ndr, int flags, struct winreg_DeleteKey *r);
void ndr_print_winreg_DeleteKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_DeleteKey *r);
void ndr_print_winreg_DeleteValue(struct ndr_print *ndr, const char *name, int flags, const struct winreg_DeleteValue *r);
+enum ndr_err_code ndr_push_winreg_EnumKey(struct ndr_push *ndr, int flags, const struct winreg_EnumKey *r);
+enum ndr_err_code ndr_pull_winreg_EnumKey(struct ndr_pull *ndr, int flags, struct winreg_EnumKey *r);
void ndr_print_winreg_EnumKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_EnumKey *r);
+enum ndr_err_code ndr_push_winreg_EnumValue(struct ndr_push *ndr, int flags, const struct winreg_EnumValue *r);
+enum ndr_err_code ndr_pull_winreg_EnumValue(struct ndr_pull *ndr, int flags, struct winreg_EnumValue *r);
void ndr_print_winreg_EnumValue(struct ndr_print *ndr, const char *name, int flags, const struct winreg_EnumValue *r);
+enum ndr_err_code ndr_push_winreg_FlushKey(struct ndr_push *ndr, int flags, const struct winreg_FlushKey *r);
+enum ndr_err_code ndr_pull_winreg_FlushKey(struct ndr_pull *ndr, int flags, struct winreg_FlushKey *r);
void ndr_print_winreg_FlushKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_FlushKey *r);
+enum ndr_err_code ndr_push_winreg_GetKeySecurity(struct ndr_push *ndr, int flags, const struct winreg_GetKeySecurity *r);
+enum ndr_err_code ndr_pull_winreg_GetKeySecurity(struct ndr_pull *ndr, int flags, struct winreg_GetKeySecurity *r);
void ndr_print_winreg_GetKeySecurity(struct ndr_print *ndr, const char *name, int flags, const struct winreg_GetKeySecurity *r);
void ndr_print_winreg_LoadKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_LoadKey *r);
+enum ndr_err_code ndr_push_winreg_NotifyChangeKeyValue(struct ndr_push *ndr, int flags, const struct winreg_NotifyChangeKeyValue *r);
+enum ndr_err_code ndr_pull_winreg_NotifyChangeKeyValue(struct ndr_pull *ndr, int flags, struct winreg_NotifyChangeKeyValue *r);
void ndr_print_winreg_NotifyChangeKeyValue(struct ndr_print *ndr, const char *name, int flags, const struct winreg_NotifyChangeKeyValue *r);
+enum ndr_err_code ndr_push_winreg_OpenKey(struct ndr_push *ndr, int flags, const struct winreg_OpenKey *r);
+enum ndr_err_code ndr_pull_winreg_OpenKey(struct ndr_pull *ndr, int flags, struct winreg_OpenKey *r);
void ndr_print_winreg_OpenKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenKey *r);
+enum ndr_err_code ndr_push_winreg_QueryInfoKey(struct ndr_push *ndr, int flags, const struct winreg_QueryInfoKey *r);
+enum ndr_err_code ndr_pull_winreg_QueryInfoKey(struct ndr_pull *ndr, int flags, struct winreg_QueryInfoKey *r);
void ndr_print_winreg_QueryInfoKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_QueryInfoKey *r);
+enum ndr_err_code ndr_push_winreg_QueryValue(struct ndr_push *ndr, int flags, const struct winreg_QueryValue *r);
+enum ndr_err_code ndr_pull_winreg_QueryValue(struct ndr_pull *ndr, int flags, struct winreg_QueryValue *r);
void ndr_print_winreg_QueryValue(struct ndr_print *ndr, const char *name, int flags, const struct winreg_QueryValue *r);
void ndr_print_winreg_ReplaceKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_ReplaceKey *r);
void ndr_print_winreg_RestoreKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_RestoreKey *r);
@@ -120,9 +149,13 @@ void ndr_print_winreg_SetValue(struct ndr_print *ndr, const char *name, int flag
void ndr_print_winreg_UnLoadKey(struct ndr_print *ndr, const char *name, int flags, const struct winreg_UnLoadKey *r);
void ndr_print_winreg_InitiateSystemShutdown(struct ndr_print *ndr, const char *name, int flags, const struct winreg_InitiateSystemShutdown *r);
void ndr_print_winreg_AbortSystemShutdown(struct ndr_print *ndr, const char *name, int flags, const struct winreg_AbortSystemShutdown *r);
+enum ndr_err_code ndr_push_winreg_GetVersion(struct ndr_push *ndr, int flags, const struct winreg_GetVersion *r);
+enum ndr_err_code ndr_pull_winreg_GetVersion(struct ndr_pull *ndr, int flags, struct winreg_GetVersion *r);
void ndr_print_winreg_GetVersion(struct ndr_print *ndr, const char *name, int flags, const struct winreg_GetVersion *r);
void ndr_print_winreg_OpenHKCC(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKCC *r);
void ndr_print_winreg_OpenHKDD(struct ndr_print *ndr, const char *name, int flags, const struct winreg_OpenHKDD *r);
+enum ndr_err_code ndr_push_winreg_QueryMultipleValues(struct ndr_push *ndr, int flags, const struct winreg_QueryMultipleValues *r);
+enum ndr_err_code ndr_pull_winreg_QueryMultipleValues(struct ndr_pull *ndr, int flags, struct winreg_QueryMultipleValues *r);
void ndr_print_winreg_QueryMultipleValues(struct ndr_print *ndr, const char *name, int flags, const struct winreg_QueryMultipleValues *r);
void ndr_print_winreg_InitiateSystemShutdownEx(struct ndr_print *ndr, const char *name, int flags, const struct winreg_InitiateSystemShutdownEx *r);
void ndr_print_winreg_SaveKeyEx(struct ndr_print *ndr, const char *name, int flags, const struct winreg_SaveKeyEx *r);
diff --git a/source3/librpc/gen_ndr/ndr_xattr.c b/source3/librpc/gen_ndr/ndr_xattr.c
index 92369835cf..0e9dda9f47 100644
--- a/source3/librpc/gen_ndr/ndr_xattr.c
+++ b/source3/librpc/gen_ndr/ndr_xattr.c
@@ -3,7 +3,244 @@
#include "includes.h"
#include "librpc/gen_ndr/ndr_xattr.h"
-_PUBLIC_ enum ndr_err_code ndr_push_tdb_xattr(struct ndr_push *ndr, int ndr_flags, const struct tdb_xattr *r)
+#include "librpc/gen_ndr/ndr_security.h"
+static enum ndr_err_code ndr_push_xattr_DosInfo1(struct ndr_push *ndr, int ndr_flags, const struct xattr_DosInfo1 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->attrib));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ea_size));
+ NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->size));
+ NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->alloc_size));
+ NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->create_time));
+ NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->change_time));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_xattr_DosInfo1(struct ndr_pull *ndr, int ndr_flags, struct xattr_DosInfo1 *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->attrib));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ea_size));
+ NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->size));
+ NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->alloc_size));
+ NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->create_time));
+ NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->change_time));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_xattr_DosInfo1(struct ndr_print *ndr, const char *name, const struct xattr_DosInfo1 *r)
+{
+ ndr_print_struct(ndr, name, "xattr_DosInfo1");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "attrib", r->attrib);
+ ndr_print_uint32(ndr, "ea_size", r->ea_size);
+ ndr_print_udlong(ndr, "size", r->size);
+ ndr_print_udlong(ndr, "alloc_size", r->alloc_size);
+ ndr_print_NTTIME(ndr, "create_time", r->create_time);
+ ndr_print_NTTIME(ndr, "change_time", r->change_time);
+ ndr->depth--;
+}
+
+static enum ndr_err_code ndr_push_xattr_DosInfo2Old(struct ndr_push *ndr, int ndr_flags, const struct xattr_DosInfo2Old *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->flags));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->attrib));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ea_size));
+ NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->size));
+ NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->alloc_size));
+ NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->create_time));
+ NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->change_time));
+ NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->write_time));
+ {
+ uint32_t _flags_save_string = ndr->flags;
+ ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM);
+ NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->name));
+ ndr->flags = _flags_save_string;
+ }
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_xattr_DosInfo2Old(struct ndr_pull *ndr, int ndr_flags, struct xattr_DosInfo2Old *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->flags));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->attrib));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ea_size));
+ NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->size));
+ NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->alloc_size));
+ NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->create_time));
+ NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->change_time));
+ NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->write_time));
+ {
+ uint32_t _flags_save_string = ndr->flags;
+ ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM);
+ NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->name));
+ ndr->flags = _flags_save_string;
+ }
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_xattr_DosInfo2Old(struct ndr_print *ndr, const char *name, const struct xattr_DosInfo2Old *r)
+{
+ ndr_print_struct(ndr, name, "xattr_DosInfo2Old");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "flags", r->flags);
+ ndr_print_uint32(ndr, "attrib", r->attrib);
+ ndr_print_uint32(ndr, "ea_size", r->ea_size);
+ ndr_print_udlong(ndr, "size", r->size);
+ ndr_print_udlong(ndr, "alloc_size", r->alloc_size);
+ ndr_print_NTTIME(ndr, "create_time", r->create_time);
+ ndr_print_NTTIME(ndr, "change_time", r->change_time);
+ ndr_print_NTTIME(ndr, "write_time", r->write_time);
+ ndr_print_string(ndr, "name", r->name);
+ ndr->depth--;
+}
+
+static enum ndr_err_code ndr_push_xattr_DosInfo(struct ndr_push *ndr, int ndr_flags, const union xattr_DosInfo *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ int level = ndr_push_get_switch_value(ndr, r);
+ NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level));
+ switch (level) {
+ case 1: {
+ NDR_CHECK(ndr_push_xattr_DosInfo1(ndr, NDR_SCALARS, &r->info1));
+ break; }
+
+ case 2: {
+ NDR_CHECK(ndr_push_xattr_DosInfo2Old(ndr, NDR_SCALARS, &r->oldinfo2));
+ break; }
+
+ default:
+ return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
+ }
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ int level = ndr_push_get_switch_value(ndr, r);
+ switch (level) {
+ case 1:
+ break;
+
+ case 2:
+ break;
+
+ default:
+ return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
+ }
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_xattr_DosInfo(struct ndr_pull *ndr, int ndr_flags, union xattr_DosInfo *r)
+{
+ int level;
+ uint16_t _level;
+ level = ndr_pull_get_switch_value(ndr, r);
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level));
+ if (_level != level) {
+ return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
+ }
+ switch (level) {
+ case 1: {
+ NDR_CHECK(ndr_pull_xattr_DosInfo1(ndr, NDR_SCALARS, &r->info1));
+ break; }
+
+ case 2: {
+ NDR_CHECK(ndr_pull_xattr_DosInfo2Old(ndr, NDR_SCALARS, &r->oldinfo2));
+ break; }
+
+ default:
+ return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
+ }
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ switch (level) {
+ case 1:
+ break;
+
+ case 2:
+ break;
+
+ default:
+ return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
+ }
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_xattr_DosInfo(struct ndr_print *ndr, const char *name, const union xattr_DosInfo *r)
+{
+ int level;
+ level = ndr_print_get_switch_value(ndr, r);
+ ndr_print_union(ndr, name, level, "xattr_DosInfo");
+ switch (level) {
+ case 1:
+ ndr_print_xattr_DosInfo1(ndr, "info1", &r->info1);
+ break;
+
+ case 2:
+ ndr_print_xattr_DosInfo2Old(ndr, "oldinfo2", &r->oldinfo2);
+ break;
+
+ default:
+ ndr_print_bad_level(ndr, name, level);
+ }
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_xattr_DosAttrib(struct ndr_push *ndr, int ndr_flags, const struct xattr_DosAttrib *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->version));
+ NDR_CHECK(ndr_push_set_switch_value(ndr, &r->info, r->version));
+ NDR_CHECK(ndr_push_xattr_DosInfo(ndr, NDR_SCALARS, &r->info));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_xattr_DosAttrib(struct ndr_pull *ndr, int ndr_flags, struct xattr_DosAttrib *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->version));
+ NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->info, r->version));
+ NDR_CHECK(ndr_pull_xattr_DosInfo(ndr, NDR_SCALARS, &r->info));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_xattr_DosAttrib(struct ndr_print *ndr, const char *name, const struct xattr_DosAttrib *r)
+{
+ ndr_print_struct(ndr, name, "xattr_DosAttrib");
+ ndr->depth++;
+ ndr_print_uint16(ndr, "version", r->version);
+ ndr_print_set_switch_value(ndr, &r->info, r->version);
+ ndr_print_xattr_DosInfo(ndr, "info", &r->info);
+ ndr->depth--;
+}
+
+static enum ndr_err_code ndr_push_xattr_EA(struct ndr_push *ndr, int ndr_flags, const struct xattr_EA *r)
{
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_push_align(ndr, 4));
@@ -20,7 +257,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_tdb_xattr(struct ndr_push *ndr, int ndr_flag
return NDR_ERR_SUCCESS;
}
-_PUBLIC_ enum ndr_err_code ndr_pull_tdb_xattr(struct ndr_pull *ndr, int ndr_flags, struct tdb_xattr *r)
+static enum ndr_err_code ndr_pull_xattr_EA(struct ndr_pull *ndr, int ndr_flags, struct xattr_EA *r)
{
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_pull_align(ndr, 4));
@@ -37,23 +274,103 @@ _PUBLIC_ enum ndr_err_code ndr_pull_tdb_xattr(struct ndr_pull *ndr, int ndr_flag
return NDR_ERR_SUCCESS;
}
-_PUBLIC_ void ndr_print_tdb_xattr(struct ndr_print *ndr, const char *name, const struct tdb_xattr *r)
+_PUBLIC_ void ndr_print_xattr_EA(struct ndr_print *ndr, const char *name, const struct xattr_EA *r)
{
- ndr_print_struct(ndr, name, "tdb_xattr");
+ ndr_print_struct(ndr, name, "xattr_EA");
ndr->depth++;
ndr_print_string(ndr, "name", r->name);
ndr_print_DATA_BLOB(ndr, "value", r->value);
ndr->depth--;
}
+_PUBLIC_ enum ndr_err_code ndr_push_xattr_DosEAs(struct ndr_push *ndr, int ndr_flags, const struct xattr_DosEAs *r)
+{
+ uint32_t cntr_eas_1;
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->num_eas));
+ NDR_CHECK(ndr_push_unique_ptr(ndr, r->eas));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ if (r->eas) {
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_eas));
+ for (cntr_eas_1 = 0; cntr_eas_1 < r->num_eas; cntr_eas_1++) {
+ NDR_CHECK(ndr_push_xattr_EA(ndr, NDR_SCALARS, &r->eas[cntr_eas_1]));
+ }
+ }
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_xattr_DosEAs(struct ndr_pull *ndr, int ndr_flags, struct xattr_DosEAs *r)
+{
+ uint32_t _ptr_eas;
+ uint32_t cntr_eas_1;
+ TALLOC_CTX *_mem_save_eas_0;
+ TALLOC_CTX *_mem_save_eas_1;
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->num_eas));
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_eas));
+ if (_ptr_eas) {
+ NDR_PULL_ALLOC(ndr, r->eas);
+ } else {
+ r->eas = NULL;
+ }
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ if (r->eas) {
+ _mem_save_eas_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->eas, 0);
+ NDR_CHECK(ndr_pull_array_size(ndr, &r->eas));
+ NDR_PULL_ALLOC_N(ndr, r->eas, ndr_get_array_size(ndr, &r->eas));
+ _mem_save_eas_1 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->eas, 0);
+ for (cntr_eas_1 = 0; cntr_eas_1 < r->num_eas; cntr_eas_1++) {
+ NDR_CHECK(ndr_pull_xattr_EA(ndr, NDR_SCALARS, &r->eas[cntr_eas_1]));
+ }
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_eas_1, 0);
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_eas_0, 0);
+ }
+ if (r->eas) {
+ NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->eas, r->num_eas));
+ }
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_xattr_DosEAs(struct ndr_print *ndr, const char *name, const struct xattr_DosEAs *r)
+{
+ uint32_t cntr_eas_1;
+ ndr_print_struct(ndr, name, "xattr_DosEAs");
+ ndr->depth++;
+ ndr_print_uint16(ndr, "num_eas", r->num_eas);
+ ndr_print_ptr(ndr, "eas", r->eas);
+ ndr->depth++;
+ if (r->eas) {
+ ndr->print(ndr, "%s: ARRAY(%d)", "eas", (int)r->num_eas);
+ ndr->depth++;
+ for (cntr_eas_1=0;cntr_eas_1<r->num_eas;cntr_eas_1++) {
+ char *idx_1=NULL;
+ if (asprintf(&idx_1, "[%d]", cntr_eas_1) != -1) {
+ ndr_print_xattr_EA(ndr, "eas", &r->eas[cntr_eas_1]);
+ free(idx_1);
+ }
+ }
+ ndr->depth--;
+ }
+ ndr->depth--;
+ ndr->depth--;
+}
+
_PUBLIC_ enum ndr_err_code ndr_push_tdb_xattrs(struct ndr_push *ndr, int ndr_flags, const struct tdb_xattrs *r)
{
- uint32_t cntr_xattrs_0;
+ uint32_t cntr_eas_0;
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_push_align(ndr, 4));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_xattrs));
- for (cntr_xattrs_0 = 0; cntr_xattrs_0 < r->num_xattrs; cntr_xattrs_0++) {
- NDR_CHECK(ndr_push_tdb_xattr(ndr, NDR_SCALARS, &r->xattrs[cntr_xattrs_0]));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_eas));
+ for (cntr_eas_0 = 0; cntr_eas_0 < r->num_eas; cntr_eas_0++) {
+ NDR_CHECK(ndr_push_xattr_EA(ndr, NDR_SCALARS, &r->eas[cntr_eas_0]));
}
}
if (ndr_flags & NDR_BUFFERS) {
@@ -63,18 +380,18 @@ _PUBLIC_ enum ndr_err_code ndr_push_tdb_xattrs(struct ndr_push *ndr, int ndr_fla
_PUBLIC_ enum ndr_err_code ndr_pull_tdb_xattrs(struct ndr_pull *ndr, int ndr_flags, struct tdb_xattrs *r)
{
- uint32_t cntr_xattrs_0;
- TALLOC_CTX *_mem_save_xattrs_0;
+ uint32_t cntr_eas_0;
+ TALLOC_CTX *_mem_save_eas_0;
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_pull_align(ndr, 4));
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_xattrs));
- NDR_PULL_ALLOC_N(ndr, r->xattrs, r->num_xattrs);
- _mem_save_xattrs_0 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, r->xattrs, 0);
- for (cntr_xattrs_0 = 0; cntr_xattrs_0 < r->num_xattrs; cntr_xattrs_0++) {
- NDR_CHECK(ndr_pull_tdb_xattr(ndr, NDR_SCALARS, &r->xattrs[cntr_xattrs_0]));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_eas));
+ NDR_PULL_ALLOC_N(ndr, r->eas, r->num_eas);
+ _mem_save_eas_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->eas, 0);
+ for (cntr_eas_0 = 0; cntr_eas_0 < r->num_eas; cntr_eas_0++) {
+ NDR_CHECK(ndr_pull_xattr_EA(ndr, NDR_SCALARS, &r->eas[cntr_eas_0]));
}
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_xattrs_0, 0);
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_eas_0, 0);
}
if (ndr_flags & NDR_BUFFERS) {
}
@@ -83,16 +400,16 @@ _PUBLIC_ enum ndr_err_code ndr_pull_tdb_xattrs(struct ndr_pull *ndr, int ndr_fla
_PUBLIC_ void ndr_print_tdb_xattrs(struct ndr_print *ndr, const char *name, const struct tdb_xattrs *r)
{
- uint32_t cntr_xattrs_0;
+ uint32_t cntr_eas_0;
ndr_print_struct(ndr, name, "tdb_xattrs");
ndr->depth++;
- ndr_print_uint32(ndr, "num_xattrs", r->num_xattrs);
- ndr->print(ndr, "%s: ARRAY(%d)", "xattrs", (int)r->num_xattrs);
+ ndr_print_uint32(ndr, "num_eas", r->num_eas);
+ ndr->print(ndr, "%s: ARRAY(%d)", "eas", (int)r->num_eas);
ndr->depth++;
- for (cntr_xattrs_0=0;cntr_xattrs_0<r->num_xattrs;cntr_xattrs_0++) {
+ for (cntr_eas_0=0;cntr_eas_0<r->num_eas;cntr_eas_0++) {
char *idx_0=NULL;
- if (asprintf(&idx_0, "[%d]", cntr_xattrs_0) != -1) {
- ndr_print_tdb_xattr(ndr, "xattrs", &r->xattrs[cntr_xattrs_0]);
+ if (asprintf(&idx_0, "[%d]", cntr_eas_0) != -1) {
+ ndr_print_xattr_EA(ndr, "eas", &r->eas[cntr_eas_0]);
free(idx_0);
}
}
@@ -100,6 +417,135 @@ _PUBLIC_ void ndr_print_tdb_xattrs(struct ndr_print *ndr, const char *name, cons
ndr->depth--;
}
+static enum ndr_err_code ndr_push_xattr_DosStream(struct ndr_push *ndr, int ndr_flags, const struct xattr_DosStream *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->flags));
+ NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->size));
+ NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->alloc_size));
+ {
+ uint32_t _flags_save_string = ndr->flags;
+ ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM);
+ NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->name));
+ ndr->flags = _flags_save_string;
+ }
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_xattr_DosStream(struct ndr_pull *ndr, int ndr_flags, struct xattr_DosStream *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->flags));
+ NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->size));
+ NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->alloc_size));
+ {
+ uint32_t _flags_save_string = ndr->flags;
+ ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM);
+ NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->name));
+ ndr->flags = _flags_save_string;
+ }
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_xattr_DosStream(struct ndr_print *ndr, const char *name, const struct xattr_DosStream *r)
+{
+ ndr_print_struct(ndr, name, "xattr_DosStream");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "flags", r->flags);
+ ndr_print_udlong(ndr, "size", r->size);
+ ndr_print_udlong(ndr, "alloc_size", r->alloc_size);
+ ndr_print_string(ndr, "name", r->name);
+ ndr->depth--;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_xattr_DosStreams(struct ndr_push *ndr, int ndr_flags, const struct xattr_DosStreams *r)
+{
+ uint32_t cntr_streams_1;
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_streams));
+ NDR_CHECK(ndr_push_unique_ptr(ndr, r->streams));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ if (r->streams) {
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_streams));
+ for (cntr_streams_1 = 0; cntr_streams_1 < r->num_streams; cntr_streams_1++) {
+ NDR_CHECK(ndr_push_xattr_DosStream(ndr, NDR_SCALARS, &r->streams[cntr_streams_1]));
+ }
+ }
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_xattr_DosStreams(struct ndr_pull *ndr, int ndr_flags, struct xattr_DosStreams *r)
+{
+ uint32_t _ptr_streams;
+ uint32_t cntr_streams_1;
+ TALLOC_CTX *_mem_save_streams_0;
+ TALLOC_CTX *_mem_save_streams_1;
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_streams));
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_streams));
+ if (_ptr_streams) {
+ NDR_PULL_ALLOC(ndr, r->streams);
+ } else {
+ r->streams = NULL;
+ }
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ if (r->streams) {
+ _mem_save_streams_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->streams, 0);
+ NDR_CHECK(ndr_pull_array_size(ndr, &r->streams));
+ NDR_PULL_ALLOC_N(ndr, r->streams, ndr_get_array_size(ndr, &r->streams));
+ _mem_save_streams_1 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->streams, 0);
+ for (cntr_streams_1 = 0; cntr_streams_1 < r->num_streams; cntr_streams_1++) {
+ NDR_CHECK(ndr_pull_xattr_DosStream(ndr, NDR_SCALARS, &r->streams[cntr_streams_1]));
+ }
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_streams_1, 0);
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_streams_0, 0);
+ }
+ if (r->streams) {
+ NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->streams, r->num_streams));
+ }
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_xattr_DosStreams(struct ndr_print *ndr, const char *name, const struct xattr_DosStreams *r)
+{
+ uint32_t cntr_streams_1;
+ ndr_print_struct(ndr, name, "xattr_DosStreams");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "num_streams", r->num_streams);
+ ndr_print_ptr(ndr, "streams", r->streams);
+ ndr->depth++;
+ if (r->streams) {
+ ndr->print(ndr, "%s: ARRAY(%d)", "streams", (int)r->num_streams);
+ ndr->depth++;
+ for (cntr_streams_1=0;cntr_streams_1<r->num_streams;cntr_streams_1++) {
+ char *idx_1=NULL;
+ if (asprintf(&idx_1, "[%d]", cntr_streams_1) != -1) {
+ ndr_print_xattr_DosStream(ndr, "streams", &r->streams[cntr_streams_1]);
+ free(idx_1);
+ }
+ }
+ ndr->depth--;
+ }
+ ndr->depth--;
+ ndr->depth--;
+}
+
_PUBLIC_ enum ndr_err_code ndr_push_security_descriptor_timestamp(struct ndr_push *ndr, int ndr_flags, const struct security_descriptor_timestamp *r)
{
if (ndr_flags & NDR_SCALARS) {
diff --git a/source3/librpc/gen_ndr/ndr_xattr.h b/source3/librpc/gen_ndr/ndr_xattr.h
index 21c5ae03b5..38701b1aca 100644
--- a/source3/librpc/gen_ndr/ndr_xattr.h
+++ b/source3/librpc/gen_ndr/ndr_xattr.h
@@ -7,12 +7,23 @@
#define _HEADER_NDR_xattr
#define NDR_XATTR_CALL_COUNT (0)
-enum ndr_err_code ndr_push_tdb_xattr(struct ndr_push *ndr, int ndr_flags, const struct tdb_xattr *r);
-enum ndr_err_code ndr_pull_tdb_xattr(struct ndr_pull *ndr, int ndr_flags, struct tdb_xattr *r);
-void ndr_print_tdb_xattr(struct ndr_print *ndr, const char *name, const struct tdb_xattr *r);
+void ndr_print_xattr_DosInfo1(struct ndr_print *ndr, const char *name, const struct xattr_DosInfo1 *r);
+void ndr_print_xattr_DosInfo2Old(struct ndr_print *ndr, const char *name, const struct xattr_DosInfo2Old *r);
+void ndr_print_xattr_DosInfo(struct ndr_print *ndr, const char *name, const union xattr_DosInfo *r);
+enum ndr_err_code ndr_push_xattr_DosAttrib(struct ndr_push *ndr, int ndr_flags, const struct xattr_DosAttrib *r);
+enum ndr_err_code ndr_pull_xattr_DosAttrib(struct ndr_pull *ndr, int ndr_flags, struct xattr_DosAttrib *r);
+void ndr_print_xattr_DosAttrib(struct ndr_print *ndr, const char *name, const struct xattr_DosAttrib *r);
+void ndr_print_xattr_EA(struct ndr_print *ndr, const char *name, const struct xattr_EA *r);
+enum ndr_err_code ndr_push_xattr_DosEAs(struct ndr_push *ndr, int ndr_flags, const struct xattr_DosEAs *r);
+enum ndr_err_code ndr_pull_xattr_DosEAs(struct ndr_pull *ndr, int ndr_flags, struct xattr_DosEAs *r);
+void ndr_print_xattr_DosEAs(struct ndr_print *ndr, const char *name, const struct xattr_DosEAs *r);
enum ndr_err_code ndr_push_tdb_xattrs(struct ndr_push *ndr, int ndr_flags, const struct tdb_xattrs *r);
enum ndr_err_code ndr_pull_tdb_xattrs(struct ndr_pull *ndr, int ndr_flags, struct tdb_xattrs *r);
void ndr_print_tdb_xattrs(struct ndr_print *ndr, const char *name, const struct tdb_xattrs *r);
+void ndr_print_xattr_DosStream(struct ndr_print *ndr, const char *name, const struct xattr_DosStream *r);
+enum ndr_err_code ndr_push_xattr_DosStreams(struct ndr_push *ndr, int ndr_flags, const struct xattr_DosStreams *r);
+enum ndr_err_code ndr_pull_xattr_DosStreams(struct ndr_pull *ndr, int ndr_flags, struct xattr_DosStreams *r);
+void ndr_print_xattr_DosStreams(struct ndr_print *ndr, const char *name, const struct xattr_DosStreams *r);
enum ndr_err_code ndr_push_security_descriptor_timestamp(struct ndr_push *ndr, int ndr_flags, const struct security_descriptor_timestamp *r);
enum ndr_err_code ndr_pull_security_descriptor_timestamp(struct ndr_pull *ndr, int ndr_flags, struct security_descriptor_timestamp *r);
void ndr_print_security_descriptor_timestamp(struct ndr_print *ndr, const char *name, const struct security_descriptor_timestamp *r);
diff --git a/source3/librpc/gen_ndr/netlogon.h b/source3/librpc/gen_ndr/netlogon.h
index a38deb302a..cf3959b199 100644
--- a/source3/librpc/gen_ndr/netlogon.h
+++ b/source3/librpc/gen_ndr/netlogon.h
@@ -79,10 +79,41 @@ struct netr_NetworkInfo {
struct netr_ChallengeResponse lm;
}/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */;
-union netr_LogonInfo {
- struct netr_PasswordInfo *password;/* [unique,case] */
- struct netr_NetworkInfo *network;/* [unique,case(2)] */
-}/* [public,switch_type(uint16)] */;
+struct netr_GenericInfo {
+ struct netr_IdentityInfo identity_info;
+ struct lsa_String package_name;
+ uint32_t length;
+ uint8_t *data;/* [unique,size_is(length)] */
+}/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */;
+
+enum netr_LogonInfoClass
+#ifndef USE_UINT_ENUMS
+ {
+ NetlogonInteractiveInformation=1,
+ NetlogonNetworkInformation=2,
+ NetlogonServiceInformation=3,
+ NetlogonGenericInformation=4,
+ NetlogonInteractiveTransitiveInformation=5,
+ NetlogonNetworkTransitiveInformation=6,
+ NetlogonServiceTransitiveInformation=7
+}
+#else
+ { __donnot_use_enum_netr_LogonInfoClass=0x7FFFFFFF}
+#define NetlogonInteractiveInformation ( 1 )
+#define NetlogonNetworkInformation ( 2 )
+#define NetlogonServiceInformation ( 3 )
+#define NetlogonGenericInformation ( 4 )
+#define NetlogonInteractiveTransitiveInformation ( 5 )
+#define NetlogonNetworkTransitiveInformation ( 6 )
+#define NetlogonServiceTransitiveInformation ( 7 )
+#endif
+;
+
+union netr_LogonLevel {
+ struct netr_PasswordInfo *password;/* [unique,case(NetlogonInteractiveInformation)] */
+ struct netr_NetworkInfo *network;/* [unique,case(NetlogonNetworkInformation)] */
+ struct netr_GenericInfo *generic;/* [unique,case(NetlogonGenericInformation)] */
+}/* [public,switch_type(netr_LogonInfoClass)] */;
struct netr_UserSessionKey {
uint8_t key[16];
@@ -173,11 +204,36 @@ struct netr_PacInfo {
struct lsa_String unknown4;
};
+struct netr_GenericInfo2 {
+ uint32_t length;
+ uint8_t *data;/* [unique,size_is(length)] */
+}/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */;
+
+enum netr_ValidationInfoClass
+#ifndef USE_UINT_ENUMS
+ {
+ NetlogonValidationUasInfo=1,
+ NetlogonValidationSamInfo=2,
+ NetlogonValidationSamInfo2=3,
+ NetlogonValidationGenericInfo2=5,
+ NetlogonValidationSamInfo4=6
+}
+#else
+ { __donnot_use_enum_netr_ValidationInfoClass=0x7FFFFFFF}
+#define NetlogonValidationUasInfo ( 1 )
+#define NetlogonValidationSamInfo ( 2 )
+#define NetlogonValidationSamInfo2 ( 3 )
+#define NetlogonValidationGenericInfo2 ( 5 )
+#define NetlogonValidationSamInfo4 ( 6 )
+#endif
+;
+
union netr_Validation {
- struct netr_SamInfo2 *sam2;/* [unique,case(2)] */
- struct netr_SamInfo3 *sam3;/* [unique,case(3)] */
+ struct netr_SamInfo2 *sam2;/* [unique,case(NetlogonValidationSamInfo)] */
+ struct netr_SamInfo3 *sam3;/* [unique,case(NetlogonValidationSamInfo2)] */
struct netr_PacInfo *pac;/* [unique,case(4)] */
- struct netr_SamInfo6 *sam6;/* [unique,case(6)] */
+ struct netr_GenericInfo2 *generic;/* [unique,case(NetlogonValidationGenericInfo2)] */
+ struct netr_SamInfo6 *sam6;/* [unique,case(NetlogonValidationSamInfo4)] */
}/* [public,switch_type(uint16)] */;
struct netr_Credential {
@@ -189,19 +245,6 @@ struct netr_Authenticator {
time_t timestamp;
}/* [public] */;
-enum netr_LogonLevel
-#ifndef USE_UINT_ENUMS
- {
- INTERACTIVE_LOGON_TYPE=1,
- NET_LOGON_TYPE=2
-}
-#else
- { __donnot_use_enum_netr_LogonLevel=0x7FFFFFFF}
-#define INTERACTIVE_LOGON_TYPE ( 1 )
-#define NET_LOGON_TYPE ( 2 )
-#endif
-;
-
enum netr_SchannelType;
enum netr_SamDatabaseID;
@@ -299,7 +342,7 @@ struct netr_DELTA_USER {
struct netr_DELTA_DOMAIN {
struct lsa_String domain_name;
- struct lsa_String comment;
+ struct lsa_String oem_information;
int64_t force_logoff_time;
uint16_t min_password_length;
uint16_t password_history_length;
@@ -737,6 +780,16 @@ struct netr_DsRGetDCNameInfo {
const char *client_site_name;/* [unique,charset(UTF16)] */
}/* [public] */;
+/* bitmap netr_TrustFlags */
+#define NETR_TRUST_FLAG_IN_FOREST ( 0x00000001 )
+#define NETR_TRUST_FLAG_OUTBOUND ( 0x00000002 )
+#define NETR_TRUST_FLAG_TREEROOT ( 0x00000004 )
+#define NETR_TRUST_FLAG_PRIMARY ( 0x00000008 )
+#define NETR_TRUST_FLAG_NATIVE ( 0x00000010 )
+#define NETR_TRUST_FLAG_INBOUND ( 0x00000020 )
+#define NETR_TRUST_FLAG_MIT_KRB5 ( 0x00000080 )
+#define NETR_TRUST_FLAG_AES ( 0x00000100 )
+
struct netr_BinaryString {
uint16_t length;
uint16_t size;
@@ -762,25 +815,57 @@ union netr_DomainQuery {
struct netr_DomainQuery1 *query1;/* [unique,case] */
};
+struct netr_trust_extension {
+ uint32_t length;/* [value(8)] */
+ uint32_t dummy;/* [value(0)] */
+ uint32_t size;/* [value(8)] */
+ uint32_t flags;
+ uint32_t parent_index;
+ uint32_t trust_type;
+ uint32_t trust_attributes;
+};
+
+struct netr_trust_extension_container {
+ uint16_t length;
+ uint16_t size;/* [value(length)] */
+ struct netr_trust_extension *info;/* [unique] */
+};
+
struct netr_DomainTrustInfo {
struct lsa_String domainname;
struct lsa_String fulldomainname;
struct lsa_String forest;
struct GUID guid;
struct dom_sid2 *sid;/* [unique] */
- struct netr_BinaryString unknown1[4];
- uint32_t unknown[4];
+ struct netr_trust_extension_container trust_extension;
+ struct lsa_String dummystring[3];
+ uint32_t dummy[4];
};
+struct netr_LsaPolicyInfo {
+ uint32_t policy_size;
+ uint8_t *policy;/* [unique,size_is(policy_size)] */
+};
+
+/* bitmap netr_WorkstationFlags */
+#define NETR_WS_FLAG_HANDLES_INBOUND_TRUSTS ( 0x00000001 )
+#define NETR_WS_FLAG_HANDLES_SPN_UPDATE ( 0x00000002 )
+
struct netr_DomainInfo1 {
struct netr_DomainTrustInfo domaininfo;
uint32_t num_trusts;
struct netr_DomainTrustInfo *trusts;/* [unique,size_is(num_trusts)] */
- uint32_t unknown[14];
+ struct netr_LsaPolicyInfo lsa_policy;
+ struct lsa_String dns_hostname;
+ struct lsa_String dummystring[3];
+ uint32_t workstation_flags;
+ uint32_t supported_enc_types;
+ uint32_t dummy[2];
};
union netr_DomainInfo {
struct netr_DomainInfo1 *info1;/* [unique,case] */
+ struct netr_DomainInfo1 *info2;/* [unique,case(2)] */
};
struct netr_CryptPassword {
@@ -798,14 +883,6 @@ struct netr_DsRAddress {
uint32_t size;
};
-/* bitmap netr_TrustFlags */
-#define NETR_TRUST_FLAG_IN_FOREST ( 0x00000001 )
-#define NETR_TRUST_FLAG_OUTBOUND ( 0x00000002 )
-#define NETR_TRUST_FLAG_TREEROOT ( 0x00000004 )
-#define NETR_TRUST_FLAG_PRIMARY ( 0x00000008 )
-#define NETR_TRUST_FLAG_NATIVE ( 0x00000010 )
-#define NETR_TRUST_FLAG_INBOUND ( 0x00000020 )
-
enum netr_TrustType
#ifndef USE_UINT_ENUMS
{
@@ -895,8 +972,8 @@ struct netr_LogonSamLogon {
const char *server_name;/* [unique,charset(UTF16)] */
const char *computer_name;/* [unique,charset(UTF16)] */
struct netr_Authenticator *credential;/* [unique] */
- enum netr_LogonLevel logon_level;
- union netr_LogonInfo *logon;/* [ref,switch_is(logon_level)] */
+ enum netr_LogonInfoClass logon_level;
+ union netr_LogonLevel *logon;/* [ref,switch_is(logon_level)] */
uint16_t validation_level;
struct netr_Authenticator *return_authenticator;/* [unique] */
} in;
@@ -916,8 +993,8 @@ struct netr_LogonSamLogoff {
const char *server_name;/* [unique,charset(UTF16)] */
const char *computer_name;/* [unique,charset(UTF16)] */
struct netr_Authenticator *credential;/* [unique] */
- enum netr_LogonLevel logon_level;
- union netr_LogonInfo logon;/* [switch_is(logon_level)] */
+ enum netr_LogonInfoClass logon_level;
+ union netr_LogonLevel logon;/* [switch_is(logon_level)] */
struct netr_Authenticator *return_authenticator;/* [unique] */
} in;
@@ -1481,8 +1558,8 @@ struct netr_LogonSamLogonEx {
struct {
const char *server_name;/* [unique,charset(UTF16)] */
const char *computer_name;/* [unique,charset(UTF16)] */
- enum netr_LogonLevel logon_level;
- union netr_LogonInfo *logon;/* [ref,switch_is(logon_level)] */
+ enum netr_LogonInfoClass logon_level;
+ union netr_LogonLevel *logon;/* [ref,switch_is(logon_level)] */
uint16_t validation_level;
uint32_t *flags;/* [ref] */
} in;
@@ -1583,8 +1660,8 @@ struct netr_LogonSamLogonWithFlags {
const char *server_name;/* [unique,charset(UTF16)] */
const char *computer_name;/* [unique,charset(UTF16)] */
struct netr_Authenticator *credential;/* [unique] */
- enum netr_LogonLevel logon_level;
- union netr_LogonInfo logon;/* [switch_is(logon_level)] */
+ enum netr_LogonInfoClass logon_level;
+ union netr_LogonLevel logon;/* [switch_is(logon_level)] */
uint16_t validation_level;
struct netr_Authenticator *return_authenticator;/* [unique] */
uint32_t *flags;/* [ref] */
diff --git a/source3/librpc/gen_ndr/notify.h b/source3/librpc/gen_ndr/notify.h
index 8b2eca5004..46a7e24e0d 100644
--- a/source3/librpc/gen_ndr/notify.h
+++ b/source3/librpc/gen_ndr/notify.h
@@ -2,7 +2,7 @@
#include <stdint.h>
-#include "librpc/gen_ndr/misc.h"
+#include "librpc/gen_ndr/security.h"
#ifndef _HEADER_notify
#define _HEADER_notify
diff --git a/source3/librpc/gen_ndr/ntsvcs.h b/source3/librpc/gen_ndr/ntsvcs.h
index 95484e49f5..b56b552ae2 100644
--- a/source3/librpc/gen_ndr/ntsvcs.h
+++ b/source3/librpc/gen_ndr/ntsvcs.h
@@ -101,6 +101,14 @@ struct PNP_EnumerateSubKeys {
struct PNP_GetDeviceList {
struct {
+ const char *filter;/* [unique,charset(UTF16)] */
+ uint32_t flags;
+ uint32_t *length;/* [ref] */
+ } in;
+
+ struct {
+ uint16_t *buffer;/* [ref,length_is(*length),size_is(*length)] */
+ uint32_t *length;/* [ref] */
WERROR result;
} out;
@@ -133,15 +141,15 @@ struct PNP_GetDeviceRegProp {
struct {
const char *devicepath;/* [ref,charset(UTF16)] */
uint32_t property;
- uint32_t unknown3;
- uint32_t *unknown1;/* [ref] */
+ uint32_t flags;
+ uint32_t *reg_data_type;/* [ref] */
uint32_t *buffer_size;/* [ref] */
uint32_t *needed;/* [ref] */
} in;
struct {
uint8_t *buffer;/* [ref,length_is(*buffer_size),size_is(*buffer_size)] */
- uint32_t *unknown1;/* [ref] */
+ uint32_t *reg_data_type;/* [ref] */
uint32_t *buffer_size;/* [ref] */
uint32_t *needed;/* [ref] */
WERROR result;
diff --git a/source3/librpc/gen_ndr/samr.h b/source3/librpc/gen_ndr/samr.h
index 522c6a9cec..62f6bf8de6 100644
--- a/source3/librpc/gen_ndr/samr.h
+++ b/source3/librpc/gen_ndr/samr.h
@@ -125,9 +125,9 @@ struct samr_DomInfo1 {
int64_t min_password_age;
};
-struct samr_DomInfo2 {
+struct samr_DomGeneralInformation {
NTTIME force_logoff_time;
- struct lsa_String comment;
+ struct lsa_String oem_information;
struct lsa_String domain_name;
struct lsa_String primary;
uint64_t sequence_num;
@@ -143,8 +143,8 @@ struct samr_DomInfo3 {
NTTIME force_logoff_time;
};
-struct samr_DomInfo4 {
- struct lsa_String comment;
+struct samr_DomOEMInformation {
+ struct lsa_String oem_information;
};
struct samr_DomInfo5 {
@@ -168,8 +168,8 @@ struct samr_DomInfo9 {
uint32_t unknown;
};
-struct samr_DomInfo11 {
- struct samr_DomInfo2 info2;
+struct samr_DomGeneralInformation2 {
+ struct samr_DomGeneralInformation general;
uint64_t lockout_duration;
uint64_t lockout_window;
uint16_t lockout_threshold;
@@ -190,15 +190,15 @@ struct samr_DomInfo13 {
union samr_DomainInfo {
struct samr_DomInfo1 info1;/* [case] */
- struct samr_DomInfo2 info2;/* [case(2)] */
+ struct samr_DomGeneralInformation general;/* [case(2)] */
struct samr_DomInfo3 info3;/* [case(3)] */
- struct samr_DomInfo4 info4;/* [case(4)] */
+ struct samr_DomOEMInformation oem;/* [case(4)] */
struct samr_DomInfo5 info5;/* [case(5)] */
struct samr_DomInfo6 info6;/* [case(6)] */
struct samr_DomInfo7 info7;/* [case(7)] */
struct samr_DomInfo8 info8;/* [case(8)] */
struct samr_DomInfo9 info9;/* [case(9)] */
- struct samr_DomInfo11 info11;/* [case(11)] */
+ struct samr_DomGeneralInformation2 general2;/* [case(11)] */
struct samr_DomInfo12 info12;/* [case(12)] */
struct samr_DomInfo13 info13;/* [case(13)] */
}/* [switch_type(uint16)] */;
diff --git a/source3/librpc/gen_ndr/security.h b/source3/librpc/gen_ndr/security.h
index 04655b178e..5b77d76b50 100644
--- a/source3/librpc/gen_ndr/security.h
+++ b/source3/librpc/gen_ndr/security.h
@@ -59,6 +59,7 @@
#define SEC_ADS_DELETE_TREE ( 0x00000040 )
#define SEC_ADS_LIST_OBJECT ( 0x00000080 )
#define SEC_ADS_CONTROL_ACCESS ( 0x00000100 )
+#define SEC_MASK_INVALID ( 0x0ce0fe00 )
#define SEC_RIGHTS_FILE_READ ( SEC_STD_READ_CONTROL|SEC_STD_SYNCHRONIZE|SEC_FILE_READ_DATA|SEC_FILE_READ_ATTRIBUTE|SEC_FILE_READ_EA )
#define SEC_RIGHTS_FILE_WRITE ( SEC_STD_READ_CONTROL|SEC_STD_SYNCHRONIZE|SEC_FILE_WRITE_DATA|SEC_FILE_WRITE_ATTRIBUTE|SEC_FILE_WRITE_EA|SEC_FILE_APPEND_DATA )
#define SEC_RIGHTS_FILE_EXECUTE ( SEC_STD_SYNCHRONIZE|SEC_STD_READ_CONTROL|SEC_FILE_READ_ATTRIBUTE|SEC_FILE_EXECUTE )
@@ -74,6 +75,7 @@
#define SID_CREATOR_OWNER_DOMAIN ( "S-1-3" )
#define SID_CREATOR_OWNER ( "S-1-3-0" )
#define SID_CREATOR_GROUP ( "S-1-3-1" )
+#define SID_OWNER_RIGHTS ( "S-1-3-4" )
#define NAME_NT_AUTHORITY ( "NT AUTHORITY" )
#define SID_NT_AUTHORITY ( "S-1-5" )
#define SID_NT_DIALUP ( "S-1-5-1" )
@@ -90,9 +92,14 @@
#define SID_NT_TERMINAL_SERVER_USERS ( "S-1-5-13" )
#define SID_NT_REMOTE_INTERACTIVE ( "S-1-5-14" )
#define SID_NT_THIS_ORGANISATION ( "S-1-5-15" )
+#define SID_NT_IUSR ( "S-1-5-17" )
#define SID_NT_SYSTEM ( "S-1-5-18" )
#define SID_NT_LOCAL_SERVICE ( "S-1-5-19" )
#define SID_NT_NETWORK_SERVICE ( "S-1-5-20" )
+#define SID_NT_DIGEST_AUTHENTICATION ( "S-1-5-64-21" )
+#define SID_NT_NTLM_AUTHENTICATION ( "S-1-5-64-10" )
+#define SID_NT_SCHANNEL_AUTHENTICATION ( "S-1-5-64-14" )
+#define SID_NT_OTHER_ORGANISATION ( "S-1-5-1000" )
#define NAME_BUILTIN ( "BUILTIN" )
#define SID_BUILTIN ( "S-1-5-32" )
#define SID_BUILTIN_ADMINISTRATORS ( "S-1-5-32-544" )
@@ -324,4 +331,11 @@ struct security_token {
#define SECINFO_PROTECTED_SACL ( 0x40000000 )
#define SECINFO_PROTECTED_DACL ( 0x80000000 )
+/* bitmap kerb_EncTypes */
+#define KERB_ENCTYPE_DES_CBC_CRC ( 0x00000001 )
+#define KERB_ENCTYPE_DES_CBC_MD5 ( 0x00000002 )
+#define KERB_ENCTYPE_RC4_HMAC_MD5 ( 0x00000004 )
+#define KERB_ENCTYPE_AES128_CTS_HMAC_SHA1_96 ( 0x00000008 )
+#define KERB_ENCTYPE_AES256_CTS_HMAC_SHA1_96 ( 0x00000010 )
+
#endif /* _HEADER_security */
diff --git a/source3/librpc/gen_ndr/srv_dfs.c b/source3/librpc/gen_ndr/srv_dfs.c
index 631bd82758..d58272084a 100644
--- a/source3/librpc/gen_ndr/srv_dfs.c
+++ b/source3/librpc/gen_ndr/srv_dfs.c
@@ -63,7 +63,7 @@ static bool api_dfs_GetManagerVersion(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(dfs_GetManagerVersion, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -136,7 +136,7 @@ static bool api_dfs_Add(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(dfs_Add, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -209,7 +209,7 @@ static bool api_dfs_Remove(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(dfs_Remove, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -282,7 +282,7 @@ static bool api_dfs_SetInfo(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(dfs_SetInfo, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -362,7 +362,7 @@ static bool api_dfs_GetInfo(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(dfs_GetInfo, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -438,7 +438,7 @@ static bool api_dfs_Enum(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(dfs_Enum, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -511,7 +511,7 @@ static bool api_dfs_Rename(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(dfs_Rename, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -584,7 +584,7 @@ static bool api_dfs_Move(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(dfs_Move, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -657,7 +657,7 @@ static bool api_dfs_ManagerGetConfigInfo(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(dfs_ManagerGetConfigInfo, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -730,7 +730,7 @@ static bool api_dfs_ManagerSendSiteInfo(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(dfs_ManagerSendSiteInfo, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -805,7 +805,7 @@ static bool api_dfs_AddFtRoot(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(dfs_AddFtRoot, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -880,7 +880,7 @@ static bool api_dfs_RemoveFtRoot(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(dfs_RemoveFtRoot, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -953,7 +953,7 @@ static bool api_dfs_AddStdRoot(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(dfs_AddStdRoot, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1026,7 +1026,7 @@ static bool api_dfs_RemoveStdRoot(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(dfs_RemoveStdRoot, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1099,7 +1099,7 @@ static bool api_dfs_ManagerInitialize(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(dfs_ManagerInitialize, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1172,7 +1172,7 @@ static bool api_dfs_AddStdRootForced(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(dfs_AddStdRootForced, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1249,7 +1249,7 @@ static bool api_dfs_GetDcAddress(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(dfs_GetDcAddress, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1322,7 +1322,7 @@ static bool api_dfs_SetDcAddress(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(dfs_SetDcAddress, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1395,7 +1395,7 @@ static bool api_dfs_FlushFtTable(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(dfs_FlushFtTable, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1468,7 +1468,7 @@ static bool api_dfs_Add2(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(dfs_Add2, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1541,7 +1541,7 @@ static bool api_dfs_Remove2(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(dfs_Remove2, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1617,7 +1617,7 @@ static bool api_dfs_EnumEx(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(dfs_EnumEx, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1690,7 +1690,7 @@ static bool api_dfs_SetInfo2(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(dfs_SetInfo2, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
diff --git a/source3/librpc/gen_ndr/srv_dssetup.c b/source3/librpc/gen_ndr/srv_dssetup.c
index 2dca1c8536..62123b826c 100644
--- a/source3/librpc/gen_ndr/srv_dssetup.c
+++ b/source3/librpc/gen_ndr/srv_dssetup.c
@@ -63,7 +63,7 @@ static bool api_dssetup_DsRoleGetPrimaryDomainInformation(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(dssetup_DsRoleGetPrimaryDomainInformation, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -136,7 +136,7 @@ static bool api_dssetup_DsRoleDnsNameToFlatName(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(dssetup_DsRoleDnsNameToFlatName, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -209,7 +209,7 @@ static bool api_dssetup_DsRoleDcAsDc(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(dssetup_DsRoleDcAsDc, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -282,7 +282,7 @@ static bool api_dssetup_DsRoleDcAsReplica(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(dssetup_DsRoleDcAsReplica, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -355,7 +355,7 @@ static bool api_dssetup_DsRoleDemoteDc(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(dssetup_DsRoleDemoteDc, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -428,7 +428,7 @@ static bool api_dssetup_DsRoleGetDcOperationProgress(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(dssetup_DsRoleGetDcOperationProgress, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -501,7 +501,7 @@ static bool api_dssetup_DsRoleGetDcOperationResults(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(dssetup_DsRoleGetDcOperationResults, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -574,7 +574,7 @@ static bool api_dssetup_DsRoleCancel(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(dssetup_DsRoleCancel, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -647,7 +647,7 @@ static bool api_dssetup_DsRoleServerSaveStateForUpgrade(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(dssetup_DsRoleServerSaveStateForUpgrade, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -720,7 +720,7 @@ static bool api_dssetup_DsRoleUpgradeDownlevelServer(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(dssetup_DsRoleUpgradeDownlevelServer, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -793,7 +793,7 @@ static bool api_dssetup_DsRoleAbortDownlevelServerUpgrade(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(dssetup_DsRoleAbortDownlevelServerUpgrade, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
diff --git a/source3/librpc/gen_ndr/srv_echo.c b/source3/librpc/gen_ndr/srv_echo.c
index 38e9e194c8..970398dc71 100644
--- a/source3/librpc/gen_ndr/srv_echo.c
+++ b/source3/librpc/gen_ndr/srv_echo.c
@@ -63,7 +63,7 @@ static bool api_echo_AddOne(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(echo_AddOne, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -143,7 +143,7 @@ static bool api_echo_EchoData(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(echo_EchoData, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -216,7 +216,7 @@ static bool api_echo_SinkData(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(echo_SinkData, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -296,7 +296,7 @@ static bool api_echo_SourceData(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(echo_SourceData, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -376,7 +376,7 @@ static bool api_echo_TestCall(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(echo_TestCall, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -456,7 +456,7 @@ static bool api_echo_TestCall2(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(echo_TestCall2, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -529,7 +529,7 @@ static bool api_echo_TestSleep(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(echo_TestSleep, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -606,7 +606,7 @@ static bool api_echo_TestEnum(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(echo_TestEnum, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -681,7 +681,7 @@ static bool api_echo_TestSurrounding(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(echo_TestSurrounding, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -754,7 +754,7 @@ static bool api_echo_TestDoublePointer(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(echo_TestDoublePointer, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
diff --git a/source3/librpc/gen_ndr/srv_epmapper.c b/source3/librpc/gen_ndr/srv_epmapper.c
index 69a47b355d..a31d89b8e8 100644
--- a/source3/librpc/gen_ndr/srv_epmapper.c
+++ b/source3/librpc/gen_ndr/srv_epmapper.c
@@ -56,7 +56,7 @@ static bool api_epm_Insert(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(epm_Insert, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -129,7 +129,7 @@ static bool api_epm_Delete(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(epm_Delete, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -216,7 +216,7 @@ static bool api_epm_Lookup(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(epm_Lookup, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -303,7 +303,7 @@ static bool api_epm_Map(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(epm_Map, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -378,7 +378,7 @@ static bool api_epm_LookupHandleFree(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(epm_LookupHandleFree, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -451,7 +451,7 @@ static bool api_epm_InqObject(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(epm_InqObject, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -524,7 +524,7 @@ static bool api_epm_MgmtDelete(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(epm_MgmtDelete, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -597,7 +597,7 @@ static bool api_epm_MapAuth(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(epm_MapAuth, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
diff --git a/source3/librpc/gen_ndr/srv_eventlog.c b/source3/librpc/gen_ndr/srv_eventlog.c
index 946be20e0f..b9a4a2e9ed 100644
--- a/source3/librpc/gen_ndr/srv_eventlog.c
+++ b/source3/librpc/gen_ndr/srv_eventlog.c
@@ -56,7 +56,7 @@ static bool api_eventlog_ClearEventLogW(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(eventlog_ClearEventLogW, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -129,7 +129,7 @@ static bool api_eventlog_BackupEventLogW(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(eventlog_BackupEventLogW, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -204,7 +204,7 @@ static bool api_eventlog_CloseEventLog(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(eventlog_CloseEventLog, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -277,7 +277,7 @@ static bool api_eventlog_DeregisterEventSource(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(eventlog_DeregisterEventSource, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -357,7 +357,7 @@ static bool api_eventlog_GetNumRecords(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(eventlog_GetNumRecords, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -437,7 +437,7 @@ static bool api_eventlog_GetOldestRecord(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(eventlog_GetOldestRecord, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -510,7 +510,7 @@ static bool api_eventlog_ChangeNotify(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(eventlog_ChangeNotify, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -590,7 +590,7 @@ static bool api_eventlog_OpenEventLogW(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(eventlog_OpenEventLogW, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -663,7 +663,7 @@ static bool api_eventlog_RegisterEventSourceW(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(eventlog_RegisterEventSourceW, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -736,7 +736,7 @@ static bool api_eventlog_OpenBackupEventLogW(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(eventlog_OpenBackupEventLogW, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -828,7 +828,7 @@ static bool api_eventlog_ReadEventLogW(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(eventlog_ReadEventLogW, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -901,7 +901,7 @@ static bool api_eventlog_ReportEventW(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(eventlog_ReportEventW, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -974,7 +974,7 @@ static bool api_eventlog_ClearEventLogA(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(eventlog_ClearEventLogA, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1047,7 +1047,7 @@ static bool api_eventlog_BackupEventLogA(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(eventlog_BackupEventLogA, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1120,7 +1120,7 @@ static bool api_eventlog_OpenEventLogA(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(eventlog_OpenEventLogA, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1193,7 +1193,7 @@ static bool api_eventlog_RegisterEventSourceA(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(eventlog_RegisterEventSourceA, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1266,7 +1266,7 @@ static bool api_eventlog_OpenBackupEventLogA(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(eventlog_OpenBackupEventLogA, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1339,7 +1339,7 @@ static bool api_eventlog_ReadEventLogA(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(eventlog_ReadEventLogA, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1412,7 +1412,7 @@ static bool api_eventlog_ReportEventA(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(eventlog_ReportEventA, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1485,7 +1485,7 @@ static bool api_eventlog_RegisterClusterSvc(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(eventlog_RegisterClusterSvc, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1558,7 +1558,7 @@ static bool api_eventlog_DeregisterClusterSvc(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(eventlog_DeregisterClusterSvc, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1631,7 +1631,7 @@ static bool api_eventlog_WriteClusterEvents(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(eventlog_WriteClusterEvents, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1704,7 +1704,7 @@ static bool api_eventlog_GetLogIntormation(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(eventlog_GetLogIntormation, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1777,7 +1777,7 @@ static bool api_eventlog_FlushEventLog(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(eventlog_FlushEventLog, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
diff --git a/source3/librpc/gen_ndr/srv_initshutdown.c b/source3/librpc/gen_ndr/srv_initshutdown.c
index 1fca682c71..51098074ac 100644
--- a/source3/librpc/gen_ndr/srv_initshutdown.c
+++ b/source3/librpc/gen_ndr/srv_initshutdown.c
@@ -56,7 +56,7 @@ static bool api_initshutdown_Init(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(initshutdown_Init, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -129,7 +129,7 @@ static bool api_initshutdown_Abort(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(initshutdown_Abort, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -202,7 +202,7 @@ static bool api_initshutdown_InitEx(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(initshutdown_InitEx, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
diff --git a/source3/librpc/gen_ndr/srv_lsa.c b/source3/librpc/gen_ndr/srv_lsa.c
index f55e079773..b0893623a8 100644
--- a/source3/librpc/gen_ndr/srv_lsa.c
+++ b/source3/librpc/gen_ndr/srv_lsa.c
@@ -58,7 +58,7 @@ static bool api_lsa_Close(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_Close, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -131,7 +131,7 @@ static bool api_lsa_Delete(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_Delete, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -212,7 +212,7 @@ static bool api_lsa_EnumPrivs(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_EnumPrivs, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -292,7 +292,7 @@ static bool api_lsa_QuerySecurity(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_QuerySecurity, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -365,7 +365,7 @@ static bool api_lsa_SetSecObj(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_SetSecObj, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -438,7 +438,7 @@ static bool api_lsa_ChangePassword(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_ChangePassword, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -518,7 +518,7 @@ static bool api_lsa_OpenPolicy(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_OpenPolicy, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -598,7 +598,7 @@ static bool api_lsa_QueryInfoPolicy(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_QueryInfoPolicy, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -671,7 +671,7 @@ static bool api_lsa_SetInfoPolicy(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_SetInfoPolicy, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -744,7 +744,7 @@ static bool api_lsa_ClearAuditLog(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_ClearAuditLog, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -824,7 +824,7 @@ static bool api_lsa_CreateAccount(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_CreateAccount, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -905,7 +905,7 @@ static bool api_lsa_EnumAccounts(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_EnumAccounts, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -985,7 +985,7 @@ static bool api_lsa_CreateTrustedDomain(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_CreateTrustedDomain, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1066,7 +1066,7 @@ static bool api_lsa_EnumTrustDom(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_EnumTrustDom, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1148,7 +1148,7 @@ static bool api_lsa_LookupNames(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_LookupNames, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1230,7 +1230,7 @@ static bool api_lsa_LookupSids(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_LookupSids, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1310,7 +1310,7 @@ static bool api_lsa_CreateSecret(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_CreateSecret, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1390,7 +1390,7 @@ static bool api_lsa_OpenAccount(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_OpenAccount, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1470,7 +1470,7 @@ static bool api_lsa_EnumPrivsAccount(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_EnumPrivsAccount, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1543,7 +1543,7 @@ static bool api_lsa_AddPrivilegesToAccount(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_AddPrivilegesToAccount, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1616,7 +1616,7 @@ static bool api_lsa_RemovePrivilegesFromAccount(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_RemovePrivilegesFromAccount, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1689,7 +1689,7 @@ static bool api_lsa_GetQuotasForAccount(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_GetQuotasForAccount, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1762,7 +1762,7 @@ static bool api_lsa_SetQuotasForAccount(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_SetQuotasForAccount, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1842,7 +1842,7 @@ static bool api_lsa_GetSystemAccessAccount(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_GetSystemAccessAccount, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1915,7 +1915,7 @@ static bool api_lsa_SetSystemAccessAccount(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_SetSystemAccessAccount, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1995,7 +1995,7 @@ static bool api_lsa_OpenTrustedDomain(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_OpenTrustedDomain, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2075,7 +2075,7 @@ static bool api_lsa_QueryTrustedDomainInfo(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_QueryTrustedDomainInfo, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2148,7 +2148,7 @@ static bool api_lsa_SetInformationTrustedDomain(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_SetInformationTrustedDomain, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2228,7 +2228,7 @@ static bool api_lsa_OpenSecret(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_OpenSecret, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2301,7 +2301,7 @@ static bool api_lsa_SetSecret(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_SetSecret, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2379,7 +2379,7 @@ static bool api_lsa_QuerySecret(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_QuerySecret, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2459,7 +2459,7 @@ static bool api_lsa_LookupPrivValue(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_LookupPrivValue, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2539,7 +2539,7 @@ static bool api_lsa_LookupPrivName(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_LookupPrivName, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2625,7 +2625,7 @@ static bool api_lsa_LookupPrivDisplayName(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_LookupPrivDisplayName, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2700,7 +2700,7 @@ static bool api_lsa_DeleteObject(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_DeleteObject, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2780,7 +2780,7 @@ static bool api_lsa_EnumAccountsWithUserRight(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_EnumAccountsWithUserRight, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2860,7 +2860,7 @@ static bool api_lsa_EnumAccountRights(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_EnumAccountRights, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2933,7 +2933,7 @@ static bool api_lsa_AddAccountRights(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_AddAccountRights, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3006,7 +3006,7 @@ static bool api_lsa_RemoveAccountRights(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_RemoveAccountRights, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3086,7 +3086,7 @@ static bool api_lsa_QueryTrustedDomainInfoBySid(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_QueryTrustedDomainInfoBySid, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3159,7 +3159,7 @@ static bool api_lsa_SetTrustedDomainInfo(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_SetTrustedDomainInfo, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3232,7 +3232,7 @@ static bool api_lsa_DeleteTrustedDomain(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_DeleteTrustedDomain, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3305,7 +3305,7 @@ static bool api_lsa_StorePrivateData(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_StorePrivateData, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3378,7 +3378,7 @@ static bool api_lsa_RetrievePrivateData(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_RetrievePrivateData, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3458,7 +3458,7 @@ static bool api_lsa_OpenPolicy2(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_OpenPolicy2, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3534,7 +3534,7 @@ static bool api_lsa_GetUserName(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_GetUserName, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3614,7 +3614,7 @@ static bool api_lsa_QueryInfoPolicy2(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_QueryInfoPolicy2, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3687,7 +3687,7 @@ static bool api_lsa_SetInfoPolicy2(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_SetInfoPolicy2, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3767,7 +3767,7 @@ static bool api_lsa_QueryTrustedDomainInfoByName(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_QueryTrustedDomainInfoByName, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3840,7 +3840,7 @@ static bool api_lsa_SetTrustedDomainInfoByName(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_SetTrustedDomainInfoByName, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3921,7 +3921,7 @@ static bool api_lsa_EnumTrustedDomainsEx(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_EnumTrustedDomainsEx, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3982,6 +3982,13 @@ static bool api_lsa_CreateTrustedDomainEx(pipes_struct *p)
NDR_PRINT_IN_DEBUG(lsa_CreateTrustedDomainEx, r);
}
+ ZERO_STRUCT(r->out);
+ r->out.trustdom_handle = talloc_zero(r, struct policy_handle);
+ if (r->out.trustdom_handle == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
r->out.result = _lsa_CreateTrustedDomainEx(p, r);
if (p->rng_fault_state) {
@@ -3994,7 +4001,7 @@ static bool api_lsa_CreateTrustedDomainEx(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_CreateTrustedDomainEx, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -4069,7 +4076,7 @@ static bool api_lsa_CloseTrustedDomainEx(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_CloseTrustedDomainEx, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -4149,7 +4156,7 @@ static bool api_lsa_QueryDomainInformationPolicy(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_QueryDomainInformationPolicy, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -4222,7 +4229,7 @@ static bool api_lsa_SetDomainInformationPolicy(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_SetDomainInformationPolicy, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -4302,7 +4309,7 @@ static bool api_lsa_OpenTrustedDomainByName(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_OpenTrustedDomainByName, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -4375,7 +4382,7 @@ static bool api_lsa_TestCall(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_TestCall, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -4457,7 +4464,7 @@ static bool api_lsa_LookupSids2(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_LookupSids2, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -4539,7 +4546,7 @@ static bool api_lsa_LookupNames2(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_LookupNames2, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -4600,6 +4607,13 @@ static bool api_lsa_CreateTrustedDomainEx2(pipes_struct *p)
NDR_PRINT_IN_DEBUG(lsa_CreateTrustedDomainEx2, r);
}
+ ZERO_STRUCT(r->out);
+ r->out.trustdom_handle = talloc_zero(r, struct policy_handle);
+ if (r->out.trustdom_handle == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
r->out.result = _lsa_CreateTrustedDomainEx2(p, r);
if (p->rng_fault_state) {
@@ -4612,7 +4626,7 @@ static bool api_lsa_CreateTrustedDomainEx2(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_CreateTrustedDomainEx2, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -4685,7 +4699,7 @@ static bool api_lsa_CREDRWRITE(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_CREDRWRITE, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -4758,7 +4772,7 @@ static bool api_lsa_CREDRREAD(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_CREDRREAD, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -4831,7 +4845,7 @@ static bool api_lsa_CREDRENUMERATE(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_CREDRENUMERATE, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -4904,7 +4918,7 @@ static bool api_lsa_CREDRWRITEDOMAINCREDENTIALS(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_CREDRWRITEDOMAINCREDENTIALS, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -4977,7 +4991,7 @@ static bool api_lsa_CREDRREADDOMAINCREDENTIALS(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_CREDRREADDOMAINCREDENTIALS, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -5050,7 +5064,7 @@ static bool api_lsa_CREDRDELETE(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_CREDRDELETE, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -5123,7 +5137,7 @@ static bool api_lsa_CREDRGETTARGETINFO(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_CREDRGETTARGETINFO, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -5196,7 +5210,7 @@ static bool api_lsa_CREDRPROFILELOADED(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_CREDRPROFILELOADED, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -5278,7 +5292,7 @@ static bool api_lsa_LookupNames3(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_LookupNames3, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -5351,7 +5365,7 @@ static bool api_lsa_CREDRGETSESSIONTYPES(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_CREDRGETSESSIONTYPES, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -5424,7 +5438,7 @@ static bool api_lsa_LSARREGISTERAUDITEVENT(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_LSARREGISTERAUDITEVENT, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -5497,7 +5511,7 @@ static bool api_lsa_LSARGENAUDITEVENT(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_LSARGENAUDITEVENT, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -5570,7 +5584,7 @@ static bool api_lsa_LSARUNREGISTERAUDITEVENT(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_LSARUNREGISTERAUDITEVENT, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -5650,7 +5664,7 @@ static bool api_lsa_lsaRQueryForestTrustInformation(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_lsaRQueryForestTrustInformation, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -5723,7 +5737,7 @@ static bool api_lsa_LSARSETFORESTTRUSTINFORMATION(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_LSARSETFORESTTRUSTINFORMATION, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -5796,7 +5810,7 @@ static bool api_lsa_CREDRRENAME(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_CREDRRENAME, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -5878,7 +5892,7 @@ static bool api_lsa_LookupSids3(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_LookupSids3, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -5960,7 +5974,7 @@ static bool api_lsa_LookupNames4(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_LookupNames4, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -6033,7 +6047,7 @@ static bool api_lsa_LSAROPENPOLICYSCE(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_LSAROPENPOLICYSCE, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -6106,7 +6120,7 @@ static bool api_lsa_LSARADTREGISTERSECURITYEVENTSOURCE(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_LSARADTREGISTERSECURITYEVENTSOURCE, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -6179,7 +6193,7 @@ static bool api_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -6252,7 +6266,7 @@ static bool api_lsa_LSARADTREPORTSECURITYEVENT(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(lsa_LSARADTREPORTSECURITYEVENT, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
diff --git a/source3/librpc/gen_ndr/srv_netlogon.c b/source3/librpc/gen_ndr/srv_netlogon.c
index 9ec98bf638..c14f682c1c 100644
--- a/source3/librpc/gen_ndr/srv_netlogon.c
+++ b/source3/librpc/gen_ndr/srv_netlogon.c
@@ -63,7 +63,7 @@ static bool api_netr_LogonUasLogon(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_LogonUasLogon, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -143,7 +143,7 @@ static bool api_netr_LogonUasLogoff(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_LogonUasLogoff, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -230,7 +230,7 @@ static bool api_netr_LogonSamLogon(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_LogonSamLogon, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -305,7 +305,7 @@ static bool api_netr_LogonSamLogoff(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_LogonSamLogoff, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -385,7 +385,7 @@ static bool api_netr_ServerReqChallenge(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_ServerReqChallenge, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -465,7 +465,7 @@ static bool api_netr_ServerAuthenticate(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -545,7 +545,7 @@ static bool api_netr_ServerPasswordSet(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_ServerPasswordSet, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -627,7 +627,7 @@ static bool api_netr_DatabaseDeltas(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_DatabaseDeltas, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -709,7 +709,7 @@ static bool api_netr_DatabaseSync(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_DatabaseSync, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -808,7 +808,7 @@ static bool api_netr_AccountDeltas(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_AccountDeltas, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -908,7 +908,7 @@ static bool api_netr_AccountSync(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_AccountSync, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -988,7 +988,7 @@ static bool api_netr_GetDcName(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_GetDcName, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1068,7 +1068,7 @@ static bool api_netr_LogonControl(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_LogonControl, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1148,7 +1148,7 @@ static bool api_netr_GetAnyDCName(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_GetAnyDCName, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1228,7 +1228,7 @@ static bool api_netr_LogonControl2(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_LogonControl2, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1309,7 +1309,7 @@ static bool api_netr_ServerAuthenticate2(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate2, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1391,7 +1391,7 @@ static bool api_netr_DatabaseSync2(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_DatabaseSync2, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1472,7 +1472,7 @@ static bool api_netr_DatabaseRedo(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_DatabaseRedo, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1552,7 +1552,7 @@ static bool api_netr_LogonControl2Ex(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_LogonControl2Ex, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1632,7 +1632,7 @@ static bool api_netr_NetrEnumerateTrustedDomains(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_NetrEnumerateTrustedDomains, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1712,7 +1712,7 @@ static bool api_netr_DsRGetDCName(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_DsRGetDCName, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1785,7 +1785,7 @@ static bool api_netr_NETRLOGONDUMMYROUTINE1(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_NETRLOGONDUMMYROUTINE1, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1858,7 +1858,7 @@ static bool api_netr_NETRLOGONSETSERVICEBITS(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_NETRLOGONSETSERVICEBITS, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1938,7 +1938,7 @@ static bool api_netr_LogonGetTrustRid(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_LogonGetTrustRid, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2011,7 +2011,7 @@ static bool api_netr_NETRLOGONCOMPUTESERVERDIGEST(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_NETRLOGONCOMPUTESERVERDIGEST, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2084,7 +2084,7 @@ static bool api_netr_NETRLOGONCOMPUTECLIENTDIGEST(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_NETRLOGONCOMPUTECLIENTDIGEST, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2166,7 +2166,7 @@ static bool api_netr_ServerAuthenticate3(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate3, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2246,7 +2246,7 @@ static bool api_netr_DsRGetDCNameEx(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_DsRGetDCNameEx, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2326,7 +2326,7 @@ static bool api_netr_DsRGetSiteName(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_DsRGetSiteName, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2407,7 +2407,7 @@ static bool api_netr_LogonGetDomainInfo(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_LogonGetDomainInfo, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2487,7 +2487,7 @@ static bool api_netr_ServerPasswordSet2(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_ServerPasswordSet2, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2573,7 +2573,7 @@ static bool api_netr_ServerPasswordGet(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_ServerPasswordGet, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2646,7 +2646,7 @@ static bool api_netr_NETRLOGONSENDTOSAM(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_NETRLOGONSENDTOSAM, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2726,7 +2726,7 @@ static bool api_netr_DsRAddressToSitenamesW(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_DsRAddressToSitenamesW, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2806,7 +2806,7 @@ static bool api_netr_DsRGetDCNameEx2(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_DsRGetDCNameEx2, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2879,7 +2879,7 @@ static bool api_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2959,7 +2959,7 @@ static bool api_netr_NetrEnumerateTrustedDomainsEx(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_NetrEnumerateTrustedDomainsEx, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3039,7 +3039,7 @@ static bool api_netr_DsRAddressToSitenamesExW(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_DsRAddressToSitenamesExW, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3119,7 +3119,7 @@ static bool api_netr_DsrGetDcSiteCoverageW(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_DsrGetDcSiteCoverageW, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3206,7 +3206,7 @@ static bool api_netr_LogonSamLogonEx(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_LogonSamLogonEx, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3286,7 +3286,7 @@ static bool api_netr_DsrEnumerateDomainTrusts(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_DsrEnumerateDomainTrusts, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3359,7 +3359,7 @@ static bool api_netr_DsrDeregisterDNSHostRecords(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_DsrDeregisterDNSHostRecords, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3451,7 +3451,7 @@ static bool api_netr_ServerTrustPasswordsGet(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_ServerTrustPasswordsGet, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3531,7 +3531,7 @@ static bool api_netr_DsRGetForestTrustInformation(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_DsRGetForestTrustInformation, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3617,7 +3617,7 @@ static bool api_netr_GetForestTrustInformation(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_GetForestTrustInformation, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3705,7 +3705,7 @@ static bool api_netr_LogonSamLogonWithFlags(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_LogonSamLogonWithFlags, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3778,7 +3778,7 @@ static bool api_netr_NETRSERVERGETTRUSTINFO(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(netr_NETRSERVERGETTRUSTINFO, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
diff --git a/source3/librpc/gen_ndr/srv_ntsvcs.c b/source3/librpc/gen_ndr/srv_ntsvcs.c
index cdf8c74eb1..87f5d51695 100644
--- a/source3/librpc/gen_ndr/srv_ntsvcs.c
+++ b/source3/librpc/gen_ndr/srv_ntsvcs.c
@@ -56,7 +56,7 @@ static bool api_PNP_Disconnect(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_Disconnect, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -129,7 +129,7 @@ static bool api_PNP_Connect(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_Connect, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -209,7 +209,7 @@ static bool api_PNP_GetVersion(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_GetVersion, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -282,7 +282,7 @@ static bool api_PNP_GetGlobalState(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_GetGlobalState, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -355,7 +355,7 @@ static bool api_PNP_InitDetection(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_InitDetection, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -428,7 +428,7 @@ static bool api_PNP_ReportLogOn(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_ReportLogOn, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -501,7 +501,7 @@ static bool api_PNP_ValidateDeviceInstance(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_ValidateDeviceInstance, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -574,7 +574,7 @@ static bool api_PNP_GetRootDeviceInstance(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_GetRootDeviceInstance, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -647,7 +647,7 @@ static bool api_PNP_GetRelatedDeviceInstance(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_GetRelatedDeviceInstance, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -720,7 +720,7 @@ static bool api_PNP_EnumerateSubKeys(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_EnumerateSubKeys, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -781,6 +781,14 @@ static bool api_PNP_GetDeviceList(pipes_struct *p)
NDR_PRINT_IN_DEBUG(PNP_GetDeviceList, r);
}
+ ZERO_STRUCT(r->out);
+ r->out.buffer = talloc_zero_array(r, uint16_t, *r->out.length);
+ if (r->out.buffer == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.length = r->in.length;
r->out.result = _PNP_GetDeviceList(p, r);
if (p->rng_fault_state) {
@@ -793,7 +801,7 @@ static bool api_PNP_GetDeviceList(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_GetDeviceList, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -873,7 +881,7 @@ static bool api_PNP_GetDeviceListSize(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_GetDeviceListSize, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -946,7 +954,7 @@ static bool api_PNP_GetDepth(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_GetDepth, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1008,7 +1016,7 @@ static bool api_PNP_GetDeviceRegProp(pipes_struct *p)
}
ZERO_STRUCT(r->out);
- r->out.unknown1 = r->in.unknown1;
+ r->out.reg_data_type = r->in.reg_data_type;
r->out.buffer = talloc_zero_array(r, uint8_t, *r->out.buffer_size);
if (r->out.buffer == NULL) {
talloc_free(r);
@@ -1029,7 +1037,7 @@ static bool api_PNP_GetDeviceRegProp(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_GetDeviceRegProp, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1102,7 +1110,7 @@ static bool api_PNP_SetDeviceRegProp(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_SetDeviceRegProp, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1175,7 +1183,7 @@ static bool api_PNP_GetClassInstance(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_GetClassInstance, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1248,7 +1256,7 @@ static bool api_PNP_CreateKey(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_CreateKey, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1321,7 +1329,7 @@ static bool api_PNP_DeleteRegistryKey(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_DeleteRegistryKey, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1394,7 +1402,7 @@ static bool api_PNP_GetClassCount(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_GetClassCount, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1467,7 +1475,7 @@ static bool api_PNP_GetClassName(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_GetClassName, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1540,7 +1548,7 @@ static bool api_PNP_DeleteClassKey(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_DeleteClassKey, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1613,7 +1621,7 @@ static bool api_PNP_GetInterfaceDeviceAlias(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_GetInterfaceDeviceAlias, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1686,7 +1694,7 @@ static bool api_PNP_GetInterfaceDeviceList(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_GetInterfaceDeviceList, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1759,7 +1767,7 @@ static bool api_PNP_GetInterfaceDeviceListSize(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_GetInterfaceDeviceListSize, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1832,7 +1840,7 @@ static bool api_PNP_RegisterDeviceClassAssociation(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_RegisterDeviceClassAssociation, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1905,7 +1913,7 @@ static bool api_PNP_UnregisterDeviceClassAssociation(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_UnregisterDeviceClassAssociation, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1978,7 +1986,7 @@ static bool api_PNP_GetClassRegProp(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_GetClassRegProp, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2051,7 +2059,7 @@ static bool api_PNP_SetClassRegProp(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_SetClassRegProp, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2124,7 +2132,7 @@ static bool api_PNP_CreateDevInst(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_CreateDevInst, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2197,7 +2205,7 @@ static bool api_PNP_DeviceInstanceAction(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_DeviceInstanceAction, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2270,7 +2278,7 @@ static bool api_PNP_GetDeviceStatus(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_GetDeviceStatus, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2343,7 +2351,7 @@ static bool api_PNP_SetDeviceProblem(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_SetDeviceProblem, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2416,7 +2424,7 @@ static bool api_PNP_DisableDevInst(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_DisableDevInst, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2489,7 +2497,7 @@ static bool api_PNP_UninstallDevInst(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_UninstallDevInst, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2562,7 +2570,7 @@ static bool api_PNP_AddID(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_AddID, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2635,7 +2643,7 @@ static bool api_PNP_RegisterDriver(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_RegisterDriver, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2708,7 +2716,7 @@ static bool api_PNP_QueryRemove(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_QueryRemove, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2781,7 +2789,7 @@ static bool api_PNP_RequestDeviceEject(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_RequestDeviceEject, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2854,7 +2862,7 @@ static bool api_PNP_IsDockStationPresent(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_IsDockStationPresent, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2927,7 +2935,7 @@ static bool api_PNP_RequestEjectPC(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_RequestEjectPC, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3009,7 +3017,7 @@ static bool api_PNP_HwProfFlags(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_HwProfFlags, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3084,7 +3092,7 @@ static bool api_PNP_GetHwProfInfo(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_GetHwProfInfo, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3157,7 +3165,7 @@ static bool api_PNP_AddEmptyLogConf(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_AddEmptyLogConf, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3230,7 +3238,7 @@ static bool api_PNP_FreeLogConf(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_FreeLogConf, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3303,7 +3311,7 @@ static bool api_PNP_GetFirstLogConf(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_GetFirstLogConf, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3376,7 +3384,7 @@ static bool api_PNP_GetNextLogConf(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_GetNextLogConf, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3449,7 +3457,7 @@ static bool api_PNP_GetLogConfPriority(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_GetLogConfPriority, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3522,7 +3530,7 @@ static bool api_PNP_AddResDes(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_AddResDes, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3595,7 +3603,7 @@ static bool api_PNP_FreeResDes(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_FreeResDes, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3668,7 +3676,7 @@ static bool api_PNP_GetNextResDes(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_GetNextResDes, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3741,7 +3749,7 @@ static bool api_PNP_GetResDesData(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_GetResDesData, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3814,7 +3822,7 @@ static bool api_PNP_GetResDesDataSize(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_GetResDesDataSize, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3887,7 +3895,7 @@ static bool api_PNP_ModifyResDes(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_ModifyResDes, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3960,7 +3968,7 @@ static bool api_PNP_DetectResourceLimit(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_DetectResourceLimit, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -4033,7 +4041,7 @@ static bool api_PNP_QueryResConfList(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_QueryResConfList, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -4106,7 +4114,7 @@ static bool api_PNP_SetHwProf(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_SetHwProf, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -4179,7 +4187,7 @@ static bool api_PNP_QueryArbitratorFreeData(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_QueryArbitratorFreeData, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -4252,7 +4260,7 @@ static bool api_PNP_QueryArbitratorFreeSize(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_QueryArbitratorFreeSize, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -4325,7 +4333,7 @@ static bool api_PNP_RunDetection(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_RunDetection, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -4398,7 +4406,7 @@ static bool api_PNP_RegisterNotification(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_RegisterNotification, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -4471,7 +4479,7 @@ static bool api_PNP_UnregisterNotification(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_UnregisterNotification, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -4544,7 +4552,7 @@ static bool api_PNP_GetCustomDevProp(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_GetCustomDevProp, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -4617,7 +4625,7 @@ static bool api_PNP_GetVersionInternal(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_GetVersionInternal, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -4690,7 +4698,7 @@ static bool api_PNP_GetBlockedDriverInfo(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_GetBlockedDriverInfo, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -4763,7 +4771,7 @@ static bool api_PNP_GetServerSideDeviceInstallFlags(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(PNP_GetServerSideDeviceInstallFlags, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
diff --git a/source3/librpc/gen_ndr/srv_samr.c b/source3/librpc/gen_ndr/srv_samr.c
index 7d4f2c11fd..e09c7a3faf 100644
--- a/source3/librpc/gen_ndr/srv_samr.c
+++ b/source3/librpc/gen_ndr/srv_samr.c
@@ -63,7 +63,7 @@ static bool api_samr_Connect(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_Connect, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -138,7 +138,7 @@ static bool api_samr_Close(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_Close, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -211,7 +211,7 @@ static bool api_samr_SetSecurity(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_SetSecurity, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -291,7 +291,7 @@ static bool api_samr_QuerySecurity(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_QuerySecurity, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -364,7 +364,7 @@ static bool api_samr_Shutdown(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_Shutdown, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -444,7 +444,7 @@ static bool api_samr_LookupDomain(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_LookupDomain, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -531,7 +531,7 @@ static bool api_samr_EnumDomains(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_EnumDomains, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -611,7 +611,7 @@ static bool api_samr_OpenDomain(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_OpenDomain, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -691,7 +691,7 @@ static bool api_samr_QueryDomainInfo(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_QueryDomainInfo, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -764,7 +764,7 @@ static bool api_samr_SetDomainInfo(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_SetDomainInfo, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -850,7 +850,7 @@ static bool api_samr_CreateDomainGroup(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_CreateDomainGroup, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -937,7 +937,7 @@ static bool api_samr_EnumDomainGroups(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_EnumDomainGroups, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1023,7 +1023,7 @@ static bool api_samr_CreateUser(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_CreateUser, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1110,7 +1110,7 @@ static bool api_samr_EnumDomainUsers(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_EnumDomainUsers, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1196,7 +1196,7 @@ static bool api_samr_CreateDomAlias(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_CreateDomAlias, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1283,7 +1283,7 @@ static bool api_samr_EnumDomainAliases(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_EnumDomainAliases, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1363,7 +1363,7 @@ static bool api_samr_GetAliasMembership(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_GetAliasMembership, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1449,7 +1449,7 @@ static bool api_samr_LookupNames(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_LookupNames, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1535,7 +1535,7 @@ static bool api_samr_LookupRids(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_LookupRids, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1615,7 +1615,7 @@ static bool api_samr_OpenGroup(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_OpenGroup, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1695,7 +1695,7 @@ static bool api_samr_QueryGroupInfo(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_QueryGroupInfo, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1768,7 +1768,7 @@ static bool api_samr_SetGroupInfo(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_SetGroupInfo, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1841,7 +1841,7 @@ static bool api_samr_AddGroupMember(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_AddGroupMember, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1916,7 +1916,7 @@ static bool api_samr_DeleteDomainGroup(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_DeleteDomainGroup, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1989,7 +1989,7 @@ static bool api_samr_DeleteGroupMember(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_DeleteGroupMember, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2069,7 +2069,7 @@ static bool api_samr_QueryGroupMember(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_QueryGroupMember, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2142,7 +2142,7 @@ static bool api_samr_SetMemberAttributesOfGroup(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_SetMemberAttributesOfGroup, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2222,7 +2222,7 @@ static bool api_samr_OpenAlias(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_OpenAlias, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2302,7 +2302,7 @@ static bool api_samr_QueryAliasInfo(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_QueryAliasInfo, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2375,7 +2375,7 @@ static bool api_samr_SetAliasInfo(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_SetAliasInfo, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2450,7 +2450,7 @@ static bool api_samr_DeleteDomAlias(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_DeleteDomAlias, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2523,7 +2523,7 @@ static bool api_samr_AddAliasMember(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_AddAliasMember, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2596,7 +2596,7 @@ static bool api_samr_DeleteAliasMember(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_DeleteAliasMember, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2676,7 +2676,7 @@ static bool api_samr_GetMembersInAlias(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_GetMembersInAlias, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2756,7 +2756,7 @@ static bool api_samr_OpenUser(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_OpenUser, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2831,7 +2831,7 @@ static bool api_samr_DeleteUser(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_DeleteUser, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2911,7 +2911,7 @@ static bool api_samr_QueryUserInfo(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_QueryUserInfo, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2984,7 +2984,7 @@ static bool api_samr_SetUserInfo(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_SetUserInfo, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3057,7 +3057,7 @@ static bool api_samr_ChangePasswordUser(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3137,7 +3137,7 @@ static bool api_samr_GetGroupsForUser(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_GetGroupsForUser, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3229,7 +3229,7 @@ static bool api_samr_QueryDisplayInfo(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3309,7 +3309,7 @@ static bool api_samr_GetDisplayEnumerationIndex(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_GetDisplayEnumerationIndex, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3382,7 +3382,7 @@ static bool api_samr_TestPrivateFunctionsDomain(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_TestPrivateFunctionsDomain, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3455,7 +3455,7 @@ static bool api_samr_TestPrivateFunctionsUser(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_TestPrivateFunctionsUser, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3535,7 +3535,7 @@ static bool api_samr_GetUserPwInfo(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_GetUserPwInfo, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3608,7 +3608,7 @@ static bool api_samr_RemoveMemberFromForeignDomain(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_RemoveMemberFromForeignDomain, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3688,7 +3688,7 @@ static bool api_samr_QueryDomainInfo2(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_QueryDomainInfo2, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3768,7 +3768,7 @@ static bool api_samr_QueryUserInfo2(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_QueryUserInfo2, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3860,7 +3860,7 @@ static bool api_samr_QueryDisplayInfo2(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo2, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3940,7 +3940,7 @@ static bool api_samr_GetDisplayEnumerationIndex2(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_GetDisplayEnumerationIndex2, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -4032,7 +4032,7 @@ static bool api_samr_CreateUser2(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_CreateUser2, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -4124,7 +4124,7 @@ static bool api_samr_QueryDisplayInfo3(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo3, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -4197,7 +4197,7 @@ static bool api_samr_AddMultipleMembersToAlias(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_AddMultipleMembersToAlias, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -4270,7 +4270,7 @@ static bool api_samr_RemoveMultipleMembersFromAlias(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_RemoveMultipleMembersFromAlias, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -4343,7 +4343,7 @@ static bool api_samr_OemChangePasswordUser2(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_OemChangePasswordUser2, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -4416,7 +4416,7 @@ static bool api_samr_ChangePasswordUser2(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser2, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -4496,7 +4496,7 @@ static bool api_samr_GetDomPwInfo(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_GetDomPwInfo, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -4576,7 +4576,7 @@ static bool api_samr_Connect2(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_Connect2, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -4649,7 +4649,7 @@ static bool api_samr_SetUserInfo2(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_SetUserInfo2, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -4722,7 +4722,7 @@ static bool api_samr_SetBootKeyInformation(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_SetBootKeyInformation, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -4802,7 +4802,7 @@ static bool api_samr_GetBootKeyInformation(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_GetBootKeyInformation, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -4882,7 +4882,7 @@ static bool api_samr_Connect3(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_Connect3, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -4962,7 +4962,7 @@ static bool api_samr_Connect4(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_Connect4, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -5048,7 +5048,7 @@ static bool api_samr_ChangePasswordUser3(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser3, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -5140,7 +5140,7 @@ static bool api_samr_Connect5(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_Connect5, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -5220,7 +5220,7 @@ static bool api_samr_RidToSid(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_RidToSid, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -5293,7 +5293,7 @@ static bool api_samr_SetDsrmPassword(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_SetDsrmPassword, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -5373,7 +5373,7 @@ static bool api_samr_ValidatePassword(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(samr_ValidatePassword, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
diff --git a/source3/librpc/gen_ndr/srv_srvsvc.c b/source3/librpc/gen_ndr/srv_srvsvc.c
index 60a7212805..57d5239971 100644
--- a/source3/librpc/gen_ndr/srv_srvsvc.c
+++ b/source3/librpc/gen_ndr/srv_srvsvc.c
@@ -66,7 +66,7 @@ static bool api_srvsvc_NetCharDevEnum(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevEnum, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -146,7 +146,7 @@ static bool api_srvsvc_NetCharDevGetInfo(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevGetInfo, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -219,7 +219,7 @@ static bool api_srvsvc_NetCharDevControl(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevControl, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -302,7 +302,7 @@ static bool api_srvsvc_NetCharDevQEnum(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevQEnum, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -382,7 +382,7 @@ static bool api_srvsvc_NetCharDevQGetInfo(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevQGetInfo, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -457,7 +457,7 @@ static bool api_srvsvc_NetCharDevQSetInfo(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevQSetInfo, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -530,7 +530,7 @@ static bool api_srvsvc_NetCharDevQPurge(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevQPurge, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -603,7 +603,7 @@ static bool api_srvsvc_NetCharDevQPurgeSelf(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NetCharDevQPurgeSelf, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -685,7 +685,7 @@ static bool api_srvsvc_NetConnEnum(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NetConnEnum, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -767,7 +767,7 @@ static bool api_srvsvc_NetFileEnum(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NetFileEnum, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -847,7 +847,7 @@ static bool api_srvsvc_NetFileGetInfo(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NetFileGetInfo, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -920,7 +920,7 @@ static bool api_srvsvc_NetFileClose(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NetFileClose, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1002,7 +1002,7 @@ static bool api_srvsvc_NetSessEnum(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NetSessEnum, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1075,7 +1075,7 @@ static bool api_srvsvc_NetSessDel(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NetSessDel, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1150,7 +1150,7 @@ static bool api_srvsvc_NetShareAdd(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NetShareAdd, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1232,7 +1232,7 @@ static bool api_srvsvc_NetShareEnumAll(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NetShareEnumAll, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1312,7 +1312,7 @@ static bool api_srvsvc_NetShareGetInfo(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NetShareGetInfo, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1387,7 +1387,7 @@ static bool api_srvsvc_NetShareSetInfo(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NetShareSetInfo, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1460,7 +1460,7 @@ static bool api_srvsvc_NetShareDel(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NetShareDel, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1533,7 +1533,7 @@ static bool api_srvsvc_NetShareDelSticky(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NetShareDelSticky, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1613,7 +1613,7 @@ static bool api_srvsvc_NetShareCheck(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NetShareCheck, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1693,7 +1693,7 @@ static bool api_srvsvc_NetSrvGetInfo(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NetSrvGetInfo, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1768,7 +1768,7 @@ static bool api_srvsvc_NetSrvSetInfo(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NetSrvSetInfo, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1850,7 +1850,7 @@ static bool api_srvsvc_NetDiskEnum(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NetDiskEnum, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1930,7 +1930,7 @@ static bool api_srvsvc_NetServerStatisticsGet(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NetServerStatisticsGet, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2003,7 +2003,7 @@ static bool api_srvsvc_NetTransportAdd(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NetTransportAdd, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2086,7 +2086,7 @@ static bool api_srvsvc_NetTransportEnum(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NetTransportEnum, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2159,7 +2159,7 @@ static bool api_srvsvc_NetTransportDel(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NetTransportDel, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2239,7 +2239,7 @@ static bool api_srvsvc_NetRemoteTOD(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NetRemoteTOD, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2312,7 +2312,7 @@ static bool api_srvsvc_NetSetServiceBits(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NetSetServiceBits, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2392,7 +2392,7 @@ static bool api_srvsvc_NetPathType(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NetPathType, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2473,7 +2473,7 @@ static bool api_srvsvc_NetPathCanonicalize(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NetPathCanonicalize, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2546,7 +2546,7 @@ static bool api_srvsvc_NetPathCompare(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NetPathCompare, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2619,7 +2619,7 @@ static bool api_srvsvc_NetNameValidate(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NetNameValidate, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2692,7 +2692,7 @@ static bool api_srvsvc_NETRPRNAMECANONICALIZE(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NETRPRNAMECANONICALIZE, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2765,7 +2765,7 @@ static bool api_srvsvc_NetPRNameCompare(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NetPRNameCompare, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2847,7 +2847,7 @@ static bool api_srvsvc_NetShareEnum(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NetShareEnum, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2927,7 +2927,7 @@ static bool api_srvsvc_NetShareDelStart(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NetShareDelStart, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3002,7 +3002,7 @@ static bool api_srvsvc_NetShareDelCommit(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NetShareDelCommit, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3082,7 +3082,7 @@ static bool api_srvsvc_NetGetFileSecurity(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NetGetFileSecurity, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3155,7 +3155,7 @@ static bool api_srvsvc_NetSetFileSecurity(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NetSetFileSecurity, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3228,7 +3228,7 @@ static bool api_srvsvc_NetServerTransportAddEx(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NetServerTransportAddEx, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3301,7 +3301,7 @@ static bool api_srvsvc_NetServerSetServiceBitsEx(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NetServerSetServiceBitsEx, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3374,7 +3374,7 @@ static bool api_srvsvc_NETRDFSGETVERSION(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSGETVERSION, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3447,7 +3447,7 @@ static bool api_srvsvc_NETRDFSCREATELOCALPARTITION(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSCREATELOCALPARTITION, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3520,7 +3520,7 @@ static bool api_srvsvc_NETRDFSDELETELOCALPARTITION(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSDELETELOCALPARTITION, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3593,7 +3593,7 @@ static bool api_srvsvc_NETRDFSSETLOCALVOLUMESTATE(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSSETLOCALVOLUMESTATE, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3666,7 +3666,7 @@ static bool api_srvsvc_NETRDFSSETSERVERINFO(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSSETSERVERINFO, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3739,7 +3739,7 @@ static bool api_srvsvc_NETRDFSCREATEEXITPOINT(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSCREATEEXITPOINT, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3812,7 +3812,7 @@ static bool api_srvsvc_NETRDFSDELETEEXITPOINT(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSDELETEEXITPOINT, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3885,7 +3885,7 @@ static bool api_srvsvc_NETRDFSMODIFYPREFIX(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSMODIFYPREFIX, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3958,7 +3958,7 @@ static bool api_srvsvc_NETRDFSFIXLOCALVOLUME(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSFIXLOCALVOLUME, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -4031,7 +4031,7 @@ static bool api_srvsvc_NETRDFSMANAGERREPORTSITEINFO(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NETRDFSMANAGERREPORTSITEINFO, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -4104,7 +4104,7 @@ static bool api_srvsvc_NETRSERVERTRANSPORTDELEX(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(srvsvc_NETRSERVERTRANSPORTDELEX, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
diff --git a/source3/librpc/gen_ndr/srv_svcctl.c b/source3/librpc/gen_ndr/srv_svcctl.c
index d371ca2ec6..2349b4fd93 100644
--- a/source3/librpc/gen_ndr/srv_svcctl.c
+++ b/source3/librpc/gen_ndr/srv_svcctl.c
@@ -58,7 +58,7 @@ static bool api_svcctl_CloseServiceHandle(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(svcctl_CloseServiceHandle, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -138,7 +138,7 @@ static bool api_svcctl_ControlService(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(svcctl_ControlService, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -211,7 +211,7 @@ static bool api_svcctl_DeleteService(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(svcctl_DeleteService, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -291,7 +291,7 @@ static bool api_svcctl_LockServiceDatabase(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(svcctl_LockServiceDatabase, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -377,7 +377,7 @@ static bool api_svcctl_QueryServiceObjectSecurity(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceObjectSecurity, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -450,7 +450,7 @@ static bool api_svcctl_SetServiceObjectSecurity(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(svcctl_SetServiceObjectSecurity, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -530,7 +530,7 @@ static bool api_svcctl_QueryServiceStatus(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceStatus, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -603,7 +603,7 @@ static bool api_svcctl_SetServiceStatus(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(svcctl_SetServiceStatus, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -678,7 +678,7 @@ static bool api_svcctl_UnlockServiceDatabase(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(svcctl_UnlockServiceDatabase, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -751,7 +751,7 @@ static bool api_svcctl_NotifyBootConfigStatus(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(svcctl_NotifyBootConfigStatus, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -824,7 +824,7 @@ static bool api_svcctl_SCSetServiceBitsW(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(svcctl_SCSetServiceBitsW, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -904,7 +904,7 @@ static bool api_svcctl_ChangeServiceConfigW(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfigW, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -985,7 +985,7 @@ static bool api_svcctl_CreateServiceW(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(svcctl_CreateServiceW, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1077,7 +1077,7 @@ static bool api_svcctl_EnumDependentServicesW(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(svcctl_EnumDependentServicesW, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1170,7 +1170,7 @@ static bool api_svcctl_EnumServicesStatusW(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(svcctl_EnumServicesStatusW, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1250,7 +1250,7 @@ static bool api_svcctl_OpenSCManagerW(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(svcctl_OpenSCManagerW, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1330,7 +1330,7 @@ static bool api_svcctl_OpenServiceW(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(svcctl_OpenServiceW, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1392,7 +1392,7 @@ static bool api_svcctl_QueryServiceConfigW(pipes_struct *p)
}
ZERO_STRUCT(r->out);
- r->out.query = talloc_zero_array(r, uint8_t, r->in.buf_size);
+ r->out.query = talloc_zero(r, struct QUERY_SERVICE_CONFIG);
if (r->out.query == NULL) {
talloc_free(r);
return false;
@@ -1416,7 +1416,7 @@ static bool api_svcctl_QueryServiceConfigW(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfigW, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1502,7 +1502,7 @@ static bool api_svcctl_QueryServiceLockStatusW(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceLockStatusW, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1575,7 +1575,7 @@ static bool api_svcctl_StartServiceW(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(svcctl_StartServiceW, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1656,7 +1656,7 @@ static bool api_svcctl_GetServiceDisplayNameW(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(svcctl_GetServiceDisplayNameW, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1737,7 +1737,7 @@ static bool api_svcctl_GetServiceKeyNameW(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(svcctl_GetServiceKeyNameW, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1810,7 +1810,7 @@ static bool api_svcctl_SCSetServiceBitsA(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(svcctl_SCSetServiceBitsA, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1890,7 +1890,7 @@ static bool api_svcctl_ChangeServiceConfigA(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfigA, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1970,7 +1970,7 @@ static bool api_svcctl_CreateServiceA(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(svcctl_CreateServiceA, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2062,7 +2062,7 @@ static bool api_svcctl_EnumDependentServicesA(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(svcctl_EnumDependentServicesA, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2155,7 +2155,7 @@ static bool api_svcctl_EnumServicesStatusA(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(svcctl_EnumServicesStatusA, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2235,7 +2235,7 @@ static bool api_svcctl_OpenSCManagerA(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(svcctl_OpenSCManagerA, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2308,7 +2308,7 @@ static bool api_svcctl_OpenServiceA(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(svcctl_OpenServiceA, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2394,7 +2394,7 @@ static bool api_svcctl_QueryServiceConfigA(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfigA, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2480,7 +2480,7 @@ static bool api_svcctl_QueryServiceLockStatusA(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceLockStatusA, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2553,7 +2553,7 @@ static bool api_svcctl_StartServiceA(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(svcctl_StartServiceA, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2634,7 +2634,7 @@ static bool api_svcctl_GetServiceDisplayNameA(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(svcctl_GetServiceDisplayNameA, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2715,7 +2715,7 @@ static bool api_svcctl_GetServiceKeyNameA(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(svcctl_GetServiceKeyNameA, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2788,7 +2788,7 @@ static bool api_svcctl_GetCurrentGroupeStateW(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(svcctl_GetCurrentGroupeStateW, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2861,7 +2861,7 @@ static bool api_svcctl_EnumServiceGroupW(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(svcctl_EnumServiceGroupW, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2934,7 +2934,7 @@ static bool api_svcctl_ChangeServiceConfig2A(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfig2A, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3007,7 +3007,7 @@ static bool api_svcctl_ChangeServiceConfig2W(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfig2W, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3093,7 +3093,7 @@ static bool api_svcctl_QueryServiceConfig2A(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfig2A, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3179,7 +3179,7 @@ static bool api_svcctl_QueryServiceConfig2W(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfig2W, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3265,7 +3265,7 @@ static bool api_svcctl_QueryServiceStatusEx(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceStatusEx, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3364,7 +3364,7 @@ static bool api_EnumServicesStatusExA(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(EnumServicesStatusExA, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3463,7 +3463,7 @@ static bool api_EnumServicesStatusExW(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(EnumServicesStatusExW, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -3536,7 +3536,7 @@ static bool api_svcctl_SCSendTSMessage(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(svcctl_SCSendTSMessage, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
diff --git a/source3/librpc/gen_ndr/srv_winreg.c b/source3/librpc/gen_ndr/srv_winreg.c
index 2162306322..77b0a1c5d2 100644
--- a/source3/librpc/gen_ndr/srv_winreg.c
+++ b/source3/librpc/gen_ndr/srv_winreg.c
@@ -63,7 +63,7 @@ static bool api_winreg_OpenHKCR(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(winreg_OpenHKCR, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -143,7 +143,7 @@ static bool api_winreg_OpenHKCU(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(winreg_OpenHKCU, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -223,7 +223,7 @@ static bool api_winreg_OpenHKLM(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(winreg_OpenHKLM, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -303,7 +303,7 @@ static bool api_winreg_OpenHKPD(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(winreg_OpenHKPD, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -383,7 +383,7 @@ static bool api_winreg_OpenHKU(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(winreg_OpenHKU, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -458,7 +458,7 @@ static bool api_winreg_CloseKey(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(winreg_CloseKey, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -539,7 +539,7 @@ static bool api_winreg_CreateKey(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(winreg_CreateKey, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -612,7 +612,7 @@ static bool api_winreg_DeleteKey(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(winreg_DeleteKey, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -685,7 +685,7 @@ static bool api_winreg_DeleteValue(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(winreg_DeleteValue, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -762,7 +762,7 @@ static bool api_winreg_EnumKey(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(winreg_EnumKey, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -841,7 +841,7 @@ static bool api_winreg_EnumValue(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(winreg_EnumValue, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -914,7 +914,7 @@ static bool api_winreg_FlushKey(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(winreg_FlushKey, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -989,7 +989,7 @@ static bool api_winreg_GetKeySecurity(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(winreg_GetKeySecurity, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1062,7 +1062,7 @@ static bool api_winreg_LoadKey(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(winreg_LoadKey, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1135,7 +1135,7 @@ static bool api_winreg_NotifyChangeKeyValue(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(winreg_NotifyChangeKeyValue, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1215,7 +1215,7 @@ static bool api_winreg_OpenKey(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(winreg_OpenKey, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1338,7 +1338,7 @@ static bool api_winreg_QueryInfoKey(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(winreg_QueryInfoKey, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1403,7 +1403,7 @@ static bool api_winreg_QueryValue(pipes_struct *p)
r->out.type = r->in.type;
r->out.data = r->in.data;
r->out.data_size = r->in.data_size;
- r->out.value_length = r->in.value_length;
+ r->out.data_length = r->in.data_length;
r->out.result = _winreg_QueryValue(p, r);
if (p->rng_fault_state) {
@@ -1416,7 +1416,7 @@ static bool api_winreg_QueryValue(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(winreg_QueryValue, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1489,7 +1489,7 @@ static bool api_winreg_ReplaceKey(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(winreg_ReplaceKey, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1562,7 +1562,7 @@ static bool api_winreg_RestoreKey(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(winreg_RestoreKey, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1635,7 +1635,7 @@ static bool api_winreg_SaveKey(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(winreg_SaveKey, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1708,7 +1708,7 @@ static bool api_winreg_SetKeySecurity(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(winreg_SetKeySecurity, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1781,7 +1781,7 @@ static bool api_winreg_SetValue(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(winreg_SetValue, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1854,7 +1854,7 @@ static bool api_winreg_UnLoadKey(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(winreg_UnLoadKey, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1927,7 +1927,7 @@ static bool api_winreg_InitiateSystemShutdown(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(winreg_InitiateSystemShutdown, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2000,7 +2000,7 @@ static bool api_winreg_AbortSystemShutdown(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(winreg_AbortSystemShutdown, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2080,7 +2080,7 @@ static bool api_winreg_GetVersion(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(winreg_GetVersion, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2160,7 +2160,7 @@ static bool api_winreg_OpenHKCC(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(winreg_OpenHKCC, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2240,7 +2240,7 @@ static bool api_winreg_OpenHKDD(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(winreg_OpenHKDD, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2317,7 +2317,7 @@ static bool api_winreg_QueryMultipleValues(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(winreg_QueryMultipleValues, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2390,7 +2390,7 @@ static bool api_winreg_InitiateSystemShutdownEx(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(winreg_InitiateSystemShutdownEx, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2463,7 +2463,7 @@ static bool api_winreg_SaveKeyEx(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(winreg_SaveKeyEx, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2543,7 +2543,7 @@ static bool api_winreg_OpenHKPT(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(winreg_OpenHKPT, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2623,7 +2623,7 @@ static bool api_winreg_OpenHKPN(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(winreg_OpenHKPN, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2696,7 +2696,7 @@ static bool api_winreg_QueryMultipleValues2(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(winreg_QueryMultipleValues2, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
diff --git a/source3/librpc/gen_ndr/srv_wkssvc.c b/source3/librpc/gen_ndr/srv_wkssvc.c
index 68813dbba7..9c07fa86ea 100644
--- a/source3/librpc/gen_ndr/srv_wkssvc.c
+++ b/source3/librpc/gen_ndr/srv_wkssvc.c
@@ -63,7 +63,7 @@ static bool api_wkssvc_NetWkstaGetInfo(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaGetInfo, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -138,7 +138,7 @@ static bool api_wkssvc_NetWkstaSetInfo(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaSetInfo, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -220,7 +220,7 @@ static bool api_wkssvc_NetWkstaEnumUsers(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaEnumUsers, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -300,7 +300,7 @@ static bool api_wkssvc_NetrWkstaUserGetInfo(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaUserGetInfo, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -375,7 +375,7 @@ static bool api_wkssvc_NetrWkstaUserSetInfo(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaUserSetInfo, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -457,7 +457,7 @@ static bool api_wkssvc_NetWkstaTransportEnum(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaTransportEnum, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -532,7 +532,7 @@ static bool api_wkssvc_NetrWkstaTransportAdd(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaTransportAdd, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -605,7 +605,7 @@ static bool api_wkssvc_NetrWkstaTransportDel(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaTransportDel, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -680,7 +680,7 @@ static bool api_wkssvc_NetrUseAdd(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseAdd, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -760,7 +760,7 @@ static bool api_wkssvc_NetrUseGetInfo(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseGetInfo, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -833,7 +833,7 @@ static bool api_wkssvc_NetrUseDel(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseDel, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -915,7 +915,7 @@ static bool api_wkssvc_NetrUseEnum(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseEnum, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -988,7 +988,7 @@ static bool api_wkssvc_NetrMessageBufferSend(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(wkssvc_NetrMessageBufferSend, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1068,7 +1068,7 @@ static bool api_wkssvc_NetrWorkstationStatisticsGet(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(wkssvc_NetrWorkstationStatisticsGet, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1141,7 +1141,7 @@ static bool api_wkssvc_NetrLogonDomainNameAdd(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(wkssvc_NetrLogonDomainNameAdd, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1214,7 +1214,7 @@ static bool api_wkssvc_NetrLogonDomainNameDel(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(wkssvc_NetrLogonDomainNameDel, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1287,7 +1287,7 @@ static bool api_wkssvc_NetrJoinDomain(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(wkssvc_NetrJoinDomain, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1360,7 +1360,7 @@ static bool api_wkssvc_NetrUnjoinDomain(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(wkssvc_NetrUnjoinDomain, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1433,7 +1433,7 @@ static bool api_wkssvc_NetrRenameMachineInDomain(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(wkssvc_NetrRenameMachineInDomain, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1506,7 +1506,7 @@ static bool api_wkssvc_NetrValidateName(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(wkssvc_NetrValidateName, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1587,7 +1587,7 @@ static bool api_wkssvc_NetrGetJoinInformation(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(wkssvc_NetrGetJoinInformation, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1668,7 +1668,7 @@ static bool api_wkssvc_NetrGetJoinableOus(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(wkssvc_NetrGetJoinableOus, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1741,7 +1741,7 @@ static bool api_wkssvc_NetrJoinDomain2(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(wkssvc_NetrJoinDomain2, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1814,7 +1814,7 @@ static bool api_wkssvc_NetrUnjoinDomain2(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(wkssvc_NetrUnjoinDomain2, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1887,7 +1887,7 @@ static bool api_wkssvc_NetrRenameMachineInDomain2(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(wkssvc_NetrRenameMachineInDomain2, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -1960,7 +1960,7 @@ static bool api_wkssvc_NetrValidateName2(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(wkssvc_NetrValidateName2, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2041,7 +2041,7 @@ static bool api_wkssvc_NetrGetJoinableOus2(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(wkssvc_NetrGetJoinableOus2, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2114,7 +2114,7 @@ static bool api_wkssvc_NetrAddAlternateComputerName(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(wkssvc_NetrAddAlternateComputerName, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2187,7 +2187,7 @@ static bool api_wkssvc_NetrRemoveAlternateComputerName(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(wkssvc_NetrRemoveAlternateComputerName, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2260,7 +2260,7 @@ static bool api_wkssvc_NetrSetPrimaryComputername(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(wkssvc_NetrSetPrimaryComputername, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
@@ -2340,7 +2340,7 @@ static bool api_wkssvc_NetrEnumerateComputerNames(pipes_struct *p)
NDR_PRINT_OUT_DEBUG(wkssvc_NetrEnumerateComputerNames, r);
}
- push = ndr_push_init_ctx(r);
+ push = ndr_push_init_ctx(r, NULL);
if (push == NULL) {
talloc_free(r);
return false;
diff --git a/source3/librpc/gen_ndr/svcctl.h b/source3/librpc/gen_ndr/svcctl.h
index b7f39a9b02..42ed039784 100644
--- a/source3/librpc/gen_ndr/svcctl.h
+++ b/source3/librpc/gen_ndr/svcctl.h
@@ -99,6 +99,18 @@ enum SERVICE_CONTROL
#define SC_RIGHT_SVC_INTERROGATE ( 0x0080 )
#define SC_RIGHT_SVC_USER_DEFINED_CONTROL ( 0x0100 )
+struct QUERY_SERVICE_CONFIG {
+ uint32_t service_type;
+ uint32_t start_type;
+ uint32_t error_control;
+ const char *executablepath;/* [unique,range(0,8192),charset(UTF16)] */
+ const char *loadordergroup;/* [unique,range(0,8192),charset(UTF16)] */
+ uint32_t tag_id;
+ const char *dependencies;/* [unique,range(0,8192),charset(UTF16)] */
+ const char *startname;/* [unique,range(0,8192),charset(UTF16)] */
+ const char *displayname;/* [unique,range(0,8192),charset(UTF16)] */
+}/* [gensize,public] */;
+
struct svcctl_CloseServiceHandle {
struct {
@@ -360,12 +372,12 @@ struct svcctl_OpenServiceW {
struct svcctl_QueryServiceConfigW {
struct {
struct policy_handle *handle;/* [ref] */
- uint32_t buf_size;
+ uint32_t buf_size;/* [range(0,8192)] */
} in;
struct {
- uint8_t *query;
- uint32_t *bytes_needed;/* [ref] */
+ struct QUERY_SERVICE_CONFIG *query;/* [ref] */
+ uint32_t *bytes_needed;/* [ref,range(0,8192)] */
WERROR result;
} out;
diff --git a/source3/librpc/gen_ndr/winreg.h b/source3/librpc/gen_ndr/winreg.h
index 4a06e3bc83..0f3c45ebb7 100644
--- a/source3/librpc/gen_ndr/winreg.h
+++ b/source3/librpc/gen_ndr/winreg.h
@@ -3,7 +3,6 @@
#include <stdint.h>
#include "librpc/gen_ndr/lsa.h"
-#include "librpc/gen_ndr/initshutdown.h"
#include "librpc/gen_ndr/security.h"
#ifndef _HEADER_winreg
#define _HEADER_winreg
@@ -96,6 +95,12 @@ struct winreg_ValNameBuf {
const char *name;/* [unique,length_is(length/2),charset(UTF16),size_is(size/2)] */
};
+/* bitmap winreg_NotifyChangeType */
+#define REG_NOTIFY_CHANGE_NAME ( 0x00000001 )
+#define REG_NOTIFY_CHANGE_ATTRIBUTES ( 0x00000002 )
+#define REG_NOTIFY_CHANGE_LAST_SET ( 0x00000004 )
+#define REG_NOTIFY_CHANGE_SECURITY ( 0x00000008 )
+
struct KeySecurityAttribute {
uint32_t data_size;
struct KeySecurityData sec_data;
@@ -383,16 +388,16 @@ struct winreg_QueryValue {
struct policy_handle *handle;/* [ref] */
struct winreg_String *value_name;/* [ref] */
enum winreg_Type *type;/* [unique] */
- uint8_t *data;/* [unique,length_is(*value_length),size_is(*data_size)] */
+ uint8_t *data;/* [unique,length_is(*data_length),size_is(*data_size)] */
uint32_t *data_size;/* [unique] */
- uint32_t *value_length;/* [unique] */
+ uint32_t *data_length;/* [unique] */
} in;
struct {
enum winreg_Type *type;/* [unique] */
- uint8_t *data;/* [unique,length_is(*value_length),size_is(*data_size)] */
+ uint8_t *data;/* [unique,length_is(*data_length),size_is(*data_size)] */
uint32_t *data_size;/* [unique] */
- uint32_t *value_length;/* [unique] */
+ uint32_t *data_length;/* [unique] */
WERROR result;
} out;
@@ -438,7 +443,7 @@ struct winreg_SaveKey {
struct winreg_SetKeySecurity {
struct {
struct policy_handle *handle;/* [ref] */
- uint32_t access_mask;
+ uint32_t sec_info;
struct KeySecurityData *sd;/* [ref] */
} in;
@@ -476,7 +481,7 @@ struct winreg_UnLoadKey {
struct winreg_InitiateSystemShutdown {
struct {
uint16_t *hostname;/* [unique] */
- struct initshutdown_String *message;/* [unique] */
+ struct lsa_StringLarge *message;/* [unique] */
uint32_t timeout;
uint8_t force_apps;
uint8_t do_reboot;
@@ -564,7 +569,7 @@ struct winreg_QueryMultipleValues {
struct winreg_InitiateSystemShutdownEx {
struct {
uint16_t *hostname;/* [unique] */
- struct initshutdown_String *message;/* [unique] */
+ struct lsa_StringLarge *message;/* [unique] */
uint32_t timeout;
uint8_t force_apps;
uint8_t do_reboot;
diff --git a/source3/librpc/gen_ndr/xattr.h b/source3/librpc/gen_ndr/xattr.h
index b0b9db99c1..1d8da3f5e2 100644
--- a/source3/librpc/gen_ndr/xattr.h
+++ b/source3/librpc/gen_ndr/xattr.h
@@ -2,18 +2,75 @@
#include <stdint.h>
+#include "librpc/gen_ndr/security.h"
#ifndef _HEADER_xattr
#define _HEADER_xattr
+#define XATTR_DOSATTRIB_NAME ( "user.DosAttrib" )
+#define XATTR_DOSATTRIB_ESTIMATED_SIZE ( 64 )
+#define XATTR_DOSEAS_NAME ( "user.DosEAs" )
+#define XATTR_DOSSTREAMS_NAME ( "user.DosStreams" )
+#define XATTR_STREAM_FLAG_INTERNAL ( 0x00000001 )
+#define XATTR_DOSSTREAM_PREFIX ( "user.DosStream." )
+#define XATTR_MAX_STREAM_SIZE ( 0x4000 )
+#define XATTR_MAX_STREAM_SIZE_TDB ( 0x100000 )
#define XATTR_NTACL_NAME ( "security.NTACL" )
-struct tdb_xattr {
+struct xattr_DosInfo1 {
+ uint32_t attrib;
+ uint32_t ea_size;
+ uint64_t size;
+ uint64_t alloc_size;
+ NTTIME create_time;
+ NTTIME change_time;
+};
+
+struct xattr_DosInfo2Old {
+ uint32_t flags;
+ uint32_t attrib;
+ uint32_t ea_size;
+ uint64_t size;
+ uint64_t alloc_size;
+ NTTIME create_time;
+ NTTIME change_time;
+ NTTIME write_time;
+ const char * name;/* [flag(LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM)] */
+};
+
+union xattr_DosInfo {
+ struct xattr_DosInfo1 info1;/* [case] */
+ struct xattr_DosInfo2Old oldinfo2;/* [case(2)] */
+}/* [switch_type(uint16)] */;
+
+struct xattr_DosAttrib {
+ uint16_t version;
+ union xattr_DosInfo info;/* [switch_is(version)] */
+}/* [public] */;
+
+struct xattr_EA {
const char * name;/* [flag(LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM)] */
DATA_BLOB value;
+};
+
+struct xattr_DosEAs {
+ uint16_t num_eas;
+ struct xattr_EA *eas;/* [unique,size_is(num_eas)] */
}/* [public] */;
struct tdb_xattrs {
- uint32_t num_xattrs;
- struct tdb_xattr *xattrs;
+ uint32_t num_eas;
+ struct xattr_EA *eas;
+}/* [public] */;
+
+struct xattr_DosStream {
+ uint32_t flags;
+ uint64_t size;
+ uint64_t alloc_size;
+ const char * name;/* [flag(LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM)] */
+};
+
+struct xattr_DosStreams {
+ uint32_t num_streams;
+ struct xattr_DosStream *streams;/* [unique,size_is(num_streams)] */
}/* [public] */;
struct security_descriptor_timestamp {
diff --git a/source3/librpc/idl/dfs.idl b/source3/librpc/idl/dfs.idl
deleted file mode 100644
index 1b145f3dfa..0000000000
--- a/source3/librpc/idl/dfs.idl
+++ /dev/null
@@ -1,419 +0,0 @@
-/*
- dfs interface definition
-*/
-
-import "misc.idl";
-
-[ uuid("4fc742e0-4a10-11cf-8273-00aa004ae673"),
- version(3.0),
- pointer_default(unique),
- helpstring("Settings for Microsoft Distributed File System"),
- endpoint("ncacn_np:[\\pipe\\netdfs]", "ncacn_ip_tcp:", "ncalrpc:")
-] interface netdfs
-{
- /******************/
- /* Function: 0x00 */
- typedef [v1_enum] enum {
- DFS_MANAGER_VERSION_NT4 = 1,
- DFS_MANAGER_VERSION_W2K = 2,
- DFS_MANAGER_VERSION_W2K3 = 4,
- DFS_MANAGER_VERSION_W2K8 = 6
- } dfs_ManagerVersion;
-
- [public] void dfs_GetManagerVersion(
- [out] dfs_ManagerVersion *version
- );
-
-
- /******************/
- /* Function: 0x01 */
- WERROR dfs_Add (
- [in] [string,charset(UTF16)] uint16 *path,
- [in] [string,charset(UTF16)] uint16 *server,
- [in,unique] [string,charset(UTF16)] uint16 *share,
- [in,unique] [string,charset(UTF16)] uint16 *comment,
- [in] uint32 flags
- );
-
- /******************/
- /* Function: 0x02 */
- WERROR dfs_Remove (
- [in] [string,charset(UTF16)] uint16 *dfs_entry_path,
- [in,unique] [string,charset(UTF16)] uint16 *servername,
- [in,unique] [string,charset(UTF16)] uint16 *sharename
- );
-
- /******************/
- /* Function: 0x03 */
-
- typedef struct {
- } dfs_Info0;
-
- typedef struct {
- [string,charset(UTF16)] uint16 *path;
- } dfs_Info1;
-
- typedef [public,bitmap32bit] bitmap {
- DFS_VOLUME_STATE_OK = 0x1,
- DFS_VOLUME_STATE_INCONSISTENT = 0x2,
- DFS_VOLUME_STATE_OFFLINE = 0x3,
- DFS_VOLUME_STATE_ONLINE = 0x4,
- DFS_VOLUME_STATE_STANDALONE = DFS_VOLUME_FLAVOR_STANDALONE,
- DFS_VOLUME_STATE_AD_BLOB = DFS_VOLUME_FLAVOR_AD_BLOB
- } dfs_VolumeState;
-
- typedef struct {
- [string,charset(UTF16)] uint16 *path;
- [string,charset(UTF16)] uint16 *comment;
- dfs_VolumeState state;
- uint32 num_stores;
- } dfs_Info2;
-
- const int DFS_STORAGE_STATES = 0xf;
-
- /* yes, this is a bitmap */
- typedef [public,bitmap32bit] bitmap {
- DFS_STORAGE_STATE_OFFLINE = 1,
- DFS_STORAGE_STATE_ONLINE = 2,
- DFS_STORAGE_STATE_ACTIVE = 4
- } dfs_StorageState;
-
- typedef struct {
- dfs_StorageState state;
- [string,charset(UTF16)] uint16 *server;
- [string,charset(UTF16)] uint16 *share;
- } dfs_StorageInfo;
-
- typedef struct {
- [string,charset(UTF16)] uint16 *path;
- [string,charset(UTF16)] uint16 *comment;
- dfs_VolumeState state;
- uint32 num_stores;
- [size_is(num_stores)] dfs_StorageInfo *stores;
- } dfs_Info3;
-
- typedef struct {
- [string,charset(UTF16)] uint16 *path;
- [string,charset(UTF16)] uint16 *comment;
- dfs_VolumeState state;
- uint32 timeout;
- GUID guid;
- uint32 num_stores;
- [size_is(num_stores)] dfs_StorageInfo *stores;
- } dfs_Info4;
-
- /* verified with dfsutil */
- typedef [public,bitmap32bit] bitmap {
- DFS_PROPERTY_FLAG_INSITE_REFERRALS = 0x01,
- DFS_PROPERTY_FLAG_ROOT_SCALABILITY = 0x02,
- DFS_PROPERTY_FLAG_SITE_COSTING = 0x04,
- DFS_PROPERTY_FLAG_TARGET_FAILBACK = 0x08,
- DFS_PROPERTY_FLAG_CLUSTER_ENABLED = 0x10 /* untested */
- } dfs_PropertyFlags;
-
- typedef struct {
- [string,charset(UTF16)] uint16 *path;
- [string,charset(UTF16)] uint16 *comment;
- dfs_VolumeState state;
- uint32 timeout;
- GUID guid;
- dfs_PropertyFlags flags;
- uint32 pktsize;
- uint32 num_stores;
- } dfs_Info5;
-
- typedef [v1_enum] enum {
- DFS_INVALID_PRIORITY_CLASS = -1,
- DFS_SITE_COST_NORMAL_PRIORITY_CLASS = 0,
- DFS_GLOBAL_HIGH_PRIORITY_CLASS = 1,
- DFS_SITE_COST_HIGH_PRIORITY_CLASS = 2,
- DFS_SITE_COST_LOW_PRIORITY_CLASS = 3,
- DFS_GLOBAL_LOW_PRIORITY_CLASS = 4
- } dfs_Target_PriorityClass;
-
- typedef struct {
- dfs_Target_PriorityClass target_priority_class;
- uint16 target_priority_rank;
- uint16 reserved;
- } dfs_Target_Priority;
-
- typedef struct {
- dfs_StorageInfo info;
- dfs_Target_Priority target_priority;
- } dfs_StorageInfo2;
-
- typedef struct {
- [string,charset(UTF16)] uint16 *entry_path;
- [string,charset(UTF16)] uint16 *comment;
- dfs_VolumeState state;
- uint32 timeout;
- GUID guid;
- dfs_PropertyFlags flags;
- uint32 pktsize;
- uint16 num_stores;
- [size_is(num_stores)] dfs_StorageInfo2 *stores;
- } dfs_Info6;
-
- typedef struct {
- GUID generation_guid;
- } dfs_Info7;
-
- typedef struct {
- [string,charset(UTF16)] uint16 *comment;
- } dfs_Info100;
-
- typedef struct {
- dfs_StorageState state;
- } dfs_Info101;
-
- typedef struct {
- uint32 timeout;
- } dfs_Info102;
-
- typedef struct {
- dfs_PropertyFlags flags;
- } dfs_Info103;
-
- typedef struct {
- dfs_Target_Priority priority;
- } dfs_Info104;
-
- typedef struct {
- [string,charset(UTF16)] uint16 *comment;
- dfs_VolumeState state;
- uint32 timeout;
- uint32 property_flag_mask;
- uint32 property_flags;
- } dfs_Info105;
-
- typedef struct {
- dfs_StorageState state;
- dfs_Target_Priority priority;
- } dfs_Info106;
-
- typedef struct {
- [string,charset(UTF16)] uint16 *dom_root;
- } dfs_Info200;
-
- typedef enum {
- DFS_VOLUME_FLAVOR_STANDALONE = 0x100,
- DFS_VOLUME_FLAVOR_AD_BLOB = 0x200
- } dfs_VolumeFlavor;
-
- typedef struct {
- dfs_VolumeFlavor flavor;
- [string,charset(UTF16)] uint16 *dom_root;
- } dfs_Info300;
-
- typedef union {
- [case(0)] dfs_Info0 *info0;
- [case(1)] dfs_Info1 *info1;
- [case(2)] dfs_Info2 *info2;
- [case(3)] dfs_Info3 *info3;
- [case(4)] dfs_Info4 *info4;
- [case(5)] dfs_Info5 *info5;
- [case(6)] dfs_Info6 *info6;
- [case(7)] dfs_Info7 *info7;
- [case(100)] dfs_Info100 *info100;
- [case(101)] dfs_Info101 *info101;
- [case(102)] dfs_Info102 *info102;
- [case(103)] dfs_Info103 *info103;
- [case(104)] dfs_Info104 *info104;
- [case(105)] dfs_Info105 *info105;
- [case(106)] dfs_Info106 *info106;
- } dfs_Info;
-
- WERROR dfs_SetInfo (
- [in] [string,charset(UTF16)] uint16 dfs_entry_path[],
- [in,unique] [string,charset(UTF16)] uint16 *servername,
- [in,unique] [string,charset(UTF16)] uint16 *sharename,
- [in] uint32 level,
- [in,ref,switch_is(level)] dfs_Info *info
- );
-
- /******************/
- /* Function: 0x04 */
- WERROR dfs_GetInfo (
- [in] [string,charset(UTF16)] uint16 dfs_entry_path[],
- [in,unique] [string,charset(UTF16)] uint16 *servername,
- [in,unique] [string,charset(UTF16)] uint16 *sharename,
- [in] uint32 level,
- [out,switch_is(level)] dfs_Info *info
- );
-
- /******************/
- /* Function: 0x05 */
-
- typedef struct {
- uint32 count;
- [size_is(count)] dfs_Info1 *s;
- } dfs_EnumArray1;
-
- typedef struct {
- uint32 count;
- [size_is(count)] dfs_Info2 *s;
- } dfs_EnumArray2;
-
- typedef struct {
- uint32 count;
- [size_is(count)] dfs_Info3 *s;
- } dfs_EnumArray3;
-
- typedef struct {
- uint32 count;
- [size_is(count)] dfs_Info4 *s;
- } dfs_EnumArray4;
-
- typedef struct {
- uint32 count;
- [size_is(count)] dfs_Info5 *s;
- } dfs_EnumArray5;
-
- typedef struct {
- uint32 count;
- [size_is(count)] dfs_Info6 *s;
- } dfs_EnumArray6;
-
- typedef struct {
- uint32 count;
- [size_is(count)] dfs_Info200 *s;
- } dfs_EnumArray200;
-
- typedef struct {
- uint32 count;
- [size_is(count)] dfs_Info300 *s;
- } dfs_EnumArray300;
-
-
- typedef union {
- [case(1)] dfs_EnumArray1 *info1;
- [case(2)] dfs_EnumArray2 *info2;
- [case(3)] dfs_EnumArray3 *info3;
- [case(4)] dfs_EnumArray4 *info4;
- [case(5)] dfs_EnumArray5 *info5;
- [case(6)] dfs_EnumArray6 *info6;
- [case(200)] dfs_EnumArray200 *info200;
- [case(300)] dfs_EnumArray300 *info300;
- } dfs_EnumInfo;
-
- typedef struct {
- uint32 level;
- [switch_is(level)] dfs_EnumInfo e;
- } dfs_EnumStruct;
-
- WERROR dfs_Enum (
- [in] uint32 level,
- [in] uint32 bufsize,
- [in,out,unique] dfs_EnumStruct *info,
- [in,out,unique] uint32 *total
- );
-
- /* Function 0x06 */
- [todo] WERROR dfs_Rename();
-
- /* Function 0x07 */
- [todo] WERROR dfs_Move();
-
- /* Function 0x08 */
- [todo] WERROR dfs_ManagerGetConfigInfo();
-
- /* Function 0x09 */
- [todo] WERROR dfs_ManagerSendSiteInfo();
-
- /* Function 0x0a */
- typedef struct {
- uint32 unknown1;
- [string,charset(UTF16)] uint16 *unknown2;
- } dfs_UnknownStruct;
-
- WERROR dfs_AddFtRoot(
- [in] [string,charset(UTF16)] uint16 servername[],
- [in] [string,charset(UTF16)] uint16 dns_servername[],
- [in] [string,charset(UTF16)] uint16 dfsname[],
- [in] [string,charset(UTF16)] uint16 rootshare[],
- [in] [string,charset(UTF16)] uint16 comment[],
- [in] [string,charset(UTF16)] uint16 dfs_config_dn[],
- [in] uint8 unknown1,
- [in] uint32 flags,
- [in,out,unique] dfs_UnknownStruct **unknown2
- );
-
- /* Function 0x0b */
- WERROR dfs_RemoveFtRoot(
- [in] [string,charset(UTF16)] uint16 servername[],
- [in] [string,charset(UTF16)] uint16 dns_servername[],
- [in] [string,charset(UTF16)] uint16 dfsname[],
- [in] [string,charset(UTF16)] uint16 rootshare[],
- [in] uint32 flags,
- [in,out,unique] dfs_UnknownStruct **unknown
- );
-
- /* Function 0x0c */
- WERROR dfs_AddStdRoot(
- [in] [string,charset(UTF16)] uint16 servername[],
- [in] [string,charset(UTF16)] uint16 rootshare[],
- [in] [string,charset(UTF16)] uint16 comment[],
- [in] uint32 flags
- );
-
- /* Function 0x0d */
- WERROR dfs_RemoveStdRoot(
- [in] [string,charset(UTF16)] uint16 servername[],
- [in] [string,charset(UTF16)] uint16 rootshare[],
- [in] uint32 flags
- );
-
- /* Function 0x0e */
- WERROR dfs_ManagerInitialize(
- [in] [string,charset(UTF16)] uint16 *servername,
- [in] uint32 flags
- );
-
- /* Function 0x0f */
- WERROR dfs_AddStdRootForced(
- [in] [string,charset(UTF16)] uint16 servername[],
- [in] [string,charset(UTF16)] uint16 rootshare[],
- [in] [string,charset(UTF16)] uint16 comment[],
- [in] [string,charset(UTF16)] uint16 store[] /* C:\\whatever */
- );
-
- /* Function 0x10 */
- WERROR dfs_GetDcAddress(
- [in] [string,charset(UTF16)] uint16 servername[],
- [in,out,ref] [string,charset(UTF16)] uint16 **server_fullname,
- [in,out,ref] boolean8 *is_root,
- [in,out,ref] uint32 *ttl
- );
-
- /* Function 0x11 */
- WERROR dfs_SetDcAddress(
- [in] [string,charset(UTF16)] uint16 servername[],
- [in] [string,charset(UTF16)] uint16 server_fullname[],
- [in] uint32 flags,
- [in] uint32 ttl
- );
-
- /* Function 0x12 */
- WERROR dfs_FlushFtTable(
- [in] [string,charset(UTF16)] uint16 servername[],
- [in] [string,charset(UTF16)] uint16 rootshare[]
- );
-
- /* Function 0x13 */
- [todo] WERROR dfs_Add2();
-
- /* Function 0x14 */
- [todo] WERROR dfs_Remove2();
-
- /* Function 0x15 */
- [public] WERROR dfs_EnumEx(
- [in] [string,charset(UTF16)] uint16 dfs_name[],
- [in] uint32 level,
- [in] uint32 bufsize,
- [in,out,unique] dfs_EnumStruct *info,
- [in,out,unique] uint32 *total
- );
-
- /* Function 0x16 */
- [todo] WERROR dfs_SetInfo2();
-}
diff --git a/source3/librpc/idl/drsblobs.idl b/source3/librpc/idl/drsblobs.idl
deleted file mode 100644
index 6fdca0ec43..0000000000
--- a/source3/librpc/idl/drsblobs.idl
+++ /dev/null
@@ -1,436 +0,0 @@
-#include "idl_types.h"
-
-import "drsuapi.idl", "misc.idl";
-
-[
- uuid("12345778-1234-abcd-0001-00000001"),
- version(0.0),
- pointer_default(unique),
- helpstring("Active Directory Replication LDAP Blobs")
-]
-interface drsblobs {
- typedef bitmap drsuapi_DsReplicaSyncOptions drsuapi_DsReplicaSyncOptions;
- typedef bitmap drsuapi_DsReplicaNeighbourFlags drsuapi_DsReplicaNeighbourFlags;
- typedef [v1_enum] enum drsuapi_DsAttributeId drsuapi_DsAttributeId;
-
- /*
- * replPropertyMetaData
- * w2k uses version 1
- * w2k3 uses version 1
- */
- typedef struct {
- drsuapi_DsAttributeId attid;
- uint32 version;
- NTTIME_1sec originating_change_time;
- GUID originating_invocation_id;
- hyper originating_usn;
- hyper local_usn;
- } replPropertyMetaData1;
-
- typedef struct {
- uint32 count;
- uint32 reserved;
- replPropertyMetaData1 array[count];
- } replPropertyMetaDataCtr1;
-
- typedef [nodiscriminant] union {
- [case(1)] replPropertyMetaDataCtr1 ctr1;
- } replPropertyMetaDataCtr;
-
- typedef [public] struct {
- uint32 version;
- uint32 reserved;
- [switch_is(version)] replPropertyMetaDataCtr ctr;
- } replPropertyMetaDataBlob;
-
- void decode_replPropertyMetaData(
- [in] replPropertyMetaDataBlob blob
- );
-
- /*
- * replUpToDateVector
- * w2k uses version 1
- * w2k3 uses version 2
- */
- typedef struct {
- uint32 count;
- uint32 reserved;
- drsuapi_DsReplicaCursor cursors[count];
- } replUpToDateVectorCtr1;
-
- typedef struct {
- uint32 count;
- uint32 reserved;
- drsuapi_DsReplicaCursor2 cursors[count];
- } replUpToDateVectorCtr2;
-
- typedef [nodiscriminant] union {
- [case(1)] replUpToDateVectorCtr1 ctr1;
- [case(2)] replUpToDateVectorCtr2 ctr2;
- } replUpToDateVectorCtr;
-
- typedef [public] struct {
- uint32 version;
- uint32 reserved;
- [switch_is(version)] replUpToDateVectorCtr ctr;
- } replUpToDateVectorBlob;
-
- void decode_replUpToDateVector(
- [in] replUpToDateVectorBlob blob
- );
-
- /*
- * repsFrom/repsTo
- * w2k uses version 1
- * w2k3 uses version 1
- */
- typedef [public,gensize] struct {
- [value(strlen(dns_name)+1)] uint32 __dns_name_size;
- [charset(DOS)] uint8 dns_name[__dns_name_size];
- } repsFromTo1OtherInfo;
-
- typedef [public,gensize,flag(NDR_PAHEX)] struct {
- /* this includes the 8 bytes of the repsFromToBlob header */
- [value(ndr_size_repsFromTo1(this, ndr->flags)+8)] uint32 blobsize;
- uint32 consecutive_sync_failures;
- NTTIME_1sec last_success;
- NTTIME_1sec last_attempt;
- WERROR result_last_attempt;
- [relative] repsFromTo1OtherInfo *other_info;
- [value(ndr_size_repsFromTo1OtherInfo(other_info, ndr->flags))] uint32 other_info_length;
- drsuapi_DsReplicaNeighbourFlags replica_flags;
- uint8 schedule[84];
- uint32 reserved;
- drsuapi_DsReplicaHighWaterMark highwatermark;
- GUID source_dsa_obj_guid; /* the 'objectGuid' field of the CN=NTDS Settings object */
- GUID source_dsa_invocation_id; /* the 'invocationId' field of the CN=NTDS Settings object */
- GUID transport_guid;
- } repsFromTo1;
-
- typedef [nodiscriminant] union {
- [case(1)] repsFromTo1 ctr1;
- } repsFromTo;
-
- typedef [public] struct {
- uint32 version;
- uint32 reserved;
- [switch_is(version)] repsFromTo ctr;
- } repsFromToBlob;
-
- void decode_repsFromTo(
- [in] repsFromToBlob blob
- );
-
- /*
- * partialAttributeSet
- * w2k uses version 1
- * w2k3 uses version 1
- */
- typedef struct {
- uint32 count;
- drsuapi_DsAttributeId array[count];
- } partialAttributeSetCtr1;
-
- typedef [nodiscriminant] union {
- [case(1)] partialAttributeSetCtr1 ctr1;
- } partialAttributeSetCtr;
-
- typedef [public] struct {
- uint32 version;
- uint32 reserved;
- [switch_is(version)] partialAttributeSetCtr ctr;
- } partialAttributeSetBlob;
-
- void decode_partialAttributeSet(
- [in] partialAttributeSetBlob blob
- );
-
- /*
- * prefixMap
- * w2k unknown
- * w2k3 unknown
- * samba4 uses 0x44534442 'DSDB'
- *
- * as we windows don't return the prefixMap attribute when you ask for
- * we don't know the format, but the attribute is not replicated
- * so that we can choose our own format...
- */
- typedef [v1_enum] enum {
- PREFIX_MAP_VERSION_DSDB = 0x44534442
- } prefixMapVersion;
-
- typedef [nodiscriminant] union {
- [case(PREFIX_MAP_VERSION_DSDB)] drsuapi_DsReplicaOIDMapping_Ctr dsdb;
- } prefixMapCtr;
-
- typedef [public] struct {
- prefixMapVersion version;
- uint32 reserved;
- [switch_is(version)] prefixMapCtr ctr;
- } prefixMapBlob;
-
- void decode_prefixMap(
- [in] prefixMapBlob blob
- );
-
- /*
- * the cookie for the LDAP dirsync control
- */
- typedef [nodiscriminant,gensize] union {
- [case(0)];
- [default] replUpToDateVectorBlob uptodateness_vector;
- } ldapControlDirSyncExtra;
-
- typedef struct {
- [value(3)] uint32 u1;
- NTTIME time;
- uint32 u2;
- uint32 u3;
- [value(ndr_size_ldapControlDirSyncExtra(&extra, extra.uptodateness_vector.version, 0))]
- uint32 extra_length;
- drsuapi_DsReplicaHighWaterMark highwatermark;
- GUID guid1;
- [switch_is(extra_length)] ldapControlDirSyncExtra extra;
- } ldapControlDirSyncBlob;
-
- typedef [public,relative_base] struct {
- [charset(DOS),value("MSDS")] uint8 msds[4];
- [subcontext(0)] ldapControlDirSyncBlob blob;
- } ldapControlDirSyncCookie;
-
- void decode_ldapControlDirSync(
- [in] ldapControlDirSyncCookie cookie
- );
-
- typedef struct {
- [value(2*strlen_m(name))] uint16 name_len;
- [value(strlen(data))] uint16 data_len;
- uint16 reserved; /* 2 for 'Packages', 1 for 'Primary:*', but should be ignored */
- [charset(UTF16)] uint8 name[name_len];
- /*
- * the data field contains data as HEX strings
- *
- * 'Packages':
- * data contains the list of packages
- * as non termiated UTF16 strings with
- * a UTF16 NULL byte as separator
- *
- * 'Primary:Kerberos-Newer-Keys':
- * ...
- *
- * 'Primary:Kerberos':
- * ...
- *
- * 'Primary:WDigest':
- * ...
- *
- * 'Primary:CLEARTEXT':
- * data contains the cleartext password
- * as UTF16 string encoded as HEX string
- */
- [charset(DOS)] uint8 data[data_len];
- } supplementalCredentialsPackage;
-
- /* this are 0x30 (48) whitespaces (0x20) */
- const string SUPPLEMENTAL_CREDENTIALS_PREFIX = " ";
-
- typedef [flag(NDR_PAHEX)] enum {
- SUPPLEMENTAL_CREDENTIALS_SIGNATURE = 0x0050
- } supplementalCredentialsSignature;
-
- typedef [gensize] struct {
- [value(SUPPLEMENTAL_CREDENTIALS_PREFIX),charset(UTF16)] uint16 prefix[0x30];
- [value(SUPPLEMENTAL_CREDENTIALS_SIGNATURE)] supplementalCredentialsSignature signature;
- uint16 num_packages;
- supplementalCredentialsPackage packages[num_packages];
- } supplementalCredentialsSubBlob;
-
- typedef [public] struct {
- [value(0)] uint32 unknown1;
- [value(ndr_size_supplementalCredentialsSubBlob(&sub, ndr->flags))] uint32 __ndr_size;
- [value(0)] uint32 unknown2;
- [subcontext(0),subcontext_size(__ndr_size)] supplementalCredentialsSubBlob sub;
- [value(0)] uint8 unknown3;
- } supplementalCredentialsBlob;
-
- void decode_supplementalCredentials(
- [in] supplementalCredentialsBlob blob
- );
-
- typedef [public] struct {
- [flag(STR_NOTERM|NDR_REMAINING)] string_array names;
- } package_PackagesBlob;
-
- void decode_Packages(
- [in] package_PackagesBlob blob
- );
-
- typedef struct {
- [value(2*strlen_m(string))] uint16 length;
- [value(2*strlen_m(string))] uint16 size;
- [relative,subcontext(0),subcontext_size(size),flag(STR_NOTERM|NDR_REMAINING)] string *string;
- } package_PrimaryKerberosString;
-
- typedef struct {
- [value(0)] uint16 reserved1;
- [value(0)] uint16 reserved2;
- [value(0)] uint32 reserved3;
- uint32 keytype;
- [value((value?value->length:0))] uint32 value_len;
- [relative,subcontext(0),subcontext_size(value_len),flag(NDR_REMAINING)] DATA_BLOB *value;
- } package_PrimaryKerberosKey3;
-
- typedef struct {
- uint16 num_keys;
- uint16 num_old_keys;
- package_PrimaryKerberosString salt;
- package_PrimaryKerberosKey3 keys[num_keys];
- package_PrimaryKerberosKey3 old_keys[num_old_keys];
- [value(0)] uint32 padding1;
- [value(0)] uint32 padding2;
- [value(0)] uint32 padding3;
- [value(0)] uint32 padding4;
- [value(0)] uint32 padding5;
- } package_PrimaryKerberosCtr3;
-
- typedef struct {
- [value(0)] uint16 reserved1;
- [value(0)] uint16 reserved2;
- [value(0)] uint32 reserved3;
- uint32 iteration_count;
- uint32 keytype;
- [value((value?value->length:0))] uint32 value_len;
- [relative,subcontext(0),subcontext_size(value_len),flag(NDR_REMAINING)] DATA_BLOB *value;
- } package_PrimaryKerberosKey4;
-
- typedef struct {
- uint16 num_keys;
- [value(0)] uint16 num_service_keys;
- uint16 num_old_keys;
- uint16 num_older_keys;
- package_PrimaryKerberosString salt;
- uint32 default_iteration_count;
- package_PrimaryKerberosKey4 keys[num_keys];
- package_PrimaryKerberosKey4 service_keys[num_service_keys];
- package_PrimaryKerberosKey4 old_keys[num_old_keys];
- package_PrimaryKerberosKey4 older_keys[num_older_keys];
- } package_PrimaryKerberosCtr4;
-
- typedef [nodiscriminant] union {
- [case(3)] package_PrimaryKerberosCtr3 ctr3;
- [case(4)] package_PrimaryKerberosCtr4 ctr4;
- } package_PrimaryKerberosCtr;
-
- typedef [public] struct {
- uint16 version;
- [value(0)] uint16 flags;
- [switch_is(version)] package_PrimaryKerberosCtr ctr;
- } package_PrimaryKerberosBlob;
-
- void decode_PrimaryKerberos(
- [in] package_PrimaryKerberosBlob blob
- );
-
- typedef [public] struct {
- [flag(STR_NOTERM|NDR_REMAINING)] string cleartext;
- } package_PrimaryCLEARTEXTBlob;
-
- void decode_PrimaryCLEARTEXT(
- [in] package_PrimaryCLEARTEXTBlob blob
- );
-
- typedef [flag(NDR_PAHEX)] struct {
- uint8 hash[16];
- } package_PrimaryWDigestHash;
-
- typedef [public] struct {
- [value(0x31)] uint16 unknown1;
- [value(0x01)] uint8 unknown2;
- uint8 num_hashes;
- [value(0)] uint32 unknown3;
- [value(0)] udlong uuknown4;
- package_PrimaryWDigestHash hashes[num_hashes];
- } package_PrimaryWDigestBlob;
-
- void decode_PrimaryWDigest(
- [in] package_PrimaryWDigestBlob blob
- );
-
- typedef struct {
- NTTIME time1;
- uint32 unknown1;
- /*
- * the secret value is encoded as UTF16 if it's a string
- * but krb5 trusts have random bytes here, so converting to UTF16
- * mayfail...
- *
- * TODO: We should try handle the case of a random buffer in all places
- * we deal with cleartext passwords from windows
- *
- * so we don't use this:
- *
- * uint32 value_len;
- * [charset(UTF16)] uint8 value[value_len];
- */
- DATA_BLOB value;
- [flag(NDR_ALIGN4)] DATA_BLOB _pad;
- } trustAuthInOutSecret1;
-
- typedef struct {
- [relative] trustAuthInOutSecret1 *value1;
- [relative] trustAuthInOutSecret1 *value2;
- } trustAuthInOutCtr1;
-
- typedef struct {
- NTTIME time1;
- uint32 unknown1;
- DATA_BLOB value;
- NTTIME time2;
- uint32 unknown2;
- uint32 unknown3;
- uint32 unknown4;
- [flag(NDR_ALIGN4)] DATA_BLOB _pad;
- } trustAuthInOutSecret2V1;
-
- typedef struct {
- NTTIME time1;
- uint32 unknown1;
- DATA_BLOB value;
- NTTIME time2;
- uint32 unknown2;
- uint32 unknown3;
- [flag(NDR_ALIGN4)] DATA_BLOB _pad;
- } trustAuthInOutSecret2V2;
-
- typedef struct {
- [relative] trustAuthInOutSecret2V1 *value1;
- [relative] trustAuthInOutSecret2V2 *value2;
- } trustAuthInOutCtr2;
-
- typedef [nodiscriminant] union {
- [case(1)] trustAuthInOutCtr1 ctr1;
- [case(2)] trustAuthInOutCtr2 ctr2;
- } trustAuthInOutCtr;
-
- typedef [public] struct {
- uint32 version;
- [switch_is(version)] trustAuthInOutCtr ctr;
- } trustAuthInOutBlob;
-
- void decode_trustAuthInOut(
- [in] trustAuthInOutBlob blob
- );
-
- typedef [public] struct {
- uint32 marker;
- DATA_BLOB data;
- } DsCompressedChunk;
-
- typedef [public] struct {
- DsCompressedChunk chunks[5];
- } DsCompressedBlob;
-
- void decode_DsCompressed(
- [in] DsCompressedBlob blob
- );
-}
diff --git a/source3/librpc/idl/drsuapi.idl b/source3/librpc/idl/drsuapi.idl
deleted file mode 100644
index df6dcba23a..0000000000
--- a/source3/librpc/idl/drsuapi.idl
+++ /dev/null
@@ -1,1601 +0,0 @@
-#include "idl_types.h"
-
-import "security.idl", "misc.idl", "samr.idl";
-
-[
- uuid("e3514235-4b06-11d1-ab04-00c04fc2dcd2"),
- version(4.0),
- endpoint("ncacn_np:[\\pipe\\lsass]","ncacn_np:[\\pipe\\protected_storage]", "ncacn_ip_tcp:", "ncalrpc:"),
- authservice("ldap"),
- helpstring("Active Directory Replication"),
- helper("librpc/ndr/ndr_drsuapi.h"),
- pointer_default(unique)
-]
-interface drsuapi
-{
- typedef bitmap samr_GroupAttrs samr_GroupAttrs;
-
- /*****************/
- /* Function 0x00 */
- typedef [bitmap32bit] bitmap {
- DRSUAPI_SUPPORTED_EXTENSION_BASE = 0x00000001,
- DRSUAPI_SUPPORTED_EXTENSION_ASYNC_REPLICATION = 0x00000002,
- DRSUAPI_SUPPORTED_EXTENSION_REMOVEAPI = 0x00000004,
- DRSUAPI_SUPPORTED_EXTENSION_MOVEREQ_V2 = 0x00000008,
- DRSUAPI_SUPPORTED_EXTENSION_GETCHG_COMPRESS = 0x00000010,
- DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V1 = 0x00000020,
- DRSUAPI_SUPPORTED_EXTENSION_RESTORE_USN_OPTIMIZATION = 0x00000040,
- DRSUAPI_SUPPORTED_EXTENSION_00000080 = 0x00000080,
- DRSUAPI_SUPPORTED_EXTENSION_KCC_EXECUTE = 0x00000100,
- DRSUAPI_SUPPORTED_EXTENSION_ADDENTRY_V2 = 0x00000200,
- DRSUAPI_SUPPORTED_EXTENSION_LINKED_VALUE_REPLICATION = 0x00000400,
- DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V2 = 0x00000800,
- DRSUAPI_SUPPORTED_EXTENSION_INSTANCE_TYPE_NOT_REQ_ON_MOD= 0x00001000,
- DRSUAPI_SUPPORTED_EXTENSION_CRYPTO_BIND = 0x00002000,
- DRSUAPI_SUPPORTED_EXTENSION_GET_REPL_INFO = 0x00004000,
- DRSUAPI_SUPPORTED_EXTENSION_STRONG_ENCRYPTION = 0x00008000,
- DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V01 = 0x00010000,
- DRSUAPI_SUPPORTED_EXTENSION_TRANSITIVE_MEMBERSHIP = 0x00020000,
- DRSUAPI_SUPPORTED_EXTENSION_ADD_SID_HISTORY = 0x00040000,
- DRSUAPI_SUPPORTED_EXTENSION_POST_BETA3 = 0x00080000,
- DRSUAPI_SUPPORTED_EXTENSION_00100000 = 0x00100000,
- DRSUAPI_SUPPORTED_EXTENSION_GET_MEMBERSHIPS2 = 0x00200000,
- DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V6 = 0x00400000,
- DRSUAPI_SUPPORTED_EXTENSION_NONDOMAIN_NCS = 0x00800000,
- DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V8 = 0x01000000,
- DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V5 = 0x02000000,
- DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V6 = 0x04000000,
- /*
- * the following 3 have the same value
- * repadmin.exe /bind says that
- */
- DRSUAPI_SUPPORTED_EXTENSION_ADDENTRYREPLY_V3 = 0x08000000,
- DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V7 = 0x08000000,
- DRSUAPI_SUPPORTED_EXTENSION_VERIFY_OBJECT = 0x08000000,
- DRSUAPI_SUPPORTED_EXTENSION_XPRESS_COMPRESS = 0x10000000,
- DRSUAPI_SUPPORTED_EXTENSION_20000000 = 0x20000000,
- DRSUAPI_SUPPORTED_EXTENSION_40000000 = 0x40000000,
- DRSUAPI_SUPPORTED_EXTENSION_80000000 = 0x80000000
- } drsuapi_SupportedExtensions;
-
- typedef [bitmap32bit] bitmap {
- DRSUAPI_SUPPORTED_EXTENSION_ADAM = 0x00000001,
- DRSUAPI_SUPPORTED_EXTENSION_LH_BETA2 = 0x00000002
- } drsuapi_SupportedExtensionsExt;
-
- /* this is used by w2k */
- typedef struct {
- drsuapi_SupportedExtensions supported_extensions;
- GUID site_guid;
- uint32 pid;
- } drsuapi_DsBindInfo24;
-
- /* this is used by w2k3 */
- typedef struct {
- drsuapi_SupportedExtensions supported_extensions;
- GUID site_guid;
- uint32 pid;
- uint32 repl_epoch;
- } drsuapi_DsBindInfo28;
-
- /* this is used by w2k8 */
- typedef struct {
- drsuapi_SupportedExtensions supported_extensions;
- GUID site_guid;
- uint32 pid;
- uint32 repl_epoch;
- drsuapi_SupportedExtensionsExt supported_extensions_ext;
- GUID config_dn_guid;
- } drsuapi_DsBindInfo48;
-
- typedef struct {
- [flag(NDR_REMAINING)] DATA_BLOB info;
- } drsuapi_DsBindInfoFallBack;
-
- typedef [nodiscriminant] union {
- [case(24)][subcontext(4)] drsuapi_DsBindInfo24 info24;
- [case(28)][subcontext(4)] drsuapi_DsBindInfo28 info28;
- [case(48)][subcontext(4)] drsuapi_DsBindInfo48 info48;
- [default][subcontext(4)] drsuapi_DsBindInfoFallBack FallBack;
- } drsuapi_DsBindInfo;
-
- /* the drsuapi_DsBindInfoCtr was this before
- * typedef [flag(NDR_PAHEX)] struct {
- * [range(1,10000)] uint32 length;
- * [size_is(length)] uint8 data[];
- * } drsuapi_DsBindInfo;
- *
- * but we don't want the caller to manually decode this blob,
- * so we're doing it here
- */
-
- typedef struct {
- [range(1,10000)] uint32 length;
- [switch_is(length)] drsuapi_DsBindInfo info;
- } drsuapi_DsBindInfoCtr;
-
- /* this is a magic guid you need to pass to DsBind to make drsuapi_DsWriteAccountSpn() work
- *
- * maybe the bind_guid could also be the invocation_id see drsuapi_DsReplicaConnection04
- */
- const char *DRSUAPI_DS_BIND_GUID = "e24d201a-4fd6-11d1-a3da-0000f875ae0d";
- /*
- * this magic guid are needed to fetch the whole tree with drsuapi_DsGetNCChanges()
- * as administrator and this values are also used in the destination_dsa_guid field
- * of drsuapi_DsGetNCChangesReq5/8 and the source_dsa_guid is zero.
- */
- const char *DRSUAPI_DS_BIND_GUID_W2K = "6abec3d1-3054-41c8-a362-5a0c5b7d5d71";
- const char *DRSUAPI_DS_BIND_GUID_W2K3 = "6afab99c-6e26-464a-975f-f58f105218bc";
-
- [public] WERROR drsuapi_DsBind(
- [in,unique] GUID *bind_guid,
- [in,out,unique] drsuapi_DsBindInfoCtr *bind_info,
- [out] policy_handle *bind_handle
- );
-
- /*****************/
- /* Function 0x01 */
- WERROR drsuapi_DsUnbind(
- [in,out] policy_handle *bind_handle
- );
-
- /*****************/
- /* Function 0x02 */
- typedef [public,gensize] struct {
- [value(ndr_size_drsuapi_DsReplicaObjectIdentifier(r, ndr->flags)-4)] uint32 __ndr_size;
- [value(ndr_size_dom_sid28(&sid, ndr->flags))] uint32 __ndr_size_sid;
- GUID guid;
- dom_sid28 sid;
- [value(strlen_m(dn))] uint32 __ndr_size_dn;
- [charset(UTF16),size_is(__ndr_size_dn+1)] uint16 dn[];
- } drsuapi_DsReplicaObjectIdentifier;
-
- typedef [public] bitmap {
- DRSUAPI_DS_REPLICA_SYNC_ASYNCHRONOUS_OPERATION = 0x00000001,
- DRSUAPI_DS_REPLICA_SYNC_WRITEABLE = 0x00000002,
- DRSUAPI_DS_REPLICA_SYNC_PERIODIC = 0x00000004,
- DRSUAPI_DS_REPLICA_SYNC_INTERSITE_MESSAGING = 0x00000008,
- DRSUAPI_DS_REPLICA_SYNC_ALL_SOURCES = 0x00000010,
- DRSUAPI_DS_REPLICA_SYNC_FULL = 0x00000020,
- DRSUAPI_DS_REPLICA_SYNC_URGENT = 0x00000040,
- DRSUAPI_DS_REPLICA_SYNC_NO_DISCARD = 0x00000080,
- DRSUAPI_DS_REPLICA_SYNC_FORCE = 0x00000100,
- DRSUAPI_DS_REPLICA_SYNC_ADD_REFERENCE = 0x00000200,
- DRSUAPI_DS_REPLICA_SYNC_NEVER_COMPLETED = 0x00000400,
- DRSUAPI_DS_REPLICA_SYNC_TWO_WAY = 0x00000800,
- DRSUAPI_DS_REPLICA_SYNC_NEVER_NOTIFY = 0x00001000,
- DRSUAPI_DS_REPLICA_SYNC_INITIAL = 0x00002000,
- DRSUAPI_DS_REPLICA_SYNC_USE_COMPRESSION = 0x00004000,
- DRSUAPI_DS_REPLICA_SYNC_ABANDONED = 0x00008000,
- DRSUAPI_DS_REPLICA_SYNC_INITIAL_IN_PROGRESS = 0x00010000,
- DRSUAPI_DS_REPLICA_SYNC_PARTIAL_ATTRIBUTE_SET = 0x00020000,
- DRSUAPI_DS_REPLICA_SYNC_REQUEUE = 0x00040000,
- DRSUAPI_DS_REPLICA_SYNC_NOTIFICATION = 0x00080000,
- DRSUAPI_DS_REPLICA_SYNC_ASYNCHRONOUS_REPLICA = 0x00100000,
- DRSUAPI_DS_REPLICA_SYNC_CRITICAL = 0x00200000,
- DRSUAPI_DS_REPLICA_SYNC_FULL_IN_PROGRESS = 0x00400000,
- DRSUAPI_DS_REPLICA_SYNC_PREEMPTED = 0x00800000
- } drsuapi_DsReplicaSyncOptions;
-
- typedef struct {
- drsuapi_DsReplicaObjectIdentifier *naming_context;
- GUID source_dsa_guid;
- astring *other_info; /* I assume this is related to the repsFromTo1OtherInfo dns_name */
- drsuapi_DsReplicaSyncOptions options;
- } drsuapi_DsReplicaSyncRequest1;
-
- typedef [switch_type(int32)] union {
- [case(1)] drsuapi_DsReplicaSyncRequest1 req1;
- } drsuapi_DsReplicaSyncRequest;
-
- WERROR drsuapi_DsReplicaSync(
- [in] policy_handle *bind_handle,
- [in] int32 level,
- [in,switch_is(level)] drsuapi_DsReplicaSyncRequest req
- );
-
- /*****************/
- /* Function 0x03 */
- typedef [public] struct {
- hyper tmp_highest_usn; /* updated after each object update */
- hyper reserved_usn;
- hyper highest_usn; /* updated after a full replication cycle */
- } drsuapi_DsReplicaHighWaterMark;
-
- typedef [public] struct {
- GUID source_dsa_invocation_id; /* the 'invocationId' field of the CN=NTDS Settings object */
- hyper highest_usn; /* updated after a full replication cycle */
- } drsuapi_DsReplicaCursor;
-
- typedef struct {
- [value(1)] uint32 version;
- [value(0)] uint32 reserved1;
- [range(0,0x100000)] uint32 count;
- [value(0)] uint32 reserved2;
- [size_is(count)] drsuapi_DsReplicaCursor cursors[];
- } drsuapi_DsReplicaCursorCtrEx;
-
- typedef [public] bitmap {
- /* the _WRITEABLE flag indicates a replication with all attributes
- *
- * --metze
- */
- DRSUAPI_DS_REPLICA_NEIGHBOUR_WRITEABLE = 0x00000010,
- DRSUAPI_DS_REPLICA_NEIGHBOUR_SYNC_ON_STARTUP = 0x00000020,
- DRSUAPI_DS_REPLICA_NEIGHBOUR_DO_SCHEDULED_SYNCS = 0x00000040,
- DRSUAPI_DS_REPLICA_NEIGHBOUR_USE_ASYNC_INTERSIDE_TRANSPORT = 0x00000080,
- DRSUAPI_DS_REPLICA_NEIGHBOUR_TWO_WAY_SYNC = 0x00000200,
- DRSUAPI_DS_REPLICA_NEIGHBOUR_RETURN_OBJECT_PARENTS = 0x00000800,
- DRSUAPI_DS_REPLICA_NEIGHBOUR_FULL_IN_PROGRESS = 0x00001000, /* was 0x00010000, */
- DRSUAPI_DS_REPLICA_NEIGHBOUR_FULL_NEXT_PACKET = 0x00002000, /* was 0x00020000, */
- DRSUAPI_DS_REPLICA_NEIGHBOUR_NEVER_SYNCED = 0x00200000,
- DRSUAPI_DS_REPLICA_NEIGHBOUR_PREEMPTED = 0x01000000,
- DRSUAPI_DS_REPLICA_NEIGHBOUR_IGNORE_CHANGE_NOTIFICATIONS = 0x04000000,
- DRSUAPI_DS_REPLICA_NEIGHBOUR_DISABLE_SCHEDULED_SYNC = 0x08000000,
- /*
- * the following NOTE applies to DsGetNCChangesRequest5:
- * - the data is only compressed when 10 or more objects are replicated
- * - but there could also be a size limit of 35 KBytes or something like that
- * - the reply is DsGetNCChangesCtr2
- * - maybe the same applies to DsGetNCChangesRequest8...
- *
- * --metze
- */
- DRSUAPI_DS_REPLICA_NEIGHBOUR_COMPRESS_CHANGES = 0x10000000,
- DRSUAPI_DS_REPLICA_NEIGHBOUR_NO_CHANGE_NOTIFICATIONS = 0x20000000,
- DRSUAPI_DS_REPLICA_NEIGHBOUR_PARTIAL_ATTRIBUTE_SET = 0x40000000
- } drsuapi_DsReplicaNeighbourFlags;
-
- typedef [flag(NDR_PAHEX),v1_enum] enum {
- DRSUAPI_EXOP_NONE = 0x00000000,
- DRSUAPI_EXOP_FSMO_REQ_ROLE = 0x00000001,
- DRSUAPI_EXOP_FSMO_RID_ALLOC = 0x00000002,
- DRSUAPI_EXOP_FSMO_RID_REQ_ROLE = 0x00000003,
- DRSUAPI_EXOP_FSMO_REQ_PDC = 0x00000004,
- DRSUAPI_EXOP_FSMO_ABANDON_ROLE = 0x00000005,
- DRSUAPI_EXOP_REPL_OBJ = 0x00000006,
- DRSUAPI_EXOP_REPL_SECRET = 0x00000007
- } drsuapi_DsExtendedOperation;
-
- typedef [flag(NDR_PAHEX),v1_enum] enum {
- DRSUAPI_EXOP_ERR_NONE = 0x00000000,
- DRSUAPI_EXOP_ERR_SUCCESS = 0x00000001,
- DRSUAPI_EXOP_ERR_UNKNOWN_OP = 0x00000002,
- DRSUAPI_EXOP_ERR_FSMO_NOT_OWNER = 0x00000003,
- DRSUAPI_EXOP_ERR_UPDATE_ERR = 0x00000004,
- DRSUAPI_EXOP_ERR_EXCEPTION = 0x00000005,
- DRSUAPI_EXOP_ERR_UNKNOWN_CALLER = 0x00000006,
- DRSUAPI_EXOP_ERR_RID_ALLOC = 0x00000007,
- DRSUAPI_EXOP_ERR_FSMO_OWNER_DELETED = 0x00000008,
- DRSUAPI_EXOP_ERR_FMSO_PENDING_OP = 0x00000009,
- DRSUAPI_EXOP_ERR_MISMATCH = 0x0000000A,
- DRSUAPI_EXOP_ERR_COULDNT_CONTACT = 0x0000000B,
- DRSUAPI_EXOP_ERR_FSMO_REFUSING_ROLES = 0x0000000C,
- DRSUAPI_EXOP_ERR_DIR_ERROR = 0x0000000D,
- DRSUAPI_EXOP_ERR_FSMO_MISSING_SETTINGS = 0x0000000E,
- DRSUAPI_EXOP_ERR_ACCESS_DENIED = 0x0000000F,
- DRSUAPI_EXOP_ERR_PARAM_ERROR = 0x00000010
- } drsuapi_DsExtendedError;
-
- typedef struct {
- GUID destination_dsa_guid;
- GUID source_dsa_invocation_id; /* the 'invocationId' field of the CN=NTDS Settings object */
- [ref] drsuapi_DsReplicaObjectIdentifier *naming_context;
- drsuapi_DsReplicaHighWaterMark highwatermark;
- drsuapi_DsReplicaCursorCtrEx *uptodateness_vector;
- drsuapi_DsReplicaNeighbourFlags replica_flags;
- uint32 max_object_count; /* w2k3 uses min(133,max(100,max_object_count)) */
- uint32 max_ndr_size; /* w2k3 seems to ignore this */
- drsuapi_DsExtendedOperation extended_op;
- hyper fsmo_info;
- } drsuapi_DsGetNCChangesRequest5;
-
- /*
- * In DRSUAPI all attributes with syntax 2.5.5.2
- * are identified by uint32 values
- *
- * the following table shows the mapping used between the two representations
- * e.g. - objectClass 'nTDSDSA' has governsID: 1.2.840.113556.1.5.7000.47
- * and a UINT32-ID of '0x0017002F'.
- * - so the OID 1.2.840.113556.1.5.7000.47 is splitted into a
- * OID-prefix: 1.2.840.113556.1.5.7000
- * and a value: 47 => 0x2F
- * - the mapping table gives a UINT32-prefix: 0x00170000
- * - and the UINT32-ID is 0x0017002F = 0x00170000 | 0x2F
- *
- * This prefix mapping table is replied in the drsuapi_DsReplicaOIDMapping_Ctr
- * array. The following are the default mappings of w2k3
- *
- * OID-prefix => UINT32-Id prefix
- *
- * 2.5.4.* => 0x00000000 (standard attributes RFC2256 core.schema)
- * 2.5.6.* => 0x00010000 (standard object classes RFC2256 core.schema)
- * 1.2.840.113556.1.2.* => 0x00020000
- * 1.2.840.113556.1.3.* => 0x00030000
- * 2.5.5.* => 0x00080000 (attributeSyntax OID's)
- * 1.2.840.113556.1.4.* => 0x00090000
- * 1.2.840.113556.1.5.* => 0x000A0000
- * 2.16.840.1.113730.3.* => 0x00140000
- * 0.9.2342.19200300.100.1.* => 0x00150000
- * 2.16.840.1.113730.3.1.* => 0x00160000
- * 1.2.840.113556.1.5.7000.* => 0x00170000
- * 2.5.21.* => 0x00180000 (attrs for SubSchema)
- * 2.5.18.* => 0x00190000 (createTimeStamp,modifyTimeStamp, SubSchema)
- * 2.5.20.* => 0x001A0000
- * 1.3.6.1.4.1.1466.101.119.* => 0x001B0000 (dynamicObject, entryTTL)
- * 2.16.840.1.113730.3.2.* => 0x001C0000
- * 1.3.6.1.4.1.250.1.* => 0x001D0000
- * 1.2.840.113549.1.9.* => 0x001E0000 (unstructuredAddress,unstructuredName)
- * 0.9.2342.19200300.100.4.* => 0x001F0000
- *
- * Here's a list of used 'attributeSyntax' OID's
- *
- * 2.5.5.1 => Object(DS-DN) string
- * struct drsuapi_DsObjectIdentifier3
- *
- * 2.5.5.2 => OID-string
- * => all values are represented as uint32 values in drsuapi
- * => governsID, attributeID and attributeSyntax returned as OID-Strings in LDAP
- * => mayContain, mustContain and all other attributes with 2.5.5.2 syntax
- * are returned as attribute names
- *
- * 2.5.5.4 => String(Teletex) case-insensitive string with teletex charset
- *
- * 2.5.5.5 => String(IA5) case-sensitive string
- *
- * 2.5.5.6 => String(Numeric)
- * => eg. internationalISDNNumber
- *
- * 2.5.5.7 => Object(DN-Binary) B:<byte count>:<bytes>:<object DN>
- * => e.g. wellKnownObjects
- *
- * 2.5.5.8 => BOOL
- *
- * 2.5.5.9 => int32
- *
- * 2.5.5.10 => DATA_BLOB
- * => struct GUID
- *
- * 2.5.5.11 => LDAP timestring
- * => NTTIME_1sec
- *
- * 2.5.5.12 => String(Unicode) case-insensitive string
- * => 'standard strings'
- *
- * 2.5.5.13 => Object(Presentation-Address) string
- * => used in objectClass applicationEntity
- *
- * 2.5.5.14 => Object(DN-String) S:<char count>:<string>:<object DN>
- * => not used
- *
- * 2.5.5.15 => ntSecurityDescriptor
- *
- * 2.5.5.16 => int64
- *
- * 2.5.5.17 => dom_sid
- */
- typedef [nopush,nopull] struct {
- [range(0,10000),value(ndr_size_drsuapi_DsReplicaOID_oid(oid, 0))] uint32 __ndr_size;
- [size_is(__ndr_size),charset(DOS)] uint8 *oid; /* it's encoded with asn1_write_OID_String() */
- } drsuapi_DsReplicaOID;
-
- typedef struct {
- uint32 id_prefix;
- drsuapi_DsReplicaOID oid;
- } drsuapi_DsReplicaOIDMapping;
-
- typedef [public] struct {
- [range(0,0x100000)] uint32 num_mappings;
- [size_is(num_mappings)] drsuapi_DsReplicaOIDMapping *mappings;
- } drsuapi_DsReplicaOIDMapping_Ctr;
-
- typedef [flag(NDR_PAHEX),v1_enum] enum {
- DRSUAPI_OBJECTCLASS_top = 0x00010000,
- DRSUAPI_OBJECTCLASS_classSchema = 0x0003000d,
- DRSUAPI_OBJECTCLASS_attributeSchema = 0x0003000e
- } drsuapi_DsObjectClassId;
-
- typedef [flag(NDR_PAHEX),v1_enum,public] enum {
- DRSUAPI_ATTRIBUTE_objectClass = 0x00000000,
- DRSUAPI_ATTRIBUTE_description = 0x0000000d,
- DRSUAPI_ATTRIBUTE_member = 0x0000001f,
- DRSUAPI_ATTRIBUTE_instanceType = 0x00020001,
- DRSUAPI_ATTRIBUTE_whenCreated = 0x00020002,
- DRSUAPI_ATTRIBUTE_hasMasterNCs = 0x0002000e,
- DRSUAPI_ATTRIBUTE_governsID = 0x00020016,
- DRSUAPI_ATTRIBUTE_attributeID = 0x0002001e,
- DRSUAPI_ATTRIBUTE_attributeSyntax = 0x00020020,
- DRSUAPI_ATTRIBUTE_isSingleValued = 0x00020021,
- DRSUAPI_ATTRIBUTE_rangeLower = 0x00020022,
- DRSUAPI_ATTRIBUTE_rangeUpper = 0x00020023,
- DRSUAPI_ATTRIBUTE_dMDLocation = 0x00020024,
- DRSUAPI_ATTRIBUTE_objectVersion = 0x0002004c,
- DRSUAPI_ATTRIBUTE_invocationId = 0x00020073,
- DRSUAPI_ATTRIBUTE_showInAdvancedViewOnly = 0x000200a9,
- DRSUAPI_ATTRIBUTE_adminDisplayName = 0x000200c2,
- DRSUAPI_ATTRIBUTE_adminDescription = 0x000200e2,
- DRSUAPI_ATTRIBUTE_oMSyntax = 0x000200e7,
- DRSUAPI_ATTRIBUTE_ntSecurityDescriptor = 0x00020119,
- DRSUAPI_ATTRIBUTE_searchFlags = 0x0002014e,
- DRSUAPI_ATTRIBUTE_lDAPDisplayName = 0x000201cc,
- DRSUAPI_ATTRIBUTE_name = 0x00090001,
- DRSUAPI_ATTRIBUTE_userAccountControl = 0x00090008,
- DRSUAPI_ATTRIBUTE_currentValue = 0x0009001b,
- DRSUAPI_ATTRIBUTE_homeDirectory = 0x0009002c,
- DRSUAPI_ATTRIBUTE_homeDrive = 0x0009002d,
- DRSUAPI_ATTRIBUTE_scriptPath = 0x0009003e,
- DRSUAPI_ATTRIBUTE_profilePath = 0x0009008b,
- DRSUAPI_ATTRIBUTE_objectSid = 0x00090092,
- DRSUAPI_ATTRIBUTE_schemaIDGUID = 0x00090094,
- DRSUAPI_ATTRIBUTE_dBCSPwd = 0x00090037,/* lmPwdHash */
- DRSUAPI_ATTRIBUTE_logonHours = 0x00090040,
- DRSUAPI_ATTRIBUTE_userWorkstations = 0x00090056,
- DRSUAPI_ATTRIBUTE_unicodePwd = 0x0009005a,/* ntPwdHash */
- DRSUAPI_ATTRIBUTE_ntPwdHistory = 0x0009005e,
- DRSUAPI_ATTRIBUTE_priorValue = 0x00090064,
- DRSUAPI_ATTRIBUTE_supplementalCredentials = 0x0009007d,
- DRSUAPI_ATTRIBUTE_trustAuthIncoming = 0x00090081,
- DRSUAPI_ATTRIBUTE_trustAuthOutgoing = 0x00090087,
- DRSUAPI_ATTRIBUTE_lmPwdHistory = 0x000900a0,
- DRSUAPI_ATTRIBUTE_sAMAccountName = 0x000900dd,
- DRSUAPI_ATTRIBUTE_sAMAccountType = 0x0009012e,
- DRSUAPI_ATTRIBUTE_fSMORoleOwner = 0x00090171,
- DRSUAPI_ATTRIBUTE_systemFlags = 0x00090177,
- DRSUAPI_ATTRIBUTE_serverReference = 0x00090203,
- DRSUAPI_ATTRIBUTE_serverReferenceBL = 0x00090204,
- DRSUAPI_ATTRIBUTE_initialAuthIncoming = 0x0009021b,
- DRSUAPI_ATTRIBUTE_initialAuthOutgoing = 0x0009021c,
- DRSUAPI_ATTRIBUTE_wellKnownObjects = 0x0009026a,
- DRSUAPI_ATTRIBUTE_dNSHostName = 0x0009026b,
- DRSUAPI_ATTRIBUTE_isMemberOfPartialAttributeSet = 0x0009027f,
- DRSUAPI_ATTRIBUTE_userPrincipalName = 0x00090290,
- DRSUAPI_ATTRIBUTE_groupType = 0x000902ee,
- DRSUAPI_ATTRIBUTE_servicePrincipalName = 0x00090303,
- DRSUAPI_ATTRIBUTE_objectCategory = 0x0009030e,
- DRSUAPI_ATTRIBUTE_gPLink = 0x0009037b,
- DRSUAPI_ATTRIBUTE_msDS_Behavior_Version = 0x000905b3,
- DRSUAPI_ATTRIBUTE_msDS_KeyVersionNumber = 0x000906f6,
- DRSUAPI_ATTRIBUTE_msDS_HasDomainNCs = 0x0009071c,
- DRSUAPI_ATTRIBUTE_msDS_hasMasterNCs = 0x0009072c
- } drsuapi_DsAttributeId;
-
- typedef struct {
- [value(1)] uint32 version;
- [value(0)] uint32 reserved1;
- [range(1,0x100000)] uint32 num_attids;
- [size_is(num_attids)] drsuapi_DsAttributeId attids[];
- } drsuapi_DsPartialAttributeSet;
-
- typedef struct {
- GUID destination_dsa_guid;
- GUID source_dsa_invocation_id; /* the 'invocationId' field of the CN=NTDS Settings object */
- [ref] drsuapi_DsReplicaObjectIdentifier *naming_context;
- drsuapi_DsReplicaHighWaterMark highwatermark;
- drsuapi_DsReplicaCursorCtrEx *uptodateness_vector;
- drsuapi_DsReplicaNeighbourFlags replica_flags;
- uint32 max_object_count; /* w2k3 uses min(133,max(100,max_object_count)) */
- uint32 max_ndr_size; /* w2k3 seems to ignore this */
- drsuapi_DsExtendedOperation extended_op;
- hyper fsmo_info;
- drsuapi_DsPartialAttributeSet *partial_attribute_set;
- drsuapi_DsPartialAttributeSet *partial_attribute_set_ex;
- drsuapi_DsReplicaOIDMapping_Ctr mapping_ctr;
- } drsuapi_DsGetNCChangesRequest8;
-
- typedef [switch_type(int32)] union {
- [case(5)] drsuapi_DsGetNCChangesRequest5 req5;
- [case(8)] drsuapi_DsGetNCChangesRequest8 req8;
- } drsuapi_DsGetNCChangesRequest;
-
- typedef [public] struct {
- GUID source_dsa_invocation_id; /* the 'invocationId' field of the CN=NTDS Settings object */
- hyper highest_usn; /* updated after a full replication cycle */
- NTTIME last_sync_success;
- } drsuapi_DsReplicaCursor2;
-
- typedef struct {
- [value(2)] uint32 version;
- [value(0)] uint32 reserved1;
- [range(0,0x100000)] uint32 count;
- [value(0)] uint32 reserved2;
- [size_is(count)] drsuapi_DsReplicaCursor2 cursors[];
- } drsuapi_DsReplicaCursor2CtrEx;
-
- /* Generic DATA_BLOB values */
- typedef struct {
- [range(0,10485760),value(ndr_size_DATA_BLOB(0,blob,0))] uint32 __ndr_size;
- DATA_BLOB *blob;
- } drsuapi_DsAttributeValue;
-
- typedef struct {
- [range(0,10485760)] uint32 num_values;
- [size_is(num_values)] drsuapi_DsAttributeValue *values;
- } drsuapi_DsAttributeValueCtr;
-
- /* DN String values */
- typedef [public,gensize] struct {
- [value(ndr_size_drsuapi_DsReplicaObjectIdentifier3(r, ndr->flags))] uint32 __ndr_size;
- [value(ndr_size_dom_sid28(&sid,ndr->flags))] uint32 __ndr_size_sid;
- GUID guid;
- dom_sid28 sid;
- [value(strlen_m(dn))] uint32 __ndr_size_dn;
- [charset(UTF16)] uint16 dn[__ndr_size_dn+1];
- } drsuapi_DsReplicaObjectIdentifier3;
-
- typedef [public,gensize] struct {
- [value(ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary(r, ndr->flags))] uint32 __ndr_size;
- [value(ndr_size_dom_sid28(&sid,ndr->flags))] uint32 __ndr_size_sid;
- GUID guid;
- dom_sid28 sid;
- [value(strlen_m(dn))] uint32 __ndr_size_dn;
- [charset(UTF16)] uint16 dn[__ndr_size_dn+1];
- [value(binary.length + 4)] uint32 __ndr_size_binary;
- [flag(NDR_REMAINING)] DATA_BLOB binary;
- } drsuapi_DsReplicaObjectIdentifier3Binary;
-
- typedef [public] struct {
- drsuapi_DsAttributeId attid;
- drsuapi_DsAttributeValueCtr value_ctr;
- } drsuapi_DsReplicaAttribute;
-
- typedef struct {
- [range(0,1048576)] uint32 num_attributes;
- [size_is(num_attributes)] drsuapi_DsReplicaAttribute *attributes;
- } drsuapi_DsReplicaAttributeCtr;
-
- typedef [public] bitmap {
- DRSUAPI_DS_REPLICA_OBJECT_FROM_MASTER = 0x00000001,
- DRSUAPI_DS_REPLICA_OBJECT_DYNAMIC = 0x00000002,
- DRSUAPI_DS_REPLICA_OBJECT_REMOTE_MODIFY = 0x00010000
- } drsuapi_DsReplicaObjectFlags;
-
- typedef [public] struct {
- drsuapi_DsReplicaObjectIdentifier *identifier;
- drsuapi_DsReplicaObjectFlags flags;
- drsuapi_DsReplicaAttributeCtr attribute_ctr;
- } drsuapi_DsReplicaObject;
-
- typedef struct {
- uint32 version;
- NTTIME_1sec originating_change_time;
- GUID originating_invocation_id;
- hyper originating_usn;
- } drsuapi_DsReplicaMetaData;
-
- typedef [public] struct {
- [range(0,1048576)] uint32 count;
- [size_is(count)] drsuapi_DsReplicaMetaData meta_data[];
- } drsuapi_DsReplicaMetaDataCtr;
-
- typedef [public,noprint] struct {
- drsuapi_DsReplicaObjectListItemEx *next_object;
- drsuapi_DsReplicaObject object;
- boolean32 is_nc_prefix;
- GUID *parent_object_guid;
- drsuapi_DsReplicaMetaDataCtr *meta_data_ctr;
- } drsuapi_DsReplicaObjectListItemEx;
-
- typedef [public,gensize] struct {
- GUID source_dsa_guid; /* the 'objectGUID' field of the CN=NTDS Settings object */
- GUID source_dsa_invocation_id; /* the 'invocationId' field of the CN=NTDS Settings object */
- drsuapi_DsReplicaObjectIdentifier *naming_context;
- drsuapi_DsReplicaHighWaterMark old_highwatermark;
- drsuapi_DsReplicaHighWaterMark new_highwatermark;
- drsuapi_DsReplicaCursorCtrEx *uptodateness_vector;
- drsuapi_DsReplicaOIDMapping_Ctr mapping_ctr;
- drsuapi_DsExtendedError extended_ret; /* w2k sends the nc_object_count value here */
- uint32 object_count;
- /* this +55 is sometimes +56, so I don't know where this comes from... --metze */
- [value(ndr_size_drsuapi_DsGetNCChangesCtr1(r,ndr->flags)+55)] uint32 __ndr_size;
- drsuapi_DsReplicaObjectListItemEx *first_object;
- boolean32 more_data;
- } drsuapi_DsGetNCChangesCtr1;
-
- /*
- * if the DRSUAPI_DS_LINKED_ATTRIBUTE_FLAG_ACTIVE flag
- * isn't there it means the value is deleted
- */
- typedef [public] bitmap {
- DRSUAPI_DS_LINKED_ATTRIBUTE_FLAG_ACTIVE = 0x00000001
- } drsuapi_DsLinkedAttributeFlags;
-
- typedef [public] struct {
- drsuapi_DsReplicaObjectIdentifier *identifier;
- drsuapi_DsAttributeId attid;
- drsuapi_DsAttributeValue value;
- drsuapi_DsLinkedAttributeFlags flags;
- NTTIME_1sec originating_add_time;
- drsuapi_DsReplicaMetaData meta_data;
- } drsuapi_DsReplicaLinkedAttribute;
-
- typedef [public,gensize] struct {
- GUID source_dsa_guid; /* the 'objectGUID' field of the CN=NTDS Settings object */
- GUID source_dsa_invocation_id; /* the 'invocationId' field of the CN=NTDS Settings object */
- drsuapi_DsReplicaObjectIdentifier *naming_context;
- drsuapi_DsReplicaHighWaterMark old_highwatermark;
- drsuapi_DsReplicaHighWaterMark new_highwatermark;
- drsuapi_DsReplicaCursor2CtrEx *uptodateness_vector;
- drsuapi_DsReplicaOIDMapping_Ctr mapping_ctr;
- drsuapi_DsExtendedError extended_ret;
- uint32 object_count;
- /* this +55 is sometimes +56, so I don't know where this comes from... --metze */
- [value(ndr_size_drsuapi_DsGetNCChangesCtr6(r,ndr->flags)+55)] uint32 __ndr_size;
- drsuapi_DsReplicaObjectListItemEx *first_object;
- boolean32 more_data;
- uint32 nc_object_count; /* estimated amount of objects in the whole NC */
- uint32 nc_linked_attributes_count; /* estimated amount of linked values in the whole NC */
- [range(0,1048576)] uint32 linked_attributes_count;
- [size_is(linked_attributes_count)] drsuapi_DsReplicaLinkedAttribute *linked_attributes;
- WERROR drs_error;
- } drsuapi_DsGetNCChangesCtr6;
-
- typedef struct {
- uint32 decompressed_length;
- uint32 compressed_length;
- [subcontext(4),subcontext_size(compressed_length),
- compression(NDR_COMPRESSION_MSZIP,compressed_length,decompressed_length)]
- drsuapi_DsGetNCChangesCtr1 *ctr1;
- } drsuapi_DsGetNCChangesMSZIPCtr1;
-
- typedef struct {
- uint32 decompressed_length;
- uint32 compressed_length;
- [subcontext(4),subcontext_size(compressed_length),
- compression(NDR_COMPRESSION_MSZIP,compressed_length,decompressed_length)]
- drsuapi_DsGetNCChangesCtr6 *ctr6;
- } drsuapi_DsGetNCChangesMSZIPCtr6;
-
- typedef struct {
- uint32 decompressed_length;
- uint32 compressed_length;
- [subcontext(4),subcontext_size(compressed_length),
- compression(NDR_COMPRESSION_XPRESS,compressed_length,decompressed_length)]
- drsuapi_DsGetNCChangesCtr1 *ctr1;
- } drsuapi_DsGetNCChangesXPRESSCtr1;
-
- typedef struct {
- uint32 decompressed_length;
- uint32 compressed_length;
- [subcontext(4),subcontext_size(compressed_length),
- compression(NDR_COMPRESSION_XPRESS,compressed_length,decompressed_length)]
- drsuapi_DsGetNCChangesCtr6 *ctr6;
- } drsuapi_DsGetNCChangesXPRESSCtr6;
-
- typedef [enum16bit] enum {
- DRSUAPI_COMPRESSION_TYPE_MSZIP = 2,
- DRSUAPI_COMPRESSION_TYPE_XPRESS = 3
- } drsuapi_DsGetNCChangesCompressionType;
-
- typedef [nodiscriminant,flag(NDR_PAHEX)] union {
- [case(1|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16))] drsuapi_DsGetNCChangesMSZIPCtr1 mszip1;
- [case(6|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16))] drsuapi_DsGetNCChangesMSZIPCtr6 mszip6;
- [case(1|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16))] drsuapi_DsGetNCChangesXPRESSCtr1 xpress1;
- [case(6|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16))] drsuapi_DsGetNCChangesXPRESSCtr6 xpress6;
- } drsuapi_DsGetNCChangesCompressedCtr;
-
- typedef struct {
- /*
- * this is a bit ugly, as the compression depends on the flags
- * in the DsBind(), but only w2k uses DsGetNCChangesReq5
- * and will get DsGetNCChangesCtr2 replies, and w2k only knowns
- * about MSZIP and level 1 replies
- */
- [switch_is(1|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16))] drsuapi_DsGetNCChangesCompressedCtr ctr;
- } drsuapi_DsGetNCChangesCtr2;
-
- typedef struct {
- [range(0,6)] int32 level;
- [range(2,3)] drsuapi_DsGetNCChangesCompressionType type;
- [switch_is(level | (type<<16))] drsuapi_DsGetNCChangesCompressedCtr ctr;
- } drsuapi_DsGetNCChangesCtr7;
-
- typedef [switch_type(int32)] union {
- [case(1)] drsuapi_DsGetNCChangesCtr1 ctr1;
- [case(2)] drsuapi_DsGetNCChangesCtr2 ctr2;
- [case(6)] drsuapi_DsGetNCChangesCtr6 ctr6;
- [case(7)] drsuapi_DsGetNCChangesCtr7 ctr7;
- } drsuapi_DsGetNCChangesCtr;
-
- WERROR drsuapi_DsGetNCChanges(
- [in] policy_handle *bind_handle,
- [in] int32 level,
- [in,ref,switch_is(level)] drsuapi_DsGetNCChangesRequest *req,
- [out,ref] int32 *level_out,
- [out,ref,switch_is(*level_out)] drsuapi_DsGetNCChangesCtr *ctr
- );
-
- /*****************/
- /* Function 0x04 */
- typedef bitmap {
- DRSUAPI_DS_REPLICA_UPDATE_ASYNCHRONOUS_OPERATION = 0x00000001,
- DRSUAPI_DS_REPLICA_UPDATE_WRITEABLE = 0x00000002,
- DRSUAPI_DS_REPLICA_UPDATE_ADD_REFERENCE = 0x00000004,
- DRSUAPI_DS_REPLICA_UPDATE_DELETE_REFERENCE = 0x00000008,
- DRSUAPI_DS_REPLICA_UPDATE_0x00000010 = 0x00000010
- } drsuapi_DsReplicaUpdateRefsOptions;
-
- typedef struct {
- [ref] drsuapi_DsReplicaObjectIdentifier *naming_context;
- [ref,charset(DOS),string] uint8 *dest_dsa_dns_name;
- GUID dest_dsa_guid;
- drsuapi_DsReplicaUpdateRefsOptions options;
- } drsuapi_DsReplicaUpdateRefsRequest1;
-
- typedef [switch_type(int32)] union {
- [case(1)] drsuapi_DsReplicaUpdateRefsRequest1 req1;
- } drsuapi_DsReplicaUpdateRefsRequest;
-
- WERROR drsuapi_DsReplicaUpdateRefs(
- [in] policy_handle *bind_handle,
- [in] int32 level,
- [in,switch_is(level)] drsuapi_DsReplicaUpdateRefsRequest req
- );
-
- /*****************/
- /* Function 0x05 */
- typedef bitmap {
- DRSUAPI_DS_REPLICA_ADD_ASYNCHRONOUS_OPERATION = 0x00000001,
- DRSUAPI_DS_REPLICA_ADD_WRITEABLE = 0x00000002
- /* TODO ... */
- } drsuapi_DsReplicaAddOptions;
-
- [todo] WERROR DRSUAPI_REPLICA_ADD();
-
- /*****************/
- /* Function 0x06 */
- typedef bitmap {
- DRSUAPI_DS_REPLICA_DELETE_ASYNCHRONOUS_OPERATION = 0x00000001,
- DRSUAPI_DS_REPLICA_DELETE_WRITEABLE = 0x00000002
- /* TODO ... */
- } drsuapi_DsReplicaDeleteOptions;
-
- [todo] WERROR DRSUAPI_REPLICA_DEL();
-
- /*****************/
- /* Function 0x07 */
- typedef bitmap {
- DRSUAPI_DS_REPLICA_MODIFY_ASYNCHRONOUS_OPERATION = 0x00000001,
- DRSUAPI_DS_REPLICA_MODIFY_WRITEABLE = 0x00000002
- } drsuapi_DsReplicaModifyOptions;
-
- [todo] WERROR DRSUAPI_REPLICA_MODIFY();
-
- /*****************/
- /* Function 0x08 */
- [todo] WERROR DRSUAPI_VERIFY_NAMES();
-
- /*****************/
- /* Function 0x09 */
-
- /* how are type 4 and 7 different from 2 and 3 ? */
- typedef [v1_enum] enum {
- DRSUAPI_DS_MEMBERSHIP_TYPE_UNIVERSAL_AND_DOMAIN_GROUPS = 1,
- DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_LOCAL_GROUPS = 2,
- DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_GROUPS = 3,
- DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_LOCAL_GROUPS2 = 4,
- DRSUAPI_DS_MEMBERSHIP_TYPE_UNIVERSAL_GROUPS = 5,
- DRSUAPI_DS_MEMBERSHIP_TYPE_GROUPMEMBERS = 6,
- DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_GROUPS2 = 7
- } drsuapi_DsMembershipType;
-
- typedef struct {
- NTSTATUS status;
- [range(0,10000)] uint32 num_memberships;
- [range(0,10000)] uint32 num_sids;
- [size_is(num_memberships)] drsuapi_DsReplicaObjectIdentifier **info_array;
- [size_is(num_memberships)] samr_GroupAttrs *group_attrs;
- [size_is(num_sids)] dom_sid28 **sids;
- } drsuapi_DsGetMembershipsCtr1;
-
- typedef [switch_type(int32)] union {
- [case(1)] drsuapi_DsGetMembershipsCtr1 ctr1;
- } drsuapi_DsGetMembershipsCtr;
-
- const int DRSUAPI_DS_MEMBERSHIP_FLAG_GROUP_ATTR = 0x1;
-
- typedef struct {
- [range(1,10000)] uint32 count;
- [size_is(count)] drsuapi_DsReplicaObjectIdentifier **info_array;
- uint32 flags;
- drsuapi_DsMembershipType type;
- drsuapi_DsReplicaObjectIdentifier *domain;
- } drsuapi_DsGetMembershipsRequest1;
-
- typedef [switch_type(int32)] union {
- [case(1)] drsuapi_DsGetMembershipsRequest1 req1;
- } drsuapi_DsGetMembershipsRequest;
-
- WERROR drsuapi_DsGetMemberships(
- [in] policy_handle *bind_handle,
- [in] int32 level,
- [in,ref] [switch_is(level)] drsuapi_DsGetMembershipsRequest *req,
- [out,ref] int32 *level_out,
- [out,ref] [switch_is(*level_out)] drsuapi_DsGetMembershipsCtr *ctr
- );
-
- /*****************/
- /* Function 0x0a */
- [todo] WERROR DRSUAPI_INTER_DOMAIN_MOVE();
-
- /*****************/
- /* Function 0x0b */
- typedef struct {
- uint32 unknown1;
- uint32 unknown2;
- [range(0,0x00A00000)] uint32 length;
- [size_is(length)] uint8 *data;
- } drsuapi_DsGetNT4ChangeLogRequest1;
-
- typedef [switch_type(uint32)] union {
- [case(1)] drsuapi_DsGetNT4ChangeLogRequest1 req1;
- } drsuapi_DsGetNT4ChangeLogRequest;
-
- typedef struct {
- [range(0,0x00A00000)] uint32 length1;
- [range(0,0x00A00000)] uint32 length2;
- hyper unknown1;
- NTTIME time2;
- hyper unknown3;
- NTTIME time4;
- hyper unknown5;
- NTTIME time6;
- NTSTATUS status;
- [size_is(length1)] uint8 *data1;
- [size_is(length2)] uint8 *data2;
- } drsuapi_DsGetNT4ChangeLogInfo1;
-
- typedef [switch_type(uint32)] union {
- [case(1)] drsuapi_DsGetNT4ChangeLogInfo1 info1;
- } drsuapi_DsGetNT4ChangeLogInfo;
-
- WERROR drsuapi_DsGetNT4ChangeLog(
- [in] policy_handle *bind_handle,
- [in] uint32 level,
- [in,ref] [switch_is(level)] drsuapi_DsGetNT4ChangeLogRequest *req,
- [out,ref] uint32 *level_out,
- [out,ref] [switch_is(*level_out)] drsuapi_DsGetNT4ChangeLogInfo *info
- );
-
- /*****************/
- /* Function 0x0c */
- typedef [v1_enum] enum {
- DRSUAPI_DS_NAME_STATUS_OK = 0,
- DRSUAPI_DS_NAME_STATUS_RESOLVE_ERROR = 1,
- DRSUAPI_DS_NAME_STATUS_NOT_FOUND = 2,
- DRSUAPI_DS_NAME_STATUS_NOT_UNIQUE = 3,
- DRSUAPI_DS_NAME_STATUS_NO_MAPPING = 4,
- DRSUAPI_DS_NAME_STATUS_DOMAIN_ONLY = 5,
- DRSUAPI_DS_NAME_STATUS_NO_SYNTACTICAL_MAPPING = 6,
- DRSUAPI_DS_NAME_STATUS_TRUST_REFERRAL = 7
- } drsuapi_DsNameStatus;
-
- typedef [v1_enum] enum {
- DRSUAPI_DS_NAME_FLAG_NO_FLAGS = 0x0,
- DRSUAPI_DS_NAME_FLAG_SYNTACTICAL_ONLY = 0x1,
- DRSUAPI_DS_NAME_FLAG_EVAL_AT_DC = 0x2,
- DRSUAPI_DS_NAME_FLAG_GCVERIFY = 0x4,
- DRSUAPI_DS_NAME_FLAG_TRUST_REFERRAL = 0x8
- } drsuapi_DsNameFlags;
-
- typedef [v1_enum] enum {
- DRSUAPI_DS_NAME_FORMAT_UKNOWN = 0,
- DRSUAPI_DS_NAME_FORMAT_FQDN_1779 = 1,
- DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT = 2,
- DRSUAPI_DS_NAME_FORMAT_DISPLAY = 3,
- DRSUAPI_DS_NAME_FORMAT_GUID = 6,
- DRSUAPI_DS_NAME_FORMAT_CANONICAL = 7,
- DRSUAPI_DS_NAME_FORMAT_USER_PRINCIPAL = 8,
- DRSUAPI_DS_NAME_FORMAT_CANONICAL_EX = 9,
- DRSUAPI_DS_NAME_FORMAT_SERVICE_PRINCIPAL = 10,
- DRSUAPI_DS_NAME_FORMAT_SID_OR_SID_HISTORY = 11,
- DRSUAPI_DS_NAME_FORMAT_DNS_DOMAIN = 12
- } drsuapi_DsNameFormat;
-
- typedef struct {
- [string,charset(UTF16)] uint16 *str;
- } drsuapi_DsNameString;
-
- typedef struct {
- uint32 codepage; /* 0x000004e4 - 1252 is german codepage*/
- uint32 language; /* 0x00000407 - german language ID*/
- drsuapi_DsNameFlags format_flags;
- drsuapi_DsNameFormat format_offered;
- drsuapi_DsNameFormat format_desired;
- [range(1,10000)] uint32 count;
- [size_is(count)] drsuapi_DsNameString *names;
- } drsuapi_DsNameRequest1;
-
- typedef [switch_type(int32)] union {
- [case(1)] drsuapi_DsNameRequest1 req1;
- } drsuapi_DsNameRequest;
-
- typedef struct {
- drsuapi_DsNameStatus status;
- [charset(UTF16),string] uint16 *dns_domain_name;
- [charset(UTF16),string] uint16 *result_name;
- } drsuapi_DsNameInfo1;
-
- typedef struct {
- uint32 count;
- [size_is(count)] drsuapi_DsNameInfo1 *array;
- } drsuapi_DsNameCtr1;
-
- typedef [switch_type(int32)] union {
- [case(1)] drsuapi_DsNameCtr1 *ctr1;
- } drsuapi_DsNameCtr;
-
- WERROR drsuapi_DsCrackNames(
- [in] policy_handle *bind_handle,
- [in] int32 level,
- [in,ref,switch_is(level)] drsuapi_DsNameRequest *req,
- [out,ref] int32 *level_out,
- [out,ref,switch_is(*level_out)] drsuapi_DsNameCtr *ctr
- );
-
- /*****************/
- /* Function 0x0d */
- typedef [v1_enum] enum {
- DRSUAPI_DS_SPN_OPERATION_ADD = 0,
- DRSUAPI_DS_SPN_OPERATION_REPLACE= 1,
- DRSUAPI_DS_SPN_OPERATION_DELETE = 2
- } drsuapi_DsSpnOperation;
-
- typedef struct {
- drsuapi_DsSpnOperation operation;
- uint32 unknown1;
- [charset(UTF16),string] uint16 *object_dn;
- [range(0,10000)] uint32 count;
- [size_is(count)] drsuapi_DsNameString *spn_names;
- } drsuapi_DsWriteAccountSpnRequest1;
-
- typedef [switch_type(int32)] union {
- [case(1)] drsuapi_DsWriteAccountSpnRequest1 req1;
- } drsuapi_DsWriteAccountSpnRequest;
-
- typedef struct {
- WERROR status;
- } drsuapi_DsWriteAccountSpnResult1;
-
- typedef [switch_type(int32)] union {
- [case(1)] drsuapi_DsWriteAccountSpnResult1 res1;
- } drsuapi_DsWriteAccountSpnResult;
-
- WERROR drsuapi_DsWriteAccountSpn(
- [in] policy_handle *bind_handle,
- [in] int32 level,
- [in,ref,switch_is(level)] drsuapi_DsWriteAccountSpnRequest *req,
- [out,ref] int32 *level_out,
- [out,ref,switch_is(*level_out)] drsuapi_DsWriteAccountSpnResult *res
- );
-
- /*****************/
- /* Function 0x0e */
- typedef struct {
- [charset(UTF16),string] uint16 *server_dn;
- [charset(UTF16),string] uint16 *domain_dn;
- uint32 unknown; /* 0x000000001 */
- } drsuapi_DsRemoveDSServerRequest1;
-
- typedef [switch_type(int32)] union {
- [case(1)] drsuapi_DsRemoveDSServerRequest1 req1;
- } drsuapi_DsRemoveDSServerRequest;
-
- typedef struct {
- WERROR status;
- } drsuapi_DsRemoveDSServerResult1;
-
- typedef [switch_type(int32)] union {
- [case(1)] drsuapi_DsRemoveDSServerResult1 res1;
- } drsuapi_DsRemoveDSServerResult;
-
- WERROR drsuapi_DsRemoveDSServer(
- [in] policy_handle *bind_handle,
- [in] int32 level,
- [in,ref,switch_is(level)] drsuapi_DsRemoveDSServerRequest *req,
- [out,ref] int32 *level_out,
- [out,ref,switch_is(*level_out)] drsuapi_DsRemoveDSServerResult *res
- );
-
- /*****************/
- /* Function 0x0f */
- [todo] WERROR DRSUAPI_REMOVE_DS_DOMAIN();
-
- /*****************/
- /* Function 0x10 */
- typedef struct {
- [charset(UTF16),string] uint16 *domain_name; /* netbios or dns */
- int32 level; /* specifies the switch level for the request */
- } drsuapi_DsGetDCInfoRequest1;
-
- typedef [switch_type(int32)] union {
- [case(1)] drsuapi_DsGetDCInfoRequest1 req1;
- } drsuapi_DsGetDCInfoRequest;
-
- typedef struct {
- [charset(UTF16),string] uint16 *netbios_name;
- [charset(UTF16),string] uint16 *dns_name;
- [charset(UTF16),string] uint16 *site_name;
- [charset(UTF16),string] uint16 *computer_dn;
- [charset(UTF16),string] uint16 *server_dn;
- uint32 is_pdc;
- uint32 is_enabled;
- } drsuapi_DsGetDCInfo1;
-
- typedef struct {
- [range(0,10000)] uint32 count;
- [size_is(count)] drsuapi_DsGetDCInfo1 *array;
- } drsuapi_DsGetDCInfoCtr1;
-
- typedef struct {
- [charset(UTF16),string] uint16 *netbios_name;
- [charset(UTF16),string] uint16 *dns_name;
- [charset(UTF16),string] uint16 *site_name;
- [charset(UTF16),string] uint16 *site_dn;
- [charset(UTF16),string] uint16 *computer_dn;
- [charset(UTF16),string] uint16 *server_dn;
- [charset(UTF16),string] uint16 *ntds_dn;
- uint32 is_pdc;
- uint32 is_enabled;
- uint32 is_gc;
- GUID site_guid;
- GUID computer_guid;
- GUID server_guid;
- GUID ntds_guid;
- } drsuapi_DsGetDCInfo2;
-
- typedef struct {
- [range(0,10000)] uint32 count;
- [size_is(count)] drsuapi_DsGetDCInfo2 *array;
- } drsuapi_DsGetDCInfoCtr2;
-
- typedef struct {
- [charset(UTF16),string] uint16 *netbios_name;
- [charset(UTF16),string] uint16 *dns_name;
- [charset(UTF16),string] uint16 *site_name;
- [charset(UTF16),string] uint16 *site_dn;
- [charset(UTF16),string] uint16 *computer_dn;
- [charset(UTF16),string] uint16 *server_dn;
- [charset(UTF16),string] uint16 *ntds_dn;
- uint32 is_pdc;
- uint32 is_enabled;
- uint32 is_gc;
- uint32 is_rodc;
- GUID site_guid;
- GUID computer_guid;
- GUID server_guid;
- GUID ntds_guid;
- } drsuapi_DsGetDCInfo3;
-
- typedef struct {
- [range(0,10000)] uint32 count;
- [size_is(count)] drsuapi_DsGetDCInfo3 *array;
- } drsuapi_DsGetDCInfoCtr3;
-
- /*
- * this represents an active connection to the
- * Directory System Agent (DSA)
- * this can be via LDAP or DRSUAPI
- */
- typedef struct {
- [flag(NDR_BIG_ENDIAN)] ipv4address client_ip_address;
- uint32 unknown2;
- uint32 connection_time; /* in seconds */
- uint32 unknown4;
- uint32 unknown5;
- uint32 unknown6;
- /*
- * client_account can be the following:
- * "W2K3\Administrator"
- * "Administrator@W2K3"
- * "cn=Administrator,cn=Users,DC=w2k3,DC=vmnet1,DC=vm,DC=base"
- * ""
- * or NULL
- */
- [charset(UTF16),string] uint16 *client_account;
- } drsuapi_DsGetDCConnection01;
-
- typedef struct {
- [range(0,10000)] uint32 count;
- [size_is(count)] drsuapi_DsGetDCConnection01 *array;
- } drsuapi_DsGetDCConnectionCtr01;
-
- typedef [v1_enum] enum {
- DRSUAPI_DC_INFO_CTR_1 = 1,
- DRSUAPI_DC_INFO_CTR_2 = 2,
- DRSUAPI_DC_INFO_CTR_3 = 3,
- DRSUAPI_DC_CONNECTION_CTR_01 = -1
- } drsuapi_DsGetDCInfoCtrLevels;
-
- typedef [switch_type(int32)] union {
- [case(DRSUAPI_DC_INFO_CTR_1)] drsuapi_DsGetDCInfoCtr1 ctr1;
- [case(DRSUAPI_DC_INFO_CTR_2)] drsuapi_DsGetDCInfoCtr2 ctr2;
- [case(DRSUAPI_DC_INFO_CTR_3)] drsuapi_DsGetDCInfoCtr3 ctr3;
- [case(DRSUAPI_DC_CONNECTION_CTR_01)] drsuapi_DsGetDCConnectionCtr01 ctr01;
- } drsuapi_DsGetDCInfoCtr;
-
- WERROR drsuapi_DsGetDomainControllerInfo(
- [in] policy_handle *bind_handle,
- [in] int32 level,
- [in,ref,switch_is(level)] drsuapi_DsGetDCInfoRequest *req,
- [out,ref] int32 *level_out,
- [out,ref,switch_is(*level_out)] drsuapi_DsGetDCInfoCtr *ctr
- );
-
- /*****************/
- /* Function 0x11 */
- typedef [public,noprint] struct {
- drsuapi_DsReplicaObjectListItem *next_object;
- drsuapi_DsReplicaObject object;
- } drsuapi_DsReplicaObjectListItem;
-
- /*
- * The DsAddEntry() call which creates a nTDSDSA object,
- * also adds a servicePrincipalName in the following form
- * to the computer account of the new domain controller
- * referenced by the "serverReferenece" attribute.
- *
- * E3514235-4B06-11D1-AB04-00C04FC2DCD2/<new-ntdsdsa-object-guid-as-string>/<domain-dns-name>
- *
- * also note that the "serverReference" isn't added to the new object!
- */
- const char *DRSUAPI_NTDSDSA_KRB5_SERVICE_GUID = "E3514235-4B06-11D1-AB04-00C04FC2DCD2";
-
- /*
- * please note the the current idl
- * for DsAddEntry does only parse
- * what I saw between 2 w2k3 boxes
- * in my dssync experiments I got some other replies
- * so all I want to say is that this is very incomplete yet...
- * --metze
- */
- typedef struct {
- drsuapi_DsReplicaObjectListItem first_object;
- } drsuapi_DsAddEntryRequest2;
-
- typedef [switch_type(int32)] union {
- [case(2)] drsuapi_DsAddEntryRequest2 req2;
- } drsuapi_DsAddEntryRequest;
-
- typedef struct {
- uint32 unknown1;
- WERROR status;
- uint32 unknown2;
- uint16 unknown3;
- } drsuapi_DsAddEntryErrorInfoX;
-
- typedef struct {
- [range(0,10485760)] uint32 size;
- [size_is(size)] uint8 *data;
- } drsuapi_DsAddEntryExtraErrorBuffer;
-
- typedef struct {
- drsuapi_DsAddEntryErrorInfoX error;
- drsuapi_DsAttributeId attid;
- uint32 unknown2;
- drsuapi_DsAddEntryExtraErrorBuffer buffer;
- } drsuapi_DsAddEntryExtraError1;
-
- typedef /*[noprint]*/ struct {
- drsuapi_DsAddEntryErrorListItem1 *next;
- drsuapi_DsAddEntryExtraError1 error;
- } drsuapi_DsAddEntryErrorListItem1;
-
- typedef struct {
- drsuapi_DsReplicaObjectIdentifier *id;
- WERROR status;
- drsuapi_DsAddEntryErrorListItem1 first;
- } drsuapi_DsAddEntryErrorInfo1;
-
- typedef [switch_type(uint32)] union {
- [case(1)] drsuapi_DsAddEntryErrorInfo1 error1;
-/* [case(2)] drsuapi_DsAddEntryErrorInfo2 error2;
- [case(3)] drsuapi_DsAddEntryErrorInfo3 error3;
-*/ [case(4)] drsuapi_DsAddEntryErrorInfoX errorX;
- [case(5)] drsuapi_DsAddEntryErrorInfoX errorX;
- [case(6)] drsuapi_DsAddEntryErrorInfoX errorX;
- [case(7)] drsuapi_DsAddEntryErrorInfoX errorX;
- } drsuapi_DsAddEntryErrorInfo;
-
- typedef struct {
- WERROR status;
- uint32 level;
- [switch_is(level)] drsuapi_DsAddEntryErrorInfo *info;
- } drsuapi_DsAddEntryError1;
-
- typedef [switch_type(uint32)] union {
- [case(1)] drsuapi_DsAddEntryError1 info1;
- } drsuapi_DsAddEntryError;
-
- typedef struct {
- GUID guid;
- dom_sid28 sid;
- } drsuapi_DsReplicaObjectIdentifier2;
-
- typedef struct {
- drsuapi_DsReplicaObjectIdentifier *id;
- uint32 unknown1;
- drsuapi_DsAddEntryErrorInfoX error;
- [range(0,10000)] uint32 count;
- [size_is(count)] drsuapi_DsReplicaObjectIdentifier2 *objects;
- } drsuapi_DsAddEntryCtr2;
-
- typedef struct {
- drsuapi_DsReplicaObjectIdentifier *id;
- uint32 level;
- [switch_is(level)] drsuapi_DsAddEntryError *error;
- [range(0,10000)] uint32 count;
- [size_is(count)] drsuapi_DsReplicaObjectIdentifier2 *objects;
- } drsuapi_DsAddEntryCtr3;
-
- typedef [switch_type(int32)] union {
- [case(2)] drsuapi_DsAddEntryCtr2 ctr2;
- [case(3)] drsuapi_DsAddEntryCtr3 ctr3;
- } drsuapi_DsAddEntryCtr;
-
- [public] WERROR drsuapi_DsAddEntry(
- [in] policy_handle *bind_handle,
- [in] int32 level,
- [in,ref,switch_is(level)] drsuapi_DsAddEntryRequest *req,
- [out,ref] int32 *level_out,
- [out,ref,switch_is(*level_out)] drsuapi_DsAddEntryCtr *ctr
- );
-
- /*****************/
- /* Function 0x12 */
- [todo] WERROR DRSUAPI_EXECUTE_KCC();
-
- /*****************/
- /* Function 0x13 */
- typedef [v1_enum] enum {
- DRSUAPI_DS_REPLICA_GET_INFO = 1,
- DRSUAPI_DS_REPLICA_GET_INFO2 = 2
- } drsuapi_DsReplicaGetInfoLevel;
-
- typedef [v1_enum] enum {
- DRSUAPI_DS_REPLICA_INFO_NEIGHBORS = 0,
- DRSUAPI_DS_REPLICA_INFO_CURSORS = 1,
- DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA = 2,
- DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES = 3,
- DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES = 4,
- DRSUAPI_DS_REPLICA_INFO_PENDING_OPS = 5,
- DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA = 6,
- DRSUAPI_DS_REPLICA_INFO_CURSORS2 = 7,
- DRSUAPI_DS_REPLICA_INFO_CURSORS3 = 8,
- DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2 = 9,
- DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2 = 10,
- DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02 = -2,
- DRSUAPI_DS_REPLICA_INFO_CONNECTIONS04 = -4,
- DRSUAPI_DS_REPLICA_INFO_CURSORS05 = -5,
- DRSUAPI_DS_REPLICA_INFO_06 = -6
- } drsuapi_DsReplicaInfoType;
-
- typedef struct {
- drsuapi_DsReplicaInfoType info_type;
- [charset(UTF16),string] uint16 *object_dn;
- GUID guid1;
- } drsuapi_DsReplicaGetInfoRequest1;
-
- typedef struct {
- drsuapi_DsReplicaInfoType info_type;
- [charset(UTF16),string] uint16 *object_dn;
- GUID guid1;
- uint32 unknown1;
- [charset(UTF16),string] uint16 *string1;
- [charset(UTF16),string] uint16 *string2;
- uint32 unknown2;
- } drsuapi_DsReplicaGetInfoRequest2;
-
- typedef [switch_type(drsuapi_DsReplicaGetInfoLevel)] union {
- [case(DRSUAPI_DS_REPLICA_GET_INFO)] drsuapi_DsReplicaGetInfoRequest1 req1;
- [case(DRSUAPI_DS_REPLICA_GET_INFO2)] drsuapi_DsReplicaGetInfoRequest2 req2;
- } drsuapi_DsReplicaGetInfoRequest;
-
- typedef struct {
- [charset(UTF16),string] uint16 *naming_context_dn;
- [charset(UTF16),string] uint16 *source_dsa_obj_dn;
- [charset(UTF16),string] uint16 *source_dsa_address;
- [charset(UTF16),string] uint16 *transport_obj_dn;
- drsuapi_DsReplicaNeighbourFlags replica_flags;
- uint32 reserved;
- GUID naming_context_obj_guid;
- GUID source_dsa_obj_guid;
- GUID source_dsa_invocation_id;
- GUID transport_obj_guid;
- hyper tmp_highest_usn;
- hyper highest_usn;
- NTTIME last_success;
- NTTIME last_attempt;
- WERROR result_last_attempt;
- uint32 consecutive_sync_failures;
- } drsuapi_DsReplicaNeighbour;
-
- typedef struct {
- uint32 count;
- uint32 reserved;
- [size_is(count)] drsuapi_DsReplicaNeighbour array[];
- } drsuapi_DsReplicaNeighbourCtr;
-
- typedef struct {
- uint32 count;
- uint32 reserved;
- [size_is(count)] drsuapi_DsReplicaCursor array[];
- } drsuapi_DsReplicaCursorCtr;
-
- typedef struct {
- [charset(UTF16),string] uint16 *attribute_name;
- uint32 version;
- NTTIME originating_change_time;
- GUID originating_invocation_id;
- hyper originating_usn;
- hyper local_usn;
- } drsuapi_DsReplicaObjMetaData;
-
- typedef struct {
- uint32 count;
- uint32 reserved;
- [size_is(count)] drsuapi_DsReplicaObjMetaData array[];
- } drsuapi_DsReplicaObjMetaDataCtr;
-
- typedef struct {
- [charset(UTF16),string] uint16 *dsa_obj_dn;
- GUID dsa_obj_guid;
- NTTIME first_failure;
- uint32 num_failures;
- WERROR last_result;
- } drsuapi_DsReplicaKccDsaFailure;
-
- typedef struct {
- uint32 count;
- uint32 reserved;
- [size_is(count)] drsuapi_DsReplicaKccDsaFailure array[];
- } drsuapi_DsReplicaKccDsaFailuresCtr;
-
- typedef enum {
- DRSUAPI_DS_REPLICA_OP_TYPE_SYNC = 0,
- DRSUAPI_DS_REPLICA_OP_TYPE_ADD = 1,
- DRSUAPI_DS_REPLICA_OP_TYPE_DELETE = 2,
- DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY = 3,
- DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS = 4
- } drsuapi_DsReplicaOpType;
-
- typedef [switch_type(drsuapi_DsReplicaOpType)] union {
- [case(DRSUAPI_DS_REPLICA_OP_TYPE_SYNC)] drsuapi_DsReplicaSyncOptions sync;
- [case(DRSUAPI_DS_REPLICA_OP_TYPE_ADD)] drsuapi_DsReplicaAddOptions add;
- [case(DRSUAPI_DS_REPLICA_OP_TYPE_DELETE)] drsuapi_DsReplicaDeleteOptions op_delete;
- [case(DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY)] drsuapi_DsReplicaModifyOptions modify;
- [case(DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS)] drsuapi_DsReplicaUpdateRefsOptions update_refs;
- [default] uint32 unknown;
- } drsuapi_DsRplicaOpOptions;
-
- typedef struct {
- NTTIME operation_start;
- uint32 serial_num; /* unique till reboot */
- uint32 priority;
- drsuapi_DsReplicaOpType operation_type;
- [switch_is(operation_type)] drsuapi_DsRplicaOpOptions options;
- [charset(UTF16),string] uint16 *nc_dn;
- [charset(UTF16),string] uint16 *remote_dsa_obj_dn;
- [charset(UTF16),string] uint16 *remote_dsa_address;
- GUID nc_obj_guid;
- GUID remote_dsa_obj_guid;
- } drsuapi_DsReplicaOp;
-
- typedef struct {
- NTTIME time;
- uint32 count;
- [size_is(count)] drsuapi_DsReplicaOp array[];
- } drsuapi_DsReplicaOpCtr;
-
- typedef struct {
- [charset(UTF16),string] uint16 *attribute_name;
- [charset(UTF16),string] uint16 *object_dn;
- [value(ndr_size_DATA_BLOB(0,binary,0))] uint32 __ndr_size_binary;
- DATA_BLOB *binary;
- NTTIME deleted;
- NTTIME created;
- uint32 version;
- NTTIME originating_change_time;
- GUID originating_invocation_id;
- hyper originating_usn;
- hyper local_usn;
- } drsuapi_DsReplicaAttrValMetaData;
-
- typedef struct {
- uint32 count;
- int32 enumeration_context;
- [size_is(count)] drsuapi_DsReplicaAttrValMetaData array[];
- } drsuapi_DsReplicaAttrValMetaDataCtr;
-
- typedef struct {
- uint32 count;
- int32 enumeration_context;
- [size_is(count)] drsuapi_DsReplicaCursor2 array[];
- } drsuapi_DsReplicaCursor2Ctr;
-
- typedef struct {
- GUID source_dsa_invocation_id;
- hyper highest_usn;
- NTTIME last_sync_success;
- [charset(UTF16),string] uint16 *source_dsa_obj_dn;
- } drsuapi_DsReplicaCursor3;
-
- typedef struct {
- uint32 count;
- int32 enumeration_context;
- [size_is(count)] drsuapi_DsReplicaCursor3 array[];
- } drsuapi_DsReplicaCursor3Ctr;
-
- typedef struct {
- [charset(UTF16),string] uint16 *attribute_name;
- uint32 version;
- NTTIME originating_change_time;
- GUID originating_invocation_id;
- hyper originating_usn;
- hyper local_usn;
- [charset(UTF16),string] uint16 *originating_dsa_dn;
- } drsuapi_DsReplicaObjMetaData2;
-
- typedef struct {
- uint32 count;
- int32 enumeration_context;
- [size_is(count)] drsuapi_DsReplicaObjMetaData2 array[];
- } drsuapi_DsReplicaObjMetaData2Ctr;
-
- typedef struct {
- [charset(UTF16),string] uint16 *attribute_name;
- [charset(UTF16),string] uint16 *object_dn;
- [value(ndr_size_DATA_BLOB(0,binary,0))] uint32 __ndr_size_binary;
- DATA_BLOB *binary;
- NTTIME deleted;
- NTTIME created;
- uint32 version;
- NTTIME originating_change_time;
- GUID originating_invocation_id;
- hyper originating_usn;
- hyper local_usn;
- [charset(UTF16),string] uint16 *originating_dsa_dn;
- } drsuapi_DsReplicaAttrValMetaData2;
-
- typedef struct {
- uint32 count;
- int32 enumeration_context;
- [size_is(count)] drsuapi_DsReplicaAttrValMetaData2 array[];
- } drsuapi_DsReplicaAttrValMetaData2Ctr;
-
- typedef struct {
- hyper u1; /* session number? */
- uint32 u2;
- uint32 u3;
- GUID bind_guid;
- NTTIME_1sec bind_time;
- [flag(NDR_BIG_ENDIAN)] ipv4address client_ip_address;
- uint32 u5; /* this is the same value the client used as pid in the DsBindInfoX struct */
- } drsuapi_DsReplicaConnection04;
-
- typedef struct {
- [range(0,10000)] uint32 count;
- uint32 reserved;
- [size_is(count)] drsuapi_DsReplicaConnection04 array[];
- } drsuapi_DsReplicaConnection04Ctr;
-
- typedef struct {
- [charset(UTF16),string] uint16 *str1;
- uint32 u1;
- uint32 u2;
- uint32 u3;
- uint32 u4;
- uint32 u5;
- hyper u6;
- uint32 u7;
- } drsuapi_DsReplica06;
-
- typedef struct {
- [range(0,256)] uint32 count;
- uint32 reserved;
- [size_is(count)] drsuapi_DsReplica06 array[];
- } drsuapi_DsReplica06Ctr;
-
- typedef [switch_type(drsuapi_DsReplicaInfoType)] union {
- [case(DRSUAPI_DS_REPLICA_INFO_NEIGHBORS)] drsuapi_DsReplicaNeighbourCtr *neighbours;
- [case(DRSUAPI_DS_REPLICA_INFO_CURSORS)] drsuapi_DsReplicaCursorCtr *cursors;
- [case(DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA)] drsuapi_DsReplicaObjMetaDataCtr *objmetadata;
- [case(DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES)] drsuapi_DsReplicaKccDsaFailuresCtr *connectfailures;
- [case(DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES)] drsuapi_DsReplicaKccDsaFailuresCtr *linkfailures;
- [case(DRSUAPI_DS_REPLICA_INFO_PENDING_OPS)] drsuapi_DsReplicaOpCtr *pendingops;
- [case(DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA)] drsuapi_DsReplicaAttrValMetaDataCtr *attrvalmetadata;
- [case(DRSUAPI_DS_REPLICA_INFO_CURSORS2)] drsuapi_DsReplicaCursor2Ctr *cursors2;
- [case(DRSUAPI_DS_REPLICA_INFO_CURSORS3)] drsuapi_DsReplicaCursor3Ctr *cursors3;
- [case(DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2)] drsuapi_DsReplicaObjMetaData2Ctr *objmetadata2;
- [case(DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2)] drsuapi_DsReplicaAttrValMetaData2Ctr *attrvalmetadata2;
- [case(DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02)] drsuapi_DsReplicaNeighbourCtr *neighbours02;
- [case(DRSUAPI_DS_REPLICA_INFO_CONNECTIONS04)] drsuapi_DsReplicaConnection04Ctr *connections04;
- [case(DRSUAPI_DS_REPLICA_INFO_CURSORS05)] drsuapi_DsReplicaCursorCtrEx *cursors05;
- [case(DRSUAPI_DS_REPLICA_INFO_06)] drsuapi_DsReplica06Ctr *i06;
- } drsuapi_DsReplicaInfo;
-
- WERROR drsuapi_DsReplicaGetInfo(
- [in] policy_handle *bind_handle,
- [in] drsuapi_DsReplicaGetInfoLevel level,
- [in,ref,switch_is(level)] drsuapi_DsReplicaGetInfoRequest *req,
- [out,ref] drsuapi_DsReplicaInfoType *info_type,
- [out,ref,switch_is(*info_type)] drsuapi_DsReplicaInfo *info
- );
-
- /*****************/
- /* Function 0x14 */
- [todo] WERROR DRSUAPI_ADD_SID_HISTORY();
-
- /*****************/
- /* Function 0x15 */
-
- typedef struct {
- [range(0,10000)] uint32 num_entries;
- [size_is(num_entries)] drsuapi_DsGetMembershipsCtr1 **ctrl_array;
- } drsuapi_DsGetMemberships2Ctr1;
-
- typedef [switch_type(int32)] union {
- [case(1)] drsuapi_DsGetMembershipsCtr1 ctr1;
- } drsuapi_DsGetMemberships2Ctr;
-
- typedef struct {
- [range(1,10000)] uint32 num_req;
- [size_is(num_req)] drsuapi_DsGetMembershipsRequest1 **req_array;
- } drsuapi_DsGetMemberships2Request1;
-
- typedef [switch_type(int32)] union {
- [case(1)] drsuapi_DsGetMemberships2Request1 req1;
- } drsuapi_DsGetMemberships2Request;
-
- WERROR drsuapi_DsGetMemberships2(
- [in] policy_handle *bind_handle,
- [in] int32 level,
- [in,ref] [switch_is(level)] drsuapi_DsGetMemberships2Request *req,
- [out,ref] int32 *level_out,
- [out,ref] [switch_is(*level_out)] drsuapi_DsGetMemberships2Ctr *ctr
- );
-
-
- /*****************/
- /* Function 0x16 */
- [todo] WERROR DRSUAPI_REPLICA_VERIFY_OBJECTS();
-
- /*****************/
- /* Function 0x17 */
- [todo] WERROR DRSUAPI_GET_OBJECT_EXISTENCE();
-
- /*****************/
- /* Function 0x18 */
- typedef struct {
- WERROR error_code;
- uint32 site_cost;
- } drsuapi_DsSiteCostInfo;
-
- typedef struct {
- [range(0,10000)] uint32 num_info;
- [size_is(num_info)] drsuapi_DsSiteCostInfo *info;
- uint32 unknown;
- } drsuapi_QuerySitesByCostCtr1;
-
- typedef [switch_type(int32)] union {
- [case(1)] drsuapi_QuerySitesByCostCtr1 ctr1;
- } drsuapi_QuerySitesByCostCtr;
-
- typedef struct {
- [charset(UTF16),string] uint16 *site_from;
- [range(1,10000)] uint32 num_req;
- [size_is(num_req)] [charset(UTF16),string] uint16 **site_to;
- uint32 flags;
- } drsuapi_QuerySitesByCostRequest1;
-
- typedef [switch_type(int32)] union {
- [case(1)] drsuapi_QuerySitesByCostRequest1 req1;
- } drsuapi_QuerySitesByCostRequest;
-
- WERROR drsuapi_QuerySitesByCost(
- [in] policy_handle *bind_handle,
- [in] int32 level,
- [in,ref] [switch_is(level)] drsuapi_QuerySitesByCostRequest *req,
- [out,ref] int32 *level_out,
- [out,ref] [switch_is(*level_out)] drsuapi_QuerySitesByCostCtr *ctr
- );
-}
diff --git a/source3/librpc/idl/dssetup.idl b/source3/librpc/idl/dssetup.idl
deleted file mode 100644
index 14de9f7633..0000000000
--- a/source3/librpc/idl/dssetup.idl
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- dssetup interface definition
-*/
-
-import "misc.idl";
-
-[
- uuid("3919286a-b10c-11d0-9ba8-00c04fd92ef5"),
- version(0.0),
- endpoint("ncacn_np:[\\pipe\\lsarpc]", "ncacn_np:[\\pipe\\lsass]", "ncacn_ip_tcp:", "ncalrpc:"),
- pointer_default(unique),
- helpstring("Active Directory Setup")
-] interface dssetup
-{
- /**********************************************/
- /* Function 0x00 */
-
- typedef enum {
- DS_ROLE_STANDALONE_WORKSTATION = 0,
- DS_ROLE_MEMBER_WORKSTATION = 1,
- DS_ROLE_STANDALONE_SERVER = 2,
- DS_ROLE_MEMBER_SERVER = 3,
- DS_ROLE_BACKUP_DC = 4,
- DS_ROLE_PRIMARY_DC = 5
- } dssetup_DsRole;
-
- typedef [bitmap32bit] bitmap {
- DS_ROLE_PRIMARY_DS_RUNNING = 0x00000001,
- DS_ROLE_PRIMARY_DS_MIXED_MODE = 0x00000002,
- DS_ROLE_UPGRADE_IN_PROGRESS = 0x00000004,
- DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT = 0x01000000
- } dssetup_DsRoleFlags;
-
- typedef struct {
- dssetup_DsRole role;
- dssetup_DsRoleFlags flags;
- [charset(UTF16),string] uint16 *domain;
- [charset(UTF16),string] uint16 *dns_domain;
- [charset(UTF16),string] uint16 *forest;
- GUID domain_guid;
- } dssetup_DsRolePrimaryDomInfoBasic;
-
- typedef [v1_enum] enum {
- DS_ROLE_NOT_UPGRADING = 0,
- DS_ROLE_UPGRADING = 1
- } dssetup_DsUpgrade;
-
- typedef enum {
- DS_ROLE_PREVIOUS_UNKNOWN = 0,
- DS_ROLE_PREVIOUS_PRIMARY = 1,
- DS_ROLE_PREVIOUS_BACKUP = 2
- } dssetup_DsPrevious;
-
- typedef struct {
- dssetup_DsUpgrade upgrading;
- dssetup_DsPrevious previous_role;
- } dssetup_DsRoleUpgradeStatus;
-
- typedef enum {
- DS_ROLE_OP_IDLE = 0,
- DS_ROLE_OP_ACTIVE = 1,
- DS_ROLE_OP_NEEDS_REBOOT = 2
- } dssetup_DsRoleOp;
-
- typedef struct {
- dssetup_DsRoleOp status;
- } dssetup_DsRoleOpStatus;
-
- typedef enum {
- DS_ROLE_BASIC_INFORMATION = 1,
- DS_ROLE_UPGRADE_STATUS = 2,
- DS_ROLE_OP_STATUS = 3
- } dssetup_DsRoleInfoLevel;
-
- typedef [switch_type(dssetup_DsRoleInfoLevel)] union {
- [case(DS_ROLE_BASIC_INFORMATION)] dssetup_DsRolePrimaryDomInfoBasic basic;
- [case(DS_ROLE_UPGRADE_STATUS)] dssetup_DsRoleUpgradeStatus upgrade;
- [case(DS_ROLE_OP_STATUS)] dssetup_DsRoleOpStatus opstatus;
- } dssetup_DsRoleInfo;
-
- WERROR dssetup_DsRoleGetPrimaryDomainInformation(
- [in] dssetup_DsRoleInfoLevel level,
- [out,switch_is(level),unique] dssetup_DsRoleInfo *info
- );
-
- /*
- w2k3 has removed all the calls below from their implementation.
- These stubs are left here only as a way of documenting the names
- of the calls in case they ever turn up on the wire.
- */
- [todo] WERROR dssetup_DsRoleDnsNameToFlatName();
- [todo] WERROR dssetup_DsRoleDcAsDc();
- [todo] WERROR dssetup_DsRoleDcAsReplica();
- [todo] WERROR dssetup_DsRoleDemoteDc();
- [todo] WERROR dssetup_DsRoleGetDcOperationProgress();
- [todo] WERROR dssetup_DsRoleGetDcOperationResults();
- [todo] WERROR dssetup_DsRoleCancel();
- [todo] WERROR dssetup_DsRoleServerSaveStateForUpgrade();
- [todo] WERROR dssetup_DsRoleUpgradeDownlevelServer();
- [todo] WERROR dssetup_DsRoleAbortDownlevelServerUpgrade();
-}
diff --git a/source3/librpc/idl/echo.idl b/source3/librpc/idl/echo.idl
deleted file mode 100644
index bf1e318674..0000000000
--- a/source3/librpc/idl/echo.idl
+++ /dev/null
@@ -1,127 +0,0 @@
-
-[
- uuid("60a15ec5-4de8-11d7-a637-005056a20182"),
- endpoint("ncacn_np:[\\pipe\\rpcecho]", "ncacn_ip_tcp:", "ncalrpc:"),
- pointer_default(unique),
- version(1.0),
- helpstring("Simple echo pipe")
-]
-interface rpcecho
-{
- /* Add one to an integer */
- void echo_AddOne(
- [in] uint32 in_data,
- [out] uint32 *out_data
- );
- /* Echo an array of bytes back at the caller */
- void echo_EchoData(
- [in] uint32 len,
- [in] [size_is(len)] uint8 in_data[],
- [out] [size_is(len)] uint8 out_data[]
- );
- /* Sink data to the server */
- void echo_SinkData(
- [in] uint32 len,
- [in,size_is(len)] uint8 data[]
- );
- /* Source data from server */
- void echo_SourceData(
- [in] uint32 len,
- [out,size_is(len)] uint8 data[]
- );
-
- /* test strings */
- void echo_TestCall (
- [in,string,charset(UTF16)] uint16 *s1,
- [out,string,charset(UTF16)] uint16 **s2
- );
-
-
- /* test some alignment issues */
- typedef [public] struct {
- uint8 v;
- } echo_info1;
-
- typedef struct {
- uint16 v;
- } echo_info2;
-
- typedef struct {
- uint32 v;
- } echo_info3;
-
- struct echo_info4 {
- hyper v;
- };
-
- typedef struct {
- uint8 v1;
- hyper v2;
- } echo_info5;
-
- typedef struct {
- uint8 v1;
- echo_info1 info1;
- } echo_info6;
-
- typedef struct {
- uint8 v1;
- struct echo_info4 info4;
- } echo_info7;
-
- typedef [switch_type(uint16)] union {
- [case(1)] echo_info1 info1;
- [case(2)] echo_info2 info2;
- [case(3)] echo_info3 info3;
- [case(4)] struct echo_info4 info4;
- [case(5)] echo_info5 info5;
- [case(6)] echo_info6 info6;
- [case(7)] echo_info7 info7;
- } echo_Info;
-
- NTSTATUS echo_TestCall2 (
- [in] uint16 level,
- [out,switch_is(level)] echo_Info *info
- );
-
- uint32 echo_TestSleep(
- [in] uint32 seconds
- );
-
- typedef enum {
- ECHO_ENUM1 = 1,
- ECHO_ENUM2 = 2
- } echo_Enum1;
-
- typedef [v1_enum] enum {
- ECHO_ENUM1_32 = 1,
- ECHO_ENUM2_32 = 2
- } echo_Enum1_32;
-
- typedef struct {
- echo_Enum1 e1;
- echo_Enum1_32 e2;
- } echo_Enum2;
-
- typedef [switch_type(uint16)] union {
- [case(ECHO_ENUM1)] echo_Enum1 e1;
- [case(ECHO_ENUM2)] echo_Enum2 e2;
- } echo_Enum3;
-
- void echo_TestEnum(
- [in,out,ref] echo_Enum1 *foo1,
- [in,out,ref] echo_Enum2 *foo2,
- [in,out,ref,switch_is(*foo1)] echo_Enum3 *foo3
- );
-
- typedef struct {
- uint32 x;
- [size_is(x)] uint16 surrounding[*];
- } echo_Surrounding;
-
- void echo_TestSurrounding(
- [in,out,ref] echo_Surrounding *data
- );
-
- uint16 echo_TestDoublePointer([in] uint16 ***data);
-}
diff --git a/source3/librpc/idl/epmapper.idl b/source3/librpc/idl/epmapper.idl
deleted file mode 100644
index 2cbe3e1f02..0000000000
--- a/source3/librpc/idl/epmapper.idl
+++ /dev/null
@@ -1,305 +0,0 @@
-#include "idl_types.h"
-
-/*
- endpoint mapper interface
- Related links:
- http://www.opengroup.org/onlinepubs/9629399/apdxo.htm : The official IDL for this pipe
- http://www.opengroup.org/onlinepubs/9629399/apdxl.htm : Details on towers
-http://www.opengroup.org/onlinepubs/9629399/chap6.htm#tagcjh_11_02_03_01: binding strings
-
-*/
-
-import "misc.idl";
-
-[
- uuid("e1af8308-5d1f-11c9-91a4-08002b14a0fa"),
- version(3.0),
- endpoint("ncacn_np:[\\pipe\\epmapper]", "ncacn_ip_tcp:[135]",
- "ncalrpc:[EPMAPPER]"),
- helpstring("EndPoint Mapper"),
- pointer_default(ptr)
-]
-interface epmapper
-{
-
- /*
- note that the following IDL won't work in MIDL, and in fact
- that the full towers/floors representation of epm cannot be
- represented in MIDL at all. I decided to represent it using
- the extended IDL syntax in pidl to make it easier to work
- with.
- */
-
- const int EPMAPPER_STATUS_NO_MORE_ENTRIES = 0x16c9a0d6;
- const int EPMAPPER_STATUS_NO_MEMORY = 0x16C9A012;
- const int EPMAPPER_STATUS_OK = 0;
-
-
-
- typedef [enum8bit] enum {
-
- /* Level 4 and higher */
- EPM_PROTOCOL_DNET_NSP = 0x04,
- EPM_PROTOCOL_OSI_TP4 = 0x05,
- EPM_PROTOCOL_OSI_CLNS = 0x06,
- EPM_PROTOCOL_TCP = 0x07,
- EPM_PROTOCOL_UDP = 0x08,
- EPM_PROTOCOL_IP = 0x09,
- /* These 4 are protocol identifiers, always at level 3 or lower */
- EPM_PROTOCOL_NCADG = 0x0a, /* Connectionless RPC */
- EPM_PROTOCOL_NCACN = 0x0b,
- EPM_PROTOCOL_NCALRPC = 0x0c, /* Local RPC */
- EPM_PROTOCOL_UUID = 0x0d,
- EPM_PROTOCOL_IPX = 0x0e,
- EPM_PROTOCOL_SMB = 0x0f,
- EPM_PROTOCOL_PIPE = 0x10,
- EPM_PROTOCOL_NETBIOS = 0x11,
- EPM_PROTOCOL_NETBEUI = 0x12,
- EPM_PROTOCOL_SPX = 0x13,
- EPM_PROTOCOL_NB_IPX = 0x14, /* NetBIOS over IPX */
- EPM_PROTOCOL_DSP = 0x16, /* AppleTalk Data Stream Protocol */
- EPM_PROTOCOL_DDP = 0x17, /* AppleTalk Data Datagram Protocol */
- EPM_PROTOCOL_APPLETALK = 0x18, /* AppleTalk */
- EPM_PROTOCOL_VINES_SPP = 0x1a,
- EPM_PROTOCOL_VINES_IPC = 0x1b, /* Inter Process Communication */
- EPM_PROTOCOL_STREETTALK = 0x1c, /* Vines Streettalk */
- EPM_PROTOCOL_HTTP = 0x1f,
- EPM_PROTOCOL_UNIX_DS = 0x20, /* Unix domain socket */
- EPM_PROTOCOL_NULL = 0x21
- } epm_protocol;
-
- typedef struct {
- /*FIXME */
- } epm_rhs_dnet_nsp;
-
- typedef struct {
- /*FIXME*/
- } epm_rhs_osi_tp4;
-
- typedef struct {
- /*FIXME*/
- } epm_rhs_osi_clns;
-
- typedef struct {
- uint16 port;
- } epm_rhs_udp;
-
- typedef struct {
- uint16 port;
- } epm_rhs_tcp;
-
- typedef struct {
- ipv4address ipaddr;
- } epm_rhs_ip;
-
- typedef struct {
- uint16 minor_version;
- } epm_rhs_ncadg;
-
- typedef struct {
- uint16 minor_version;
- } epm_rhs_ncacn;
-
- typedef struct {
- [flag(NDR_REMAINING)] DATA_BLOB unknown;
- } epm_rhs_uuid;
-
- typedef struct {
- /*FIXME */
- } epm_rhs_ipx;
-
- typedef struct {
- astring unc;
- } epm_rhs_smb;
-
- typedef struct {
- astring path;
- } epm_rhs_pipe;
-
- typedef struct {
- astring name;
- } epm_rhs_netbios;
-
- typedef struct {
- } epm_rhs_netbeui;
-
- typedef struct {
- } epm_rhs_spx;
-
- typedef struct {
- } epm_rhs_nb_ipx;
-
- typedef struct {
- uint16 port;
- } epm_rhs_http;
-
- typedef struct {
- astring path;
- } epm_rhs_unix_ds;
-
- typedef struct {
- } epm_rhs_null;
-
- typedef struct {
- uint16 minor_version;
- } epm_rhs_ncalrpc;
-
- typedef struct {
- } epm_rhs_appletalk;
-
- typedef struct {
- } epm_rhs_atalk_stream;
-
- typedef struct {
- } epm_rhs_atalk_datagram;
-
- typedef struct {
- uint16 port;
- } epm_rhs_vines_spp;
-
- typedef struct {
- uint16 port;
- } epm_rhs_vines_ipc;
-
- typedef struct {
- astring streettalk;
- } epm_rhs_streettalk;
-
- typedef [flag(NDR_BIG_ENDIAN),nodiscriminant] union {
- [case(EPM_PROTOCOL_DNET_NSP)] epm_rhs_dnet_nsp dnet_nsp;
- [case(EPM_PROTOCOL_OSI_TP4)] epm_rhs_osi_tp4 osi_tp4;
- [case(EPM_PROTOCOL_OSI_CLNS)] epm_rhs_osi_clns osi_clns;
- [case(EPM_PROTOCOL_TCP)] epm_rhs_tcp tcp;
- [case(EPM_PROTOCOL_UDP)] epm_rhs_udp udp;
- [case(EPM_PROTOCOL_IP)] epm_rhs_ip ip;
- [case(EPM_PROTOCOL_NCADG)] epm_rhs_ncadg ncadg;
- [case(EPM_PROTOCOL_NCACN)] epm_rhs_ncacn ncacn;
- [case(EPM_PROTOCOL_NCALRPC)] epm_rhs_ncalrpc ncalrpc;
- [case(EPM_PROTOCOL_UUID)] epm_rhs_uuid uuid;
- [case(EPM_PROTOCOL_IPX)] epm_rhs_ipx ipx;
- [case(EPM_PROTOCOL_SMB)] epm_rhs_smb smb;
- [case(EPM_PROTOCOL_PIPE)] epm_rhs_pipe pipe;
- [case(EPM_PROTOCOL_NETBIOS)] epm_rhs_netbios netbios;
- [case(EPM_PROTOCOL_NETBEUI)] epm_rhs_netbeui netbeui;
- [case(EPM_PROTOCOL_SPX)] epm_rhs_spx spx;
- [case(EPM_PROTOCOL_NB_IPX)] epm_rhs_nb_ipx nb_ipx;
- [case(EPM_PROTOCOL_DSP)] epm_rhs_atalk_stream atalk_stream;
- [case(EPM_PROTOCOL_DDP)] epm_rhs_atalk_datagram atalk_datagram;
- [case(EPM_PROTOCOL_APPLETALK)] epm_rhs_appletalk appletalk;
- [case(EPM_PROTOCOL_VINES_SPP)] epm_rhs_vines_spp vines_spp;
- [case(EPM_PROTOCOL_VINES_IPC)] epm_rhs_vines_ipc vines_ipc;
- [case(EPM_PROTOCOL_STREETTALK)] epm_rhs_streettalk streettalk;
- [case(EPM_PROTOCOL_HTTP)] epm_rhs_http http;
- [case(EPM_PROTOCOL_UNIX_DS)] epm_rhs_unix_ds unix_ds;
- [case(EPM_PROTOCOL_NULL)] epm_rhs_null null;
- [default] [flag(NDR_REMAINING)] DATA_BLOB unknown;
- } epm_rhs;
-
- typedef struct {
- epm_protocol protocol;
- [flag(NDR_REMAINING)] DATA_BLOB lhs_data;
- } epm_lhs;
-
- typedef struct {
- [subcontext(2)] epm_lhs lhs;
- [subcontext(2),switch_is(lhs.protocol)] epm_rhs rhs;
- } epm_floor;
-
- /* note that the NDR_NOALIGN flag is inherited by all nested
- structures. All of the towers/floors stuff is
- non-aligned. I wonder what sort of wicked substance these
- guys were smoking?
- */
- typedef [gensize,flag(NDR_NOALIGN|NDR_LITTLE_ENDIAN)] struct {
- uint16 num_floors;
- epm_floor floors[num_floors];
- } epm_tower;
-
- typedef struct {
- [value(ndr_size_epm_tower(&tower, ndr->flags))] uint32 tower_length;
- [subcontext(4)] epm_tower tower;
- } epm_twr_t;
-
- typedef struct {
- GUID object;
- epm_twr_t *tower;
- ascstr2 annotation;
- } epm_entry_t;
-
- typedef struct {
- GUID uuid;
- uint16 vers_major;
- uint16 vers_minor;
- } rpc_if_id_t;
-
- /**********************/
- /* Function 0x0 */
- error_status_t epm_Insert(
- [in] uint32 num_ents,
- [in,size_is(num_ents)] epm_entry_t entries[],
- [in] uint32 replace
- );
-
- /**********************/
- /* Function 0x1 */
- error_status_t epm_Delete(
- [in] uint32 num_ents,
- [in, size_is(num_ents)] epm_entry_t entries[]
- );
-
- /**********************/
- /* Function 0x02 */
- error_status_t epm_Lookup(
- [in] uint32 inquiry_type,
- [in,ptr] GUID *object,
- [in,ptr] rpc_if_id_t *interface_id,
- [in] uint32 vers_option,
- [in,out] policy_handle *entry_handle,
- [in] uint32 max_ents,
- [out] uint32 *num_ents,
- [out, length_is(*num_ents), size_is(max_ents)] epm_entry_t entries[]
- );
-
-
- /**********************/
- /* Function 0x03 */
-
- typedef struct {
- epm_twr_t *twr;
- } epm_twr_p_t;
-
- [public] error_status_t epm_Map(
- [in,ptr] GUID *object,
- [in,ptr] epm_twr_t *map_tower,
- [in,out] policy_handle *entry_handle,
- [in] uint32 max_towers,
- [out] uint32 *num_towers,
- [out, length_is(*num_towers), size_is(max_towers)] epm_twr_p_t towers[]
- );
-
-
- /**********************/
- /* Function 0x04 */
- error_status_t epm_LookupHandleFree(
- [in,out] policy_handle *entry_handle
- );
-
- /**********************/
- /* Function 0x05 */
- error_status_t epm_InqObject(
- [in] GUID *epm_object
- );
-
-
- /**********************/
- /* Function 0x06 */
- error_status_t epm_MgmtDelete(
- [in] uint32 object_speced,
- [in,ptr] GUID *object,
- [in,ptr] epm_twr_t *tower
- );
-
- /**********************/
- /* Function 0x07 */
- [todo] error_status_t epm_MapAuth();
-}
diff --git a/source3/librpc/idl/eventlog.idl b/source3/librpc/idl/eventlog.idl
deleted file mode 100644
index ce25dd65ff..0000000000
--- a/source3/librpc/idl/eventlog.idl
+++ /dev/null
@@ -1,181 +0,0 @@
-#include "idl_types.h"
-
-/*
- eventlog interface definition
-*/
-
-import "lsa.idl", "security.idl";
-
-[ uuid("82273fdc-e32a-18c3-3f78-827929dc23ea"),
- version(0.0),
- helpstring("Event Logger")
-] interface eventlog
-{
- typedef bitmap {
- EVENTLOG_SEQUENTIAL_READ = 0x0001,
- EVENTLOG_SEEK_READ = 0x0002,
- EVENTLOG_FORWARDS_READ = 0x0004,
- EVENTLOG_BACKWARDS_READ = 0x0008
- } eventlogReadFlags;
-
- typedef bitmap {
- EVENTLOG_SUCCESS = 0x0000,
- EVENTLOG_ERROR_TYPE = 0x0001,
- EVENTLOG_WARNING_TYPE = 0x0002,
- EVENTLOG_INFORMATION_TYPE = 0x0004,
- EVENTLOG_AUDIT_SUCCESS = 0x0008,
- EVENTLOG_AUDIT_FAILURE = 0x0010
- } eventlogEventTypes;
-
- typedef struct {
- uint16 unknown0;
- uint16 unknown1;
- } eventlog_OpenUnknown0;
-
- typedef [public] struct {
- uint32 size;
- uint32 reserved;
- uint32 record_number;
- uint32 time_generated;
- uint32 time_written;
- uint32 event_id;
- uint16 event_type;
- uint16 num_of_strings;
- uint16 event_category;
- uint16 reserved_flags;
- uint32 closing_record_number;
- uint32 stringoffset;
- uint32 sid_length;
- uint32 sid_offset;
- uint32 data_length;
- uint32 data_offset;
- nstring source_name;
- nstring computer_name;
- nstring strings[num_of_strings];
- astring raw_data;
- } eventlog_Record;
-
- /******************/
- /* Function: 0x00 */
- NTSTATUS eventlog_ClearEventLogW(
- [in] policy_handle *handle,
- [in,unique] lsa_String *backupfile
- );
-
- /******************/
- /* Function: 0x01 */
- [todo] NTSTATUS eventlog_BackupEventLogW();
-
- /******************/
- /* Function: 0x02 */
- NTSTATUS eventlog_CloseEventLog(
- [in,out] policy_handle *handle
- );
-
- /******************/
- /* Function: 0x03 */
- [todo] NTSTATUS eventlog_DeregisterEventSource();
-
- /******************/
- /* Function: 0x04 */
- NTSTATUS eventlog_GetNumRecords(
- [in] policy_handle *handle,
- [out] uint32 *number
- );
-
- /******************/
- /* Function: 0x05 */
- NTSTATUS eventlog_GetOldestRecord(
- [in] policy_handle *handle,
- [out,ref] uint32 *oldest_entry
- );
-
- /******************/
- /* Function: 0x06 */
- [todo] NTSTATUS eventlog_ChangeNotify();
-
- /******************/
- /* Function: 0x07 */
- NTSTATUS eventlog_OpenEventLogW(
- [in,unique] eventlog_OpenUnknown0 *unknown0,
- [in,ref] lsa_String *logname,
- [in,ref] lsa_String *servername,
- [in] uint32 unknown2,
- [in] uint32 unknown3,
- [out] policy_handle *handle
- );
-
- /******************/
- /* Function: 0x08 */
- [todo] NTSTATUS eventlog_RegisterEventSourceW();
-
- /******************/
- /* Function: 0x09 */
- [todo] NTSTATUS eventlog_OpenBackupEventLogW();
-
- /******************/
- /* Function: 0x0a */
- NTSTATUS eventlog_ReadEventLogW(
- [in] policy_handle *handle,
- [in] uint32 flags,
- [in] uint32 offset,
- [in] [range(0,0x7FFFF)] uint32 number_of_bytes,
- [out,ref,size_is(number_of_bytes)] uint8 *data,
- [out,ref] uint32 *sent_size,
- [out,ref] uint32 *real_size
- );
-
- /*****************/
- /* Function 0x0b */
- [todo] NTSTATUS eventlog_ReportEventW();
-
- /*****************/
- /* Function 0x0c */
- [todo] NTSTATUS eventlog_ClearEventLogA();
-
- /******************/
- /* Function: 0x0d */
- [todo] NTSTATUS eventlog_BackupEventLogA();
-
- /*****************/
- /* Function 0x0e */
- [todo] NTSTATUS eventlog_OpenEventLogA();
-
- /*****************/
- /* Function 0x0f */
- [todo] NTSTATUS eventlog_RegisterEventSourceA();
-
- /*****************/
- /* Function 0x10 */
- [todo] NTSTATUS eventlog_OpenBackupEventLogA();
-
- /*****************/
- /* Function 0x11 */
- [todo] NTSTATUS eventlog_ReadEventLogA();
-
- /*****************/
- /* Function 0x12 */
- [todo] NTSTATUS eventlog_ReportEventA();
-
- /*****************/
- /* Function 0x13 */
- [todo] NTSTATUS eventlog_RegisterClusterSvc();
-
- /*****************/
- /* Function 0x14 */
- [todo] NTSTATUS eventlog_DeregisterClusterSvc();
-
- /*****************/
- /* Function 0x15 */
- [todo] NTSTATUS eventlog_WriteClusterEvents();
-
- /*****************/
- /* Function 0x16 */
- [todo] NTSTATUS eventlog_GetLogIntormation();
-
- /*****************/
- /* Function 0x17 */
- NTSTATUS eventlog_FlushEventLog(
- [in] policy_handle *handle
- );
-}
diff --git a/source3/librpc/idl/idl_types.h b/source3/librpc/idl/idl_types.h
deleted file mode 100644
index f21f3e660d..0000000000
--- a/source3/librpc/idl/idl_types.h
+++ /dev/null
@@ -1,86 +0,0 @@
-#define STR_ASCII LIBNDR_FLAG_STR_ASCII
-#define STR_LEN4 LIBNDR_FLAG_STR_LEN4
-#define STR_SIZE4 LIBNDR_FLAG_STR_SIZE4
-#define STR_SIZE2 LIBNDR_FLAG_STR_SIZE2
-#define STR_NOTERM LIBNDR_FLAG_STR_NOTERM
-#define STR_NULLTERM LIBNDR_FLAG_STR_NULLTERM
-#define STR_BYTESIZE LIBNDR_FLAG_STR_BYTESIZE
-#define STR_FIXLEN32 LIBNDR_FLAG_STR_FIXLEN32
-#define STR_FIXLEN15 LIBNDR_FLAG_STR_FIXLEN15
-#define STR_CONFORMANT LIBNDR_FLAG_STR_CONFORMANT
-#define STR_CHARLEN LIBNDR_FLAG_STR_CHARLEN
-#define STR_UTF8 LIBNDR_FLAG_STR_UTF8
-
-/*
- a UCS2 string prefixed with [size], 32 bits
-*/
-#define lstring [flag(STR_SIZE4)] string
-
-/*
- a null terminated UCS2 string
-*/
-#define nstring [flag(STR_NULLTERM)] string
-
-/*
- fixed length 32 character UCS-2 string
-*/
-#define string32 [flag(STR_FIXLEN32)] string
-
-/*
- fixed length 16 character ascii string
-*/
-#define astring15 [flag(STR_ASCII|STR_FIXLEN15)] string
-
-/*
- an ascii string prefixed with [offset] [length], both 32 bits
- null terminated
-*/
-#define ascstr2 [flag(STR_ASCII|STR_LEN4)] string
-
-/*
- an ascii string prefixed with [size], 32 bits
-*/
-#define asclstr [flag(STR_ASCII|STR_SIZE4)] string
-
-/*
- an ascii string prefixed with [size], 16 bits
- null terminated
-*/
-#define ascstr3 [flag(STR_ASCII|STR_SIZE2)] string
-
-/*
- an ascii string prefixed with [size] [offset] [length], all 32 bits
- not null terminated
-*/
-#define ascstr_noterm [flag(STR_NOTERM|STR_ASCII|STR_SIZE4|STR_LEN4)] string
-
-/*
- a null terminated ascii string
-*/
-#define astring [flag(STR_ASCII|STR_NULLTERM)] string
-
-/*
- a null terminated UTF8 string
-*/
-#define utf8string [flag(STR_UTF8|STR_NULLTERM)] string
-
-/*
- a null terminated UCS2 string
-*/
-#define nstring_array [flag(STR_NULLTERM)] string_array
-
-#define NDR_NOALIGN LIBNDR_FLAG_NOALIGN
-#define NDR_REMAINING LIBNDR_FLAG_REMAINING
-#define NDR_ALIGN2 LIBNDR_FLAG_ALIGN2
-#define NDR_ALIGN4 LIBNDR_FLAG_ALIGN4
-#define NDR_ALIGN8 LIBNDR_FLAG_ALIGN8
-
-/* this flag is used to force a section of IDL as little endian. It is
- needed for the epmapper IDL, which is defined as always being LE */
-#define NDR_LITTLE_ENDIAN LIBNDR_FLAG_LITTLE_ENDIAN
-#define NDR_BIG_ENDIAN LIBNDR_FLAG_BIGENDIAN
-
-/*
- this is used to control formatting of uint8 arrays
-*/
-#define NDR_PAHEX LIBNDR_PRINT_ARRAY_HEX
diff --git a/source3/librpc/idl/initshutdown.idl b/source3/librpc/idl/initshutdown.idl
deleted file mode 100644
index dfc52714c4..0000000000
--- a/source3/librpc/idl/initshutdown.idl
+++ /dev/null
@@ -1,48 +0,0 @@
-#include "idl_types.h"
-
-/*
- initshutdown interface definition
-*/
-
-import "lsa.idl";
-
-[
- uuid("894de0c0-0d55-11d3-a322-00c04fa321a1"),
- version(1.0),
- endpoint("ncacn_np:[\\pipe\\InitShutdown]"),
- pointer_default(unique),
- helpstring("Init shutdown service")
-] interface initshutdown
-{
- typedef struct {
- [value(strlen_m_term(name))] uint32 name_size;
- [flag(STR_LEN4|STR_NOTERM)] string name;
- } initshutdown_String_sub;
-
- typedef [public] struct {
- [value(strlen_m(name->name)*2)] uint16 name_len;
- [value(strlen_m_term(name->name)*2)] uint16 name_size;
- initshutdown_String_sub *name;
- } initshutdown_String;
-
- WERROR initshutdown_Init(
- [in,unique] uint16 *hostname,
- [in,unique] initshutdown_String *message,
- [in] uint32 timeout,
- [in] uint8 force_apps,
- [in] uint8 do_reboot
- );
-
- WERROR initshutdown_Abort(
- [in,unique] uint16 *server
- );
-
- WERROR initshutdown_InitEx(
- [in,unique] uint16 *hostname,
- [in,unique] initshutdown_String *message,
- [in] uint32 timeout,
- [in] uint8 force_apps,
- [in] uint8 do_reboot,
- [in] uint32 reason
- );
-}
diff --git a/source3/librpc/idl/lsa.idl b/source3/librpc/idl/lsa.idl
index ff4aafa0bd..98c27cb717 100644
--- a/source3/librpc/idl/lsa.idl
+++ b/source3/librpc/idl/lsa.idl
@@ -14,6 +14,7 @@ import "misc.idl", "security.idl";
] interface lsarpc
{
typedef bitmap security_secinfo security_secinfo;
+ typedef bitmap kerb_EncTypes kerb_EncTypes;
typedef [public,noejs] struct {
[value(2*strlen_m(string))] uint16 length;
@@ -224,7 +225,7 @@ import "misc.idl", "security.idl";
typedef struct {
hyper modified_id;
- NTTIME db_create_time;
+ NTTIME_hyper db_create_time;
} lsa_ModificationInfo;
typedef struct {
@@ -263,7 +264,8 @@ import "misc.idl", "security.idl";
LSA_POLICY_INFO_DB=9,
LSA_POLICY_INFO_AUDIT_FULL_SET=10,
LSA_POLICY_INFO_AUDIT_FULL_QUERY=11,
- LSA_POLICY_INFO_DNS=12
+ LSA_POLICY_INFO_DNS=12,
+ LSA_POLICY_INFO_DNS_INT=13
} lsa_PolicyInfo;
typedef [switch_type(uint16)] union {
@@ -279,6 +281,7 @@ import "misc.idl", "security.idl";
[case(LSA_POLICY_INFO_AUDIT_FULL_SET)] lsa_AuditFullSetInfo auditfullset;
[case(LSA_POLICY_INFO_AUDIT_FULL_QUERY)] lsa_AuditFullQueryInfo auditfullquery;
[case(LSA_POLICY_INFO_DNS)] lsa_DnsDomainInfo dns;
+ [case(LSA_POLICY_INFO_DNS_INT)] lsa_DnsDomainInfo dns;
} lsa_PolicyInformation;
NTSTATUS lsa_QueryInfoPolicy(
@@ -409,7 +412,8 @@ import "misc.idl", "security.idl";
LSA_LOOKUP_NAMES_PRIMARY_DOMAIN_ONLY = 3,
LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY = 4,
LSA_LOOKUP_NAMES_FOREST_TRUSTS_ONLY = 5,
- LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2 = 6
+ LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2 = 6,
+ LSA_LOOKUP_NAMES_RODC_REFERRAL_TO_FULL_DC = 7
} lsa_LookupNamesLevel;
[public] NTSTATUS lsa_LookupNames (
@@ -543,22 +547,53 @@ import "misc.idl", "security.idl";
} lsa_DATA_BUF2;
typedef enum {
- LSA_TRUSTED_DOMAIN_INFO_NAME = 1,
- LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS_INFO = 2,
- LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET = 3,
- LSA_TRUSTED_DOMAIN_INFO_PASSWORD = 4,
- LSA_TRUSTED_DOMAIN_INFO_BASIC = 5,
- LSA_TRUSTED_DOMAIN_INFO_INFO_EX = 6,
- LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO = 7,
- LSA_TRUSTED_DOMAIN_INFO_FULL_INFO = 8,
- LSA_TRUSTED_DOMAIN_INFO_11 = 11,
- LSA_TRUSTED_DOMAIN_INFO_INFO_ALL = 12
+ LSA_TRUSTED_DOMAIN_INFO_NAME = 1,
+ LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS = 2,
+ LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET = 3,
+ LSA_TRUSTED_DOMAIN_INFO_PASSWORD = 4,
+ LSA_TRUSTED_DOMAIN_INFO_BASIC = 5,
+ LSA_TRUSTED_DOMAIN_INFO_INFO_EX = 6,
+ LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO = 7,
+ LSA_TRUSTED_DOMAIN_INFO_FULL_INFO = 8,
+ LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL = 9,
+ LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL = 10,
+ LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL = 11,
+ LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL = 12,
+ LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES = 13
} lsa_TrustDomInfoEnum;
+ typedef [public,bitmap32bit] bitmap {
+ LSA_TRUST_DIRECTION_INBOUND = 0x00000001,
+ LSA_TRUST_DIRECTION_OUTBOUND = 0x00000002
+ } lsa_TrustDirection;
+
+ typedef [v1_enum] enum {
+ LSA_TRUST_TYPE_DOWNLEVEL = 0x00000001,
+ LSA_TRUST_TYPE_UPLEVEL = 0x00000002,
+ LSA_TRUST_TYPE_MIT = 0x00000003
+ } lsa_TrustType;
+
+ typedef [public,bitmap32bit] bitmap {
+ LSA_TRUST_ATTRIBUTE_NON_TRANSITIVE = 0x00000001,
+ LSA_TRUST_ATTRIBUTE_UPLEVEL_ONLY = 0x00000002,
+ LSA_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN = 0x00000004,
+ LSA_TRUST_ATTRIBUTE_FOREST_TRANSITIVE = 0x00000008,
+ LSA_TRUST_ATTRIBUTE_CROSS_ORGANIZATION = 0x00000010,
+ LSA_TRUST_ATTRIBUTE_WITHIN_FOREST = 0x00000020,
+ LSA_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL = 0x00000040,
+ LSA_TRUST_ATTRIBUTE_USES_RC4_ENCRYPTION = 0x00000080
+ } lsa_TrustAttributes;
+
typedef struct {
lsa_StringLarge netbios_name;
} lsa_TrustDomainInfoName;
+
+ typedef struct {
+ uint32 entries;
+ [size_is(entries)] lsa_StringLarge *netbios_names;
+ } lsa_TrustDomainInfoControllers;
+
typedef struct {
uint32 posix_offset;
} lsa_TrustDomainInfoPosixOffset;
@@ -576,15 +611,22 @@ import "misc.idl", "security.idl";
typedef struct {
lsa_StringLarge domain_name;
lsa_StringLarge netbios_name;
- dom_sid2 *sid;
- uint32 trust_direction;
- uint32 trust_type;
- uint32 trust_attributes;
+ dom_sid2 *sid;
+ lsa_TrustDirection trust_direction;
+ lsa_TrustType trust_type;
+ lsa_TrustAttributes trust_attributes;
} lsa_TrustDomainInfoInfoEx;
+ typedef [public,v1_enum] enum {
+ TRUST_AUTH_TYPE_NONE = 0,
+ TRUST_AUTH_TYPE_NT4OWF = 1,
+ TRUST_AUTH_TYPE_CLEAR = 2,
+ TRUST_AUTH_TYPE_VERSION = 3
+ } lsa_TrustAuthType;
+
typedef struct {
NTTIME_hyper last_update_time;
- uint32 secret_type;
+ lsa_TrustAuthType AuthType;
lsa_DATA_BUF2 data;
} lsa_TrustDomainInfoBuffer;
@@ -604,27 +646,58 @@ import "misc.idl", "security.idl";
} lsa_TrustDomainInfoFullInfo;
typedef struct {
- lsa_TrustDomainInfoInfoEx info_ex;
- lsa_DATA_BUF2 data1;
- } lsa_TrustDomainInfo11;
+ lsa_DATA_BUF2 auth_blob;
+ } lsa_TrustDomainInfoAuthInfoInternal;
+
+ typedef struct {
+ lsa_TrustDomainInfoInfoEx info_ex;
+ lsa_TrustDomainInfoPosixOffset posix_offset;
+ lsa_TrustDomainInfoAuthInfoInternal auth_info;
+ } lsa_TrustDomainInfoFullInfoInternal;
typedef struct {
lsa_TrustDomainInfoInfoEx info_ex;
- lsa_DATA_BUF2 data1;
+ uint32 forest_trust_length;
+ [size_is(forest_trust_length)] uint8 *forest_trust_data;
+ } lsa_TrustDomainInfoInfoEx2Internal;
+
+ typedef struct {
+ lsa_TrustDomainInfoInfoEx2Internal info;
lsa_TrustDomainInfoPosixOffset posix_offset;
lsa_TrustDomainInfoAuthInfo auth_info;
- } lsa_TrustDomainInfoInfoAll;
+ } lsa_TrustDomainInfoFullInfo2Internal;
+
+ typedef struct {
+ kerb_EncTypes enc_types;
+ } lsa_TrustDomainInfoSupportedEncTypes;
typedef [switch_type(lsa_TrustDomInfoEnum)] union {
- [case(LSA_TRUSTED_DOMAIN_INFO_NAME)] lsa_TrustDomainInfoName name;
- [case(LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET)] lsa_TrustDomainInfoPosixOffset posix_offset;
- [case(LSA_TRUSTED_DOMAIN_INFO_PASSWORD)] lsa_TrustDomainInfoPassword password;
- [case(LSA_TRUSTED_DOMAIN_INFO_BASIC)] lsa_TrustDomainInfoBasic info_basic;
- [case(LSA_TRUSTED_DOMAIN_INFO_INFO_EX)] lsa_TrustDomainInfoInfoEx info_ex;
- [case(LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO)] lsa_TrustDomainInfoAuthInfo auth_info;
- [case(LSA_TRUSTED_DOMAIN_INFO_FULL_INFO)] lsa_TrustDomainInfoFullInfo full_info;
- [case(LSA_TRUSTED_DOMAIN_INFO_11)] lsa_TrustDomainInfo11 info11;
- [case(LSA_TRUSTED_DOMAIN_INFO_INFO_ALL)] lsa_TrustDomainInfoInfoAll info_all;
+ [case(LSA_TRUSTED_DOMAIN_INFO_NAME)]
+ lsa_TrustDomainInfoName name;
+ [case(LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS)]
+ lsa_TrustDomainInfoControllers controllers;
+ [case(LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET)]
+ lsa_TrustDomainInfoPosixOffset posix_offset;
+ [case(LSA_TRUSTED_DOMAIN_INFO_PASSWORD)]
+ lsa_TrustDomainInfoPassword password;
+ [case(LSA_TRUSTED_DOMAIN_INFO_BASIC)]
+ lsa_TrustDomainInfoBasic info_basic;
+ [case(LSA_TRUSTED_DOMAIN_INFO_INFO_EX)]
+ lsa_TrustDomainInfoInfoEx info_ex;
+ [case(LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO)]
+ lsa_TrustDomainInfoAuthInfo auth_info;
+ [case(LSA_TRUSTED_DOMAIN_INFO_FULL_INFO)]
+ lsa_TrustDomainInfoFullInfo full_info;
+ [case(LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL)]
+ lsa_TrustDomainInfoAuthInfoInternal auth_info_internal;
+ [case(LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL)]
+ lsa_TrustDomainInfoFullInfoInternal full_info_internal;
+ [case(LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL)]
+ lsa_TrustDomainInfoInfoEx2Internal info_ex2_internal;
+ [case(LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL)]
+ lsa_TrustDomainInfoFullInfo2Internal full_info2_internal;
+ [case(LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES)]
+ lsa_TrustDomainInfoSupportedEncTypes enc_types;
} lsa_TrustedDomainInfo;
/* Function: 0x1a */
@@ -635,7 +708,11 @@ import "misc.idl", "security.idl";
);
/* Function: 0x1b */
- NTSTATUS lsa_SetInformationTrustedDomain();
+ NTSTATUS lsa_SetInformationTrustedDomain(
+ [in] policy_handle *trustdom_handle,
+ [in] lsa_TrustDomInfoEnum level,
+ [in,switch_is(level)] lsa_TrustedDomainInfo *info
+ );
/* Function: 0x1c */
[public] NTSTATUS lsa_OpenSecret(
@@ -696,10 +773,11 @@ import "misc.idl", "security.idl";
);
/* Function: 0x22 */
- NTSTATUS lsa_DeleteObject(
- [in,out] policy_handle *handle
+ NTSTATUS lsa_DeleteObject (
+ [in,out] policy_handle *handle
);
+
/*******************/
/* Function: 0x23 */
NTSTATUS lsa_EnumAccountsWithUserRight (
@@ -732,7 +810,7 @@ import "misc.idl", "security.idl";
[in,ref] dom_sid2 *sid,
[in,ref] lsa_RightSet *rights
);
-
+
/**********************/
/* Function: 0x26 */
NTSTATUS lsa_RemoveAccountRights (
@@ -751,7 +829,13 @@ import "misc.idl", "security.idl";
);
/* Function: 0x28 */
- NTSTATUS lsa_SetTrustedDomainInfo();
+ NTSTATUS lsa_SetTrustedDomainInfo(
+ [in] policy_handle *handle,
+ [in] dom_sid2 *dom_sid,
+ [in] lsa_TrustDomInfoEnum level,
+ [in,switch_is(level)] lsa_TrustedDomainInfo *info
+ );
+
/* Function: 0x29 */
NTSTATUS lsa_DeleteTrustedDomain(
[in] policy_handle *handle,
@@ -832,9 +916,15 @@ import "misc.idl", "security.idl";
[in] uint32 max_size
);
-
/* Function 0x33 */
- NTSTATUS lsa_CreateTrustedDomainEx();
+ NTSTATUS lsa_CreateTrustedDomainEx(
+ [in] policy_handle *policy_handle,
+ [in] lsa_TrustDomainInfoInfoEx *info,
+ [in] lsa_TrustDomainInfoAuthInfoInternal *auth_info,
+ [in] uint32 access_mask,
+ [out] policy_handle *trustdom_handle
+ );
+
/* Function 0x34 */
NTSTATUS lsa_CloseTrustedDomainEx(
@@ -943,12 +1033,18 @@ import "misc.idl", "security.idl";
[in,out,ref] lsa_TransSidArray2 *sids,
[in] lsa_LookupNamesLevel level,
[in,out,ref] uint32 *count,
- [in] uint32 unknown1,
- [in] uint32 unknown2
+ [in] uint32 lookup_options,
+ [in] uint32 client_revision /* LSA_CLIENT_REVISION* */
);
/* Function 0x3b */
- NTSTATUS lsa_CreateTrustedDomainEx2();
+ NTSTATUS lsa_CreateTrustedDomainEx2(
+ [in] policy_handle *policy_handle,
+ [in] lsa_TrustDomainInfoInfoEx *info,
+ [in] lsa_TrustDomainInfoAuthInfoInternal *auth_info,
+ [in] uint32 access_mask,
+ [out] policy_handle *trustdom_handle
+ );
/* Function 0x3c */
[todo] NTSTATUS lsa_CREDRWRITE();
@@ -980,7 +1076,7 @@ import "misc.idl", "security.idl";
lsa_SidType sid_type;
dom_sid2 *sid;
uint32 sid_index;
- uint32 unknown;
+ uint32 flags;
} lsa_TranslatedSid3;
typedef struct {
@@ -996,8 +1092,8 @@ import "misc.idl", "security.idl";
[in,out,ref] lsa_TransSidArray3 *sids,
[in] lsa_LookupNamesLevel level,
[in,out,ref] uint32 *count,
- [in] uint32 unknown1,
- [in] uint32 unknown2
+ [in] uint32 lookup_options,
+ [in] uint32 client_revision /* LSA_CLIENT_REVISION* */
);
/* Function 0x45 */
@@ -1076,6 +1172,11 @@ import "misc.idl", "security.idl";
[in] uint32 unknown2
);
+ const int LSA_CLIENT_REVISION_NO_DNS = 0x00000001;
+ const int LSA_CLIENT_REVISION_DNS = 0x00000002;
+
+ const int LSA_LOOKUP_OPTIONS_NO_ISOLATED = 0x80000000;
+
/* Function 0x4d */
NTSTATUS lsa_LookupNames4(
[in,range(0,1000)] uint32 num_names,
@@ -1084,8 +1185,8 @@ import "misc.idl", "security.idl";
[in,out,ref] lsa_TransSidArray3 *sids,
[in] lsa_LookupNamesLevel level,
[in,out,ref] uint32 *count,
- [in] uint32 unknown1,
- [in] uint32 unknown2
+ [in] uint32 lookup_options,
+ [in] uint32 client_revision /* LSA_CLIENT_REVISION* */
);
/* Function 0x4e */
diff --git a/source3/librpc/idl/misc.idl b/source3/librpc/idl/misc.idl
deleted file mode 100644
index 132a81f138..0000000000
--- a/source3/librpc/idl/misc.idl
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- miscellaneous IDL structures
-*/
-
-
-[
- pointer_default(unique)
-]
-interface misc
-{
- typedef [public,noprint,gensize,noejs] struct {
- uint32 time_low;
- uint16 time_mid;
- uint16 time_hi_and_version;
- uint8 clock_seq[2];
- uint8 node[6];
- } GUID;
-
- typedef [public] struct {
- GUID uuid;
- uint32 if_version;
- } ndr_syntax_id;
-
- typedef [public] struct {
- uint32 handle_type;
- GUID uuid;
- } policy_handle;
-
- /* secure channel types */
- /* Only SEC_CHAN_WKSTA can forward requests to other domains. */
-
- typedef [public] enum {
- SEC_CHAN_WKSTA = 2,
- SEC_CHAN_DOMAIN = 4,
- SEC_CHAN_BDC = 6
- } netr_SchannelType;
-
- /* SAM database types */
- typedef [public,v1_enum] enum {
- SAM_DATABASE_DOMAIN = 0, /* Domain users and groups */
- SAM_DATABASE_BUILTIN = 1, /* BUILTIN users and groups */
- SAM_DATABASE_PRIVS = 2 /* Privileges */
- } netr_SamDatabaseID;
-
- typedef [public,v1_enum] enum {
- SAMR_REJECT_OTHER = 0,
- SAMR_REJECT_TOO_SHORT = 1,
- SAMR_REJECT_IN_HISTORY = 2,
- SAMR_REJECT_COMPLEXITY = 5
- } samr_RejectReason;
-}
diff --git a/source3/librpc/idl/nbt.idl b/source3/librpc/idl/nbt.idl
deleted file mode 100644
index f3590fcf2b..0000000000
--- a/source3/librpc/idl/nbt.idl
+++ /dev/null
@@ -1,650 +0,0 @@
-#include "idl_types.h"
-
-/*
- IDL structures for NBT operations
-
- NBT is not traditionally encoded using IDL/NDR. This is a bit of an
- experiment, and I may well switch us back to a more traditional
- encoding if it doesn't work out
-*/
-
-import "misc.idl", "security.idl", "svcctl.idl", "samr.idl";
-[
- helper("../libcli/netlogon.h", "../libcli/nbt/libnbt.h")
-]
-interface nbt
-{
- const int NBT_NAME_SERVICE_PORT = 137;
- const int NBT_DGRAM_SERVICE_PORT = 138;
-
- typedef [bitmap16bit] bitmap {
- NBT_RCODE = 0x000F,
- NBT_FLAG_BROADCAST = 0x0010,
- NBT_FLAG_RECURSION_AVAIL = 0x0080,
- NBT_FLAG_RECURSION_DESIRED = 0x0100,
- NBT_FLAG_TRUNCATION = 0x0200,
- NBT_FLAG_AUTHORITIVE = 0x0400,
- NBT_OPCODE = 0x7800,
- NBT_FLAG_REPLY = 0x8000
- } nbt_operation;
-
- /* the opcodes are in the operation field, masked with
- NBT_OPCODE */
- typedef enum {
- NBT_OPCODE_QUERY = (0x0<<11),
- NBT_OPCODE_REGISTER = (0x5<<11),
- NBT_OPCODE_RELEASE = (0x6<<11),
- NBT_OPCODE_WACK = (0x7<<11),
- NBT_OPCODE_REFRESH = (0x8<<11),
- NBT_OPCODE_REFRESH2 = (0x9<<11),
- NBT_OPCODE_MULTI_HOME_REG = (0xf<<11)
- } nbt_opcode;
-
- /* rcode values */
- typedef enum {
- NBT_RCODE_OK = 0x0,
- NBT_RCODE_FMT = 0x1,
- NBT_RCODE_SVR = 0x2,
- NBT_RCODE_NAM = 0x3,
- NBT_RCODE_IMP = 0x4,
- NBT_RCODE_RFS = 0x5,
- NBT_RCODE_ACT = 0x6,
- NBT_RCODE_CFT = 0x7
- } nbt_rcode;
-
- /* we support any 8bit name type, but by defining the common
- ones here we get better debug displays */
- typedef [enum8bit] enum {
- NBT_NAME_CLIENT = 0x00,
- NBT_NAME_MS = 0x01,
- NBT_NAME_USER = 0x03,
- NBT_NAME_SERVER = 0x20,
- NBT_NAME_PDC = 0x1B,
- NBT_NAME_LOGON = 0x1C,
- NBT_NAME_MASTER = 0x1D,
- NBT_NAME_BROWSER = 0x1E
- } nbt_name_type;
-
- /* the ndr parser for nbt_name is separately defined in
- nbtname.c (along with the parsers for nbt_string) */
- typedef [public,nopull,nopush] struct {
- string name;
- string scope;
- nbt_name_type type;
- } nbt_name;
-
- typedef [public,enum16bit] enum {
- NBT_QCLASS_IP = 0x01
- } nbt_qclass;
-
- typedef [public,enum16bit] enum {
- NBT_QTYPE_ADDRESS = 0x0001,
- NBT_QTYPE_NAMESERVICE = 0x0002,
- NBT_QTYPE_NULL = 0x000A,
- NBT_QTYPE_NETBIOS = 0x0020,
- NBT_QTYPE_STATUS = 0x0021
- } nbt_qtype;
-
- typedef struct {
- nbt_name name;
- nbt_qtype question_type;
- nbt_qclass question_class;
- } nbt_name_question;
-
- /* these are the possible values of the NBT_NM_OWNER_TYPE
- field */
- typedef enum {
- NBT_NODE_B = 0x0000,
- NBT_NODE_P = 0x2000,
- NBT_NODE_M = 0x4000,
- NBT_NODE_H = 0x6000
- } nbt_node_type;
-
- typedef [bitmap16bit] bitmap {
- NBT_NM_PERMANENT = 0x0200,
- NBT_NM_ACTIVE = 0x0400,
- NBT_NM_CONFLICT = 0x0800,
- NBT_NM_DEREGISTER = 0x1000,
- NBT_NM_OWNER_TYPE = 0x6000,
- NBT_NM_GROUP = 0x8000
- } nb_flags;
-
- typedef struct {
- nb_flags nb_flags;
- ipv4address ipaddr;
- } nbt_rdata_address;
-
- typedef struct {
- uint16 length;
- nbt_rdata_address addresses[length/6];
- } nbt_rdata_netbios;
-
- typedef struct {
- uint8 unit_id[6];
- uint8 jumpers;
- uint8 test_result;
- uint16 version_number;
- uint16 period_of_statistics;
- uint16 number_of_crcs;
- uint16 number_alignment_errors;
- uint16 number_of_collisions;
- uint16 number_send_aborts;
- uint32 number_good_sends;
- uint32 number_good_receives;
- uint16 number_retransmits;
- uint16 number_no_resource_conditions;
- uint16 number_free_command_blocks;
- uint16 total_number_command_blocks;
- uint16 max_total_number_command_blocks;
- uint16 number_pending_sessions;
- uint16 max_number_pending_sessions;
- uint16 max_total_sessions_possible;
- uint16 session_data_packet_size;
- } nbt_statistics;
-
- typedef struct {
- [charset(DOS)] uint8 name[15];
- nbt_name_type type;
- nb_flags nb_flags;
- } nbt_status_name;
-
- typedef struct {
- [value(num_names * 18 + 47)] uint16 length;
- uint8 num_names;
- nbt_status_name names[num_names];
- nbt_statistics statistics;
- } nbt_rdata_status;
-
- typedef struct {
- uint16 length;
- uint8 data[length];
- } nbt_rdata_data;
-
- typedef [nodiscriminant,public] union {
- [case(NBT_QTYPE_NETBIOS)] nbt_rdata_netbios netbios;
- [case(NBT_QTYPE_STATUS)] nbt_rdata_status status;
- [default] nbt_rdata_data data;
- } nbt_rdata;
-
-/*
- * this macro works around the problem
- * that we need to use nbt_rdata_data
- * together with NBT_QTYPE_NETBIOS
- * for WACK replies
- */
- typedef [flag(LIBNDR_PRINT_ARRAY_HEX),nopush] struct {
- nbt_name name;
- nbt_qtype rr_type;
- nbt_qclass rr_class;
- uint32 ttl;
- [switch_is(rr_type)] nbt_rdata rdata;
- } nbt_res_rec;
-
- typedef [flag(NDR_NOALIGN|NDR_BIG_ENDIAN|NDR_PAHEX),public] struct {
- uint16 name_trn_id;
- nbt_operation operation;
- uint16 qdcount;
- uint16 ancount;
- uint16 nscount;
- uint16 arcount;
- nbt_name_question questions[qdcount];
- nbt_res_rec answers[ancount];
- nbt_res_rec nsrecs[nscount];
- nbt_res_rec additional[arcount];
- [flag(NDR_REMAINING)] DATA_BLOB padding;
- } nbt_name_packet;
-
-
- /*
- NBT DGRAM packets (UDP/138)
- */
-
- typedef [enum8bit] enum {
- DGRAM_DIRECT_UNIQUE = 0x10,
- DGRAM_DIRECT_GROUP = 0x11,
- DGRAM_BCAST = 0x12,
- DGRAM_ERROR = 0x13,
- DGRAM_QUERY = 0x14,
- DGRAM_QUERY_POSITIVE = 0x15,
- DGRAM_QUERY_NEGATIVE = 0x16
- } dgram_msg_type;
-
- typedef [bitmap8bit] bitmap {
- DGRAM_FLAG_MORE = 0x01,
- DGRAM_FLAG_FIRST = 0x02,
- DGRAM_FLAG_NODE_TYPE = 0x0C
- } dgram_flags;
-
- typedef [enum8bit] enum {
- DGRAM_NODE_B = 0x00,
- DGRAM_NODE_P = 0x04,
- DGRAM_NODE_M = 0x08,
- DGRAM_NODE_NBDD = 0x0C
- } dgram_node_type;
-
- /* a dgram_message is the main dgram body in general use */
-
- /* the most common datagram type is a SMB_TRANSACTION
- operation, where a SMB packet is used in the data section
- of a dgram_message to hold a trans request, which in turn
- holds a small command structure. It's a very strange beast
- indeed. To make the code cleaner we define a basic SMB
- packet in IDL here. This is not a general purpose SMB
- packet, and won't be used in the core SMB client/server
- code, but it does make working with these types of dgrams
- easier */
-
- const string NBT_MAILSLOT_NETLOGON = "\\MAILSLOT\\NET\\NETLOGON";
- const string NBT_MAILSLOT_NTLOGON = "\\MAILSLOT\\NET\\NTLOGON";
- const string NBT_MAILSLOT_GETDC = "\\MAILSLOT\\NET\\GETDC";
- const string NBT_MAILSLOT_BROWSE = "\\MAILSLOT\\BROWSE";
-
- typedef [enum8bit] enum {
- SMB_TRANSACTION = 0x25
- } smb_command;
-
- typedef struct {
- [range(17,17),value(17)] uint8 wct;
- uint16 total_param_count;
- uint16 total_data_count;
- uint16 max_param_count;
- uint16 max_data_count;
- uint8 max_setup_count;
- uint8 pad;
- uint16 trans_flags;
- uint32 timeout;
- uint16 reserved;
- uint16 param_count;
- uint16 param_offset;
- uint16 data_count;
- uint16 data_offset;
- [range(3,3),value(3)] uint8 setup_count;
- uint8 pad2;
- uint16 opcode;
- uint16 priority;
- uint16 _class;
- [value(strlen(mailslot_name)+1+data.length)]
- uint16 byte_count;
- astring mailslot_name;
- [flag(NDR_REMAINING)] DATA_BLOB data;
- } smb_trans_body;
-
- typedef [nodiscriminant] union {
- [case(SMB_TRANSACTION)] smb_trans_body trans;
- } smb_body;
-
-
- typedef [flag(NDR_NOALIGN|NDR_LITTLE_ENDIAN|NDR_PAHEX),public] struct {
- smb_command smb_command;
- uint8 err_class;
- uint8 pad;
- uint16 err_code;
- uint8 flags;
- uint16 flags2;
- uint16 pid_high;
- uint8 signature[8];
- uint16 reserved;
- uint16 tid;
- uint16 pid;
- uint16 vuid;
- uint16 mid;
- [switch_is(smb_command)] smb_body body;
- } dgram_smb_packet;
-
- const uint32 DGRAM_SMB = 0xff534d42; /* 0xffSMB */
-
- typedef [nodiscriminant] union {
- [case(DGRAM_SMB)] dgram_smb_packet smb;
- } dgram_message_body;
-
- typedef struct {
- uint16 length;
- uint16 offset;
- nbt_name source_name;
- nbt_name dest_name;
- uint32 dgram_body_type;
- [switch_is(dgram_body_type)] dgram_message_body body;
- } dgram_message;
-
- typedef [enum8bit] enum {
- DGRAM_ERROR_NAME_NOT_PRESENT = 0x82,
- DGRAM_ERROR_INVALID_SOURCE = 0x83,
- DGRAM_ERROR_INVALID_DEST = 0x84
- } dgram_err_code;
-
- typedef [nodiscriminant] union {
- [case(DGRAM_DIRECT_UNIQUE)] dgram_message msg;
- [case(DGRAM_DIRECT_GROUP)] dgram_message msg;
- [case(DGRAM_BCAST)] dgram_message msg;
- [case(DGRAM_ERROR)] dgram_err_code error;
- [case(DGRAM_QUERY)] nbt_name dest_name;
- [case(DGRAM_QUERY_POSITIVE)] nbt_name dest_name;
- [case(DGRAM_QUERY_NEGATIVE)] nbt_name dest_name;
- } dgram_data;
-
- typedef [flag(NDR_NOALIGN|NDR_BIG_ENDIAN|NDR_PAHEX),public] struct {
- dgram_msg_type msg_type;
- dgram_flags flags;
- uint16 dgram_id;
- ipv4address src_addr;
- uint16 src_port;
- [switch_is(msg_type)] dgram_data data;
- } nbt_dgram_packet;
-
-
- /******************************************
- * \MAILSLOT\NET\NETLOGON mailslot requests
- * and
- * \MAILSLOT\NET\NTLOGON mailslot requests
- */
-
- typedef [public,gensize] struct {
- uint32 sockaddr_family;
- [flag(NDR_BIG_ENDIAN)] ipv4address pdc_ip;
- [flag(NDR_REMAINING)] DATA_BLOB remaining;
- } nbt_sockaddr;
-
- typedef [bitmap32bit,public] bitmap {
- NBT_SERVER_PDC = 0x00000001,
- NBT_SERVER_GC = 0x00000004,
- NBT_SERVER_LDAP = 0x00000008,
- NBT_SERVER_DS = 0x00000010,
- NBT_SERVER_KDC = 0x00000020,
- NBT_SERVER_TIMESERV = 0x00000040,
- NBT_SERVER_CLOSEST = 0x00000080,
- NBT_SERVER_WRITABLE = 0x00000100,
- NBT_SERVER_GOOD_TIMESERV = 0x00000200,
- NBT_SERVER_NDNC = 0x00000400,
- NBT_SERVER_SELECT_SECRET_DOMAIN_6 = 0x00000800,
- NBT_SERVER_FULL_SECRET_DOMAIN_6 = 0x00001000
- } nbt_server_type;
-
- typedef [bitmap32bit,public] bitmap {
- NETLOGON_NT_VERSION_1 = 0x00000001,
- NETLOGON_NT_VERSION_5 = 0x00000002,
- NETLOGON_NT_VERSION_5EX = 0x00000004,
- NETLOGON_NT_VERSION_5EX_WITH_IP = 0x00000008,
- NETLOGON_NT_VERSION_WITH_CLOSEST_SITE = 0x00000010,
- NETLOGON_NT_VERSION_AVIOD_NT4EMUL = 0x01000000,
- NETLOGON_NT_VERSION_PDC = 0x10000000,
- NETLOGON_NT_VERSION_IP = 0x20000000,
- NETLOGON_NT_VERSION_LOCAL = 0x40000000,
- NETLOGON_NT_VERSION_GC = 0x80000000
- } netlogon_nt_version_flags;
-
- typedef [enum16bit,public] enum {
- LOGON_PRIMARY_QUERY = 7, /* Was also NETLOGON_QUERY_FOR_PDC */
- NETLOGON_ANNOUNCE_UAS = 10,
- NETLOGON_RESPONSE_FROM_PDC = 12,
- LOGON_SAM_LOGON_REQUEST = 18, /* Was also NETLOGON_QUERY_FOR_PDC2, NTLOGON_SAM_LOGON */
- LOGON_SAM_LOGON_RESPONSE = 19, /* Was also NTLOGON_SAM_LOGON_REPLY */
- LOGON_SAM_LOGON_PAUSE_RESPONSE = 20,
- LOGON_SAM_LOGON_USER_UNKNOWN = 21, /* Was also NTLOGON_SAM_LOGON_REPLY15 */
- LOGON_SAM_LOGON_RESPONSE_EX = 23, /* was NETLOGON_RESPONSE_FROM_PDC2 */
- LOGON_SAM_LOGON_PAUSE_RESPONSE_EX = 24,
- LOGON_SAM_LOGON_USER_UNKNOWN_EX = 25 /* was NETLOGON_RESPONSE_FROM_PDC_USER */
- } netlogon_command;
-
- typedef bitmap samr_AcctFlags samr_AcctFlags;
-
- /* query to dc hand marshaled, as it has 'optional'
- * parts */
- typedef [nopull,nopush] struct {
- uint16 request_count;
- nstring computer_name;
- nstring user_name;
- astring mailslot_name;
- samr_AcctFlags acct_control;
- [value(ndr_size_dom_sid0(&sid, ndr->flags))] uint32 sid_size;
- /* The manual alignment is required because this
- * structure is marked flag(NDR_NOALIGN) via the
- * nbt_netlogon_packet below.
- *
- * However, both MUST only be present if sid_size > 0
- */
- [flag(NDR_ALIGN4)] DATA_BLOB _pad;
- [subcontext(0),subcontext_size(sid_size)] dom_sid0 sid;
- netlogon_nt_version_flags nt_version;
- uint16 lmnt_token;
- uint16 lm20_token;
- } NETLOGON_SAM_LOGON_REQUEST;
-
- typedef [flag(NDR_NOALIGN),public] struct {
- netlogon_command command;
- nstring server;
- nstring user_name;
- nstring domain;
- netlogon_nt_version_flags nt_version;
- uint16 lmnt_token;
- uint16 lm20_token;
- } NETLOGON_SAM_LOGON_RESPONSE_NT40;
-
- typedef [flag(NDR_NOALIGN),public] struct {
- netlogon_command command;
- nstring pdc_name;
- nstring user_name;
- nstring domain_name;
- GUID domain_uuid;
- GUID zero_uuid;
- nbt_string forest;
- nbt_string dns_domain;
- nbt_string pdc_dns_name;
- ipv4address pdc_ip;
- nbt_server_type server_type;
- netlogon_nt_version_flags nt_version;
- uint16 lmnt_token;
- uint16 lm20_token;
- } NETLOGON_SAM_LOGON_RESPONSE;
-
- /* response from pdc hand marshaled (we have an additional
- * function that uses this structure), as it has 'optional'
- * parts */
- typedef [flag(NDR_NOALIGN),public] struct {
- netlogon_command command;
- uint16 sbz; /* From the docs */
- nbt_server_type server_type;
- GUID domain_uuid;
- nbt_string forest;
- nbt_string dns_domain;
- nbt_string pdc_dns_name;
- nbt_string domain;
- nbt_string pdc_name;
- nbt_string user_name;
- nbt_string server_site;
- nbt_string client_site;
-
- /* Optional on NETLOGON_NT_VERSION_5EX_WITH_IP */
- [value(ndr_size_nbt_sockaddr(&sockaddr, ndr->flags))] uint8 sockaddr_size;
- [subcontext(0),subcontext_size(sockaddr_size)] nbt_sockaddr sockaddr;
-
- /* Optional on NETLOGON_NT_VERSION_WITH_CLOSEST_SITE */
- nbt_string next_closest_site;
-
- netlogon_nt_version_flags nt_version;
- uint16 lmnt_token;
- uint16 lm20_token;
- } NETLOGON_SAM_LOGON_RESPONSE_EX;
-
- /* query for pdc request */
- typedef struct {
- astring computer_name;
- astring mailslot_name;
- [flag(NDR_ALIGN2)] DATA_BLOB _pad;
- nstring unicode_name;
- netlogon_nt_version_flags nt_version;
- uint16 lmnt_token;
- uint16 lm20_token;
- } nbt_netlogon_query_for_pdc;
-
- /* response from pdc */
- typedef [flag(NDR_NOALIGN),public] struct {
- netlogon_command command;
- astring pdc_name;
- [flag(NDR_ALIGN2)] DATA_BLOB _pad;
- nstring unicode_pdc_name;
- nstring domain_name;
- netlogon_nt_version_flags nt_version;
- uint16 lmnt_token;
- uint16 lm20_token;
- } nbt_netlogon_response_from_pdc;
-
- typedef enum netr_SamDatabaseID netr_SamDatabaseID;
-
- /* used to announce SAM changes - MS-NRPC 2.2.1.5.1 */
- typedef struct {
- netr_SamDatabaseID db_index;
- hyper serial;
- NTTIME timestamp;
- } nbt_db_change_info;
-
- typedef struct {
- uint32 serial_lo;
- time_t timestamp;
- uint32 pulse;
- uint32 random;
- astring pdc_name;
- astring domain;
- [flag(NDR_ALIGN2)] DATA_BLOB _pad;
- nstring unicode_pdc_name;
- nstring unicode_domain;
- uint32 db_count;
- nbt_db_change_info dbchange[db_count];
- [value(ndr_size_dom_sid0(&sid, ndr->flags))] uint32 sid_size;
- [subcontext(0),subcontext_size(sid_size)] dom_sid0 sid;
- uint32 message_format_version;
- uint32 message_token;
- } NETLOGON_DB_CHANGE;
-
- typedef [nodiscriminant] union {
- [case(LOGON_SAM_LOGON_REQUEST)] NETLOGON_SAM_LOGON_REQUEST logon;
- [case(LOGON_PRIMARY_QUERY)] nbt_netlogon_query_for_pdc pdc;
- [case(NETLOGON_ANNOUNCE_UAS)] NETLOGON_DB_CHANGE uas;
- } nbt_netlogon_request;
-
-#if 0
- [case(NETLOGON_RESPONSE_FROM_PDC)] nbt_netlogon_response_from_pdc response;
- [case(NETLOGON_RESPONSE_FROM_PDC_USER)] nbt_netlogon_response_from_pdc2 response2;
-
- [case(LOGON_SAM_LOGON_PAUSE_RESPONSE)] NETLOGON_SAM_LOGON_RESPONSE reply;
- [case(LOGON_SAM_LOGON_RESPONSE)] NETLOGON_SAM_LOGON_RESPONSE reply;
- [case(LOGON_SAM_LOGON_USER_UNKNOWN)] NETLOGON_SAM_LOGON_RESPONSE reply;
- [case(LOGON_SAM_LOGON_RESPONSE_EX)] NETLOGON_SAM_LOGON_RESPONSE_EX reply_ex;
- [case(LOGON_SAM_LOGON_PAUSE_RESPONSE_EX)] NETLOGON_SAM_LOGON_RESPONSE_EX reply_ex;
- [case(LOGON_SAM_LOGON_USER_UNKNOWN_EX)] NETLOGON_SAM_LOGON_RESPONSE_EX reply_ex;
-#endif
-
- typedef [flag(NDR_NOALIGN),public] struct {
- netlogon_command command;
- [switch_is(command)] nbt_netlogon_request req;
- } nbt_netlogon_packet;
-
- /********************************************************/
- /* \MAILSLOT\BROWSE mailslot requests */
- /* for details see http://ubiqx.org/cifs/Browsing.html */
- /********************************************************/
- typedef bitmap svcctl_ServerType svcctl_ServerType;
-
- typedef [enum8bit] enum {
- HostAnnouncement = 1,
- AnnouncementRequest = 2,
- Election = 8,
- GetBackupListReq = 9,
- GetBackupListResp = 10,
- BecomeBackup = 11,
- DomainAnnouncement = 12,
- MasterAnnouncement = 13,
- ResetBrowserState = 14,
- LocalMasterAnnouncement = 15
- } nbt_browse_opcode;
-
- typedef struct {
- uint8 UpdateCount;
- uint32 Periodicity;
- [charset(DOS)] uint8 ServerName[16];
- uint8 OSMajor;
- uint8 OSMinor;
- svcctl_ServerType ServerType;
- uint8 BroMajorVer;
- uint8 BroMinorVer;
- uint16 Signature;
- astring Comment;
- } nbt_browse_host_announcement;
-
- typedef struct {
- uint8 Unused;
- astring ResponseName;
- } nbt_browse_announcement_request;
-
- typedef struct {
- uint8 Version;
- uint32 Criteria;
- uint32 UpTime; /* In milliseconds */
- uint32 Reserved; /* Must be zero */
- astring ServerName;
- } nbt_browse_election_request;
-
- typedef struct {
- uint8 ReqCount;
- uint32 Token;
- } nbt_browse_backup_list_request;
-
- typedef struct {
- uint8 BackupCount;
- uint32 Token;
- nbt_name BackupServerList[BackupCount];/* TODO: this is wrong */
- } nbt_browse_backup_list_response;
-
- typedef struct {
- astring BrowserName;
- } nbt_browse_become_backup;
-
- typedef struct {
- uint8 UpdateCount;
- uint32 Periodicity;
- [charset(DOS)] uint8 ServerName[16];
- uint8 OSMajor;
- uint8 OSMinor;
- svcctl_ServerType ServerType;
- uint32 MysteriousField;
- astring Comment;
- } nbt_browse_domain_announcement;
-
- typedef struct {
- astring ServerName;
- } nbt_browse_master_announcement;
-
- typedef struct {
- uint8 Command;
- } nbt_browse_reset_state;
-
- typedef struct {
- uint8 UpdateCount;
- uint32 Periodicity;
- [charset(DOS)] uint8 ServerName[16];
- uint8 OSMajor;
- uint8 OSMinor;
- svcctl_ServerType ServerType;
- uint8 BroMajorVer;
- uint8 BroMinorVer;
- uint16 Signature;
- astring Comment;
- } nbt_browse_local_master_announcement;
-
- typedef [nodiscriminant] union {
- [case(HostAnnouncement)] nbt_browse_host_announcement host_annoucement;
- [case(AnnouncementRequest)] nbt_browse_announcement_request announcement_request;
- [case(Election)] nbt_browse_election_request election_request;
- [case(GetBackupListReq)] nbt_browse_backup_list_request backup_list_request;
- [case(GetBackupListResp)] nbt_browse_backup_list_response backup_list_response;
- [case(BecomeBackup)] nbt_browse_become_backup become_backup;
- [case(DomainAnnouncement)] nbt_browse_domain_announcement domain_announcement;
- [case(MasterAnnouncement)] nbt_browse_master_announcement master_announcement;
- [case(ResetBrowserState)] nbt_browse_reset_state reset_browser_state;
- [case(LocalMasterAnnouncement)] nbt_browse_local_master_announcement local_master_announcement;
- } nbt_browse_payload;
-
- typedef [public,flag(NDR_NOALIGN)] struct {
- nbt_browse_opcode opcode;
- [switch_is(opcode)] nbt_browse_payload payload;
- } nbt_browse_packet;
-}
diff --git a/source3/librpc/idl/netlogon.idl b/source3/librpc/idl/netlogon.idl
index eaa4ed14da..b4e34a07ab 100644
--- a/source3/librpc/idl/netlogon.idl
+++ b/source3/librpc/idl/netlogon.idl
@@ -135,13 +135,32 @@ interface netlogon
netr_ChallengeResponse lm;
} netr_NetworkInfo;
- typedef [public,switch_type(uint16)] union {
- [case(1)] netr_PasswordInfo *password;
- [case(2)] netr_NetworkInfo *network;
- [case(3)] netr_PasswordInfo *password;
- [case(5)] netr_PasswordInfo *password;
- [case(6)] netr_NetworkInfo *network;
- } netr_LogonInfo;
+ typedef [flag(NDR_PAHEX)] struct {
+ netr_IdentityInfo identity_info;
+ lsa_String package_name;
+ uint32 length;
+ [size_is(length)] uint8 *data;
+ } netr_GenericInfo;
+
+ typedef enum {
+ NetlogonInteractiveInformation = 1,
+ NetlogonNetworkInformation = 2,
+ NetlogonServiceInformation = 3,
+ NetlogonGenericInformation = 4,
+ NetlogonInteractiveTransitiveInformation = 5,
+ NetlogonNetworkTransitiveInformation = 6,
+ NetlogonServiceTransitiveInformation = 7
+ } netr_LogonInfoClass;
+
+ typedef [public,switch_type(netr_LogonInfoClass)] union {
+ [case(NetlogonInteractiveInformation)] netr_PasswordInfo *password;
+ [case(NetlogonNetworkInformation)] netr_NetworkInfo *network;
+ [case(NetlogonServiceInformation)] netr_PasswordInfo *password;
+ [case(NetlogonGenericInformation)] netr_GenericInfo *generic;
+ [case(NetlogonInteractiveTransitiveInformation)] netr_PasswordInfo *password;
+ [case(NetlogonNetworkTransitiveInformation)] netr_NetworkInfo *network;
+ [case(NetlogonServiceTransitiveInformation)] netr_PasswordInfo *password;
+ } netr_LogonLevel;
typedef [public,flag(NDR_PAHEX)] struct {
uint8 key[16];
@@ -234,12 +253,25 @@ interface netlogon
lsa_String unknown4;
} netr_PacInfo;
+ typedef [flag(NDR_PAHEX)] struct {
+ uint32 length;
+ [size_is(length)] uint8 *data;
+ } netr_GenericInfo2;
+
+ typedef enum {
+ NetlogonValidationUasInfo = 1,
+ NetlogonValidationSamInfo = 2,
+ NetlogonValidationSamInfo2 = 3,
+ NetlogonValidationGenericInfo2 = 5,
+ NetlogonValidationSamInfo4 = 6
+ } netr_ValidationInfoClass;
+
typedef [public,switch_type(uint16)] union {
- [case(2)] netr_SamInfo2 *sam2;
- [case(3)] netr_SamInfo3 *sam3;
+ [case(NetlogonValidationSamInfo)] netr_SamInfo2 *sam2;
+ [case(NetlogonValidationSamInfo2)] netr_SamInfo3 *sam3;
[case(4)] netr_PacInfo *pac;
- [case(5)] netr_PacInfo *pac;
- [case(6)] netr_SamInfo6 *sam6;
+ [case(NetlogonValidationGenericInfo2)] netr_GenericInfo2 *generic;
+ [case(NetlogonValidationSamInfo4)] netr_SamInfo6 *sam6;
} netr_Validation;
typedef [public, flag(NDR_PAHEX)] struct {
@@ -251,21 +283,16 @@ interface netlogon
time_t timestamp;
} netr_Authenticator;
- typedef enum {
- INTERACTIVE_LOGON_TYPE = 1,
- NET_LOGON_TYPE = 2
- } netr_LogonLevel;
-
NTSTATUS netr_LogonSamLogon(
- [in,unique] [string,charset(UTF16)] uint16 *server_name,
- [in,unique] [string,charset(UTF16)] uint16 *computer_name,
- [in,unique] netr_Authenticator *credential,
- [in,out,unique] netr_Authenticator *return_authenticator,
- [in] netr_LogonLevel logon_level,
- [in,ref] [switch_is(logon_level)] netr_LogonInfo *logon,
- [in] uint16 validation_level,
+ [in,unique] [string,charset(UTF16)] uint16 *server_name,
+ [in,unique] [string,charset(UTF16)] uint16 *computer_name,
+ [in,unique] netr_Authenticator *credential,
+ [in,out,unique] netr_Authenticator *return_authenticator,
+ [in] netr_LogonInfoClass logon_level,
+ [in,ref] [switch_is(logon_level)] netr_LogonLevel *logon,
+ [in] uint16 validation_level,
[out,ref] [switch_is(validation_level)] netr_Validation *validation,
- [out,ref] uint8 *authoritative
+ [out,ref] uint8 *authoritative
);
@@ -277,8 +304,8 @@ interface netlogon
[in,unique] [string,charset(UTF16)] uint16 *computer_name,
[in,unique] netr_Authenticator *credential,
[in,out,unique] netr_Authenticator *return_authenticator,
- [in] netr_LogonLevel logon_level,
- [in] [switch_is(logon_level)] netr_LogonInfo logon
+ [in] netr_LogonInfoClass logon_level,
+ [in] [switch_is(logon_level)] netr_LogonLevel logon
);
@@ -423,7 +450,7 @@ interface netlogon
typedef struct {
lsa_String domain_name;
- lsa_String comment;
+ lsa_String oem_information; /* comment */
dlong force_logoff_time;
uint16 min_password_length;
uint16 password_history_length;
@@ -1111,6 +1138,16 @@ interface netlogon
/****************/
/* Function 0x1d */
+ typedef [bitmap32bit] bitmap {
+ NETR_TRUST_FLAG_IN_FOREST = 0x00000001,
+ NETR_TRUST_FLAG_OUTBOUND = 0x00000002,
+ NETR_TRUST_FLAG_TREEROOT = 0x00000004,
+ NETR_TRUST_FLAG_PRIMARY = 0x00000008,
+ NETR_TRUST_FLAG_NATIVE = 0x00000010,
+ NETR_TRUST_FLAG_INBOUND = 0x00000020,
+ NETR_TRUST_FLAG_MIT_KRB5 = 0x00000080,
+ NETR_TRUST_FLAG_AES = 0x00000100
+ } netr_TrustFlags;
typedef [flag(NDR_PAHEX)] struct {
uint16 length;
@@ -1139,25 +1176,60 @@ interface netlogon
} netr_DomainQuery;
typedef struct {
+ /* these first 3 values come from the fact windows
+ actually encodes this structure as a UNICODE_STRING
+ - see MS-NRPC section 2.2.1.3.9 */
+ [value(8)] uint32 length;
+ [value(0)] uint32 dummy;
+ [value(8)] uint32 size;
+ netr_TrustFlags flags;
+ uint32 parent_index;
+ uint32 trust_type;
+ uint32 trust_attributes;
+ } netr_trust_extension;
+
+ typedef struct {
+ uint16 length; /* value is 16 when info != NULL, otherwise 0 */
+ [value(length)] uint16 size; /* value is 16 when info != NULL, otherwise 0 */
+ netr_trust_extension *info;
+ } netr_trust_extension_container;
+
+ typedef struct {
lsa_String domainname;
lsa_String fulldomainname;
lsa_String forest;
GUID guid;
dom_sid2 *sid;
- netr_BinaryString unknown1[4];
- uint32 unknown[4];
+ netr_trust_extension_container trust_extension;
+ lsa_String dummystring[3];
+ uint32 dummy[4];
} netr_DomainTrustInfo;
typedef struct {
+ uint32 policy_size;
+ [size_is(policy_size)] uint8 *policy;
+ } netr_LsaPolicyInfo;
+
+ typedef [public,bitmap32bit] bitmap {
+ NETR_WS_FLAG_HANDLES_INBOUND_TRUSTS = 0x00000001,
+ NETR_WS_FLAG_HANDLES_SPN_UPDATE = 0x00000002
+ } netr_WorkstationFlags;
+
+ typedef struct {
netr_DomainTrustInfo domaininfo;
uint32 num_trusts;
[size_is(num_trusts)] netr_DomainTrustInfo *trusts;
- uint32 unknown[14]; /* room for expansion? */
+ netr_LsaPolicyInfo lsa_policy;
+ lsa_String dns_hostname;
+ lsa_String dummystring[3];
+ netr_WorkstationFlags workstation_flags;
+ uint32 supported_enc_types;
+ uint32 dummy[2];
} netr_DomainInfo1;
typedef union {
[case(1)] netr_DomainInfo1 *info1;
- [case(2)] netr_DomainInfo1 *info1;
+ [case(2)] netr_DomainInfo1 *info2;
} netr_DomainInfo;
NTSTATUS netr_LogonGetDomainInfo(
@@ -1241,15 +1313,6 @@ interface netlogon
/****************/
/* Function 0x24 */
- typedef [bitmap32bit] bitmap {
- NETR_TRUST_FLAG_IN_FOREST = 0x00000001,
- NETR_TRUST_FLAG_OUTBOUND = 0x00000002,
- NETR_TRUST_FLAG_TREEROOT = 0x00000004,
- NETR_TRUST_FLAG_PRIMARY = 0x00000008,
- NETR_TRUST_FLAG_NATIVE = 0x00000010,
- NETR_TRUST_FLAG_INBOUND = 0x00000020
- } netr_TrustFlags;
-
typedef [v1_enum] enum {
NETR_TRUST_TYPE_DOWNLEVEL = 1,
NETR_TRUST_TYPE_UPLEVEL = 2,
@@ -1321,8 +1384,8 @@ interface netlogon
NTSTATUS netr_LogonSamLogonEx(
[in,unique] [string,charset(UTF16)] uint16 *server_name,
[in,unique] [string,charset(UTF16)] uint16 *computer_name,
- [in] netr_LogonLevel logon_level,
- [in,ref] [switch_is(logon_level)] netr_LogonInfo *logon,
+ [in] netr_LogonInfoClass logon_level,
+ [in,ref] [switch_is(logon_level)] netr_LogonLevel *logon,
[in] uint16 validation_level,
[out,ref] [switch_is(validation_level)] netr_Validation *validation,
[out,ref] uint8 *authoritative,
@@ -1394,8 +1457,8 @@ interface netlogon
[in,unique] [string,charset(UTF16)] uint16 *computer_name,
[in,unique] netr_Authenticator *credential,
[in,out,unique] netr_Authenticator *return_authenticator,
- [in] netr_LogonLevel logon_level,
- [in] [switch_is(logon_level)] netr_LogonInfo logon,
+ [in] netr_LogonInfoClass logon_level,
+ [in] [switch_is(logon_level)] netr_LogonLevel logon,
[in] uint16 validation_level,
[out,ref] [switch_is(validation_level)] netr_Validation *validation,
[out,ref] uint8 *authoritative,
diff --git a/source3/librpc/idl/notify.idl b/source3/librpc/idl/notify.idl
deleted file mode 100644
index 6f9ad25f09..0000000000
--- a/source3/librpc/idl/notify.idl
+++ /dev/null
@@ -1,58 +0,0 @@
-#include "idl_types.h"
-
-/*
- IDL structures for notify change code
-
- this defines the structures used in the notify database code, and
- the change notify buffers
-*/
-
-import "misc.idl";
-
-[
- pointer_default(unique)
-]
-interface notify
-{
-
- /* structure used in the notify database */
- typedef [public] struct {
- server_id server;
- uint32 filter; /* filter to apply in this directory */
- uint32 subdir_filter; /* filter to apply in child directories */
- utf8string path;
- uint32 path_len; /* saves some computation on search */
- pointer private_data;
- } notify_entry;
-
- /*
- to allow for efficient search for matching entries, we
- divide them by the directory depth, with a separate array
- per depth. The entries within each depth are sorted by path,
- allowing for a bisection search.
-
- The max_mask and max_mask_subdir at each depth is the
- bitwise or of the filters and subdir filters for all entries
- at that depth. This allows a depth to be quickly skipped if
- no entries will match the target filter
- */
- typedef struct {
- uint32 max_mask;
- uint32 max_mask_subdir;
- uint32 num_entries;
- notify_entry entries[num_entries];
- } notify_depth;
-
- typedef [public] struct {
- uint32 num_depths;
- notify_depth depth[num_depths];
- } notify_array;
-
- /* structure sent between servers in notify messages */
- typedef [public] struct {
- uint32 action;
- utf8string path;
- pointer private_data;
- } notify_event;
-
-}
diff --git a/source3/librpc/idl/ntsvcs.idl b/source3/librpc/idl/ntsvcs.idl
deleted file mode 100644
index cd71de5868..0000000000
--- a/source3/librpc/idl/ntsvcs.idl
+++ /dev/null
@@ -1,376 +0,0 @@
-/*
- plug and play services
-*/
-
-[
- uuid("8d9f4e40-a03d-11ce-8f69-08003e30051b"),
- version(1.0),
- helpstring("Plug and Play services")
-]
-interface ntsvcs
-{
- /******************/
- /* Function: 0x00 */
-
- WERROR PNP_Disconnect();
-
- /******************/
- /* Function: 0x01 */
-
- WERROR PNP_Connect();
-
- /******************/
- /* Function: 0x02 */
-
- WERROR PNP_GetVersion(
- [out,ref] uint16 *version
- );
-
- /******************/
- /* Function: 0x03 */
-
- WERROR PNP_GetGlobalState();
-
- /******************/
- /* Function: 0x04 */
-
- WERROR PNP_InitDetection();
-
- /******************/
- /* Function: 0x05 */
-
- WERROR PNP_ReportLogOn();
-
- /******************/
- /* Function: 0x06 */
-
- WERROR PNP_ValidateDeviceInstance(
- [in,ref] [string,charset(UTF16)] uint16 *devicepath,
- [in] uint32 flags
- );
-
- /******************/
- /* Function: 0x07 */
-
- WERROR PNP_GetRootDeviceInstance();
-
- /******************/
- /* Function: 0x08 */
-
- WERROR PNP_GetRelatedDeviceInstance();
-
- /******************/
- /* Function: 0x09 */
-
- WERROR PNP_EnumerateSubKeys();
-
- /******************/
- /* Function: 0x0a */
-
- WERROR PNP_GetDeviceList();
-
- /******************/
- /* Function: 0x0b */
-
- WERROR PNP_GetDeviceListSize(
- [in,unique] [string,charset(UTF16)] uint16 *devicename,
- [out,ref] uint32 *size,
- [in] uint32 flags
- );
-
- /******************/
- /* Function: 0x0c */
-
- WERROR PNP_GetDepth();
-
- /******************/
- /* Function: 0x0d */
-
- const int DEV_REGPROP_DESC = 1;
-
- WERROR PNP_GetDeviceRegProp(
- [in,ref] [string,charset(UTF16)] uint16 *devicepath,
- [in] uint32 property,
- [in,out,ref] uint32 *unknown1,
- [out,ref] [size_is(*buffer_size)] [length_is(*buffer_size)] uint8 *buffer,
- [in,out,ref] uint32 *buffer_size,
- [in,out,ref] uint32 *needed,
- [in] uint32 unknown3
- );
-
- /******************/
- /* Function: 0x0e */
-
- WERROR PNP_SetDeviceRegProp();
-
- /******************/
- /* Function: 0x0f */
-
- WERROR PNP_GetClassInstance();
-
- /******************/
- /* Function: 0x10 */
-
- WERROR PNP_CreateKey();
-
- /******************/
- /* Function: 0x11 */
-
- WERROR PNP_DeleteRegistryKey();
-
- /******************/
- /* Function: 0x12 */
-
- WERROR PNP_GetClassCount();
-
- /******************/
- /* Function: 0x13 */
-
- WERROR PNP_GetClassName();
-
- /******************/
- /* Function: 0x14 */
-
- WERROR PNP_DeleteClassKey();
-
- /******************/
- /* Function: 0x15 */
-
- WERROR PNP_GetInterfaceDeviceAlias();
-
- /******************/
- /* Function: 0x16 */
-
- WERROR PNP_GetInterfaceDeviceList();
-
- /******************/
- /* Function: 0x17 */
-
- WERROR PNP_GetInterfaceDeviceListSize();
-
- /******************/
- /* Function: 0x18 */
-
- WERROR PNP_RegisterDeviceClassAssociation();
-
- /******************/
- /* Function: 0x19 */
-
- WERROR PNP_UnregisterDeviceClassAssociation();
-
- /******************/
- /* Function: 0x1a */
-
- WERROR PNP_GetClassRegProp();
-
- /******************/
- /* Function: 0x1b */
-
- WERROR PNP_SetClassRegProp();
-
- /******************/
- /* Function: 0x1c */
-
- WERROR PNP_CreateDevInst();
-
- /******************/
- /* Function: 0x1d */
-
- WERROR PNP_DeviceInstanceAction();
-
- /******************/
- /* Function: 0x1e */
-
- WERROR PNP_GetDeviceStatus();
-
- /******************/
- /* Function: 0x1f */
-
- WERROR PNP_SetDeviceProblem();
-
- /******************/
- /* Function: 0x20 */
-
- WERROR PNP_DisableDevInst();
-
- /******************/
- /* Function: 0x21 */
-
- WERROR PNP_UninstallDevInst();
-
- /******************/
- /* Function: 0x22 */
-
- WERROR PNP_AddID();
-
- /******************/
- /* Function: 0x23 */
-
- WERROR PNP_RegisterDriver();
-
- /******************/
- /* Function: 0x24 */
-
- WERROR PNP_QueryRemove();
-
- /******************/
- /* Function: 0x25 */
-
- WERROR PNP_RequestDeviceEject();
-
- /******************/
- /* Function: 0x26 */
-
- WERROR PNP_IsDockStationPresent();
-
- /******************/
- /* Function: 0x27 */
-
- WERROR PNP_RequestEjectPC();
-
- /******************/
- /* Function: 0x28 */
-
- WERROR PNP_HwProfFlags(
- [in] uint32 unknown1,
- [in,ref] [string,charset(UTF16)] uint16 *devicepath,
- [in] uint32 unknown2,
- [in,out,ref] uint32 *unknown3,
- [in,out,unique] uint16 *unknown4,
- [in,unique] [string,charset(UTF16)] uint16 *unknown5,
- [out,unique] [string,charset(UTF16)] uint16 **unknown5a,
- [in] uint32 unknown6,
- [in] uint32 unknown7
- );
-
- /******************/
- /* Function: 0x29 */
-
- typedef struct {
- uint32 unknown1;
- uint16 unknown2[160];
- uint32 unknown3;
- } PNP_HwProfInfo;
-
- WERROR PNP_GetHwProfInfo(
- [in] uint32 idx,
- [in,out,ref] PNP_HwProfInfo *info,
- [in] uint32 unknown1,
- [in] uint32 unknown2
- );
-
- /******************/
- /* Function: 0x2a */
-
- WERROR PNP_AddEmptyLogConf();
-
- /******************/
- /* Function: 0x2b */
-
- WERROR PNP_FreeLogConf();
-
- /******************/
- /* Function: 0x2c */
-
- WERROR PNP_GetFirstLogConf();
-
- /******************/
- /* Function: 0x2d */
-
- WERROR PNP_GetNextLogConf();
-
- /******************/
- /* Function: 0x2e */
-
- WERROR PNP_GetLogConfPriority();
-
- /******************/
- /* Function: 0x2f */
-
- WERROR PNP_AddResDes();
-
- /******************/
- /* Function: 0x30 */
-
- WERROR PNP_FreeResDes();
-
- /******************/
- /* Function: 0x31 */
-
- WERROR PNP_GetNextResDes();
-
- /******************/
- /* Function: 0x32 */
-
- WERROR PNP_GetResDesData();
-
- /******************/
- /* Function: 0x33 */
-
- WERROR PNP_GetResDesDataSize();
-
- /******************/
- /* Function: 0x34 */
-
- WERROR PNP_ModifyResDes();
-
- /******************/
- /* Function: 0x35 */
-
- WERROR PNP_DetectResourceLimit();
-
- /******************/
- /* Function: 0x36 */
-
- WERROR PNP_QueryResConfList();
-
- /******************/
- /* Function: 0x37 */
-
- WERROR PNP_SetHwProf();
-
- /******************/
- /* Function: 0x38 */
-
- WERROR PNP_QueryArbitratorFreeData();
-
- /******************/
- /* Function: 0x39 */
-
- WERROR PNP_QueryArbitratorFreeSize();
-
- /******************/
- /* Function: 0x3a */
-
- WERROR PNP_RunDetection();
-
- /******************/
- /* Function: 0x3b */
-
- WERROR PNP_RegisterNotification();
-
- /******************/
- /* Function: 0x3c */
-
- WERROR PNP_UnregisterNotification();
-
- /******************/
- /* Function: 0x3d */
-
- WERROR PNP_GetCustomDevProp();
-
- /******************/
- /* Function: 0x3e */
-
- WERROR PNP_GetVersionInternal();
-
- /******************/
- /* Function: 0x3f */
-
- WERROR PNP_GetBlockedDriverInfo();
-
- /******************/
- /* Function: 0x40 */
-
- WERROR PNP_GetServerSideDeviceInstallFlags();
-}
diff --git a/source3/librpc/idl/samr.idl b/source3/librpc/idl/samr.idl
index e823d1d77b..cd5fe07845 100644
--- a/source3/librpc/idl/samr.idl
+++ b/source3/librpc/idl/samr.idl
@@ -208,7 +208,7 @@ import "misc.idl", "lsa.idl", "security.idl";
typedef struct {
NTTIME force_logoff_time;
- lsa_String comment;
+ lsa_String oem_information; /* comment */
lsa_String domain_name;
lsa_String primary; /* PDC name if this is a BDC */
udlong sequence_num;
@@ -218,15 +218,15 @@ import "misc.idl", "lsa.idl", "security.idl";
uint32 num_users;
uint32 num_groups;
uint32 num_aliases;
- } samr_DomInfo2;
+ } samr_DomGeneralInformation;
typedef struct {
NTTIME force_logoff_time;
} samr_DomInfo3;
typedef struct {
- lsa_String comment;
- } samr_DomInfo4;
+ lsa_String oem_information; /* comment */
+ } samr_DomOEMInformation;
typedef struct {
lsa_String domain_name;
@@ -250,11 +250,11 @@ import "misc.idl", "lsa.idl", "security.idl";
} samr_DomInfo9;
typedef struct {
- samr_DomInfo2 info2;
+ samr_DomGeneralInformation general;
hyper lockout_duration;
hyper lockout_window;
uint16 lockout_threshold;
- } samr_DomInfo11;
+ } samr_DomGeneralInformation2;
typedef struct {
hyper lockout_duration;
@@ -271,15 +271,15 @@ import "misc.idl", "lsa.idl", "security.idl";
typedef [switch_type(uint16)] union {
[case(1)] samr_DomInfo1 info1;
- [case(2)] samr_DomInfo2 info2;
+ [case(2)] samr_DomGeneralInformation general;
[case(3)] samr_DomInfo3 info3;
- [case(4)] samr_DomInfo4 info4;
+ [case(4)] samr_DomOEMInformation oem;
[case(5)] samr_DomInfo5 info5;
[case(6)] samr_DomInfo6 info6;
[case(7)] samr_DomInfo7 info7;
[case(8)] samr_DomInfo8 info8;
[case(9)] samr_DomInfo9 info9;
- [case(11)] samr_DomInfo11 info11;
+ [case(11)] samr_DomGeneralInformation2 general2;
[case(12)] samr_DomInfo12 info12;
[case(13)] samr_DomInfo13 info13;
} samr_DomainInfo;
diff --git a/source3/librpc/idl/security.idl b/source3/librpc/idl/security.idl
deleted file mode 100644
index c1dfe272e9..0000000000
--- a/source3/librpc/idl/security.idl
+++ /dev/null
@@ -1,376 +0,0 @@
-#include "idl_types.h"
-
-/*
- security IDL structures
-*/
-
-import "misc.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")
-
-[
- pointer_default(unique)
-]
-interface security
-{
- /*
- access masks are divided up like this:
- 0xabccdddd
- where
- a = generic rights bits SEC_GENERIC_
- b = flags SEC_FLAG_
- c = standard rights bits SEC_STD_
- d = object type specific bits SEC_{FILE,DIR,REG,xxx}_
-
- common combinations of bits are prefixed with SEC_RIGHTS_
- */
- const int SEC_MASK_GENERIC = 0xF0000000;
- const int SEC_MASK_FLAGS = 0x0F000000;
- const int SEC_MASK_STANDARD = 0x00FF0000;
- const int SEC_MASK_SPECIFIC = 0x0000FFFF;
-
- /* generic bits */
- const int SEC_GENERIC_ALL = 0x10000000;
- const int SEC_GENERIC_EXECUTE = 0x20000000;
- const int SEC_GENERIC_WRITE = 0x40000000;
- const int SEC_GENERIC_READ = 0x80000000;
-
- /* flag bits */
- const int SEC_FLAG_SYSTEM_SECURITY = 0x01000000;
- const int SEC_FLAG_MAXIMUM_ALLOWED = 0x02000000;
-
- /* standard bits */
- const int SEC_STD_DELETE = 0x00010000;
- const int SEC_STD_READ_CONTROL = 0x00020000;
- const int SEC_STD_WRITE_DAC = 0x00040000;
- const int SEC_STD_WRITE_OWNER = 0x00080000;
- const int SEC_STD_SYNCHRONIZE = 0x00100000;
- const int SEC_STD_REQUIRED = 0x000F0000;
- const int SEC_STD_ALL = 0x001F0000;
-
- /* file specific bits */
- const int SEC_FILE_READ_DATA = 0x00000001;
- const int SEC_FILE_WRITE_DATA = 0x00000002;
- const int SEC_FILE_APPEND_DATA = 0x00000004;
- const int SEC_FILE_READ_EA = 0x00000008;
- const int SEC_FILE_WRITE_EA = 0x00000010;
- const int SEC_FILE_EXECUTE = 0x00000020;
- const int SEC_FILE_READ_ATTRIBUTE = 0x00000080;
- const int SEC_FILE_WRITE_ATTRIBUTE = 0x00000100;
- const int SEC_FILE_ALL = 0x000001ff;
-
- /* directory specific bits */
- const int SEC_DIR_LIST = 0x00000001;
- const int SEC_DIR_ADD_FILE = 0x00000002;
- const int SEC_DIR_ADD_SUBDIR = 0x00000004;
- const int SEC_DIR_READ_EA = 0x00000008;
- const int SEC_DIR_WRITE_EA = 0x00000010;
- const int SEC_DIR_TRAVERSE = 0x00000020;
- const int SEC_DIR_DELETE_CHILD = 0x00000040;
- const int SEC_DIR_READ_ATTRIBUTE = 0x00000080;
- const int SEC_DIR_WRITE_ATTRIBUTE = 0x00000100;
-
- /* registry entry specific bits */
- const int SEC_REG_QUERY_VALUE = 0x00000001;
- const int SEC_REG_SET_VALUE = 0x00000002;
- const int SEC_REG_CREATE_SUBKEY = 0x00000004;
- const int SEC_REG_ENUM_SUBKEYS = 0x00000008;
- const int SEC_REG_NOTIFY = 0x00000010;
- const int SEC_REG_CREATE_LINK = 0x00000020;
-
- /* ldap specific access bits */
- const int SEC_ADS_CREATE_CHILD = 0x00000001;
- const int SEC_ADS_DELETE_CHILD = 0x00000002;
- const int SEC_ADS_LIST = 0x00000004;
- const int SEC_ADS_SELF_WRITE = 0x00000008;
- const int SEC_ADS_READ_PROP = 0x00000010;
- const int SEC_ADS_WRITE_PROP = 0x00000020;
- const int SEC_ADS_DELETE_TREE = 0x00000040;
- const int SEC_ADS_LIST_OBJECT = 0x00000080;
- const int SEC_ADS_CONTROL_ACCESS = 0x00000100;
-
- /* generic->specific mappings for files */
- const int SEC_RIGHTS_FILE_READ = SEC_STD_READ_CONTROL |
- SEC_STD_SYNCHRONIZE |
- SEC_FILE_READ_DATA |
- SEC_FILE_READ_ATTRIBUTE |
- SEC_FILE_READ_EA;
-
- const int SEC_RIGHTS_FILE_WRITE = SEC_STD_READ_CONTROL |
- SEC_STD_SYNCHRONIZE |
- SEC_FILE_WRITE_DATA |
- SEC_FILE_WRITE_ATTRIBUTE |
- SEC_FILE_WRITE_EA |
- SEC_FILE_APPEND_DATA;
-
- const int SEC_RIGHTS_FILE_EXECUTE = SEC_STD_SYNCHRONIZE |
- SEC_STD_READ_CONTROL |
- SEC_FILE_READ_ATTRIBUTE |
- SEC_FILE_EXECUTE;
-
- const int SEC_RIGHTS_FILE_ALL = SEC_STD_ALL | SEC_FILE_ALL;
-
- /* generic->specific mappings for directories (same as files) */
- const int SEC_RIGHTS_DIR_READ = SEC_RIGHTS_FILE_READ;
- const int SEC_RIGHTS_DIR_WRITE = SEC_RIGHTS_FILE_WRITE;
- const int SEC_RIGHTS_DIR_EXECUTE = SEC_RIGHTS_FILE_EXECUTE;
- const int SEC_RIGHTS_DIR_ALL = SEC_RIGHTS_FILE_ALL;
-
-
- /***************************************************************/
- /* WELL KNOWN SIDS */
-
- /* a NULL sid */
- const string SID_NULL = "S-1-0-0";
-
- /* the world domain */
- const string NAME_WORLD = "WORLD";
-
- const string SID_WORLD_DOMAIN = "S-1-1";
- const string SID_WORLD = "S-1-1-0";
-
- /* SECURITY_CREATOR_SID_AUTHORITY */
- const string SID_CREATOR_OWNER_DOMAIN = "S-1-3";
- const string SID_CREATOR_OWNER = "S-1-3-0";
- const string SID_CREATOR_GROUP = "S-1-3-1";
-
- /* SECURITY_NT_AUTHORITY */
- const string NAME_NT_AUTHORITY = "NT AUTHORITY";
-
- const string SID_NT_AUTHORITY = "S-1-5";
- const string SID_NT_DIALUP = "S-1-5-1";
- const string SID_NT_NETWORK = "S-1-5-2";
- const string SID_NT_BATCH = "S-1-5-3";
- const string SID_NT_INTERACTIVE = "S-1-5-4";
- const string SID_NT_SERVICE = "S-1-5-6";
- const string SID_NT_ANONYMOUS = "S-1-5-7";
- const string SID_NT_PROXY = "S-1-5-8";
- const string SID_NT_ENTERPRISE_DCS = "S-1-5-9";
- const string SID_NT_SELF = "S-1-5-10";
- const string SID_NT_AUTHENTICATED_USERS = "S-1-5-11";
- const string SID_NT_RESTRICTED = "S-1-5-12";
- const string SID_NT_TERMINAL_SERVER_USERS = "S-1-5-13";
- const string SID_NT_REMOTE_INTERACTIVE = "S-1-5-14";
- const string SID_NT_THIS_ORGANISATION = "S-1-5-15";
- const string SID_NT_SYSTEM = "S-1-5-18";
- const string SID_NT_LOCAL_SERVICE = "S-1-5-19";
- const string SID_NT_NETWORK_SERVICE = "S-1-5-20";
-
- /* SECURITY_BUILTIN_DOMAIN_RID */
- const string NAME_BUILTIN = "BUILTIN";
-
- const string SID_BUILTIN = "S-1-5-32";
- const string SID_BUILTIN_ADMINISTRATORS = "S-1-5-32-544";
- const string SID_BUILTIN_USERS = "S-1-5-32-545";
- const string SID_BUILTIN_GUESTS = "S-1-5-32-546";
- const string SID_BUILTIN_POWER_USERS = "S-1-5-32-547";
- const string SID_BUILTIN_ACCOUNT_OPERATORS = "S-1-5-32-548";
- const string SID_BUILTIN_SERVER_OPERATORS = "S-1-5-32-549";
- const string SID_BUILTIN_PRINT_OPERATORS = "S-1-5-32-550";
- const string SID_BUILTIN_BACKUP_OPERATORS = "S-1-5-32-551";
- const string SID_BUILTIN_REPLICATOR = "S-1-5-32-552";
- const string SID_BUILTIN_RAS_SERVERS = "S-1-5-32-553";
- const string SID_BUILTIN_PREW2K = "S-1-5-32-554";
-
- /* well-known domain RIDs */
- const int DOMAIN_RID_LOGON = 9;
- const int DOMAIN_RID_ADMINISTRATOR = 500;
- const int DOMAIN_RID_GUEST = 501;
- const int DOMAIN_RID_ADMINS = 512;
- const int DOMAIN_RID_USERS = 513;
- const int DOMAIN_RID_DOMAIN_MEMBERS = 515;
- const int DOMAIN_RID_DCS = 516;
- const int DOMAIN_RID_CERT_ADMINS = 517;
- const int DOMAIN_RID_SCHEMA_ADMINS = 518;
- const int DOMAIN_RID_ENTERPRISE_ADMINS = 519;
-
-
- /*
- privilege IDs. Please keep the IDs below 64. If we get more
- than 64 then we need to change security_token
- */
- typedef enum {
- SEC_PRIV_SECURITY = 1,
- SEC_PRIV_BACKUP = 2,
- SEC_PRIV_RESTORE = 3,
- SEC_PRIV_SYSTEMTIME = 4,
- SEC_PRIV_SHUTDOWN = 5,
- SEC_PRIV_REMOTE_SHUTDOWN = 6,
- SEC_PRIV_TAKE_OWNERSHIP = 7,
- SEC_PRIV_DEBUG = 8,
- SEC_PRIV_SYSTEM_ENVIRONMENT = 9,
- SEC_PRIV_SYSTEM_PROFILE = 10,
- SEC_PRIV_PROFILE_SINGLE_PROCESS = 11,
- SEC_PRIV_INCREASE_BASE_PRIORITY = 12,
- SEC_PRIV_LOAD_DRIVER = 13,
- SEC_PRIV_CREATE_PAGEFILE = 14,
- SEC_PRIV_INCREASE_QUOTA = 15,
- SEC_PRIV_CHANGE_NOTIFY = 16,
- SEC_PRIV_UNDOCK = 17,
- SEC_PRIV_MANAGE_VOLUME = 18,
- SEC_PRIV_IMPERSONATE = 19,
- SEC_PRIV_CREATE_GLOBAL = 20,
- SEC_PRIV_ENABLE_DELEGATION = 21,
- SEC_PRIV_INTERACTIVE_LOGON = 22,
- SEC_PRIV_NETWORK_LOGON = 23,
- SEC_PRIV_REMOTE_INTERACTIVE_LOGON = 24
- } sec_privilege;
-
- typedef [bitmap8bit] bitmap {
- SEC_ACE_FLAG_OBJECT_INHERIT = 0x01,
- SEC_ACE_FLAG_CONTAINER_INHERIT = 0x02,
- SEC_ACE_FLAG_NO_PROPAGATE_INHERIT = 0x04,
- SEC_ACE_FLAG_INHERIT_ONLY = 0x08,
- SEC_ACE_FLAG_INHERITED_ACE = 0x10,
- SEC_ACE_FLAG_VALID_INHERIT = 0x0f,
- SEC_ACE_FLAG_SUCCESSFUL_ACCESS = 0x40,
- SEC_ACE_FLAG_FAILED_ACCESS = 0x80
- } security_ace_flags;
-
- typedef [enum8bit] enum {
- SEC_ACE_TYPE_ACCESS_ALLOWED = 0,
- SEC_ACE_TYPE_ACCESS_DENIED = 1,
- SEC_ACE_TYPE_SYSTEM_AUDIT = 2,
- SEC_ACE_TYPE_SYSTEM_ALARM = 3,
- SEC_ACE_TYPE_ALLOWED_COMPOUND = 4,
- SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT = 5,
- SEC_ACE_TYPE_ACCESS_DENIED_OBJECT = 6,
- SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT = 7,
- SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT = 8
- } security_ace_type;
-
- typedef [bitmap32bit] bitmap {
- SEC_ACE_OBJECT_TYPE_PRESENT = 0x00000001,
- SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT = 0x00000002
- } security_ace_object_flags;
-
- typedef [nodiscriminant] union {
- /* this is the 'schemaIDGUID' attribute of the attribute object in the schema naming context */
- [case(SEC_ACE_OBJECT_TYPE_PRESENT)] GUID type;
- [default];
- } security_ace_object_type;
-
- typedef [nodiscriminant] union {
- /* this is the 'schemaIDGUID' attribute of the objectclass object in the schema naming context
- * (of the parent container)
- */
- [case(SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT)] GUID inherited_type;
- [default];
- } security_ace_object_inherited_type;
-
- typedef struct {
- security_ace_object_flags flags;
- [switch_is(flags & SEC_ACE_OBJECT_TYPE_PRESENT)] security_ace_object_type type;
- [switch_is(flags & SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT)] security_ace_object_inherited_type inherited_type;
- } security_ace_object;
-
- typedef [nodiscriminant] union {
- [case(SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT)] security_ace_object object;
- [case(SEC_ACE_TYPE_ACCESS_DENIED_OBJECT)] security_ace_object object;
- [case(SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT)] security_ace_object object;
- [case(SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT)] security_ace_object object;
- [default];
- } security_ace_object_ctr;
-
- typedef [public,gensize,nosize] struct {
- security_ace_type type; /* SEC_ACE_TYPE_* */
- security_ace_flags flags; /* SEC_ACE_FLAG_* */
- [value(ndr_size_security_ace(r,ndr->flags))] uint16 size;
- uint32 access_mask;
- [switch_is(type)] security_ace_object_ctr object;
- dom_sid trustee;
- } security_ace;
-
- typedef enum {
- SECURITY_ACL_REVISION_NT4 = 2,
- SECURITY_ACL_REVISION_ADS = 4
- } security_acl_revision;
-
- const uint NT4_ACL_REVISION = SECURITY_ACL_REVISION_NT4;
-
- typedef [public,gensize,nosize] struct {
- security_acl_revision revision;
- [value(ndr_size_security_acl(r,ndr->flags))] uint16 size;
- [range(0,1000)] uint32 num_aces;
- security_ace aces[num_aces];
- } security_acl;
-
- /* default revision for new ACLs */
- typedef [enum8bit] enum {
- SECURITY_DESCRIPTOR_REVISION_1 = 1
- } security_descriptor_revision;
-
- const int SD_REVISION = SECURITY_DESCRIPTOR_REVISION_1;
-
- /* security_descriptor->type bits */
- typedef [bitmap16bit] bitmap {
- SEC_DESC_OWNER_DEFAULTED = 0x0001,
- SEC_DESC_GROUP_DEFAULTED = 0x0002,
- SEC_DESC_DACL_PRESENT = 0x0004,
- SEC_DESC_DACL_DEFAULTED = 0x0008,
- SEC_DESC_SACL_PRESENT = 0x0010,
- SEC_DESC_SACL_DEFAULTED = 0x0020,
- SEC_DESC_DACL_TRUSTED = 0x0040,
- SEC_DESC_SERVER_SECURITY = 0x0080,
- SEC_DESC_DACL_AUTO_INHERIT_REQ = 0x0100,
- SEC_DESC_SACL_AUTO_INHERIT_REQ = 0x0200,
- SEC_DESC_DACL_AUTO_INHERITED = 0x0400,
- SEC_DESC_SACL_AUTO_INHERITED = 0x0800,
- SEC_DESC_DACL_PROTECTED = 0x1000,
- SEC_DESC_SACL_PROTECTED = 0x2000,
- SEC_DESC_RM_CONTROL_VALID = 0x4000,
- SEC_DESC_SELF_RELATIVE = 0x8000
- } security_descriptor_type;
-
- typedef [gensize,nosize,public,flag(NDR_LITTLE_ENDIAN)] struct {
- security_descriptor_revision revision;
- security_descriptor_type type; /* SEC_DESC_xxxx flags */
- [relative] dom_sid *owner_sid;
- [relative] dom_sid *group_sid;
- [relative] security_acl *sacl; /* system ACL */
- [relative] security_acl *dacl; /* user (discretionary) ACL */
- } security_descriptor;
-
- typedef [public] struct {
- [range(0,0x40000),value(ndr_size_security_descriptor(sd,ndr->flags))] uint32 sd_size;
- [subcontext(4)] security_descriptor *sd;
- } sec_desc_buf;
-
- typedef [public] struct {
- dom_sid *user_sid;
- dom_sid *group_sid;
- uint32 num_sids;
- [size_is(num_sids)] dom_sid *sids[*];
- udlong privilege_mask;
- } security_token;
-
- /* bits that determine which parts of a security descriptor
- are being queried/set */
- typedef [public,bitmap32bit] bitmap {
- SECINFO_OWNER = 0x00000001,
- SECINFO_GROUP = 0x00000002,
- SECINFO_DACL = 0x00000004,
- SECINFO_SACL = 0x00000008,
- SECINFO_UNPROTECTED_SACL = 0x10000000,
- SECINFO_UNPROTECTED_DACL = 0x20000000,
- SECINFO_PROTECTED_SACL = 0x40000000,
- SECINFO_PROTECTED_DACL = 0x80000000
- } security_secinfo;
-}
diff --git a/source3/librpc/idl/spoolss.idl b/source3/librpc/idl/spoolss.idl
deleted file mode 100644
index 6b4b0b8a16..0000000000
--- a/source3/librpc/idl/spoolss.idl
+++ /dev/null
@@ -1,1571 +0,0 @@
-#include "idl_types.h"
-
-/*
- spoolss interface definitions
-*/
-import "misc.idl", "security.idl", "winreg.idl";
-
-[ uuid("12345678-1234-abcd-ef00-0123456789ab"),
- version(1.0),
- endpoint("ncacn_np:[\\pipe\\spoolss]"),
- pointer_default(unique),
- helpstring("Spooler SubSystem"),
- helper("librpc/ndr/ndr_spoolss_buf.h")
-] interface spoolss
-{
- typedef [v1_enum] enum winreg_Type winreg_Type;
- typedef struct {
- uint16 year;
- uint16 month;
- uint16 day_of_week;
- uint16 day;
- uint16 hour;
- uint16 minute;
- uint16 second;
- uint16 millisecond;
- } spoolss_Time;
-
- typedef struct {
- [relative] nstring *printername;
- [relative] nstring *servername;
- uint32 cjobs;
- uint32 total_jobs;
- uint32 total_bytes;
- spoolss_Time time;
- uint32 global_counter;
- uint32 total_pages;
- uint32 version;
- uint32 unknown10;
- uint32 unknown11;
- uint32 unknown12;
- uint32 session_counter;
- uint32 unknown14;
- uint32 printer_errors;
- uint32 unknown16;
- uint32 unknown17;
- uint32 unknown18;
- uint32 unknown19;
- uint32 change_id;
- uint32 unknown21;
- uint32 status;
- uint32 unknown23;
- uint32 c_setprinter;
- uint16 unknown25;
- uint16 unknown26;
- uint32 unknown27;
- uint32 unknown28;
- uint32 unknown29;
- } spoolss_PrinterInfo0;
-
- typedef [public,gensize] struct {
- [charset(UTF16)] uint16 devicename[32];
- uint16 specversion;
- uint16 driverversion;
- uint16 size;
- [value(r->driverextra_data.length)] uint16 __driverextra_length;
- uint32 fields;
- uint16 orientation;
- uint16 papersize;
- uint16 paperlength;
- uint16 paperwidth;
- uint16 scale;
- uint16 copies;
- uint16 defaultsource;
- uint16 printquality;
- uint16 color;
- uint16 duplex;
- uint16 yresolution;
- uint16 ttoption;
- uint16 collate;
- [charset(UTF16)] uint16 formname[32];
- uint16 logpixels;
- uint32 bitsperpel;
- uint32 pelswidth;
- uint32 pelsheight;
- uint32 displayflags;
- uint32 displayfrequency;
- uint32 icmmethod;
- uint32 icmintent;
- uint32 mediatype;
- uint32 dithertype;
- uint32 reserved1;
- uint32 reserved2;
- uint32 panningwidth;
- uint32 panningheight;
- [subcontext_size(__driverextra_length),subcontext(0),flag(NDR_REMAINING)] DATA_BLOB driverextra_data;
- } spoolss_DeviceMode;
-
- typedef [public] bitmap {
- PRINTER_ENUM_DEFAULT = 0x00000001,
- PRINTER_ENUM_LOCAL = 0x00000002,
- PRINTER_ENUM_CONNECTIONS = 0x00000004,
- PRINTER_ENUM_FAVORITE = 0x00000004,
- PRINTER_ENUM_NAME = 0x00000008,
- PRINTER_ENUM_REMOTE = 0x00000010,
- PRINTER_ENUM_SHARED = 0x00000020,
- PRINTER_ENUM_NETWORK = 0x00000040,
- PRINTER_ENUM_EXPAND = 0x00004000,
- PRINTER_ENUM_CONTAINER = 0x00008000,
- PRINTER_ENUM_ICON1 = 0x00010000,
- PRINTER_ENUM_ICON2 = 0x00020000,
- PRINTER_ENUM_ICON3 = 0x00040000,
- PRINTER_ENUM_ICON4 = 0x00080000,
- PRINTER_ENUM_ICON5 = 0x00100000,
- PRINTER_ENUM_ICON6 = 0x00200000,
- PRINTER_ENUM_ICON7 = 0x00400000,
- PRINTER_ENUM_ICON8 = 0x00800000,
- PRINTER_ENUM_HIDE = 0x01000000
- } spoolss_EnumPrinterFlags;
-
- typedef struct {
- spoolss_EnumPrinterFlags flags;
- [relative] nstring *name;
- [relative] nstring *description;
- [relative] nstring *comment;
- } spoolss_PrinterInfo1;
-
- typedef bitmap {
- PRINTER_ATTRIBUTE_QUEUED = 0x00000001,
- PRINTER_ATTRIBUTE_DIRECT = 0x00000002,
- PRINTER_ATTRIBUTE_DEFAULT = 0x00000004,
- PRINTER_ATTRIBUTE_SHARED = 0x00000008,
- PRINTER_ATTRIBUTE_NETWORK = 0x00000010,
- PRINTER_ATTRIBUTE_HIDDEN = 0x00000020,
- PRINTER_ATTRIBUTE_LOCAL = 0x00000040,
- PRINTER_ATTRIBUTE_ENABLE_DEVQ = 0x00000080,
- PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS = 0x00000100,
- PRINTER_ATTRIBUTE_DO_COMPLETE_FIRST = 0x00000200,
- PRINTER_ATTRIBUTE_WORK_OFFLINE = 0x00000400,
- PRINTER_ATTRIBUTE_ENABLE_BIDI = 0x00000800,
- PRINTER_ATTRIBUTE_RAW_ONLY = 0x00001000,
- PRINTER_ATTRIBUTE_PUBLISHED = 0x00002000,
- PRINTER_ATTRIBUTE_FAX = 0x00004000,
- PRINTER_ATTRIBUTE_TS = 0x00008000
- } spoolss_PrinterAttributes;
-
- typedef bitmap {
- PRINTER_STATUS_PAUSED = 0x00000001,
- PRINTER_STATUS_ERROR = 0x00000002,
- PRINTER_STATUS_PENDING_DELETION = 0x00000004,
- PRINTER_STATUS_PAPER_JAM = 0x00000008,
- PRINTER_STATUS_PAPER_OUT = 0x00000010,
- PRINTER_STATUS_MANUAL_FEED = 0x00000020,
- PRINTER_STATUS_PAPER_PROBLEM = 0x00000040,
- PRINTER_STATUS_OFFLINE = 0x00000080,
- PRINTER_STATUS_IO_ACTIVE = 0x00000100,
- PRINTER_STATUS_BUSY = 0x00000200,
- PRINTER_STATUS_PRINTING = 0x00000400,
- PRINTER_STATUS_OUTPUT_BIN_FULL = 0x00000800,
- PRINTER_STATUS_NOT_AVAILABLE = 0x00001000,
- PRINTER_STATUS_WAITING = 0x00002000,
- PRINTER_STATUS_PROCESSING = 0x00004000,
- PRINTER_STATUS_INITIALIZING = 0x00008000,
- PRINTER_STATUS_WARMING_UP = 0x00010000,
- PRINTER_STATUS_TONER_LOW = 0x00020000,
- PRINTER_STATUS_NO_TONER = 0x00040000,
- PRINTER_STATUS_PAGE_PUNT = 0x00080000,
- PRINTER_STATUS_USER_INTERVENTION= 0x00100000,
- PRINTER_STATUS_OUT_OF_MEMORY = 0x00200000,
- PRINTER_STATUS_DOOR_OPEN = 0x00400000,
- PRINTER_STATUS_SERVER_UNKNOWN = 0x00800000,
- PRINTER_STATUS_POWER_SAVE = 0x01000000
- } spoolss_PrinterStatus;
-
- typedef struct {
- [relative] nstring *servername;
- [relative] nstring *printername;
- [relative] nstring *sharename;
- [relative] nstring *portname;
- [relative] nstring *drivername;
- [relative] nstring *comment;
- [relative] nstring *location;
- [relative,subcontext(0)] spoolss_DeviceMode *devmode;
- [relative] nstring *sepfile;
- [relative] nstring *printprocessor;
- [relative] nstring *datatype;
- [relative] nstring *parameters;
- [relative,subcontext(0)] security_descriptor *secdesc;
- spoolss_PrinterAttributes attributes;
- uint32 priority;
- uint32 defaultpriority;
- uint32 starttime;
- uint32 untiltime;
- spoolss_PrinterStatus status;
- uint32 cjobs;
- uint32 averageppm;
- } spoolss_PrinterInfo2;
-
- typedef struct {
- [relative,subcontext(0)] security_descriptor *secdesc;
- } spoolss_PrinterInfo3;
-
- typedef struct {
- [relative] nstring *printername;
- [relative] nstring *servername;
- spoolss_PrinterAttributes attributes;
- } spoolss_PrinterInfo4;
-
- typedef struct {
- [relative] nstring *printername;
- [relative] nstring *portname;
- spoolss_PrinterAttributes attributes;
- uint32 device_not_selected_timeout;
- uint32 transmission_retry_timeout;
- } spoolss_PrinterInfo5;
-
- typedef struct {
- spoolss_PrinterStatus status;
- } spoolss_PrinterInfo6;
-
- typedef bitmap {
- DSPRINT_PUBLISH = 0x00000001,
- DSPRINT_UPDATE = 0x00000002,
- DSPRINT_UNPUBLISH = 0x00000004,
- DSPRINT_REPUBLISH = 0x00000008,
- DSPRINT_PENDING = 0x80000000
- } spoolss_DsPrintAction;
-
- typedef struct {
- [relative] nstring *guid; /* text form of printer guid */
- spoolss_DsPrintAction action;
- } spoolss_PrinterInfo7;
-
- typedef struct {
- [relative,subcontext(0)] spoolss_DeviceMode *devmode;
- } spoolss_DeviceModeInfo;
-
- typedef [nodiscriminant,relative_base,public] union {
- [case(0)] spoolss_PrinterInfo0 info0;
- [case(1)] spoolss_PrinterInfo1 info1;
- [case(2)] spoolss_PrinterInfo2 info2;
- [case(3)] spoolss_PrinterInfo3 info3;
- [case(4)] spoolss_PrinterInfo4 info4;
- [case(5)] spoolss_PrinterInfo5 info5;
- [case(6)] spoolss_PrinterInfo6 info6;
- [case(7)] spoolss_PrinterInfo7 info7;
- [case(8)] spoolss_DeviceModeInfo info8;
- [case(9)] spoolss_DeviceModeInfo info9;
- [default];
- } spoolss_PrinterInfo;
-
- /******************/
- /* Function: 0x00 */
- /* we are using this as internal parsing code */
- [public,noopnum,noprint] WERROR _spoolss_EnumPrinters(
- [in] spoolss_EnumPrinterFlags flags,
- [in,unique] [string,charset(UTF16)] uint16 *server,
- [in] uint32 level,
- [in,unique] DATA_BLOB *buffer,
- [in] uint32 offered,
- [out,unique] DATA_BLOB *info,
- [out] uint32 needed,
- [out] uint32 count
- );
- [public,noopnum,noprint] void __spoolss_EnumPrinters(
- [in] uint32 level,
- [in] uint32 count,
- [out,switch_is(level)] spoolss_PrinterInfo info[count]
- );
- [nopull,nopush] WERROR spoolss_EnumPrinters(
- [in] spoolss_EnumPrinterFlags flags,
- [in,unique] [string,charset(UTF16)] uint16 *server,
- [in] uint32 level,
- [in,unique] DATA_BLOB *buffer,
- [in] uint32 offered,
- /* what we have here is a subcontext containing an array of no discriminant unions
- * and the array has no size in front
- */
- [out,unique,switch_is(level),size_is(count)] spoolss_PrinterInfo *info,
- [out] uint32 needed,
- [out] uint32 count
- );
-
- /******************/
- /* Function: 0x01 */
- typedef struct {
- [value(_ndr_size_spoolss_DeviceMode(devmode, ndr->flags))] uint32 _ndr_size;
- [subcontext(4),subcontext_size(_ndr_size)] spoolss_DeviceMode *devmode;
- } spoolss_DevmodeContainer;
-
- [public] WERROR spoolss_OpenPrinter(
- [in,unique] [string,charset(UTF16)] uint16 *printername,
- [in,unique] [string,charset(UTF16)] uint16 *datatype,
- [in] spoolss_DevmodeContainer devmode_ctr,
- [in] uint32 access_mask,
- [out,ref] policy_handle *handle
- );
-
- /******************/
- /* Function: 0x02 */
- typedef struct {
- uint32 job_id;
- [relative] nstring *printer_name;
- [relative] nstring *server_name;
- [relative] nstring *user_name;
- [relative] nstring *document_name;
- [relative] nstring *data_type;
- [relative] nstring *text_status;
- uint32 status;
- uint32 priority;
- uint32 position;
- uint32 total_pages;
- uint32 pages_printed;
- spoolss_Time time;
- } spoolss_JobInfo1;
-
- typedef [nodiscriminant,relative_base,public] union {
- [case(1)] spoolss_JobInfo1 info1;
- [case(2)]; /* TODO */
- [case(3)]; /* TODO */
- [default];
- } spoolss_JobInfo;
-
- typedef struct {
- uint32 level;
- [switch_is(level)] spoolss_JobInfo info;
- } spoolss_JobInfoContainer;
-
- typedef [v1_enum] enum {
- SPOOLSS_JOB_CONTROL_PAUSE = 1,
- SPOOLSS_JOB_CONTROL_RESUME = 2,
- SPOOLSS_JOB_CONTROL_CANCEL = 3,
- SPOOLSS_JOB_CONTROL_RESTART = 4,
- SPOOLSS_JOB_CONTROL_DELETE = 5,
- SPOOLSS_JOB_CONTROL_SEND_TO_PRINTER = 6,
- SPOOLSS_JOB_CONTROL_LAST_PAGE_EJECTED = 7
- } spoolss_JobControl;
-
- WERROR spoolss_SetJob(
- [in,ref] policy_handle *handle,
- [in] uint32 job_id,
- [in,unique] spoolss_JobInfoContainer *ctr,
- [in] spoolss_JobControl command
- );
-
- /******************/
- /* Function: 0x03 */
- WERROR spoolss_GetJob(
- [in,ref] policy_handle *handle,
- [in] uint32 job_id,
- [in] uint32 level,
- [in,unique] DATA_BLOB *buffer,
- [in] uint32 offered,
- [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_JobInfo *info,
- [out] uint32 needed
- );
-
- /******************/
- /* Function: 0x04 */
- [public,noopnum,noprint] WERROR _spoolss_EnumJobs(
- [in,ref] policy_handle *handle,
- [in] uint32 firstjob,
- [in] uint32 numjobs,
- [in] uint32 level,
- [in,unique] DATA_BLOB *buffer,
- [in] uint32 offered,
- [out,unique] DATA_BLOB *info,
- [out] uint32 needed,
- [out] uint32 count
- );
- [public,noopnum,noprint] void __spoolss_EnumJobs(
- [in] uint32 level,
- [in] uint32 count,
- [out,switch_is(level)] spoolss_JobInfo info[count]
- );
- [nopull,nopush] WERROR spoolss_EnumJobs(
- [in,ref] policy_handle *handle,
- [in] uint32 firstjob,
- [in] uint32 numjobs,
- [in] uint32 level,
- [in,unique] DATA_BLOB *buffer,
- [in] uint32 offered,
- [out,unique,switch_is(level),size_is(count)] spoolss_JobInfo *info,
- [out] uint32 needed,
- [out] uint32 count
- );
-
- /******************/
- /* Function: 0x05 */
- [todo] WERROR spoolss_AddPrinter(
- /* This function is not implemented in Samba 3 as no
- clients have been observed using it. */
- );
-
- /******************/
- /* Function: 0x06 */
- [todo] WERROR spoolss_DeletePrinter(
- );
-
- /******************/
- /* Function: 0x07 */
- typedef [v1_enum] enum {
- SPOOLSS_PRINTER_CONTROL_UNPAUSE = 0,
- SPOOLSS_PRINTER_CONTROL_PAUSE = 1,
- SPOOLSS_PRINTER_CONTROL_RESUME = 2,
- SPOOLSS_PRINTER_CONTROL_PURGE = 3,
- SPOOLSS_PRINTER_CONTROL_SET_STATUS = 4
- } spoolss_PrinterControl;
-
- typedef [switch_type(uint32)] union {
- [case(0)] spoolss_PrinterInfo0 *info0;
- [case(1)] spoolss_PrinterInfo1 *info1;
- [case(2)] spoolss_PrinterInfo2 *info2;
- [case(3)] spoolss_PrinterInfo3 *info3;
- [case(4)] spoolss_PrinterInfo4 *info4;
- [case(5)] spoolss_PrinterInfo5 *info5;
- [case(6)] spoolss_PrinterInfo6 *info6;
- [case(7)] spoolss_PrinterInfo7 *info7;
- [case(8)] spoolss_DeviceModeInfo *info8;
- [case(9)] spoolss_DeviceModeInfo *info9;
- [default];
- } spoolss_SetPrinterInfo;
-
- WERROR spoolss_SetPrinter(
- [in,ref] policy_handle *handle,
- [in] uint32 level,
- [in,switch_is(level)] spoolss_SetPrinterInfo info,
- [in] spoolss_DevmodeContainer devmode_ctr,
- [in] sec_desc_buf secdesc_ctr,
- [in] spoolss_PrinterControl command
- );
-
- /******************/
- /* Function: 0x08 */
- [public] WERROR spoolss_GetPrinter(
- [in,ref] policy_handle *handle,
- [in] uint32 level,
- [in,unique] DATA_BLOB *buffer,
- [in] uint32 offered,
- [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_PrinterInfo *info,
- [out] uint32 needed
- );
-
- /******************/
- /* Function: 0x09 */
- [todo] WERROR spoolss_AddPrinterDriver(
- );
-
- typedef struct {
- [relative] nstring *driver_name;
- } spoolss_DriverInfo1;
-
- typedef [v1_enum] enum {
- SPOOLSS_DRIVER_VERSION_9X = 0,
- SPOOLSS_DRIVER_VERSION_NT35 = 1,
- SPOOLSS_DRIVER_VERSION_NT4 = 2,
- SPOOLSS_DRIVER_VERSION_200X = 3
- } spoolss_DriverOSVersion;
-
- typedef struct {
- spoolss_DriverOSVersion version;
- [relative] nstring *driver_name;
- [relative] nstring *architecture;
- [relative] nstring *driver_path;
- [relative] nstring *data_file;
- [relative] nstring *config_file;
- } spoolss_DriverInfo2;
-
- typedef struct {
- spoolss_DriverOSVersion version;
- [relative] nstring *driver_name;
- [relative] nstring *architecture;
- [relative] nstring *driver_path;
- [relative] nstring *data_file;
- [relative] nstring *config_file;
- [relative] nstring *help_file;
- [relative] nstring_array *dependent_files;
- [relative] nstring *monitor_name;
- [relative] nstring *default_datatype;
- } spoolss_DriverInfo3;
-
- typedef struct {
- spoolss_DriverOSVersion version;
- [relative] nstring *driver_name;
- [relative] nstring *architecture;
- [relative] nstring *driver_path;
- [relative] nstring *data_file;
- [relative] nstring *config_file;
- [relative] nstring *help_file;
- [relative] nstring_array *dependent_files;
- [relative] nstring *monitor_name;
- [relative] nstring *default_datatype;
- [relative] nstring_array *previous_names;
- } spoolss_DriverInfo4;
-
- typedef struct {
- spoolss_DriverOSVersion version;
- [relative] nstring *driver_name;
- [relative] nstring *architecture;
- [relative] nstring *driver_path;
- [relative] nstring *data_file;
- [relative] nstring *config_file;
- uint32 driver_attributes;
- uint32 config_version;
- uint32 driver_version;
- } spoolss_DriverInfo5;
-
- typedef struct {
- spoolss_DriverOSVersion version;
- [relative] nstring *driver_name;
- [relative] nstring *architecture;
- [relative] nstring *driver_path;
- [relative] nstring *data_file;
- [relative] nstring *config_file;
- [relative] nstring *help_file;
- [relative] nstring_array *dependent_files;
- [relative] nstring *monitor_name;
- [relative] nstring *default_datatype;
- [relative] nstring_array *previous_names;
- NTTIME driver_data;
- hyper driver_version;
- [relative] nstring *manufacturer_name;
- [relative] nstring *manufacturer_url;
- [relative] nstring *hardware_id;
- [relative] nstring *provider;
- } spoolss_DriverInfo6;
-
- typedef [nodiscriminant,relative_base,public] union {
- [case(1)] spoolss_DriverInfo1 info1;
- [case(2)] spoolss_DriverInfo2 info2;
- [case(3)] spoolss_DriverInfo3 info3;
- [case(4)] spoolss_DriverInfo4 info4;
- [case(5)] spoolss_DriverInfo5 info5;
- [case(6)] spoolss_DriverInfo6 info6;
- [default];
- } spoolss_DriverInfo;
-
- /******************/
- /* Function: 0x0a */
- [public,noopnum,noprint] WERROR _spoolss_EnumPrinterDrivers(
- [in,unique] [string,charset(UTF16)] uint16 *server,
- [in,unique] [string,charset(UTF16)] uint16 *environment,
- [in] uint32 level,
- [in,unique] DATA_BLOB *buffer,
- [in] uint32 offered,
- [out,unique] DATA_BLOB *info,
- [out] uint32 needed,
- [out] uint32 count
- );
- [public,noopnum,noprint] void __spoolss_EnumPrinterDrivers(
- [in] uint32 level,
- [in] uint32 count,
- [out,switch_is(level)] spoolss_DriverInfo info[count]
- );
- [nopull,nopush] WERROR spoolss_EnumPrinterDrivers(
- [in,unique] [string,charset(UTF16)] uint16 *server,
- [in,unique] [string,charset(UTF16)] uint16 *environment,
- [in] uint32 level,
- [in,unique] DATA_BLOB *buffer,
- [in] uint32 offered,
- [out,unique,switch_is(level),size_is(count)] spoolss_DriverInfo *info,
- [out] uint32 needed,
- [out] uint32 count
- );
-
- /******************/
- /* Function: 0x0b */
- [todo] WERROR spoolss_GetPrinterDriver(
- );
-
- /******************/
- /* Function: 0x0c */
- typedef struct {
- nstring directory_name;
- } spoolss_DriverDirectoryInfo1;
-
- /* NOTE: it's seems that w2k3 completly ignores the level
- in its server code
- */
- typedef [nodiscriminant,relative_base,gensize,public] union {
- [case(1)] spoolss_DriverDirectoryInfo1 info1;
- [default] spoolss_DriverDirectoryInfo1 info1;
- } spoolss_DriverDirectoryInfo;
-
- [public] WERROR spoolss_GetPrinterDriverDirectory(
- [in,unique] [string,charset(UTF16)] uint16 *server,
- [in,unique] [string,charset(UTF16)] uint16 *environment,
- [in] uint32 level,
- [in,unique] DATA_BLOB *buffer,
- [in] uint32 offered,
- [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_DriverDirectoryInfo *info,
- [out] uint32 needed
- );
-
- /******************/
- /* Function: 0x0d */
- WERROR spoolss_DeletePrinterDriver(
- [in,ref] policy_handle *handle,
- [in,unique] [string,charset(UTF16)] uint16 *server,
- [in] [string,charset(UTF16)] uint16 architecture[],
- [in] [string,charset(UTF16)] uint16 driver[]
- );
-
- /******************/
- /* Function: 0x0e */
- [todo] WERROR spoolss_AddPrintProcessor(
- );
-
- /******************/
- /* Function: 0x0f */
- typedef struct {
- [relative] nstring *print_processor_name;
- } spoolss_PrintProcessorInfo1;
-
- typedef [nodiscriminant,relative_base,public] union {
- [case(1)] spoolss_PrintProcessorInfo1 info1;
- [default];
- } spoolss_PrintProcessorInfo;
-
- [public,noopnum,noprint] WERROR _spoolss_EnumPrintProcessors(
- [in,unique] [string,charset(UTF16)] uint16 *servername,
- [in,unique] [string,charset(UTF16)] uint16 *environment,
- [in] uint32 level,
- [in,unique] DATA_BLOB *buffer,
- [in] uint32 offered,
- [out,unique] DATA_BLOB *info,
- [out] uint32 needed,
- [out] uint32 count
- );
- [public,noopnum,noprint] void __spoolss_EnumPrintProcessors(
- [in] uint32 level,
- [in] uint32 count,
- [out,switch_is(level)] spoolss_PrintProcessorInfo info[count]
- );
- [nopull,nopush] WERROR spoolss_EnumPrintProcessors(
- [in,unique] [string,charset(UTF16)] uint16 *servername,
- [in,unique] [string,charset(UTF16)] uint16 *environment,
- [in] uint32 level,
- [in,unique] DATA_BLOB *buffer,
- [in] uint32 offered,
- [out,unique,switch_is(level),size_is(count)] spoolss_PrintProcessorInfo *info,
- [out] uint32 needed,
- [out] uint32 count
- );
-
- /******************/
- /* Function: 0x10 */
- [todo] WERROR spoolss_GetPrintProcessorDirectory(
- );
-
- /******************/
- /* Function: 0x11 */
- typedef struct {
- [string,charset(UTF16)] uint16 *document_name;
- [string,charset(UTF16)] uint16 *output_file;
- [string,charset(UTF16)] uint16 *datatype;
- } spoolss_DocumentInfo1;
-
- typedef [switch_type(uint32)] union {
- [case(1)] spoolss_DocumentInfo1 *info1;
- [case(2)]; /* TODO */
- [case(3)]; /* TODO */
- [default];
- } spoolss_DocumentInfo;
-
- WERROR spoolss_StartDocPrinter(
- [in,ref] policy_handle *handle,
- [in] uint32 level,
- [in,switch_is(level)] spoolss_DocumentInfo info,
- [out] uint32 job_id
- );
-
- /******************/
- /* Function: 0x12 */
- WERROR spoolss_StartPagePrinter(
- [in,ref] policy_handle *handle
- );
-
- /******************/
- /* Function: 0x13 */
- WERROR spoolss_WritePrinter(
- [in,ref] policy_handle *handle,
- [in] DATA_BLOB data,
- [in,value(r->in.data.length)] uint32 _data_size,
- [out] uint32 num_written
- );
-
- /******************/
- /* Function: 0x14 */
- WERROR spoolss_EndPagePrinter(
- [in,ref] policy_handle *handle
- );
-
- /******************/
- /* Function: 0x15 */
- WERROR spoolss_AbortPrinter(
- [in,ref] policy_handle *handle
- );
-
- /******************/
- /* Function: 0x16 */
- WERROR spoolss_ReadPrinter(
- [in,ref] policy_handle *handle,
- [in] uint32 data_size,
- [out] DATA_BLOB data,
- [out,value(r->out.data.length)] uint32 _data_size
- );
-
- /******************/
- /* Function: 0x17 */
- WERROR spoolss_EndDocPrinter(
- [in,ref] policy_handle *handle
- );
-
- /******************/
- /* Function: 0x18 */
- [todo] WERROR spoolss_AddJob(
- );
-
- /******************/
- /* Function: 0x19 */
- [todo] WERROR spoolss_ScheduleJob(
- );
-
- /******************/
- /* Function: 0x1a */
- const string SPOOLSS_ARCHITECTURE_NT_X86 = "Windows NT x86";
-
- typedef [public,gensize] struct {
- [value(ndr_size_spoolss_OSVersion(r,ndr->flags))] uint32 _ndr_size;
- uint32 major;
- uint32 minor;
- uint32 build;
- [value(2)] uint32 unknown;
- [subcontext(0),subcontext_size(256)] nstring extra_string;
- } spoolss_OSVersion;
-
- typedef [public,gensize] struct {
- [value(ndr_size_spoolss_OSVersionEx(r,ndr->flags))] uint32 _ndr_size;
- uint32 major;
- uint32 minor;
- uint32 build;
- [value(2)] uint32 unknown1;
- [subcontext(0),subcontext_size(256)] nstring extra_string;
- uint32 unknown2;/* service pack number? I saw 0 from w2k3 and 1 from winxp sp1*/
- uint32 unknown3;/* hmm? w2k3: 131346(0x20112) winxp sp1: 503382272 0x1E010100 */
- } spoolss_OSVersionEx;
-
- typedef [v1_enum] enum {
- SPOOLSS_PRINTER_DATA_TYPE_NULL = 0,
- SPOOLSS_PRINTER_DATA_TYPE_STRING = 1,
- SPOOLSS_PRINTER_DATA_TYPE_BINARY = 3,
- SPOOLSS_PRINTER_DATA_TYPE_UINT32 = 4,
- SPOOLSS_PRINTER_DATA_TYPE_STRING_ARRAY = 7
- } spoolss_PrinterDataType;
-
- typedef [nodiscriminant,public,gensize] union {
- [case(SPOOLSS_PRINTER_DATA_TYPE_NULL)];
- [case(SPOOLSS_PRINTER_DATA_TYPE_STRING)] nstring string;
- [case(SPOOLSS_PRINTER_DATA_TYPE_BINARY),flag(NDR_REMAINING)] DATA_BLOB binary;
- [case(SPOOLSS_PRINTER_DATA_TYPE_UINT32)] uint32 value;
- [case(SPOOLSS_PRINTER_DATA_TYPE_STRING_ARRAY)] nstring_array string_array;
- [default,flag(NDR_REMAINING)] DATA_BLOB data;
- } spoolss_PrinterData;
-
- [noopnum,noprint,public] WERROR _spoolss_GetPrinterData(
- [in,ref] policy_handle *handle,
- [in] [string,charset(UTF16)] uint16 value_name[],
- [in] uint32 offered,
- [out] spoolss_PrinterDataType type,
- [out] DATA_BLOB data,
- [out] uint32 needed
- );
- [noopnum,noprint,public] void __spoolss_GetPrinterData(
- [in] spoolss_PrinterDataType type,
- [out,switch_is(type)] spoolss_PrinterData data
- );
- [nopull,nopush,public] WERROR spoolss_GetPrinterData(
- [in,ref] policy_handle *handle,
- [in] [string,charset(UTF16)] uint16 value_name[],
- [in] uint32 offered,
- [out] spoolss_PrinterDataType type,
- [out,subcontext(4),subcontext_size(offered),switch_is(type)] spoolss_PrinterData data,
- [out] uint32 needed
- );
-
- /******************/
- /* Function: 0x1b */
- [noopnum,nopull,noprint,public] WERROR _spoolss_SetPrinterData(
- [in,ref] policy_handle *handle,
- [in] [string,charset(UTF16)] uint16 value_name[],
- [in] spoolss_PrinterDataType type,
- [in] DATA_BLOB data,
- [in] uint32 _offered
- );
- [noopnum,nopull,noprint,public] void __spoolss_SetPrinterData(
- [in] spoolss_PrinterDataType type,
- [out,switch_is(type)] spoolss_PrinterData data
- );
- [nopush] WERROR spoolss_SetPrinterData(
- [in,ref] policy_handle *handle,
- [in] [string,charset(UTF16)] uint16 value_name[],
- [in] spoolss_PrinterDataType type,
- [in,subcontext(4),switch_is(type)] spoolss_PrinterData data,
- [in,value(ndr_size_spoolss_PrinterData(&data,type,flags))] uint32 _offered
- );
-
- /******************/
- /* Function: 0x1c */
- [todo] WERROR spoolss_WaitForPrinterChange(
- );
-
- /******************/
- /* Function: 0x1d */
- [public] WERROR spoolss_ClosePrinter(
- [in,out,ref] policy_handle *handle
- );
-
- /******************/
- /* Function: 0x1e */
- typedef [v1_enum] enum {
- SPOOLSS_FORM_USER = 0,
- SPOOLSS_FORM_BUILTIN = 1,
- SPOOLSS_FORM_PRINTER = 2
- } spoolss_FormFlags;
-
- typedef struct {
- uint32 width;
- uint32 height;
- } spoolss_FormSize;
-
- typedef struct {
- uint32 left;
- uint32 top;
- uint32 right;
- uint32 bottom;
- } spoolss_FormArea;
-
- typedef struct {
- spoolss_FormFlags flags;
- [relative] nstring *form_name;
- spoolss_FormSize size;
- spoolss_FormArea area;
- } spoolss_FormInfo1;
-
- typedef [nodiscriminant,relative_base,public,gensize] union {
- [case(1)] spoolss_FormInfo1 info1;
- [default];
- } spoolss_FormInfo;
-
- typedef struct {
- spoolss_FormFlags flags;
- [string,charset(UTF16)] uint16 *form_name;
- spoolss_FormSize size;
- spoolss_FormArea area;
- } spoolss_AddFormInfo1;
-
- typedef [switch_type(uint32)] union {
- [case(1)] spoolss_AddFormInfo1 *info1;
- } spoolss_AddFormInfo;
-
- WERROR spoolss_AddForm(
- [in,ref] policy_handle *handle,
- [in] uint32 level,
- [in,switch_is(level)] spoolss_AddFormInfo info
- );
-
- /******************/
- /* Function: 0x1f */
- WERROR spoolss_DeleteForm(
- [in,ref] policy_handle *handle,
- [in] [string,charset(UTF16)] uint16 form_name[]
- );
-
- /******************/
- /* Function: 0x20 */
- WERROR spoolss_GetForm(
- [in,ref] policy_handle *handle,
- [in] [string,charset(UTF16)] uint16 form_name[],
- [in] uint32 level,
- [in,unique] DATA_BLOB *buffer,
- [in] uint32 offered,
- [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_FormInfo *info,
- [out] uint32 needed
- );
-
- /******************/
- /* Function: 0x21 */
- WERROR spoolss_SetForm(
- [in,ref] policy_handle *handle,
- [in] [string,charset(UTF16)] uint16 form_name[],
- [in] uint32 level,
- [in,switch_is(level)] spoolss_AddFormInfo info
- );
-
- /******************/
- /* Function: 0x22 */
- [public,noopnum,noprint] WERROR _spoolss_EnumForms(
- [in,ref] policy_handle *handle,
- [in] uint32 level,
- [in,unique] DATA_BLOB *buffer,
- [in] uint32 offered,
- [out,unique] DATA_BLOB *info,
- [out] uint32 needed,
- [out] uint32 count
- );
- [public,noopnum,noprint] void __spoolss_EnumForms(
- [in] uint32 level,
- [in] uint32 count,
- [out,switch_is(level)] spoolss_FormInfo info[count]
- );
- [nopull,nopush] WERROR spoolss_EnumForms(
- [in,ref] policy_handle *handle,
- [in] uint32 level,
- [in,unique] DATA_BLOB *buffer,
- [in] uint32 offered,
- [out,unique,switch_is(level),size_is(count)] spoolss_FormInfo *info,
- [out] uint32 needed,
- [out] uint32 count
- );
-
- typedef struct {
- [relative] nstring *port_name;
- } spoolss_PortInfo1;
-
- typedef bitmap {
- SPOOLSS_PORT_TYPE_WRITE = 0x00000001,
- SPOOLSS_PORT_TYPE_READ = 0x00000002,
- SPOOLSS_PORT_TYPE_REDIRECTED = 0x00000004,
- SPOOLSS_PORT_TYPE_NET_ATTACHED = 0x00000008
- } spoolss_PortType;
-
- typedef struct {
- [relative] nstring *port_name;
- [relative] nstring *monitor_name;
- [relative] nstring *description;
- spoolss_PortType port_type;
- uint32 reserved;
- } spoolss_PortInfo2;
-
- typedef [nodiscriminant,relative_base,public] union {
- [case(1)] spoolss_PortInfo1 info1;
- [case(2)] spoolss_PortInfo2 info2;
- [case(3)]; /* TODO */
- [default];
- } spoolss_PortInfo;
-
- /******************/
- /* Function: 0x23 */
- [public,noopnum,noprint] WERROR _spoolss_EnumPorts(
- [in,unique] [string,charset(UTF16)] uint16 *servername,
- [in] uint32 level,
- [in,unique] DATA_BLOB *buffer,
- [in] uint32 offered,
- [out,unique] DATA_BLOB *info,
- [out] uint32 needed,
- [out] uint32 count
- );
- [public,noopnum,noprint] void __spoolss_EnumPorts(
- [in] uint32 level,
- [in] uint32 count,
- [out,switch_is(level)] spoolss_PortInfo info[count]
- );
- [nopull,nopush] WERROR spoolss_EnumPorts(
- [in,unique] [string,charset(UTF16)] uint16 *servername,
- [in] uint32 level,
- [in,unique] DATA_BLOB *buffer,
- [in] uint32 offered,
- [out,unique,switch_is(level),size_is(count)] spoolss_PortInfo *info,
- [out] uint32 needed,
- [out] uint32 count
- );
-
- /******************/
- /* Function: 0x24 */
- typedef struct {
- [relative] nstring *monitor_name;
- } spoolss_MonitorInfo1;
-
- typedef struct {
- [relative] nstring *monitor_name;
- [relative] nstring *environment;
- [relative] nstring *dll_name;
- } spoolss_MonitorInfo2;
-
- typedef [nodiscriminant,relative_base,public] union {
- [case(1)] spoolss_MonitorInfo1 info1;
- [case(2)] spoolss_MonitorInfo2 info2;
- [default];
- } spoolss_MonitorInfo;
-
- [public,noopnum,noprint] WERROR _spoolss_EnumMonitors(
- [in,unique] [string,charset(UTF16)] uint16 *servername,
- [in] uint32 level,
- [in,unique] DATA_BLOB *buffer,
- [in] uint32 offered,
- [out,unique] DATA_BLOB *info,
- [out] uint32 needed,
- [out] uint32 count
- );
- [public,noopnum,noprint] void __spoolss_EnumMonitors(
- [in] uint32 level,
- [in] uint32 count,
- [out,switch_is(level)] spoolss_MonitorInfo info[count]
- );
- [nopull,nopush] WERROR spoolss_EnumMonitors(
- [in,unique] [string,charset(UTF16)] uint16 *servername,
- [in] uint32 level,
- [in,unique] DATA_BLOB *buffer,
- [in] uint32 offered,
- [out,unique,switch_is(level),size_is(count)] spoolss_MonitorInfo *info,
- [out] uint32 needed,
- [out] uint32 count
- );
-
- /******************/
- /* Function: 0x25 */
- WERROR spoolss_AddPort(
- [in,unique] [string,charset(UTF16)] uint16 *server_name,
- [in] uint32 unknown,
- [in] [string,charset(UTF16)] uint16 monitor_name[]
- );
-
- /******************/
- /* Function: 0x26 */
- [todo] WERROR spoolss_ConfigurePort(
- );
-
- /******************/
- /* Function: 0x27 */
- [todo] WERROR spoolss_DeletePort(
- );
-
- /******************/
- /* Function: 0x28 */
- [todo] WERROR spoolss_CreatePrinterIC(
- );
-
- /******************/
- /* Function: 0x29 */
- [todo] WERROR spoolss_PlayGDIScriptOnPrinterIC(
- );
-
- /******************/
- /* Function: 0x2a */
- [todo] WERROR spoolss_DeletePrinterIC(
- );
-
- /******************/
- /* Function: 0x2b */
- [todo] WERROR spoolss_AddPrinterConnection(
- );
-
- /******************/
- /* Function: 0x2c */
- [todo] WERROR spoolss_DeletePrinterConnection(
- );
-
- /******************/
- /* Function: 0x2d */
- [todo] WERROR spoolss_PrinterMessageBox(
- /* Marked as obsolete in MSDN. "Not necessary and has
- no effect". */
- );
-
- /******************/
- /* Function: 0x2e */
- [todo] WERROR spoolss_AddMonitor(
- );
-
- /******************/
- /* Function: 0x2f */
- [todo] WERROR spoolss_DeleteMonitor(
- );
-
- /******************/
- /* Function: 0x30 */
- [todo] WERROR spoolss_DeletePrintProcessor(
- );
-
- /******************/
- /* Function: 0x31 */
- [todo] WERROR spoolss_AddPrintProvidor(
- );
-
- /******************/
- /* Function: 0x32 */
- [todo] WERROR spoolss_DeletePrintProvidor(
- );
-
- /******************/
- /* Function: 0x33 */
- [todo] WERROR spoolss_EnumPrintProcDataTypes(
- );
-
- /******************/
- /* Function: 0x34 */
- [todo] WERROR spoolss_ResetPrinter(
- );
-
- /******************/
- /* Function: 0x35 */
- WERROR spoolss_GetPrinterDriver2(
- [in,ref] policy_handle *handle,
- [in,unique] [string,charset(UTF16)] uint16 *architecture,
- [in] uint32 level,
- [in,unique] DATA_BLOB *buffer,
- [in] uint32 offered,
- [in] uint32 client_major_version,
- [in] uint32 client_minor_version,
- [out,unique] DATA_BLOB *info,
- [out] uint32 needed,
- [out] uint32 server_major_version,
- [out] uint32 server_minor_version
- );
-
- /******************/
- /* Function: 0x36 */
- [todo] WERROR spoolss_FindFirstPrinterChangeNotification(
- );
-
- /******************/
- /* Function: 0x37 */
- [todo] WERROR spoolss_FindNextPrinterChangeNotification(
- );
-
- /******************/
- /* Function: 0x38 */
- [public] WERROR spoolss_FindClosePrinterNotify(
- [in,ref] policy_handle *handle
- );
-
- /******************/
- /* Function: 0x39 */
- [todo] WERROR spoolss_RouterFindFirstPrinterChangeNotificationOld(
- );
-
- /******************/
- /* Function: 0x3a */
- [public] WERROR spoolss_ReplyOpenPrinter(
- [in,string,charset(UTF16)] uint16 server_name[],
- [in] uint32 printer_local,
- [in] winreg_Type type,
- [in] uint32 unknown1,
- [in] uint32 unknown2,
- [out,ref] policy_handle *handle
- );
-
- /******************/
- /* Function: 0x3b */
- [todo] WERROR spoolss_RouterReplyPrinter(
- );
-
- /******************/
- /* Function: 0x3c */
- [public] WERROR spoolss_ReplyClosePrinter(
- [in,out,ref] policy_handle *handle
- );
-
- /******************/
- /* Function: 0x3d */
- [todo] WERROR spoolss_AddPortEx(
- );
-
- /******************/
- /* Function: 0x3e */
- [todo] WERROR spoolss_RouterFindFirstPrinterChangeNotification(
- );
-
- /******************/
- /* Function: 0x3f */
- [todo] WERROR spoolss_SpoolerInit(
- );
-
- /******************/
- /* Function: 0x40 */
- [todo] WERROR spoolss_ResetPrinterEx(
- );
-
- typedef [enum16bit] enum {
- SPOOLSS_FIELD_SERVER_NAME = 0,
- SPOOLSS_FIELD_PRINTER_NAME = 1,
- SPOOLSS_FIELD_SHARE_NAME = 2,
- SPOOLSS_FIELD_PORT_NAME = 3,
- SPOOLSS_FIELD_DRIVER_NAME = 4,
- SPOOLSS_FIELD_COMMENT = 5,
- SPOOLSS_FIELD_LOCATION = 6,
- SPOOLSS_FIELD_DEVMODE = 7,
- SPOOLSS_FIELD_SEPFILE = 8,
- SPOOLSS_FIELD_PRINT_PROCESSOR = 9,
- SPOOLSS_FIELD_PARAMETERS = 10,
- SPOOLSS_FIELD_DATATYPE = 11,
- SPOOLSS_FIELD_SECURITY_DESCRIPTOR=12,
- SPOOLSS_FIELD_ATTRIBUTES = 13,
- SPOOLSS_FIELD_PRIORITY = 14,
- SPOOLSS_FIELD_DEFAULT_PRIORITY = 15,
- SPOOLSS_FIELD_START_TIME = 16,
- SPOOLSS_FIELD_UNTIL_TIME = 17,
- SPOOLSS_FIELD_STATUS = 18,
- SPOOLSS_FIELD_STATUS_STRING = 19,
- SPOOLSS_FIELD_CJOBS = 20,
- SPOOLSS_FIELD_AVERAGE_PPM = 21,
- SPOOLSS_FIELD_TOTAL_PAGES = 22,
- SPOOLSS_FIELD_PAGES_PRINTED = 23,
- SPOOLSS_FIELD_TOTAL_BYTES = 24,
- SPOOLSS_FIELD_BYTES_PRINTED = 25
- } spoolss_Field;
-
- typedef [enum16bit] enum {
- SPOOLSS_NOTIFY_PRINTER = 0,
- SPOOLSS_NOTIFY_JOB = 1
- } spoolss_NotifyType;
-
- /******************/
- /* Function: 0x41 */
- typedef struct {
- spoolss_NotifyType type;
- uint16 u1;
- uint32 u2;
- uint32 u3;
- uint32 count;
- [size_is(count)] spoolss_Field *fields;
- } spoolss_NotifyOptionsArray;
-
- typedef struct {
- uint32 version;
- uint32 flags;
- uint32 count;
- [size_is(count)] spoolss_NotifyOptionsArray *options;
- } spoolss_NotifyOptionsContainer;
-
- [public] WERROR spoolss_RemoteFindFirstPrinterChangeNotifyEx(
- [in,ref] policy_handle *handle,
- [in] uint32 flags,
- [in] uint32 options,
- [in,unique] [string,charset(UTF16)] uint16 *str,
- [in] uint32 printer_local,
- [in,unique] spoolss_NotifyOptionsContainer *t1
- );
-
- /******************/
- /* Function: 0x42 */
- [todo] WERROR spoolss_RouterRefreshPrinterChangeNotification(
- );
-
- typedef struct {
- uint32 size;
- [size_is(size/2),unique,charset(UTF16)] uint16 *string;
- } spoolss_NotifyUTF16String;
-
- typedef struct {
- uint32 size;
- [size_is(size),charset(DOS)] uint8 *string;
- } spoolss_NotifyDOSString;
-
- typedef struct {
- uint16 data[8];
- } spoolss_NotifyBlobData;
-
- typedef struct {
- uint32 len;
- [unique] spoolss_NotifyBlobData *data;
- } spoolss_NotifyBlob;
-
- typedef [switch_type(uint32)] union {
- [case(1)] dlong integer;
- [case(2)] spoolss_NotifyUTF16String utf16_string;
- [case(3)] spoolss_NotifyDOSString ascii_string;
- [case(4)] spoolss_NotifyBlob blob;
- [case(5)] spoolss_NotifyDOSString ascii_string;
- } spoolss_NotifyData;
-
- typedef struct {
- spoolss_NotifyType type;
- spoolss_Field field;
- uint32 variable_type;
- uint32 job_id;
- [switch_is(variable_type)] spoolss_NotifyData data;
- } spoolss_Notify;
-
- typedef struct {
- uint32 version;
- uint32 flags;
- uint32 count;
- [size_is(count)] spoolss_Notify notifies[];
- } spoolss_NotifyInfo;
-
- /******************/
- /* Function: 0x43 */
- [public] WERROR spoolss_RemoteFindNextPrinterChangeNotifyEx(
- [in,ref] policy_handle *handle,
- [in] uint32 change_low,
- [in,unique] spoolss_NotifyOptionsContainer *container,
- [out, unique] spoolss_NotifyInfo *info
- );
-
- /******************/
- /* Function: 0x44 */
- [todo] WERROR spoolss_44(
- );
-
- typedef struct {
- uint32 size;
- [string,charset(UTF16)] uint16 *client;
- [string,charset(UTF16)] uint16 *user;
- uint32 build;
- uint32 major;
- uint32 minor;
- uint32 processor;
- } spoolss_UserLevel1;
-
- typedef union {
- [case(1)] spoolss_UserLevel1 *level1;
- } spoolss_UserLevel;
-
- typedef bitmap {
- SERVER_ACCESS_ADMINISTER = 0x00000001,
- SERVER_ACCESS_ENUMERATE = 0x00000002,
- PRINTER_ACCESS_ADMINISTER = 0x00000004,
- PRINTER_ACCESS_USE = 0x00000008,
- JOB_ACCESS_ADMINISTER = 0x00000010
- } spoolss_AccessRights;
-
- /* Access rights for print servers */
- const int SERVER_ALL_ACCESS = SEC_STD_REQUIRED |
- SERVER_ACCESS_ADMINISTER |
- SERVER_ACCESS_ENUMERATE;
-
- const int SERVER_READ = SEC_STD_READ_CONTROL |
- SERVER_ACCESS_ENUMERATE;
-
- const int SERVER_WRITE = STANDARD_RIGHTS_WRITE_ACCESS |
- SERVER_ACCESS_ADMINISTER |
- SERVER_ACCESS_ENUMERATE;
-
- const int SERVER_EXECUTE = SEC_STD_READ_CONTROL |
- SERVER_ACCESS_ENUMERATE;
-
- /* Access rights for printers */
- const int PRINTER_ALL_ACCESS = SEC_STD_REQUIRED |
- PRINTER_ACCESS_ADMINISTER |
- PRINTER_ACCESS_USE;
-
- const int PRINTER_READ = SEC_STD_READ_CONTROL |
- PRINTER_ACCESS_USE;
-
- const int PRINTER_WRITE = STANDARD_RIGHTS_WRITE_ACCESS |
- PRINTER_ACCESS_USE;
-
- const int PRINTER_EXECUTE = SEC_STD_READ_CONTROL |
- PRINTER_ACCESS_USE;
-
- /* Access rights for jobs */
- const int JOB_ALL_ACCESS = SEC_STD_REQUIRED |
- JOB_ACCESS_ADMINISTER;
-
- const int JOB_READ = SEC_STD_READ_CONTROL |
- JOB_ACCESS_ADMINISTER;
-
- const int JOB_WRITE = STANDARD_RIGHTS_WRITE_ACCESS |
- JOB_ACCESS_ADMINISTER;
-
- const int JOB_EXECUTE = SEC_STD_READ_CONTROL |
- JOB_ACCESS_ADMINISTER;
-
- /* ACE masks for various print permissions */
- const int PRINTER_ACE_FULL_CONTROL = SEC_GENERIC_ALL |
- PRINTER_ALL_ACCESS;
-
- const int PRINTER_ACE_MANAGE_DOCUMENTS = SEC_GENERIC_ALL |
- READ_CONTROL_ACCESS;
-
- const int PRINTER_ACE_PRINT = GENERIC_EXECUTE_ACCESS |
- READ_CONTROL_ACCESS |
- PRINTER_ACCESS_USE;
-
- /******************/
- /* Function: 0x45 */
- [public] WERROR spoolss_OpenPrinterEx(
- [in,unique] [string,charset(UTF16)] uint16 *printername,
- [in,unique] [string,charset(UTF16)] uint16 *datatype,
- [in] spoolss_DevmodeContainer devmode_ctr,
- [in] uint32 access_mask,
- [in] uint32 level,
- [in,switch_is(level)] spoolss_UserLevel userlevel,
- [out,ref] policy_handle *handle
- );
-
- /******************/
- /* Function: 0x46 */
- WERROR spoolss_AddPrinterEx(
- [in,unique] [string,charset(UTF16)] uint16 *server,
- [in] uint32 level,
- [in,unique,switch_is(level)] spoolss_PrinterInfo *info,
- [in] spoolss_DevmodeContainer devmode_ctr,
- [in,unique] security_descriptor *secdesc,
- [in] uint32 ulevel,
- [in,switch_is(ulevel)] spoolss_UserLevel userlevel
- );
-
- /******************/
- /* Function: 0x47 */
- [todo] WERROR spoolss_47(
- );
-
- /******************/
- /* Function: 0x48 */
- WERROR spoolss_EnumPrinterData(
- [in,ref] policy_handle *handle,
- [in] uint32 enum_index,
- [out,ref,size_is(value_offered/2),charset(UTF16)] uint16 *value_name,
- [in] uint32 value_offered,
- [out,ref] uint32 *value_needed,
- [out,ref] uint32 *printerdata_type,
- [out,ref] DATA_BLOB *buffer,
- [in] uint32 data_offered,
- [out,ref] uint32 *data_needed
- );
-
- /******************/
- /* Function: 0x49 */
- WERROR spoolss_DeletePrinterData(
- [in,ref] policy_handle *handle,
- [in] [string,charset(UTF16)] uint16 value_name[]
- );
-
- /******************/
- /* Function: 0x4a */
- [todo] WERROR spoolss_4a(
- );
-
- /******************/
- /* Function: 0x4b */
- [todo] WERROR spoolss_4b(
- );
-
- /******************/
- /* Function: 0x4c */
- [todo] WERROR spoolss_4c(
- );
-
- /******************/
- /* Function: 0x4d */
- WERROR spoolss_SetPrinterDataEx(
- [in,ref] policy_handle *handle,
- [in] [string,charset(UTF16)] uint16 key_name[],
- [in] [string,charset(UTF16)] uint16 value_name[],
- [in] uint32 type,
- [in] DATA_BLOB buffer,
- [in] uint32 offered
- );
-
- /******************/
- /* Function: 0x4e */
- WERROR spoolss_GetPrinterDataEx(
- [in,ref] policy_handle *handle,
- [in] [string,charset(UTF16)] uint16 key_name[],
- [in] [string,charset(UTF16)] uint16 value_name[],
- [in] uint32 offered,
- [out] uint32 type,
- [out] DATA_BLOB buffer,
- [out] uint32 needed
- );
-
- /******************/
- /* Function: 0x4f */
- [public] WERROR spoolss_EnumPrinterDataEx(
- [in,ref] policy_handle *handle,
- [in] [string,charset(UTF16)] uint16 key_name[],
- [in] uint32 offered,
- [out] DATA_BLOB buffer,
- [out] uint32 needed,
- [out] uint32 count
- );
-
- /******************/
- /* Function: 0x50 */
- [public] WERROR spoolss_EnumPrinterKey(
- [in, ref] policy_handle *handle,
- [in] [string,charset(UTF16)] uint16 key_name[],
- [out] uint32 key_buffer_size,
- [out] uint16 key_buffer[key_buffer_size],
- [in,out] uint32 needed
- );
-
- /******************/
- /* Function: 0x51 */
- WERROR spoolss_DeletePrinterDataEx(
- [in,ref] policy_handle *handle,
- [in] [string,charset(UTF16)] uint16 key_name[],
- [in] [string,charset(UTF16)] uint16 value_name[]
- );
-
- /******************/
- /* Function: 0x52 */
- [todo] WERROR spoolss_DeletePrinterKey(
- );
-
- /******************/
- /* Function: 0x53 */
- [todo] WERROR spoolss_53(
- );
-
- /******************/
- /* Function: 0x54 */
- [todo] WERROR spoolss_DeletePrinterDriverEx(
- );
-
- /******************/
- /* Function: 0x55 */
- [todo] WERROR spoolss_55(
- );
-
- /******************/
- /* Function: 0x56 */
- [todo] WERROR spoolss_56(
- );
-
- /******************/
- /* Function: 0x57 */
- [todo] WERROR spoolss_57(
- );
-
- /******************/
- /* Function: 0x58 */
- WERROR spoolss_XcvData(
- [in,ref] policy_handle *handle,
- [in] [string,charset(UTF16)] uint16 function_name[],
- [in] DATA_BLOB in_data,
- [in,value(r->in.in_data.length)] uint32 _in_data_length,
- [in] uint32 offered,
- [in] uint32 unknown1,
- [out] DATA_BLOB out_data,
- [out] uint32 needed,
- [out] uint32 unknown2
- );
-
- /******************/
- /* Function: 0x59 */
- [public,todo] WERROR spoolss_AddPrinterDriverEx(
- );
-
- /******************/
- /* Function: 0x5a */
- [todo] WERROR spoolss_5a(
- );
-
- /******************/
- /* Function: 0x5b */
- [todo] WERROR spoolss_5b(
- );
-
- /******************/
- /* Function: 0x5c */
- [todo] WERROR spoolss_5c(
- );
-
- /******************/
- /* Function: 0x5d */
- [todo] WERROR spoolss_5d(
- );
-
- /******************/
- /* Function: 0x5e */
- [todo] WERROR spoolss_5e(
- );
-
- /******************/
- /* Function: 0x5f */
- [todo] WERROR spoolss_5f(
- );
-}
diff --git a/source3/librpc/idl/svcctl.idl b/source3/librpc/idl/svcctl.idl
deleted file mode 100644
index d1289a64d7..0000000000
--- a/source3/librpc/idl/svcctl.idl
+++ /dev/null
@@ -1,529 +0,0 @@
-#include "idl_types.h"
-
-/*
- svcctl interface definitions
-*/
-
-import "misc.idl";
-[ uuid("367abb81-9844-35f1-ad32-98f038001003"),
- version(2.0),
- pointer_default(unique),
- endpoint("ncacn_np:[\\pipe\\svcctl]", "ncalrpc:"),
- helpstring("Service Control")
-] interface svcctl
-{
- typedef struct {
- uint32 is_locked;
- [string,charset(UTF16)] uint16 *lock_owner;
- uint32 lock_duration;
- } SERVICE_LOCK_STATUS;
-
- typedef struct {
- uint32 type;
- uint32 state;
- uint32 controls_accepted;
- WERROR win32_exit_code;
- uint32 service_exit_code;
- uint32 check_point;
- uint32 wait_hint;
- } SERVICE_STATUS;
-
- typedef struct {
- [relative] astring *service_name;
- [relative] astring *display_name;
- SERVICE_STATUS status;
- } ENUM_SERVICE_STATUS;
-
- const int SERVICE_TYPE_KERNEL_DRIVER = 0x01;
- const int SERVICE_TYPE_FS_DRIVER = 0x02;
- const int SERVICE_TYPE_ADAPTER = 0x04;
- const int SERVICE_TYPE_RECOGNIZER_DRIVER = 0x08;
- const int SERVICE_TYPE_DRIVER=SERVICE_TYPE_KERNEL_DRIVER|SERVICE_TYPE_FS_DRIVER|SERVICE_TYPE_RECOGNIZER_DRIVER;
- const int SERVICE_TYPE_WIN32_OWN_PROCESS = 0x10;
- const int SERVICE_TYPE_WIN32_SHARE_PROCESS = 0x20;
- const int SERVICE_TYPE_WIN32=SERVICE_TYPE_WIN32_OWN_PROCESS|SERVICE_TYPE_WIN32_SHARE_PROCESS;
-
- const int SERVICE_STATE_ACTIVE = 0x01;
- const int SERVICE_STATE_INACTIVE = 0x02;
- const int SERVICE_STATE_ALL = 0x03;
-
- typedef [public,bitmap32bit] bitmap {
- SV_TYPE_WORKSTATION = 0x00000001,
- SV_TYPE_SERVER = 0x00000002,
- SV_TYPE_SQLSERVER = 0x00000004,
- SV_TYPE_DOMAIN_CTRL = 0x00000008,
- SV_TYPE_DOMAIN_BAKCTRL = 0x00000010,
- SV_TYPE_TIME_SOURCE = 0x00000020,
- SV_TYPE_AFP = 0x00000040,
- SV_TYPE_NOVELL = 0x00000080,
-
- SV_TYPE_DOMAIN_MEMBER = 0x00000100,
- SV_TYPE_PRINTQ_SERVER = 0x00000200,
- SV_TYPE_DIALIN_SERVER = 0x00000400,
- SV_TYPE_SERVER_UNIX = 0x00000800,
- SV_TYPE_NT = 0x00001000,
- SV_TYPE_WFW = 0x00002000,
- SV_TYPE_SERVER_MFPN = 0x00004000,
- SV_TYPE_SERVER_NT = 0x00008000,
- SV_TYPE_POTENTIAL_BROWSER = 0x00010000,
- SV_TYPE_BACKUP_BROWSER = 0x00020000,
- SV_TYPE_MASTER_BROWSER = 0x00040000,
- SV_TYPE_DOMAIN_MASTER = 0x00080000,
- SV_TYPE_SERVER_OSF = 0x00100000,
- SV_TYPE_SERVER_VMS = 0x00200000,
- SV_TYPE_WIN95_PLUS = 0x00400000,
- SV_TYPE_DFS_SERVER = 0x00800000,
- SV_TYPE_ALTERNATE_XPORT = 0x20000000,
- SV_TYPE_LOCAL_LIST_ONLY = 0x40000000,
- SV_TYPE_DOMAIN_ENUM = 0x80000000
- } svcctl_ServerType;
-
- const uint32 SV_TYPE_ALL = 0xFFFFFFFF;
-
- /*****************/
- /* Function 0x00 */
- WERROR svcctl_CloseServiceHandle(
- [in,out,ref] policy_handle *handle
- );
-
- /*****************/
- /* Function 0x01 */
-
- typedef enum {
- FIXME=1
- } SERVICE_CONTROL;
-
- WERROR svcctl_ControlService(
- [in,ref] policy_handle *handle,
- [in] uint32 control,
- [out,ref] SERVICE_STATUS *service_status
- );
-
- /*****************/
- /* Function 0x02 */
- WERROR svcctl_DeleteService(
- [in,ref] policy_handle *handle
- );
-
- /*****************/
- /* Function 0x03 */
-
- WERROR svcctl_LockServiceDatabase(
- [in,ref] policy_handle *handle,
- [out,ref] policy_handle *lock
- );
-
- /*****************/
- /* Function 0x04 */
- WERROR svcctl_QueryServiceObjectSecurity(
- [in] policy_handle *handle,
- [in] uint32 security_flags,
- [out,ref,size_is(buffer_size)] uint8 *buffer,
- [in,range(0,0x40000)] uint32 buffer_size,
- [out,ref,range(0,0x40000)] uint32 *needed
- );
-
- /*****************/
- /* Function 0x05 */
- WERROR svcctl_SetServiceObjectSecurity(
- [in] policy_handle *handle,
- [in] uint32 security_flags,
- [in,ref,size_is(buffer_size)] uint8 *buffer,
- [in] uint32 buffer_size
- );
-
- /*****************/
- /* Function 0x06 */
- WERROR svcctl_QueryServiceStatus(
- [in,ref] policy_handle *handle,
- [out,ref] SERVICE_STATUS *service_status
- );
-
- /*****************/
- /* Function 0x07 */
- [todo] WERROR svcctl_SetServiceStatus(
- );
-
- /*****************/
- /* Function 0x08 */
- WERROR svcctl_UnlockServiceDatabase(
- [in,out,ref] policy_handle *lock
- );
-
- /*****************/
- /* Function 0x09 */
- [todo] WERROR svcctl_NotifyBootConfigStatus(
- );
-
- /*****************/
- /* Function 0x0a */
- WERROR svcctl_SCSetServiceBitsW(
- [in,ref] policy_handle *handle,
- [in] uint32 bits,
- [in] boolean32 bitson,
- [in] boolean32 immediate
- );
-
- /*****************/
- /* Function 0x0b */
- WERROR svcctl_ChangeServiceConfigW(
- [in,ref] policy_handle *handle,
- [in] uint32 type,
- [in] uint32 start,
- [in] uint32 error,
- [in,unique] [string,charset(UTF16)] uint16 *binary_path,
- [in,unique] [string,charset(UTF16)] uint16 *load_order_group,
- [out,ref] uint32 *tag_id,
- [in,unique] [string,charset(UTF16)] uint16 *dependencies,
- [in,unique] [string,charset(UTF16)] uint16 *service_start_name,
- [in,unique] [string,charset(UTF16)] uint16 *password,
- [in,unique] [string,charset(UTF16)] uint16 *display_name
- );
-
- /*****************/
- /* Function 0x0c */
- WERROR svcctl_CreateServiceW(
- [in,ref] policy_handle *scmanager_handle,
- [in] [string,charset(UTF16)] uint16 ServiceName[],
- [in,unique] [string,charset(UTF16)] uint16 *DisplayName,
- [in] uint32 desired_access,
- [in] uint32 type,
- [in] uint32 start_type,
- [in] uint32 error_control,
- [in] [string,charset(UTF16)] uint16 binary_path[],
- [in,unique] [string,charset(UTF16)] uint16 *LoadOrderGroupKey,
- [in,out,unique] uint32 *TagId,
- [in,unique,size_is(dependencies_size)] uint8 *dependencies,
- [in] uint32 dependencies_size,
- [in,unique] [string,charset(UTF16)] uint16 *service_start_name,
- [in,unique,size_is(password_size)] uint8 *password,
- [in] uint32 password_size,
- [out,ref] policy_handle *handle
- );
-
- /*****************/
- /* Function 0x0d */
- WERROR svcctl_EnumDependentServicesW(
- [in,ref] policy_handle *service,
- [in] uint32 state,
- [out,ref,size_is(buf_size)] uint8 *service_status,
- [in,range(0,0x40000)] uint32 buf_size,
- [out,ref,range(0,0x40000)] uint32 *bytes_needed,
- [out,ref,range(0,0x40000)] uint32 *services_returned
- );
-
- /*****************/
- /* Function 0x0e */
- WERROR svcctl_EnumServicesStatusW(
- [in,ref] policy_handle *handle,
- [in] uint32 type,
- [in] uint32 state,
- [in] uint32 buf_size,
- [out,size_is(buf_size)] uint8 service[*],
- [out,ref] uint32 *bytes_needed,
- [out,ref] uint32 *services_returned,
- [in,out,unique] uint32 *resume_handle
- );
-
- /*****************/
- /* Function 0x0f */
- typedef [bitmap32bit] bitmap {
- SC_RIGHT_MGR_CONNECT = 0x0001,
- SC_RIGHT_MGR_CREATE_SERVICE = 0x0002,
- SC_RIGHT_MGR_ENUMERATE_SERVICE = 0x0004,
- SC_RIGHT_MGR_LOCK = 0x0008,
- SC_RIGHT_MGR_QUERY_LOCK_STATUS = 0x0010,
- SC_RIGHT_MGR_MODIFY_BOOT_CONFIG = 0x0020
- } svcctl_MgrAccessMask;
-
- WERROR svcctl_OpenSCManagerW(
- [in,unique] [string,charset(UTF16)] uint16 *MachineName,
- [in,unique] [string,charset(UTF16)] uint16 *DatabaseName,
- [in] svcctl_MgrAccessMask access_mask,
- [out,ref] policy_handle *handle
- );
-
- /*****************/
- /* Function 0x10 */
- typedef [bitmap32bit] bitmap {
- SC_RIGHT_SVC_QUERY_CONFIG = 0x0001,
- SC_RIGHT_SVC_CHANGE_CONFIG = 0x0002,
- SC_RIGHT_SVC_QUERY_STATUS = 0x0004,
- SC_RIGHT_SVC_ENUMERATE_DEPENDENTS = 0x0008,
- SC_RIGHT_SVC_START = 0x0010,
- SC_RIGHT_SVC_STOP = 0x0020,
- SC_RIGHT_SVC_PAUSE_CONTINUE = 0x0040,
- SC_RIGHT_SVC_INTERROGATE = 0x0080,
- SC_RIGHT_SVC_USER_DEFINED_CONTROL = 0x0100
- } svcctl_ServiceAccessMask;
-
- WERROR svcctl_OpenServiceW(
- [in,ref] policy_handle *scmanager_handle,
- [in] [string,charset(UTF16)] uint16 ServiceName[],
- [in] svcctl_ServiceAccessMask access_mask,
- [out,ref] policy_handle *handle
- );
-
- /*****************/
- /* Function 0x11 */
- WERROR svcctl_QueryServiceConfigW(
- [in,ref] policy_handle *handle,
- [out] uint8 query[buf_size], /*QUERY_SERVICE_CONFIG */
- [in] uint32 buf_size,
- [out,ref] uint32 *bytes_needed
- );
-
- /*****************/
- /* Function 0x12 */
- WERROR svcctl_QueryServiceLockStatusW(
- [in,ref] policy_handle *handle,
- [in] uint32 buf_size,
- [out,ref] SERVICE_LOCK_STATUS *lock_status,
- [out,ref] uint32 *required_buf_size
- );
-
- /*****************/
- /* Function 0x13 */
- WERROR svcctl_StartServiceW(
- [in,ref] policy_handle *handle,
- [in] uint32 NumArgs,
- [in,unique/*FIXME:,length_is(NumArgs)*/] [string,charset(UTF16)] uint16 *Arguments
- );
-
- /*****************/
- /* Function 0x14 */
- WERROR svcctl_GetServiceDisplayNameW(
- [in,ref] policy_handle *handle,
- [in,unique] [string,charset(UTF16)] uint16 *service_name,
- [out,ref] [string,charset(UTF16)] uint16 **display_name,
- [in,out,unique] uint32 *display_name_length
- );
-
- /*****************/
- /* Function 0x15 */
- WERROR svcctl_GetServiceKeyNameW(
- [in,ref] policy_handle *handle,
- [in,unique] [string,charset(UTF16)] uint16 *service_name,
- [out,ref] [string,charset(UTF16)] uint16 **key_name,
- [in,out,unique] uint32 *display_name_length
- );
-
- /*****************/
- /* Function 0x16 */
- WERROR svcctl_SCSetServiceBitsA(
- [in,ref] policy_handle *handle,
- [in] uint32 bits,
- [in] boolean32 bitson,
- [in] boolean32 immediate
- );
-
- /*****************/
- /* Function 0x17 */
- WERROR svcctl_ChangeServiceConfigA(
- [in,ref] policy_handle *handle,
- [in] uint32 type,
- [in] uint32 start,
- [in] uint32 error,
- [in,unique] [string,charset(UTF16)] uint16 *binary_path,
- [in,unique] [string,charset(UTF16)] uint16 *load_order_group,
- [out,ref] uint32 *tag_id,
- [in,unique] [string,charset(UTF16)] uint16 *dependencies,
- [in,unique] [string,charset(UTF16)] uint16 *service_start_name,
- [in,unique] [string,charset(UTF16)] uint16 *password,
- [in,unique] [string,charset(UTF16)] uint16 *display_name
- );
-
- /*****************/
- /* Function 0x18 */
- WERROR svcctl_CreateServiceA(
- [in,ref] policy_handle *handle,
- [in,unique] [string,charset(UTF16)] uint16 *ServiceName,
- [in,unique] [string,charset(UTF16)] uint16 *DisplayName,
- [in] uint32 desired_access,
- [in] uint32 type,
- [in] uint32 start_type,
- [in] uint32 error_control,
- [in,unique] [string,charset(UTF16)] uint16 *binary_path,
- [in,unique] [string,charset(UTF16)] uint16 *LoadOrderGroupKey,
- [out,unique] uint32 *TagId,
- [in,unique] [string,charset(UTF16)] uint16 *dependencies,
- [in,unique] [string,charset(UTF16)] uint16 *service_start_name,
- [in,unique] [string,charset(UTF16)] uint16 *password
- );
-
- /*****************/
- /* Function 0x19 */
- WERROR svcctl_EnumDependentServicesA(
- [in,ref] policy_handle *service,
- [in] uint32 state,
- [out,unique] ENUM_SERVICE_STATUS *service_status,
- [in] uint32 buf_size,
- [out,ref] uint32 *bytes_needed,
- [out,ref] uint32 *services_returned
- );
-
- /*****************/
- /* Function 0x1a */
- WERROR svcctl_EnumServicesStatusA(
- [in,ref] policy_handle *handle,
- [in] uint32 type,
- [in] uint32 state,
- [in] uint32 buf_size,
- [out,size_is(buf_size)] uint8 service[*],
- [out,ref] uint32 *bytes_needed,
- [out,ref] uint32 *services_returned,
- [in,out,unique] uint32 *resume_handle
- );
-
- /*****************/
- /* Function 0x1b */
- WERROR svcctl_OpenSCManagerA(
- [in,unique] [string,charset(UTF16)] uint16 *MachineName,
- [in,unique] [string,charset(UTF16)] uint16 *DatabaseName,
- [in] uint32 access_mask,
- [out,ref] policy_handle *handle
- );
-
- /*****************/
- /* Function 0x1c */
- WERROR svcctl_OpenServiceA(
- [in,ref] policy_handle *scmanager_handle,
- [in,unique] [string,charset(UTF16)] uint16 *ServiceName,
- [in] uint32 access_mask
- );
-
- /*****************/
- /* Function 0x1d */
- WERROR svcctl_QueryServiceConfigA(
- [in,ref] policy_handle *handle,
- [out] uint8 query[buf_size], /*QUERYU_SERVICE_CONFIG */
- [in] uint32 buf_size,
- [out,ref] uint32 *bytes_needed
- );
-
- /*****************/
- /* Function 0x1e */
- WERROR svcctl_QueryServiceLockStatusA(
- [in,ref] policy_handle *handle,
- [in] uint32 buf_size,
- [out,ref] SERVICE_LOCK_STATUS *lock_status,
- [out,ref] uint32 *required_buf_size
- );
-
- /*****************/
- /* Function 0x1f */
- WERROR svcctl_StartServiceA(
- [in,ref] policy_handle *handle,
- [in] uint32 NumArgs,
- [in,unique/*FIXME:,length_is(NumArgs)*/] [string,charset(UTF16)] uint16 *Arguments
- );
-
- /*****************/
- /* Function 0x20 */
- WERROR svcctl_GetServiceDisplayNameA(
- [in,ref] policy_handle *handle,
- [in,unique] [string,charset(UTF16)] uint16 *service_name,
- [out,ref] [string,charset(UTF16)] uint16 **display_name,
- [in,out,unique] uint32 *display_name_length
- );
-
- /*****************/
- /* Function 0x21 */
- WERROR svcctl_GetServiceKeyNameA(
- [in,ref] policy_handle *handle,
- [in,unique] [string,charset(UTF16)] uint16 *service_name,
- [out,ref] [string,charset(UTF16)] uint16 **key_name,
- [in,out,unique] uint32 *display_name_length
- );
-
- /*****************/
- /* Function 0x22 */
- [todo] WERROR svcctl_GetCurrentGroupeStateW(
- );
-
- /*****************/
- /* Function 0x23 */
- [todo] WERROR svcctl_EnumServiceGroupW(
- );
-
- /*****************/
- /* Function 0x24 */
- WERROR svcctl_ChangeServiceConfig2A(
- [in,ref] policy_handle *handle,
- [in] uint32 info_level,
- [in,unique] uint8 *info
- );
-
- /*****************/
- /* Function 0x25 */
- WERROR svcctl_ChangeServiceConfig2W(
- [in,ref] policy_handle *handle,
- [in] uint32 info_level,
- [in,unique] uint8 *info
- );
-
- /*****************/
- /* Function 0x26 */
- WERROR svcctl_QueryServiceConfig2A(
- [in,ref] policy_handle *handle,
- [in] uint32 info_level,
- [out] uint8 buffer[buf_size],
- [in] uint32 buf_size,
- [out,ref] uint32 *bytes_needed
- );
-
- /*****************/
- /* Function 0x27 */
- WERROR svcctl_QueryServiceConfig2W(
- [in,ref] policy_handle *handle,
- [in] uint32 info_level,
- [out] uint8 buffer[buf_size],
- [in] uint32 buf_size,
- [out,ref] uint32 *bytes_needed
- );
-
- /*****************/
- /* Function 0x28 */
- WERROR svcctl_QueryServiceStatusEx(
- [in,ref] policy_handle *handle,
- [in] uint32 info_level,
- [out] uint8 buffer[buf_size],
- [in] uint32 buf_size,
- [out,ref] uint32 *bytes_needed
- );
-
- /*****************/
- /* Function 0x29 */
- WERROR EnumServicesStatusExA(
- [in,ref] policy_handle *scmanager,
- [in] uint32 info_level,
- [in] uint32 type,
- [in] uint32 state,
- [out] uint8 services[buf_size],
- [in] uint32 buf_size,
- [out,ref] uint32 *bytes_needed,
- [out,ref] uint32 *service_returned,
- [in,out,unique] uint32 *resume_handle,
- [out,ref] [string,charset(UTF16)] uint16 **group_name
- );
-
- /*****************/
- /* Function 0x2a */
- WERROR EnumServicesStatusExW(
- [in,ref] policy_handle *scmanager,
- [in] uint32 info_level,
- [in] uint32 type,
- [in] uint32 state,
- [out] uint8 services[buf_size],
- [in] uint32 buf_size,
- [out,ref] uint32 *bytes_needed,
- [out,ref] uint32 *service_returned,
- [in,out,unique] uint32 *resume_handle,
- [out,ref] [string,charset(UTF16)] uint16 **group_name
- );
-
- /*****************/
- /* Function 0x2b */
- [todo] WERROR svcctl_SCSendTSMessage(
- );
-}
diff --git a/source3/librpc/idl/winreg.idl b/source3/librpc/idl/winreg.idl
index 0d651800a5..58f5eab805 100644
--- a/source3/librpc/idl/winreg.idl
+++ b/source3/librpc/idl/winreg.idl
@@ -2,7 +2,7 @@
winreg interface definition
*/
-import "lsa.idl", "initshutdown.idl", "security.idl";
+import "lsa.idl", "security.idl";
[
uuid("338cd001-2244-31f1-aaaa-900038001003"),
@@ -18,14 +18,14 @@ import "lsa.idl", "initshutdown.idl", "security.idl";
KEY_QUERY_VALUE = 0x00001,
KEY_SET_VALUE = 0x00002,
KEY_CREATE_SUB_KEY = 0x00004,
- KEY_ENUMERATE_SUB_KEYS = 0x00008,
- KEY_NOTIFY = 0x00010,
+ KEY_ENUMERATE_SUB_KEYS = 0x00008,
+ KEY_NOTIFY = 0x00010,
KEY_CREATE_LINK = 0x00020,
KEY_WOW64_64KEY = 0x00100,
KEY_WOW64_32KEY = 0x00200
} winreg_AccessMask;
- typedef [v1_enum] enum {
+ typedef [public,v1_enum] enum {
REG_NONE = 0,
REG_SZ = 1,
REG_EXPAND_SZ = 2,
@@ -64,7 +64,7 @@ import "lsa.idl", "initshutdown.idl", "security.idl";
/******************/
/* Function: 0x02 */
- WERROR winreg_OpenHKLM(
+ [public] WERROR winreg_OpenHKLM(
[in,unique] uint16 *system_name,
[in] winreg_AccessMask access_mask,
[out,ref] policy_handle *handle
@@ -88,7 +88,7 @@ import "lsa.idl", "initshutdown.idl", "security.idl";
/******************/
/* Function: 0x05 */
- WERROR winreg_CloseKey(
+ [public] WERROR winreg_CloseKey(
[in,out,ref] policy_handle *handle
);
@@ -113,7 +113,7 @@ import "lsa.idl", "initshutdown.idl", "security.idl";
REG_OPENED_EXISTING_KEY = 2
} winreg_CreateAction;
- WERROR winreg_CreateKey(
+ [public] WERROR winreg_CreateKey(
[in,ref] policy_handle *handle,
[in] winreg_String name,
[in] winreg_String keyclass,
@@ -126,7 +126,7 @@ import "lsa.idl", "initshutdown.idl", "security.idl";
/******************/
/* Function: 0x07 */
- WERROR winreg_DeleteKey(
+ [public] WERROR winreg_DeleteKey(
[in,ref] policy_handle *handle,
[in] winreg_String key
);
@@ -149,7 +149,7 @@ import "lsa.idl", "initshutdown.idl", "security.idl";
/******************/
/* Function: 0x09 */
- WERROR winreg_EnumKey(
+ [public] WERROR winreg_EnumKey(
[in,ref] policy_handle *handle,
[in] uint32 enum_index,
[in,out,ref] winreg_StringBuf *name,
@@ -169,7 +169,7 @@ import "lsa.idl", "initshutdown.idl", "security.idl";
/******************/
/* Function: 0x0a */
- WERROR winreg_EnumValue(
+ [public] WERROR winreg_EnumValue(
[in,ref] policy_handle *handle,
[in] uint32 enum_index,
[in,out,ref] winreg_ValNameBuf *name,
@@ -181,13 +181,13 @@ import "lsa.idl", "initshutdown.idl", "security.idl";
/******************/
/* Function: 0x0b */
- WERROR winreg_FlushKey(
+ [public] WERROR winreg_FlushKey(
[in,ref] policy_handle *handle
);
/******************/
/* Function: 0x0c */
- WERROR winreg_GetKeySecurity(
+ [public] WERROR winreg_GetKeySecurity(
[in,ref] policy_handle *handle,
[in] security_secinfo sec_info,
[in,out,ref] KeySecurityData *sd
@@ -203,19 +203,26 @@ import "lsa.idl", "initshutdown.idl", "security.idl";
/******************/
/* Function: 0x0e */
- WERROR winreg_NotifyChangeKeyValue(
+ typedef [public,bitmap32bit] bitmap {
+ REG_NOTIFY_CHANGE_NAME = 0x00000001,
+ REG_NOTIFY_CHANGE_ATTRIBUTES = 0x00000002,
+ REG_NOTIFY_CHANGE_LAST_SET = 0x00000004,
+ REG_NOTIFY_CHANGE_SECURITY = 0x00000008
+ } winreg_NotifyChangeType;
+
+ [public] WERROR winreg_NotifyChangeKeyValue(
[in,ref] policy_handle *handle,
- [in] uint8 watch_subtree,
- [in] uint32 notify_filter,
+ [in] boolean8 watch_subtree,
+ [in] winreg_NotifyChangeType notify_filter,
[in] uint32 unknown,
[in] winreg_String string1,
- [in] winreg_String string2,
+ [in] winreg_String string2,
[in] uint32 unknown2
);
/******************/
/* Function: 0x0f */
- WERROR winreg_OpenKey(
+ [public] WERROR winreg_OpenKey(
[in,ref] policy_handle *parent_handle,
[in] winreg_String keyname,
[in] uint32 unknown,
@@ -225,7 +232,7 @@ import "lsa.idl", "initshutdown.idl", "security.idl";
/******************/
/* Function: 0x10 */
- WERROR winreg_QueryInfoKey(
+ [public] WERROR winreg_QueryInfoKey(
[in,ref] policy_handle *handle,
[in,out,ref] winreg_String *classname,
[out,ref] uint32 *num_subkeys,
@@ -240,18 +247,18 @@ import "lsa.idl", "initshutdown.idl", "security.idl";
/******************/
/* Function: 0x11 */
- WERROR winreg_QueryValue(
+ [public] WERROR winreg_QueryValue(
[in,ref] policy_handle *handle,
[in,ref] winreg_String *value_name,
[in,out,unique] winreg_Type *type,
- [in,out,unique,size_is(*data_size),length_is(*value_length)] uint8 *data,
+ [in,out,unique,size_is(*data_size),length_is(*data_length)] uint8 *data,
[in,out,unique] uint32 *data_size,
- [in,out,unique] uint32 *value_length
+ [in,out,unique] uint32 *data_length
);
/******************/
/* Function: 0x12 */
- WERROR winreg_ReplaceKey(
+ [todo] WERROR winreg_ReplaceKey(
);
/******************/
@@ -281,7 +288,7 @@ import "lsa.idl", "initshutdown.idl", "security.idl";
/* Function: 0x15 */
WERROR winreg_SetKeySecurity(
[in,ref] policy_handle *handle,
- [in] winreg_AccessMask access_mask,
+ [in] security_secinfo sec_info,
[in,ref] KeySecurityData *sd
);
@@ -304,7 +311,11 @@ import "lsa.idl", "initshutdown.idl", "security.idl";
/* Function: 0x18 */
WERROR winreg_InitiateSystemShutdown(
[in,unique] uint16 *hostname,
- [in,unique] initshutdown_String *message,
+ /*
+ * Note: lsa_String and winreg_String both result
+ * in WERR_INVALID_PARAM
+ */
+ [in,unique] lsa_StringLarge *message,
[in] uint32 timeout,
[in] uint8 force_apps,
[in] uint8 do_reboot
@@ -318,7 +329,7 @@ import "lsa.idl", "initshutdown.idl", "security.idl";
/******************/
/* Function: 0x1a */
- WERROR winreg_GetVersion(
+ [public] WERROR winreg_GetVersion(
[in,ref] policy_handle *handle,
[out,ref] uint32 *version
);
@@ -348,7 +359,7 @@ import "lsa.idl", "initshutdown.idl", "security.idl";
/******************/
/* Function: 0x1d */
- WERROR winreg_QueryMultipleValues(
+ [public] WERROR winreg_QueryMultipleValues(
[in,ref] policy_handle *key_handle,
[in,out,ref,size_is(num_values),length_is(num_values)] QueryMultipleValue *values,
[in] uint32 num_values,
@@ -360,7 +371,11 @@ import "lsa.idl", "initshutdown.idl", "security.idl";
/* Function: 0x1e */
WERROR winreg_InitiateSystemShutdownEx(
[in,unique] uint16 *hostname,
- [in,unique] initshutdown_String *message,
+ /*
+ * Note: lsa_String and winreg_String both result
+ * in WERR_INVALID_PARAM
+ */
+ [in,unique] lsa_StringLarge *message,
[in] uint32 timeout,
[in] uint8 force_apps,
[in] uint8 do_reboot,
diff --git a/source3/librpc/idl/wkssvc.idl b/source3/librpc/idl/wkssvc.idl
deleted file mode 100644
index 9340990e99..0000000000
--- a/source3/librpc/idl/wkssvc.idl
+++ /dev/null
@@ -1,795 +0,0 @@
-#include "idl_types.h"
-
-/*
- wkssvc interface definitions
-*/
-
-import "srvsvc.idl", "lsa.idl";
-
-[ uuid("6bffd098-a112-3610-9833-46c3f87e345a"),
- version(1.0),
- pointer_default(unique),
- helpstring("Workstation Service"),
- endpoint("ncacn_np:[\\pipe\\wkssvc]","ncacn_ip_tcp:","ncalrpc:")
-] interface wkssvc
-{
- typedef [v1_enum] enum srvsvc_PlatformId srvsvc_PlatformId;
-
-#define BOOL uint32
-
- /******************/
- /* Function: 0x00 */
-
- typedef struct {
- srvsvc_PlatformId platform_id;
- [string,charset(UTF16)] uint16 *server_name;
- [string,charset(UTF16)] uint16 *domain_name;
- uint32 version_major;
- uint32 version_minor;
- } wkssvc_NetWkstaInfo100;
-
- typedef struct {
- srvsvc_PlatformId platform_id;
- [string,charset(UTF16)] uint16 *server_name;
- [string,charset(UTF16)] uint16 *domain_name;
- uint32 version_major;
- uint32 version_minor;
- [string,charset(UTF16)] uint16 *lan_root;
- } wkssvc_NetWkstaInfo101;
-
- typedef struct {
- srvsvc_PlatformId platform_id;
- [string,charset(UTF16)] uint16 *server_name;
- [string,charset(UTF16)] uint16 *domain_name;
- uint32 version_major;
- uint32 version_minor;
- [string,charset(UTF16)] uint16 *lan_root;
- uint32 logged_on_users;
- } wkssvc_NetWkstaInfo102;
-
- /* FIXME: 302, 402 */
-
- typedef struct {
- uint32 char_wait;
- uint32 collection_time;
- uint32 maximum_collection_count;
- uint32 keep_connection;
- uint32 max_commands;
- uint32 session_timeout;
- uint32 size_char_buf;
- uint32 max_threads;
- uint32 lock_quota;
- uint32 lock_increment;
- uint32 lock_maximum;
- uint32 pipe_increment;
- uint32 pipe_maximum;
- uint32 cache_file_timeout;
- uint32 dormant_file_limit;
- uint32 read_ahead_throughput;
- uint32 num_mailslot_buffers;
- uint32 num_srv_announce_buffers;
- uint32 max_illegal_dgram_events;
- uint32 dgram_event_reset_freq;
- BOOL log_election_packets;
- BOOL use_opportunistic_locking;
- BOOL use_unlock_behind;
- BOOL use_close_behind;
- BOOL buf_named_pipes;
- BOOL use_lock_read_unlock;
- BOOL utilize_nt_caching;
- BOOL use_raw_read;
- BOOL use_raw_write;
- BOOL use_write_raw_data;
- BOOL use_encryption;
- BOOL buf_files_deny_write;
- BOOL buf_read_only_files;
- BOOL force_core_create_mode;
- BOOL use_512_byte_max_transfer;
- } wkssvc_NetWkstaInfo502;
-
- typedef struct {
- uint32 char_wait;
- } wkssvc_NetWkstaInfo1010;
-
- typedef struct {
- uint32 collection_time;
- } wkssvc_NetWkstaInfo1011;
-
- typedef struct {
- uint32 maximum_collection_count;
- } wkssvc_NetWkstaInfo1012;
-
- typedef struct {
- uint32 keep_connection;
- } wkssvc_NetWkstaInfo1013;
-
- typedef struct {
- uint32 session_timeout;
- } wkssvc_NetWkstaInfo1018;
-
- typedef struct {
- uint32 size_char_buf;
- } wkssvc_NetWkstaInfo1023;
-
- typedef struct {
- uint32 errorlog_sz;
- } wkssvc_NetWkstaInfo1027;
-
- /* downlevel */
- typedef struct {
- uint32 print_buf_time;
- } wkssvc_NetWkstaInfo1028;
-
- /* downlevel */
- typedef struct {
- uint32 wrk_heuristics;
- } wkssvc_NetWkstaInfo1032;
-
- typedef struct {
- uint32 max_threads;
- } wkssvc_NetWkstaInfo1033;
-
- typedef struct {
- uint32 lock_quota;
- } wkssvc_NetWkstaInfo1041;
-
- typedef struct {
- uint32 lock_increment;
- } wkssvc_NetWkstaInfo1042;
-
- typedef struct {
- uint32 lock_maximum;
- } wkssvc_NetWkstaInfo1043;
-
- typedef struct {
- uint32 pipe_increment;
- } wkssvc_NetWkstaInfo1044;
-
- typedef struct {
- uint32 pipe_maximum;
- } wkssvc_NetWkstaInfo1045;
-
- typedef struct {
- uint32 dormant_file_limit;
- } wkssvc_NetWkstaInfo1046;
-
- typedef struct {
- uint32 cache_file_timeout;
- } wkssvc_NetWkstaInfo1047;
-
- typedef struct {
- uint32 use_opportunistic_locking;
- } wkssvc_NetWkstaInfo1048;
-
- typedef struct {
- uint32 use_unlock_behind;
- } wkssvc_NetWkstaInfo1049;
-
- typedef struct {
- uint32 use_close_behind;
- } wkssvc_NetWkstaInfo1050;
-
- typedef struct {
- uint32 buf_named_pipes;
- } wkssvc_NetWkstaInfo1051;
-
- typedef struct {
- uint32 use_lock_read_unlock;
- } wkssvc_NetWkstaInfo1052;
-
- typedef struct {
- uint32 utilize_nt_caching;
- } wkssvc_NetWkstaInfo1053;
-
- typedef struct {
- uint32 use_raw_read;
- } wkssvc_NetWkstaInfo1054;
-
- typedef struct {
- uint32 use_raw_write;
- } wkssvc_NetWkstaInfo1055;
-
- typedef struct {
- uint32 use_write_raw_data;
- } wkssvc_NetWkstaInfo1056;
-
- typedef struct {
- uint32 use_encryption;
- } wkssvc_NetWkstaInfo1057;
-
- typedef struct {
- uint32 buf_files_deny_write;
- } wkssvc_NetWkstaInfo1058;
-
- typedef struct {
- uint32 buf_read_only_files;
- } wkssvc_NetWkstaInfo1059;
-
- typedef struct {
- uint32 force_core_create_mode;
- } wkssvc_NetWkstaInfo1060;
-
- typedef struct {
- uint32 use_512_byte_max_transfer;
- } wkssvc_NetWkstaInfo1061;
-
- typedef struct {
- uint32 read_ahead_throughput;
- } wkssvc_NetWkstaInfo1062;
-
- typedef union {
- [case(100)] wkssvc_NetWkstaInfo100 *info100;
- [case(101)] wkssvc_NetWkstaInfo101 *info101;
- [case(102)] wkssvc_NetWkstaInfo102 *info102;
- [case(502)] wkssvc_NetWkstaInfo502 *info502;
- [case(1010)] wkssvc_NetWkstaInfo1010 *info1010;
- [case(1011)] wkssvc_NetWkstaInfo1011 *info1011;
- [case(1012)] wkssvc_NetWkstaInfo1012 *info1012;
- [case(1013)] wkssvc_NetWkstaInfo1013 *info1013;
- [case(1018)] wkssvc_NetWkstaInfo1018 *info1018;
- [case(1023)] wkssvc_NetWkstaInfo1023 *info1023;
- [case(1027)] wkssvc_NetWkstaInfo1027 *info1027;
- [case(1028)] wkssvc_NetWkstaInfo1028 *info1028;
- [case(1032)] wkssvc_NetWkstaInfo1032 *info1032;
- [case(1033)] wkssvc_NetWkstaInfo1033 *info1033;
- [case(1041)] wkssvc_NetWkstaInfo1041 *info1041;
- [case(1042)] wkssvc_NetWkstaInfo1042 *info1042;
- [case(1043)] wkssvc_NetWkstaInfo1043 *info1043;
- [case(1044)] wkssvc_NetWkstaInfo1044 *info1044;
- [case(1045)] wkssvc_NetWkstaInfo1045 *info1045;
- [case(1046)] wkssvc_NetWkstaInfo1046 *info1046;
- [case(1047)] wkssvc_NetWkstaInfo1047 *info1047;
- [case(1048)] wkssvc_NetWkstaInfo1048 *info1048;
- [case(1049)] wkssvc_NetWkstaInfo1049 *info1049;
- [case(1050)] wkssvc_NetWkstaInfo1050 *info1050;
- [case(1051)] wkssvc_NetWkstaInfo1051 *info1051;
- [case(1052)] wkssvc_NetWkstaInfo1052 *info1052;
- [case(1053)] wkssvc_NetWkstaInfo1053 *info1053;
- [case(1054)] wkssvc_NetWkstaInfo1054 *info1054;
- [case(1055)] wkssvc_NetWkstaInfo1055 *info1055;
- [case(1056)] wkssvc_NetWkstaInfo1056 *info1056;
- [case(1057)] wkssvc_NetWkstaInfo1057 *info1057;
- [case(1058)] wkssvc_NetWkstaInfo1058 *info1058;
- [case(1059)] wkssvc_NetWkstaInfo1059 *info1059;
- [case(1060)] wkssvc_NetWkstaInfo1060 *info1060;
- [case(1061)] wkssvc_NetWkstaInfo1061 *info1061;
- [case(1062)] wkssvc_NetWkstaInfo1062 *info1062;
- [default] ;
- } wkssvc_NetWkstaInfo;
-
- WERROR wkssvc_NetWkstaGetInfo(
- [in,unique] [string,charset(UTF16)] uint16 *server_name,
- [in] uint32 level,
- [out,switch_is(level),ref] wkssvc_NetWkstaInfo *info
- );
-
-
- /******************/
- /* Function: 0x01 */
- WERROR wkssvc_NetWkstaSetInfo(
- [in,unique] [string,charset(UTF16)] uint16 *server_name,
- [in] uint32 level,
- [in,switch_is(level),ref] wkssvc_NetWkstaInfo *info,
- [in,out,ref] uint32 *parm_error
- );
-
-
- /*****************************/
- /* Function 0x02 */
- typedef struct {
- [string,charset(UTF16)] uint16 *user_name;
- } wkssvc_NetrWkstaUserInfo0;
-
- typedef struct {
- uint32 entries_read;
- [size_is(entries_read)] wkssvc_NetrWkstaUserInfo0 *user0;
- } wkssvc_NetWkstaEnumUsersCtr0;
-
- typedef struct {
- [string,charset(UTF16)] uint16 *user_name;
- [string,charset(UTF16)] uint16 *logon_domain;
- [string,charset(UTF16)] uint16 *other_domains;
- [string,charset(UTF16)] uint16 *logon_server;
- } wkssvc_NetrWkstaUserInfo1;
-
- typedef struct {
- uint32 entries_read;
- [size_is(entries_read)] wkssvc_NetrWkstaUserInfo1 *user1;
- } wkssvc_NetWkstaEnumUsersCtr1;
-
- typedef [switch_type(uint32)] union {
- [case(0)] wkssvc_NetWkstaEnumUsersCtr0 *user0;
- [case(1)] wkssvc_NetWkstaEnumUsersCtr1 *user1;
- } wkssvc_NetWkstaEnumUsersCtr;
-
- typedef struct {
- uint32 level;
- [switch_is(level)] wkssvc_NetWkstaEnumUsersCtr ctr;
- } wkssvc_NetWkstaEnumUsersInfo;
-
- WERROR wkssvc_NetWkstaEnumUsers(
- [in,unique] [string,charset(UTF16)] uint16 *server_name,
- [in,out,ref] wkssvc_NetWkstaEnumUsersInfo *info,
- [in] uint32 prefmaxlen,
- [out,ref] uint32 *entries_read,
- [in,out,unique] uint32 *resume_handle
- );
-
- /*****************************/
- /* Function 0x03 */
- typedef struct {
- [string,charset(UTF16)] uint16 *other_domains;
- } wkssvc_NetrWkstaUserInfo1101;
-
- typedef [switch_type(uint32)] union {
- [case(0)] wkssvc_NetrWkstaUserInfo0 *info0;
- [case(1)] wkssvc_NetrWkstaUserInfo1 *info1;
- [case(1101)] wkssvc_NetrWkstaUserInfo1101 *info1101;
- } wkssvc_NetrWkstaUserInfo;
-
- WERROR wkssvc_NetrWkstaUserGetInfo(
- [in,unique] [string,charset(UTF16)] uint16 *unknown,
- [in] uint32 level,
- [out,ref] [switch_is(level)] wkssvc_NetrWkstaUserInfo *info
- );
-
- /*****************************/
- /* Function 0x04 */
- WERROR wkssvc_NetrWkstaUserSetInfo(
- [in,unique] [string,charset(UTF16)] uint16 *unknown,
- [in] uint32 level,
- [in,ref] [switch_is(level)] wkssvc_NetrWkstaUserInfo *info,
- [in,out,unique] uint32 *parm_err
- );
-
- /*****************************/
- /* Function 0x05 */
-
- typedef struct {
- uint32 quality_of_service;
- uint32 vc_count;
- [string,charset(UTF16)] uint16 *name;
- [string,charset(UTF16)] uint16 *address;
- uint32 wan_link;
- } wkssvc_NetWkstaTransportInfo0;
-
- typedef struct {
- uint32 count;
- [size_is(count)] wkssvc_NetWkstaTransportInfo0 *array;
- } wkssvc_NetWkstaTransportCtr0;
-
- typedef union {
- [case(0)] wkssvc_NetWkstaTransportCtr0 *ctr0;
- } wkssvc_NetWkstaTransportCtr;
-
- typedef struct {
- uint32 level;
- [switch_is(level)] wkssvc_NetWkstaTransportCtr ctr;
- } wkssvc_NetWkstaTransportInfo;
-
- WERROR wkssvc_NetWkstaTransportEnum (
- [in,unique] [string,charset(UTF16)] uint16 *server_name,
- [in,out,ref] wkssvc_NetWkstaTransportInfo *info,
- [in] uint32 max_buffer,
- [out,ref] uint32 *total_entries,
- [in,out,unique] uint32 *resume_handle
- );
-
- /*****************************/
- /* Function 0x06 */
- /* only supported on NT */
- WERROR wkssvc_NetrWkstaTransportAdd(
- [in,unique] [string,charset(UTF16)] uint16 *server_name,
- [in] uint32 level, /* must be 0 */
- [in,ref] wkssvc_NetWkstaTransportInfo0 *info0,
- [in,out,unique] uint32 *parm_err
- );
-
- /*****************************/
- /* Function 0x07 */
- /* only supported on NT */
- WERROR wkssvc_NetrWkstaTransportDel(
- [in,unique] [string,charset(UTF16)] uint16 *server_name,
- [in,unique] [string,charset(UTF16)] uint16 *transport_name,
- [in] uint32 unknown3
- );
-
- /*****************************/
- /* Function 0x08 */
- typedef struct {
- [string,charset(UTF16)] uint16 *unknown1;
- [string,charset(UTF16)] uint16 *unknown2;
- } wkssvc_NetrUseInfo3;
-
- typedef struct {
- [string,charset(UTF16)] uint16 *local;
- [string,charset(UTF16)] uint16 *remote;
- [string,charset(UTF16)] uint16 *password;
- uint32 status;
- uint32 asg_type;
- uint32 ref_count;
- uint32 use_count;
- [string,charset(UTF16)] uint16 *user_name;
- [string,charset(UTF16)] uint16 *domain_name;
- } wkssvc_NetrUseInfo2;
-
- typedef struct {
- [string,charset(UTF16)] uint16 *local;
- [string,charset(UTF16)] uint16 *remote;
- [string,charset(UTF16)] uint16 *password;
- uint32 status;
- uint32 asg_type;
- uint32 ref_count;
- uint32 use_count;
- } wkssvc_NetrUseInfo1;
-
- typedef struct {
- [string,charset(UTF16)] uint16 *local;
- [string,charset(UTF16)] uint16 *remote;
- } wkssvc_NetrUseInfo0;
-
- typedef [switch_type(uint32)] union {
- [case(0)] wkssvc_NetrUseInfo0 *info0;
- [case(1)] wkssvc_NetrUseInfo1 *info1;
- [case(2)] wkssvc_NetrUseInfo2 *info2;
- [case(3)] wkssvc_NetrUseInfo3 *info3;
- } wkssvc_NetrUseGetInfoCtr;
-
- WERROR wkssvc_NetrUseAdd(
- [in,unique] [string,charset(UTF16)] uint16 *server_name,
- [in] uint32 level,
- [in,ref] [switch_is(level)] wkssvc_NetrUseGetInfoCtr *ctr,
- [in,out,unique] uint32 *parm_err
- );
-
- /*****************************/
- /* Function 0x09 */
- WERROR wkssvc_NetrUseGetInfo(
- [in,unique] [string,charset(UTF16)] uint16 *server_name,
- [in,ref] [string,charset(UTF16)] uint16 *use_name,
- [in] uint32 level,
- [out,ref] [switch_is(level)] wkssvc_NetrUseGetInfoCtr *ctr
- );
-
- /*****************************/
- /* Function 0x0a */
- WERROR wkssvc_NetrUseDel(
- [in,unique] [string,charset(UTF16)] uint16 *server_name,
- [in,ref] [string,charset(UTF16)] uint16 *use_name,
- [in] uint32 force_cond
- );
-
- /*****************************/
- /* Function 0x0b */
- typedef struct {
- uint32 count;
- [size_is(count)] wkssvc_NetrUseInfo2 *array;
- } wkssvc_NetrUseEnumCtr2;
-
- typedef struct {
- uint32 count;
- [size_is(count)] wkssvc_NetrUseInfo1 *array;
- } wkssvc_NetrUseEnumCtr1;
-
- typedef struct {
- uint32 count;
- [size_is(count)] wkssvc_NetrUseInfo0 *array;
- } wkssvc_NetrUseEnumCtr0;
-
- typedef [switch_type(uint32)] union {
- [case(0)] wkssvc_NetrUseEnumCtr0 *ctr0;
- [case(1)] wkssvc_NetrUseEnumCtr1 *ctr1;
- [case(2)] wkssvc_NetrUseEnumCtr2 *ctr2;
- } wkssvc_NetrUseEnumCtr;
-
- typedef struct {
- uint32 level;
- [switch_is(level)] wkssvc_NetrUseEnumCtr ctr;
- } wkssvc_NetrUseEnumInfo;
-
- WERROR wkssvc_NetrUseEnum(
- [in,unique] [string,charset(UTF16)] uint16 *server_name,
- [in,out,ref] wkssvc_NetrUseEnumInfo *info,
- [in] uint32 prefmaxlen,
- [out,ref] uint32 *entries_read,
- [in,out,unique] uint32 *resume_handle
- );
-
- /*****************************/
- /* Function 0x0c */
- WERROR wkssvc_NetrMessageBufferSend(
- [in,unique] [string,charset(UTF16)] uint16 *server_name,
- [in,ref] [string,charset(UTF16)] uint16 *message_name,
- [in,unique] [string,charset(UTF16)] uint16 *message_sender_name,
- [in,ref] [size_is(message_size)] uint8 *message_buffer,
- [in] uint32 message_size
- );
-
- /*****************************/
- /* Function 0x0d */
- typedef struct {
- hyper unknown1;
- hyper unknown2;
- hyper unknown3;
- hyper unknown4;
- hyper unknown5;
- hyper unknown6;
- hyper unknown7;
- hyper unknown8;
- hyper unknown9;
- hyper unknown10;
- hyper unknown11;
- hyper unknown12;
- hyper unknown13;
- uint32 unknown14;
- uint32 unknown15;
- uint32 unknown16;
- uint32 unknown17;
- uint32 unknown18;
- uint32 unknown19;
- uint32 unknown20;
- uint32 unknown21;
- uint32 unknown22;
- uint32 unknown23;
- uint32 unknown24;
- uint32 unknown25;
- uint32 unknown26;
- uint32 unknown27;
- uint32 unknown28;
- uint32 unknown29;
- uint32 unknown30;
- uint32 unknown31;
- uint32 unknown32;
- uint32 unknown33;
- uint32 unknown34;
- uint32 unknown35;
- uint32 unknown36;
- uint32 unknown37;
- uint32 unknown38;
- uint32 unknown39;
- uint32 unknown40;
- } wkssvc_NetrWorkstationStatistics;
-
- WERROR wkssvc_NetrWorkstationStatisticsGet(
- [in,unique] [string,charset(UTF16)] uint16 *server_name,
- [in,unique] [string,charset(UTF16)] uint16 *unknown2,
- [in] uint32 unknown3,
- [in] uint32 unknown4,
- [out,ref] wkssvc_NetrWorkstationStatistics **info
- );
-
- /*****************************/
- /* Function 0x0e */
- WERROR wkssvc_NetrLogonDomainNameAdd(
- [in,ref] [string,charset(UTF16)] uint16 *domain_name
- );
-
- /*****************************/
- /* Function 0x0f */
- WERROR wkssvc_NetrLogonDomainNameDel(
- [in,ref] [string,charset(UTF16)] uint16 *domain_name
- );
-
- /*****************************/
- /* Function 0x10 */
- WERROR wkssvc_NetrJoinDomain(
- [in,unique] [string,charset(UTF16)] uint16 *server_name,
- [in,ref] [string,charset(UTF16)] uint16 *domain_name,
- [in,unique] [string,charset(UTF16)] uint16 *account_ou,
- [in,unique] [string,charset(UTF16)] uint16 *Account,
- [in,unique] [string,charset(UTF16)] uint16 *password,
- [in] wkssvc_joinflags join_flags
- );
-
- /*****************************/
- /* Function 0x11 */
- WERROR wkssvc_NetrUnjoinDomain(
- [in,unique] [string,charset(UTF16)] uint16 *server_name,
- [in,unique] [string,charset(UTF16)] uint16 *Account,
- [in,unique] [string,charset(UTF16)] uint16 *password,
- [in] wkssvc_joinflags unjoin_flags
- );
-
- /*****************************/
- /* Function 0x12 */
- typedef [bitmap32bit] bitmap {
- /* TRUE: create the account in the domain */
- WKSSVC_JOIN_FLAGS_ACCOUNT_CREATE = 0x00000002
- } wkssvc_renameflags;
-
- WERROR wkssvc_NetrRenameMachineInDomain(
- [in,unique] [string,charset(UTF16)] uint16 *server_name,
- [in,unique] [string,charset(UTF16)] uint16 *NewMachineName,
- [in,unique] [string,charset(UTF16)] uint16 *Account,
- [in,unique] [string,charset(UTF16)] uint16 *password,
- [in] wkssvc_renameflags RenameOptions
- );
-
- /*****************************/
- /* Function 0x13 */
- typedef enum {
- NetSetupUnknown = 0,
- NetSetupMachine = 1,
- NetSetupWorkgroup = 2,
- NetSetupDomain = 3,
- NetSetupNonExistentDomain = 4,
- NetSetupDnsMachine = 5
- } wkssvc_NetValidateNameType;
-
- WERROR wkssvc_NetrValidateName(
- [in,unique] [string,charset(UTF16)] uint16 *server_name,
- [in,ref] [string,charset(UTF16)] uint16 *name,
- [in,unique] [string,charset(UTF16)] uint16 *Account,
- [in,unique] [string,charset(UTF16)] uint16 *Password,
- [in] wkssvc_NetValidateNameType name_type
- );
-
- /*****************************/
- /* Function 0x14 */
- typedef enum {
- NET_SETUP_UNKNOWN_STATUS = 0,
- NET_SETUP_UNJOINED = 1,
- NET_SETUP_WORKGROUP_NAME = 2,
- NET_SETUP_DOMAIN_NAME = 3
- } wkssvc_NetJoinStatus;
-
- WERROR wkssvc_NetrGetJoinInformation(
- [in,unique] [string,charset(UTF16)] uint16 *server_name,
- [in,out,ref] [string,charset(UTF16)] uint16 **name_buffer,
- [out,ref] wkssvc_NetJoinStatus *name_type
- );
-
- /*****************************/
- /* Function 0x15 */
- WERROR wkssvc_NetrGetJoinableOus(
- [in,unique] [string,charset(UTF16)] uint16 *server_name,
- [in,ref] [string,charset(UTF16)] uint16 *domain_name,
- [in,unique] [string,charset(UTF16)] uint16 *Account,
- [in,unique] [string,charset(UTF16)] uint16 *unknown,
- [in,out,ref] uint32 *num_ous,
- /*
- * this is a [ref] pointer to a [unique] pointer to an
- * array of [unique] pointers to a string array
- */
- [out,ref] [size_is(,*num_ous)] [string,charset(UTF16)] uint16 ***ous
- );
-
- typedef [flag(NDR_PAHEX)] struct {
- uint8 data[524];
- } wkssvc_PasswordBuffer;
-
- typedef [bitmap32bit] bitmap {
- WKSSVC_JOIN_FLAGS_JOIN_WITH_NEW_NAME = 0x00000400,
- WKSSVC_JOIN_FLAGS_JOIN_DC_ACCOUNT = 0x00000200,
- /* TRUE: defer setting the SPN and dNSHostName until a rename operation */
- WKSSVC_JOIN_FLAGS_DEFER_SPN = 0x00000100,
-
- /* TRUE: set the machine password to the provided one after the join completes */
- WKSSVC_JOIN_FLAGS_MACHINE_PWD_PASSED = 0x00000080,
-
- /* TRUE: perform an unsecured join */
- WKSSVC_JOIN_FLAGS_JOIN_UNSECURE = 0x00000040,
-
- /* TRUE: allow the join to complete even if the account already exists */
- WKSSVC_JOIN_FLAGS_DOMAIN_JOIN_IF_JOINED = 0x00000020,
-
- /* TRUE: this join is part of a w9x upgrade */
- WKSSVC_JOIN_FLAGS_WIN9X_UPGRADE = 0x00000010,
-
- /* TRUE: delete the account when the domain is left */
- WKSSVC_JOIN_FLAGS_ACCOUNT_DELETE = 0x00000004,
-
- /* TRUE: create the account in the domain */
- WKSSVC_JOIN_FLAGS_ACCOUNT_CREATE = 0x00000002,
-
- /* TRUE: join domain FALSE: join workgroup */
- WKSSVC_JOIN_FLAGS_JOIN_TYPE = 0x00000001
-
- } wkssvc_joinflags;
-
- /*****************************/
- /* Function 0x16 */
- WERROR wkssvc_NetrJoinDomain2 (
- [in,unique] [string,charset(UTF16)] uint16 *server_name,
- [in,ref] [string,charset(UTF16)] uint16 *domain_name,
- [in,unique] [string,charset(UTF16)] uint16 *account_ou,
- [in,unique] [string,charset(UTF16)] uint16 *admin_account,
- [in,unique] wkssvc_PasswordBuffer *encrypted_password,
- [in] wkssvc_joinflags join_flags
- );
-
- /*****************************/
- /* Function 0x17 */
- WERROR wkssvc_NetrUnjoinDomain2 (
- [in,unique] [string,charset(UTF16)] uint16 *server_name,
- [in,unique] [string,charset(UTF16)] uint16 *account,
- [in,unique] wkssvc_PasswordBuffer *encrypted_password,
- [in] wkssvc_joinflags unjoin_flags
- );
-
- /*****************************/
- /* Function 0x18 */
- WERROR wkssvc_NetrRenameMachineInDomain2(
- [in,unique] [string,charset(UTF16)] uint16 *server_name,
- [in,unique] [string,charset(UTF16)] uint16 *NewMachineName,
- [in,unique] [string,charset(UTF16)] uint16 *Account,
- [in,unique] wkssvc_PasswordBuffer *EncryptedPassword,
- [in] wkssvc_renameflags RenameOptions
- );
-
- /*****************************/
- /* Function 0x19 */
- WERROR wkssvc_NetrValidateName2(
- [in,unique] [string,charset(UTF16)] uint16 *server_name,
- [in,ref] [string,charset(UTF16)] uint16 *name,
- [in,unique] [string,charset(UTF16)] uint16 *Account,
- [in,unique] wkssvc_PasswordBuffer *EncryptedPassword,
- [in] wkssvc_NetValidateNameType name_type
- );
-
- /*****************************/
- /* Function 0x1a */
- WERROR wkssvc_NetrGetJoinableOus2(
- [in,unique] [string,charset(UTF16)] uint16 *server_name,
- [in,ref] [string,charset(UTF16)] uint16 *domain_name,
- [in,unique] [string,charset(UTF16)] uint16 *Account,
- [in,unique] wkssvc_PasswordBuffer *EncryptedPassword,
- [in,out,ref] uint32 *num_ous,
- /*
- * this is a [ref] pointer to a [unique] pointer to an
- * array of [unique] pointers to a string array
- */
- [out,ref] [size_is(,*num_ous)] [string,charset(UTF16)] uint16 ***ous
- );
-
- /*****************************/
- /* Function 0x1b */
- WERROR wkssvc_NetrAddAlternateComputerName(
- [in,unique] [string,charset(UTF16)] uint16 *server_name,
- [in,unique] [string,charset(UTF16)] uint16 *NewAlternateMachineName,
- [in,unique] [string,charset(UTF16)] uint16 *Account,
- [in,unique] wkssvc_PasswordBuffer *EncryptedPassword,
- [in] uint32 Reserved
- );
-
- /*****************************/
- /* Function 0x1c */
- WERROR wkssvc_NetrRemoveAlternateComputerName(
- [in,unique] [string,charset(UTF16)] uint16 *server_name,
- [in,unique] [string,charset(UTF16)] uint16 *AlternateMachineNameToRemove,
- [in,unique] [string,charset(UTF16)] uint16 *Account,
- [in,unique] wkssvc_PasswordBuffer *EncryptedPassword,
- [in] uint32 Reserved
- );
-
- /*****************************/
- /* Function 0x1d */
- WERROR wkssvc_NetrSetPrimaryComputername(
- [in,unique] [string,charset(UTF16)] uint16 *server_name,
- [in,unique] [string,charset(UTF16)] uint16 *primary_name,
- [in,unique] [string,charset(UTF16)] uint16 *Account,
- [in,unique] wkssvc_PasswordBuffer *EncryptedPassword,
- [in] uint32 Reserved
- );
-
- /*****************************/
- /* Function 0x1e */
- typedef enum {
- NetPrimaryComputerName = 0,
- NetAlternateComputerNames = 1,
- NetAllComputerNames = 2,
- NetComputerNameTypeMax = 3
- } wkssvc_ComputerNameType;
-
- typedef struct {
- uint32 count;
- [size_is(count)] lsa_String *computer_name;
- } wkssvc_ComputerNamesCtr;
-
- WERROR wkssvc_NetrEnumerateComputerNames(
- [in,unique] [string,charset(UTF16)] uint16 *server_name,
- [in] wkssvc_ComputerNameType name_type,
- [in] uint32 Reserved,
- [out,ref] wkssvc_ComputerNamesCtr **ctr
- );
-}
diff --git a/source3/librpc/idl/xattr.idl b/source3/librpc/idl/xattr.idl
deleted file mode 100644
index 23af2df404..0000000000
--- a/source3/librpc/idl/xattr.idl
+++ /dev/null
@@ -1,54 +0,0 @@
-#include "idl_types.h"
-
-/*
- IDL structures for xattrs
-*/
-
-[
- pointer_default(unique)
-]
-interface xattr
-{
- /* xattrs for file systems that don't have any */
-
- typedef [public] struct {
- utf8string name;
- DATA_BLOB value;
- } tdb_xattr;
-
- typedef [public] struct {
- uint32 num_xattrs;
- tdb_xattr xattrs[num_xattrs];
- } tdb_xattrs;
-
- /* we store the NT ACL a NTACL xattr. It is versioned so we
- can later add other acl attribs (such as posix acl mapping)
-
- we put this xattr in the security namespace to ensure that
- only trusted users can write to the ACL
-
- stored in "security.NTACL"
-
- Version 1. raw SD stored as Samba4 does it.
- Version 2. raw SD + last changed timestamp so we
- can discard if this doesn't match the POSIX st_ctime.
- */
-
- const char *XATTR_NTACL_NAME = "security.NTACL";
-
- typedef [public] struct {
- security_descriptor *sd;
- NTTIME last_changed;
- } security_descriptor_timestamp;
-
- typedef [switch_type(uint16)] union {
- [case(1)] security_descriptor *sd;
- [case(2)] security_descriptor_timestamp *sd_ts;
- } xattr_NTACL_Info;
-
- typedef [public] struct {
- uint16 version;
- [switch_is(version)] xattr_NTACL_Info info;
- } xattr_NTACL;
-
-}
diff --git a/source3/librpc/ndr/libndr.h b/source3/librpc/ndr/libndr.h
deleted file mode 100644
index 155f5f1f7d..0000000000
--- a/source3/librpc/ndr/libndr.h
+++ /dev/null
@@ -1,354 +0,0 @@
-/*
- Unix SMB/CIFS implementation.
- rpc interface definitions
- Copyright (C) Andrew Tridgell 2003
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef __LIBNDR_H__
-#define __LIBNDR_H__
-
-#define _PRINTF_ATTRIBUTE(a,b)
-
-#include "librpc/gen_ndr/misc.h"
-#include "librpc/gen_ndr/security.h"
-
-/*
- this provides definitions for the libcli/rpc/ MSRPC library
-*/
-
-
-/*
- this is used by the token store/retrieve code
-*/
-struct ndr_token_list {
- struct ndr_token_list *next, *prev;
- const void *key;
- uint32_t value;
-};
-
-/* this is the base structure passed to routines that
- parse MSRPC formatted data
-
- note that in Samba4 we use separate routines and structures for
- MSRPC marshalling and unmarshalling. Also note that these routines
- are being kept deliberately very simple, and are not tied to a
- particular transport
-*/
-struct ndr_pull {
- uint32_t flags; /* LIBNDR_FLAG_* */
- uint8_t *data;
- uint32_t data_size;
- uint32_t offset;
-
- uint32_t relative_base_offset;
- struct ndr_token_list *relative_base_list;
-
- struct ndr_token_list *relative_list;
- struct ndr_token_list *array_size_list;
- struct ndr_token_list *array_length_list;
- struct ndr_token_list *switch_list;
-
- TALLOC_CTX *current_mem_ctx;
-
- /* this is used to ensure we generate unique reference IDs
- between request and reply */
- uint32_t ptr_count;
-};
-
-struct ndr_pull_save {
- uint32_t data_size;
- uint32_t offset;
- struct ndr_pull_save *next;
-};
-
-/* structure passed to functions that generate NDR formatted data */
-struct ndr_push {
- uint32_t flags; /* LIBNDR_FLAG_* */
- uint8_t *data;
- uint32_t alloc_size;
- uint32_t offset;
-
- uint32_t relative_base_offset;
- struct ndr_token_list *relative_base_list;
-
- struct ndr_token_list *switch_list;
- struct ndr_token_list *relative_list;
- struct ndr_token_list *nbt_string_list;
- struct ndr_token_list *full_ptr_list;
-
- /* this is used to ensure we generate unique reference IDs */
- uint32_t ptr_count;
-};
-
-struct ndr_push_save {
- uint32_t offset;
- struct ndr_push_save *next;
-};
-
-
-/* structure passed to functions that print IDL structures */
-struct ndr_print {
- uint32_t flags; /* LIBNDR_FLAG_* */
- uint32_t depth;
- struct ndr_token_list *switch_list;
- void (*print)(struct ndr_print *, const char *, ...) PRINTF_ATTRIBUTE(2,3);
- void *private_data;
-};
-
-#define LIBNDR_FLAG_BIGENDIAN (1<<0)
-#define LIBNDR_FLAG_NOALIGN (1<<1)
-
-#define LIBNDR_FLAG_STR_ASCII (1<<2)
-#define LIBNDR_FLAG_STR_LEN4 (1<<3)
-#define LIBNDR_FLAG_STR_SIZE4 (1<<4)
-#define LIBNDR_FLAG_STR_NOTERM (1<<5)
-#define LIBNDR_FLAG_STR_NULLTERM (1<<6)
-#define LIBNDR_FLAG_STR_SIZE2 (1<<7)
-#define LIBNDR_FLAG_STR_BYTESIZE (1<<8)
-#define LIBNDR_FLAG_STR_FIXLEN32 (1<<9)
-#define LIBNDR_FLAG_STR_CONFORMANT (1<<10)
-#define LIBNDR_FLAG_STR_CHARLEN (1<<11)
-#define LIBNDR_FLAG_STR_UTF8 (1<<12)
-#define LIBNDR_FLAG_STR_FIXLEN15 (1<<13)
-#define LIBNDR_STRING_FLAGS (0x7FFC)
-
-
-#define LIBNDR_FLAG_REF_ALLOC (1<<20)
-#define LIBNDR_FLAG_REMAINING (1<<21)
-#define LIBNDR_FLAG_ALIGN2 (1<<22)
-#define LIBNDR_FLAG_ALIGN4 (1<<23)
-#define LIBNDR_FLAG_ALIGN8 (1<<24)
-
-#define LIBNDR_ALIGN_FLAGS (LIBNDR_FLAG_ALIGN2|LIBNDR_FLAG_ALIGN4|LIBNDR_FLAG_ALIGN8)
-
-#define LIBNDR_PRINT_ARRAY_HEX (1<<25)
-#define LIBNDR_PRINT_SET_VALUES (1<<26)
-
-/* used to force a section of IDL to be little-endian */
-#define LIBNDR_FLAG_LITTLE_ENDIAN (1<<27)
-
-/* used to check if alignment padding is zero */
-#define LIBNDR_FLAG_PAD_CHECK (1<<28)
-
-/* set if an object uuid will be present */
-#define LIBNDR_FLAG_OBJECT_PRESENT (1<<30)
-
-/* set to avoid recursion in ndr_size_*() calculation */
-#define LIBNDR_FLAG_NO_NDR_SIZE (1<<31)
-
-/* useful macro for debugging with DEBUG */
-#define NDR_PRINT_DEBUG(type, p) ndr_print_debug((ndr_print_fn_t)ndr_print_ ##type, #p, p)
-#define NDR_PRINT_UNION_DEBUG(type, level, p) ndr_print_union_debug((ndr_print_fn_t)ndr_print_ ##type, #p, level, p)
-#define NDR_PRINT_FUNCTION_DEBUG(type, flags, p) ndr_print_function_debug((ndr_print_function_t)ndr_print_ ##type, #type, flags, p)
-#define NDR_PRINT_BOTH_DEBUG(type, p) NDR_PRINT_FUNCTION_DEBUG(type, NDR_BOTH, p)
-#define NDR_PRINT_OUT_DEBUG(type, p) NDR_PRINT_FUNCTION_DEBUG(type, NDR_OUT, p)
-#define NDR_PRINT_IN_DEBUG(type, p) NDR_PRINT_FUNCTION_DEBUG(type, NDR_IN | NDR_SET_VALUES, p)
-
-/* useful macro for debugging in strings */
-#define NDR_PRINT_STRUCT_STRING(ctx, type, p) ndr_print_struct_string(ctx, (ndr_print_fn_t)ndr_print_ ##type, #p, p)
-#define NDR_PRINT_UNION_STRING(ctx, type, level, p) ndr_print_union_string(ctx, (ndr_print_fn_t)ndr_print_ ##type, #p, level, p)
-#define NDR_PRINT_FUNCTION_STRING(ctx, type, flags, p) ndr_print_function_string(ctx, (ndr_print_function_t)ndr_print_ ##type, #type, flags, p)
-#define NDR_PRINT_BOTH_STRING(ctx, type, p) NDR_PRINT_FUNCTION_STRING(ctx, type, NDR_BOTH, p)
-#define NDR_PRINT_OUT_STRING(ctx, type, p) NDR_PRINT_FUNCTION_STRING(ctx, type, NDR_OUT, p)
-#define NDR_PRINT_IN_STRING(ctx, type, p) NDR_PRINT_FUNCTION_STRING(ctx, type, NDR_IN | NDR_SET_VALUES, p)
-
-#define NDR_BE(ndr) (((ndr)->flags & (LIBNDR_FLAG_BIGENDIAN|LIBNDR_FLAG_LITTLE_ENDIAN)) == LIBNDR_FLAG_BIGENDIAN)
-
-enum ndr_err_code {
- NDR_ERR_SUCCESS = 0,
- NDR_ERR_ARRAY_SIZE,
- NDR_ERR_BAD_SWITCH,
- NDR_ERR_OFFSET,
- NDR_ERR_RELATIVE,
- NDR_ERR_CHARCNV,
- NDR_ERR_LENGTH,
- NDR_ERR_SUBCONTEXT,
- NDR_ERR_COMPRESSION,
- NDR_ERR_STRING,
- NDR_ERR_VALIDATE,
- NDR_ERR_BUFSIZE,
- NDR_ERR_ALLOC,
- NDR_ERR_RANGE,
- NDR_ERR_TOKEN,
- NDR_ERR_IPV4ADDRESS,
- NDR_ERR_INVALID_POINTER,
- NDR_ERR_UNREAD_BYTES
-};
-
-#define NDR_ERR_CODE_IS_SUCCESS(x) (x == NDR_ERR_SUCCESS)
-
-#define NDR_ERR_HAVE_NO_MEMORY(x) do { \
- if (NULL == (x)) { \
- return NDR_ERR_ALLOC; \
- } \
-} while (0)
-
-enum ndr_compression_alg {
- NDR_COMPRESSION_MSZIP = 2,
- NDR_COMPRESSION_XPRESS = 3
-};
-
-/*
- flags passed to control parse flow
-*/
-#define NDR_SCALARS 1
-#define NDR_BUFFERS 2
-
-/*
- flags passed to ndr_print_*()
-*/
-#define NDR_IN 1
-#define NDR_OUT 2
-#define NDR_BOTH 3
-#define NDR_SET_VALUES 4
-
-#define NDR_PULL_NEED_BYTES(ndr, n) do { \
- if ((n) > ndr->data_size || ndr->offset + (n) > ndr->data_size) { \
- return ndr_pull_error(ndr, NDR_ERR_BUFSIZE, "Pull bytes %u", (unsigned)n); \
- } \
-} while(0)
-
-#define NDR_ALIGN(ndr, n) ndr_align_size(ndr->offset, n)
-
-#define NDR_ROUND(size, n) (((size)+((n)-1)) & ~((n)-1))
-
-#define NDR_PULL_ALIGN(ndr, n) do { \
- if (!(ndr->flags & LIBNDR_FLAG_NOALIGN)) { \
- if (ndr->flags & LIBNDR_FLAG_PAD_CHECK) { \
- ndr_check_padding(ndr, n); \
- } \
- ndr->offset = (ndr->offset + (n-1)) & ~(n-1); \
- } \
- if (ndr->offset > ndr->data_size) { \
- return ndr_pull_error(ndr, NDR_ERR_BUFSIZE, "Pull align %u", (unsigned)n); \
- } \
-} while(0)
-
-#define NDR_PUSH_NEED_BYTES(ndr, n) NDR_CHECK(ndr_push_expand(ndr, n))
-
-#define NDR_PUSH_ALIGN(ndr, n) do { \
- if (!(ndr->flags & LIBNDR_FLAG_NOALIGN)) { \
- uint32_t _pad = ((ndr->offset + (n-1)) & ~(n-1)) - ndr->offset; \
- while (_pad--) NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, 0)); \
- } \
-} while(0)
-
-/* these are used to make the error checking on each element in libndr
- less tedious, hopefully making the code more readable */
-#define NDR_CHECK(call) do { \
- enum ndr_err_code _status; \
- _status = call; \
- if (!NDR_ERR_CODE_IS_SUCCESS(_status)) { \
- return _status; \
- } \
-} while (0)
-
-#define NDR_PULL_GET_MEM_CTX(ndr) (ndr->current_mem_ctx)
-
-#define NDR_PULL_SET_MEM_CTX(ndr, mem_ctx, flgs) do {\
- if ( !(flgs) || (ndr->flags & flgs) ) {\
- if (!(mem_ctx)) {\
- return ndr_pull_error(ndr, NDR_ERR_ALLOC, "NDR_PULL_SET_MEM_CTX(NULL): %s\n", __location__); \
- }\
- ndr->current_mem_ctx = discard_const(mem_ctx);\
- }\
-} while(0)
-
-#define _NDR_PULL_FIX_CURRENT_MEM_CTX(ndr) do {\
- if (!ndr->current_mem_ctx) {\
- ndr->current_mem_ctx = talloc_new(ndr);\
- if (!ndr->current_mem_ctx) {\
- return ndr_pull_error(ndr, NDR_ERR_ALLOC, "_NDR_PULL_FIX_CURRENT_MEM_CTX() failed: %s\n", __location__); \
- }\
- }\
-} while(0)
-
-#define NDR_PULL_ALLOC(ndr, s) do { \
- _NDR_PULL_FIX_CURRENT_MEM_CTX(ndr);\
- (s) = talloc_ptrtype(ndr->current_mem_ctx, (s)); \
- if (!(s)) return ndr_pull_error(ndr, NDR_ERR_ALLOC, "Alloc %s failed: %s\n", # s, __location__); \
-} while (0)
-
-#define NDR_PULL_ALLOC_N(ndr, s, n) do { \
- _NDR_PULL_FIX_CURRENT_MEM_CTX(ndr);\
- (s) = talloc_array_ptrtype(ndr->current_mem_ctx, (s), n); \
- if (!(s)) return ndr_pull_error(ndr, NDR_ERR_ALLOC, "Alloc %u * %s failed: %s\n", (unsigned)n, # s, __location__); \
-} while (0)
-
-
-#define NDR_PUSH_ALLOC_SIZE(ndr, s, size) do { \
- (s) = talloc_array(ndr, uint8_t, size); \
- if (!(s)) return ndr_push_error(ndr, NDR_ERR_ALLOC, "push alloc %u failed: %s\n", (unsigned)size, __location__); \
-} while (0)
-
-#define NDR_PUSH_ALLOC(ndr, s) do { \
- (s) = talloc_ptrtype(ndr, (s)); \
- if (!(s)) return ndr_push_error(ndr, NDR_ERR_ALLOC, "push alloc %s failed: %s\n", # s, __location__); \
-} while (0)
-
-/* these are used when generic fn pointers are needed for ndr push/pull fns */
-typedef enum ndr_err_code (*ndr_push_flags_fn_t)(struct ndr_push *, int ndr_flags, const void *);
-typedef enum ndr_err_code (*ndr_pull_flags_fn_t)(struct ndr_pull *, int ndr_flags, void *);
-typedef void (*ndr_print_fn_t)(struct ndr_print *, const char *, const void *);
-typedef void (*ndr_print_function_t)(struct ndr_print *, const char *, int, const void *);
-
-extern const struct ndr_syntax_id ndr_transfer_syntax;
-extern const struct ndr_syntax_id ndr64_transfer_syntax;
-
-struct ndr_interface_call {
- const char *name;
- size_t struct_size;
- ndr_push_flags_fn_t ndr_push;
- ndr_pull_flags_fn_t ndr_pull;
- ndr_print_function_t ndr_print;
- bool async;
-};
-
-struct ndr_interface_string_array {
- uint32_t count;
- const char * const *names;
-};
-
-struct ndr_interface_table {
- const char *name;
- struct ndr_syntax_id syntax_id;
- const char *helpstring;
- uint32_t num_calls;
- const struct ndr_interface_call *calls;
- const struct ndr_interface_string_array *endpoints;
- const struct ndr_interface_string_array *authservices;
-};
-
-struct ndr_interface_list {
- struct ndr_interface_list *prev, *next;
- const struct ndr_interface_table *table;
-};
-
-#define NDR_SCALAR_PROTO(name, type) \
-enum ndr_err_code ndr_push_ ## name(struct ndr_push *ndr, int ndr_flags, type v); \
-enum ndr_err_code ndr_pull_ ## name(struct ndr_pull *ndr, int ndr_flags, type *v); \
-void ndr_print_ ## name(struct ndr_print *ndr, const char *var_name, type v);
-
-#define NDR_BUFFER_PROTO(name, type) \
-enum ndr_err_code ndr_push_ ## name(struct ndr_push *ndr, int ndr_flags, const type *v); \
-enum ndr_err_code ndr_pull_ ## name(struct ndr_pull *ndr, int ndr_flags, type *v); \
-void ndr_print_ ## name(struct ndr_print *ndr, const char *var_name, const type *v);
-
-
-void ndr_print_dom_sid28(struct ndr_print *ndr, const char *name, const struct dom_sid *sid);
-size_t ndr_size_dom_sid28(const struct dom_sid *sid, int flags);
-
-#endif /* __LIBNDR_H__ */
diff --git a/source3/librpc/ndr/ndr.c b/source3/librpc/ndr/ndr.c
deleted file mode 100644
index 56d5967de9..0000000000
--- a/source3/librpc/ndr/ndr.c
+++ /dev/null
@@ -1,1108 +0,0 @@
-/*
- Unix SMB/CIFS implementation.
-
- libndr interface
-
- Copyright (C) Andrew Tridgell 2003
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-/*
- this provides the core routines for NDR parsing functions
-
- see http://www.opengroup.org/onlinepubs/9629399/chap14.htm for details
- of NDR encoding rules
-*/
-
-#include "includes.h"
-
-#define NDR_BASE_MARSHALL_SIZE 1024
-
-/* this guid indicates NDR encoding in a protocol tower */
-const struct ndr_syntax_id ndr_transfer_syntax = {
- { 0x8a885d04, 0x1ceb, 0x11c9, {0x9f, 0xe8}, {0x08,0x00,0x2b,0x10,0x48,0x60} },
- 2
-};
-
-const struct ndr_syntax_id ndr64_transfer_syntax = {
- { 0x71710533, 0xbeba, 0x4937, {0x83, 0x19}, {0xb5,0xdb,0xef,0x9c,0xcc,0x36} },
- 1
-};
-
-/*
- work out the number of bytes needed to align on a n byte boundary
-*/
-_PUBLIC_ size_t ndr_align_size(uint32_t offset, size_t n)
-{
- if ((offset & (n-1)) == 0) return 0;
- return n - (offset & (n-1));
-}
-
-/*
- initialise a ndr parse structure from a data blob
-*/
-_PUBLIC_ struct ndr_pull *ndr_pull_init_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience)
-{
- struct ndr_pull *ndr;
-
- ndr = talloc_zero(mem_ctx, struct ndr_pull);
- if (!ndr) return NULL;
- ndr->current_mem_ctx = mem_ctx;
-
- ndr->data = blob->data;
- ndr->data_size = blob->length;
-
- return ndr;
-}
-
-/*
- advance by 'size' bytes
-*/
-_PUBLIC_ enum ndr_err_code ndr_pull_advance(struct ndr_pull *ndr, uint32_t size)
-{
- ndr->offset += size;
- if (ndr->offset > ndr->data_size) {
- return ndr_pull_error(ndr, NDR_ERR_BUFSIZE,
- "ndr_pull_advance by %u failed",
- size);
- }
- return NDR_ERR_SUCCESS;
-}
-
-/*
- set the parse offset to 'ofs'
-*/
-static enum ndr_err_code ndr_pull_set_offset(struct ndr_pull *ndr, uint32_t ofs)
-{
- ndr->offset = ofs;
- if (ndr->offset > ndr->data_size) {
- return ndr_pull_error(ndr, NDR_ERR_BUFSIZE,
- "ndr_pull_set_offset %u failed",
- ofs);
- }
- return NDR_ERR_SUCCESS;
-}
-
-/* save the offset/size of the current ndr state */
-_PUBLIC_ void ndr_pull_save(struct ndr_pull *ndr, struct ndr_pull_save *save)
-{
- save->offset = ndr->offset;
- save->data_size = ndr->data_size;
-}
-
-/* restore the size/offset of a ndr structure */
-_PUBLIC_ void ndr_pull_restore(struct ndr_pull *ndr, struct ndr_pull_save *save)
-{
- ndr->offset = save->offset;
- ndr->data_size = save->data_size;
-}
-
-
-/* create a ndr_push structure, ready for some marshalling */
-_PUBLIC_ struct ndr_push *ndr_push_init_ctx(TALLOC_CTX *mem_ctx)
-{
- struct ndr_push *ndr;
-
- ndr = talloc_zero(mem_ctx, struct ndr_push);
- if (!ndr) {
- return NULL;
- }
-
- ndr->flags = 0;
- ndr->alloc_size = NDR_BASE_MARSHALL_SIZE;
- ndr->data = talloc_array(ndr, uint8_t, ndr->alloc_size);
- if (!ndr->data) {
- return NULL;
- }
-
- return ndr;
-}
-
-/* return a DATA_BLOB structure for the current ndr_push marshalled data */
-_PUBLIC_ DATA_BLOB ndr_push_blob(struct ndr_push *ndr)
-{
- DATA_BLOB blob;
- blob = data_blob_const(ndr->data, ndr->offset);
- if (ndr->alloc_size > ndr->offset) {
- ndr->data[ndr->offset] = 0;
- }
- return blob;
-}
-
-
-/*
- expand the available space in the buffer to ndr->offset + extra_size
-*/
-_PUBLIC_ enum ndr_err_code ndr_push_expand(struct ndr_push *ndr, uint32_t extra_size)
-{
- uint32_t size = extra_size + ndr->offset;
-
- if (size < ndr->offset) {
- /* extra_size overflowed the offset */
- return ndr_push_error(ndr, NDR_ERR_BUFSIZE, "Overflow in push_expand to %u",
- size);
- }
-
- if (ndr->alloc_size > size) {
- return NDR_ERR_SUCCESS;
- }
-
- ndr->alloc_size += NDR_BASE_MARSHALL_SIZE;
- if (size+1 > ndr->alloc_size) {
- ndr->alloc_size = size+1;
- }
- ndr->data = talloc_realloc(ndr, ndr->data, uint8_t, ndr->alloc_size);
- if (!ndr->data) {
- return ndr_push_error(ndr, NDR_ERR_ALLOC, "Failed to push_expand to %u",
- ndr->alloc_size);
- }
-
- return NDR_ERR_SUCCESS;
-}
-
-_PUBLIC_ void ndr_print_debug_helper(struct ndr_print *ndr, const char *format, ...) _PRINTF_ATTRIBUTE(2,3)
-{
- va_list ap;
- char *s = NULL;
- int i, ret;
-
- va_start(ap, format);
- ret = vasprintf(&s, format, ap);
- va_end(ap);
-
- if (ret == -1) {
- return;
- }
-
- for (i=0;i<ndr->depth;i++) {
- DEBUGADD(0,(" "));
- }
-
- DEBUGADD(0,("%s\n", s));
- free(s);
-}
-
-_PUBLIC_ void ndr_print_string_helper(struct ndr_print *ndr, const char *format, ...) _PRINTF_ATTRIBUTE(2,3)
-{
- va_list ap;
- int i;
-
- for (i=0;i<ndr->depth;i++) {
- ndr->private_data = talloc_asprintf_append_buffer(
- (char *)ndr->private_data, " ");
- }
-
- va_start(ap, format);
- ndr->private_data = talloc_vasprintf_append_buffer((char *)ndr->private_data,
- format, ap);
- va_end(ap);
- ndr->private_data = talloc_asprintf_append_buffer((char *)ndr->private_data,
- "\n");
-}
-
-/*
- a useful helper function for printing idl structures via DEBUG()
-*/
-_PUBLIC_ void ndr_print_debug(ndr_print_fn_t fn, const char *name, void *ptr)
-{
- struct ndr_print *ndr;
-
- ndr = talloc_zero(NULL, struct ndr_print);
- if (!ndr) return;
- ndr->print = ndr_print_debug_helper;
- ndr->depth = 1;
- ndr->flags = 0;
- fn(ndr, name, ptr);
- talloc_free(ndr);
-}
-
-/*
- a useful helper function for printing idl unions via DEBUG()
-*/
-_PUBLIC_ void ndr_print_union_debug(ndr_print_fn_t fn, const char *name, uint32_t level, void *ptr)
-{
- struct ndr_print *ndr;
-
- ndr = talloc_zero(NULL, struct ndr_print);
- if (!ndr) return;
- ndr->print = ndr_print_debug_helper;
- ndr->depth = 1;
- ndr->flags = 0;
- ndr_print_set_switch_value(ndr, ptr, level);
- fn(ndr, name, ptr);
- talloc_free(ndr);
-}
-
-/*
- a useful helper function for printing idl function calls via DEBUG()
-*/
-_PUBLIC_ void ndr_print_function_debug(ndr_print_function_t fn, const char *name, int flags, void *ptr)
-{
- struct ndr_print *ndr;
-
- ndr = talloc_zero(NULL, struct ndr_print);
- if (!ndr) return;
- ndr->print = ndr_print_debug_helper;
- ndr->depth = 1;
- ndr->flags = 0;
- fn(ndr, name, flags, ptr);
- talloc_free(ndr);
-}
-
-/*
- a useful helper function for printing idl structures to a string
-*/
-_PUBLIC_ char *ndr_print_struct_string(TALLOC_CTX *mem_ctx, ndr_print_fn_t fn, const char *name, void *ptr)
-{
- struct ndr_print *ndr;
- char *ret = NULL;
-
- ndr = talloc_zero(mem_ctx, struct ndr_print);
- if (!ndr) return NULL;
- ndr->private_data = talloc_strdup(ndr, "");
- if (!ndr->private_data) {
- goto failed;
- }
- ndr->print = ndr_print_string_helper;
- ndr->depth = 1;
- ndr->flags = 0;
- fn(ndr, name, ptr);
- ret = talloc_steal(mem_ctx, (char *)ndr->private_data);
-failed:
- talloc_free(ndr);
- return ret;
-}
-
-/*
- a useful helper function for printing idl unions to a string
-*/
-_PUBLIC_ char *ndr_print_union_string(TALLOC_CTX *mem_ctx, ndr_print_fn_t fn, const char *name, uint32_t level, void *ptr)
-{
- struct ndr_print *ndr;
- char *ret = NULL;
-
- ndr = talloc_zero(mem_ctx, struct ndr_print);
- if (!ndr) return NULL;
- ndr->private_data = talloc_strdup(ndr, "");
- if (!ndr->private_data) {
- goto failed;
- }
- ndr->print = ndr_print_string_helper;
- ndr->depth = 1;
- ndr->flags = 0;
- ndr_print_set_switch_value(ndr, ptr, level);
- fn(ndr, name, ptr);
- ret = talloc_steal(mem_ctx, (char *)ndr->private_data);
-failed:
- talloc_free(ndr);
- return ret;
-}
-
-/*
- a useful helper function for printing idl function calls to a string
-*/
-_PUBLIC_ char *ndr_print_function_string(TALLOC_CTX *mem_ctx,
- ndr_print_function_t fn, const char *name,
- int flags, void *ptr)
-{
- struct ndr_print *ndr;
- char *ret = NULL;
-
- ndr = talloc_zero(mem_ctx, struct ndr_print);
- if (!ndr) return NULL;
- ndr->private_data = talloc_strdup(ndr, "");
- if (!ndr->private_data) {
- goto failed;
- }
- ndr->print = ndr_print_string_helper;
- ndr->depth = 1;
- ndr->flags = 0;
- fn(ndr, name, flags, ptr);
- ret = talloc_steal(mem_ctx, (char *)ndr->private_data);
-failed:
- talloc_free(ndr);
- return ret;
-}
-
-_PUBLIC_ void ndr_set_flags(uint32_t *pflags, uint32_t new_flags)
-{
- /* the big/little endian flags are inter-dependent */
- if (new_flags & LIBNDR_FLAG_LITTLE_ENDIAN) {
- (*pflags) &= ~LIBNDR_FLAG_BIGENDIAN;
- }
- if (new_flags & LIBNDR_FLAG_BIGENDIAN) {
- (*pflags) &= ~LIBNDR_FLAG_LITTLE_ENDIAN;
- }
- if (new_flags & LIBNDR_FLAG_REMAINING) {
- (*pflags) &= ~LIBNDR_ALIGN_FLAGS;
- }
- if (new_flags & LIBNDR_ALIGN_FLAGS) {
- (*pflags) &= ~LIBNDR_FLAG_REMAINING;
- }
- (*pflags) |= new_flags;
-}
-
-NTSTATUS ndr_map_error2ntstatus(enum ndr_err_code ndr_err)
-{
- switch (ndr_err) {
- case NDR_ERR_SUCCESS:
- return NT_STATUS_OK;
- case NDR_ERR_BUFSIZE:
- return NT_STATUS_BUFFER_TOO_SMALL;
- case NDR_ERR_TOKEN:
- return NT_STATUS_INTERNAL_ERROR;
- case NDR_ERR_ALLOC:
- return NT_STATUS_NO_MEMORY;
- case NDR_ERR_ARRAY_SIZE:
- return NT_STATUS_ARRAY_BOUNDS_EXCEEDED;
- case NDR_ERR_INVALID_POINTER:
- return NT_STATUS_INVALID_PARAMETER_MIX;
- case NDR_ERR_UNREAD_BYTES:
- return NT_STATUS_PORT_MESSAGE_TOO_LONG;
- default:
- break;
- }
-
- /* we should map all error codes to different status codes */
- return NT_STATUS_INVALID_PARAMETER;
-}
-
-/*
- * Convert an ndr error to string
- */
-
-const char *ndr_errstr(enum ndr_err_code err)
-{
- switch (err) {
- case NDR_ERR_SUCCESS:
- return "NDR_ERR_SUCCESS";
- break;
- case NDR_ERR_ARRAY_SIZE:
- return "NDR_ERR_ARRAY_SIZE";
- break;
- case NDR_ERR_BAD_SWITCH:
- return "NDR_ERR_BAD_SWITCH";
- break;
- case NDR_ERR_OFFSET:
- return "NDR_ERR_OFFSET";
- break;
- case NDR_ERR_RELATIVE:
- return "NDR_ERR_RELATIVE";
- break;
- case NDR_ERR_CHARCNV:
- return "NDR_ERR_CHARCNV";
- break;
- case NDR_ERR_LENGTH:
- return "NDR_ERR_LENGTH";
- break;
- case NDR_ERR_SUBCONTEXT:
- return "NDR_ERR_SUBCONTEXT";
- break;
- case NDR_ERR_COMPRESSION:
- return "NDR_ERR_COMPRESSION";
- break;
- case NDR_ERR_STRING:
- return "NDR_ERR_STRING";
- break;
- case NDR_ERR_VALIDATE:
- return "NDR_ERR_VALIDATE";
- break;
- case NDR_ERR_BUFSIZE:
- return "NDR_ERR_BUFSIZE";
- break;
- case NDR_ERR_ALLOC:
- return "NDR_ERR_ALLOC";
- break;
- case NDR_ERR_RANGE:
- return "NDR_ERR_RANGE";
- break;
- case NDR_ERR_TOKEN:
- return "NDR_ERR_TOKEN";
- break;
- case NDR_ERR_IPV4ADDRESS:
- return "NDR_ERR_IPV4ADDRESS";
- break;
- case NDR_ERR_INVALID_POINTER:
- return "NDR_ERR_INVALID_POINTER";
- break;
- case NDR_ERR_UNREAD_BYTES:
- return "NDR_ERR_UNREAD_BYTES";
- break;
- }
-
- return talloc_asprintf(talloc_tos(), "Unknown NDR error: %d", err);
-}
-
-/*
- return and possibly log an NDR error
-*/
-_PUBLIC_ enum ndr_err_code ndr_pull_error(struct ndr_pull *ndr,
- enum ndr_err_code ndr_err,
- const char *format, ...) _PRINTF_ATTRIBUTE(3,4)
-{
- char *s=NULL;
- va_list ap;
- int ret;
-
- va_start(ap, format);
- ret = vasprintf(&s, format, ap);
- va_end(ap);
-
- if (ret == -1) {
- return NDR_ERR_ALLOC;
- }
-
- DEBUG(1,("ndr_pull_error(%u): %s\n", ndr_err, s));
-
- free(s);
-
- return ndr_err;
-}
-
-/*
- return and possibly log an NDR error
-*/
-_PUBLIC_ enum ndr_err_code ndr_push_error(struct ndr_push *ndr,
- enum ndr_err_code ndr_err,
- const char *format, ...) _PRINTF_ATTRIBUTE(3,4)
-{
- char *s=NULL;
- va_list ap;
- int ret;
-
- va_start(ap, format);
- ret = vasprintf(&s, format, ap);
- va_end(ap);
-
- if (ret == -1) {
- return NDR_ERR_ALLOC;
- }
-
- DEBUG(1,("ndr_push_error(%u): %s\n", ndr_err, s));
-
- free(s);
-
- return ndr_err;
-}
-
-/*
- handle subcontext buffers, which in midl land are user-marshalled, but
- we use magic in pidl to make them easier to cope with
-*/
-_PUBLIC_ enum ndr_err_code ndr_pull_subcontext_start(struct ndr_pull *ndr,
- struct ndr_pull **_subndr,
- size_t header_size,
- ssize_t size_is)
-{
- struct ndr_pull *subndr;
- uint32_t r_content_size;
-
- switch (header_size) {
- case 0: {
- uint32_t content_size = ndr->data_size - ndr->offset;
- if (size_is >= 0) {
- content_size = size_is;
- }
- r_content_size = content_size;
- break;
- }
-
- case 2: {
- uint16_t content_size;
- NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &content_size));
- if (size_is >= 0 && size_is != content_size) {
- return ndr_pull_error(ndr, NDR_ERR_SUBCONTEXT, "Bad subcontext (PULL) size_is(%d) mismatch content_size %d",
- (int)size_is, (int)content_size);
- }
- r_content_size = content_size;
- break;
- }
-
- case 4: {
- uint32_t content_size;
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &content_size));
- if (size_is >= 0 && size_is != content_size) {
- return ndr_pull_error(ndr, NDR_ERR_SUBCONTEXT, "Bad subcontext (PULL) size_is(%d) mismatch content_size %d",
- (int)size_is, (int)content_size);
- }
- r_content_size = content_size;
- break;
- }
- default:
- return ndr_pull_error(ndr, NDR_ERR_SUBCONTEXT, "Bad subcontext (PULL) header_size %d",
- (int)header_size);
- }
-
- NDR_PULL_NEED_BYTES(ndr, r_content_size);
-
- 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->offset = 0;
- subndr->data_size = r_content_size;
-
- *_subndr = subndr;
- return NDR_ERR_SUCCESS;
-}
-
-_PUBLIC_ enum ndr_err_code ndr_pull_subcontext_end(struct ndr_pull *ndr,
- struct ndr_pull *subndr,
- size_t header_size,
- ssize_t size_is)
-{
- uint32_t advance;
- if (size_is >= 0) {
- advance = size_is;
- } else if (header_size > 0) {
- advance = subndr->data_size;
- } else {
- advance = subndr->offset;
- }
- NDR_CHECK(ndr_pull_advance(ndr, advance));
- return NDR_ERR_SUCCESS;
-}
-
-_PUBLIC_ enum ndr_err_code ndr_push_subcontext_start(struct ndr_push *ndr,
- struct ndr_push **_subndr,
- size_t header_size,
- ssize_t size_is)
-{
- struct ndr_push *subndr;
-
- subndr = ndr_push_init_ctx(ndr);
- NDR_ERR_HAVE_NO_MEMORY(subndr);
- subndr->flags = ndr->flags;
-
- *_subndr = subndr;
- return NDR_ERR_SUCCESS;
-}
-
-/*
- push a subcontext header
-*/
-_PUBLIC_ enum ndr_err_code ndr_push_subcontext_end(struct ndr_push *ndr,
- struct ndr_push *subndr,
- size_t header_size,
- ssize_t size_is)
-{
- if (size_is >= 0) {
- ssize_t padding_len = size_is - subndr->offset;
- if (padding_len > 0) {
- NDR_CHECK(ndr_push_zero(subndr, padding_len));
- } else if (padding_len < 0) {
- return ndr_push_error(ndr, NDR_ERR_SUBCONTEXT, "Bad subcontext (PUSH) content_size %d is larger than size_is(%d)",
- (int)subndr->offset, (int)size_is);
- }
- }
-
- switch (header_size) {
- case 0:
- break;
-
- case 2:
- NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, subndr->offset));
- break;
-
- case 4:
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, subndr->offset));
- break;
-
- default:
- return ndr_push_error(ndr, NDR_ERR_SUBCONTEXT, "Bad subcontext header size %d",
- (int)header_size);
- }
-
- NDR_CHECK(ndr_push_bytes(ndr, subndr->data, subndr->offset));
- return NDR_ERR_SUCCESS;
-}
-
-/*
- store a token in the ndr context, for later retrieval
-*/
-_PUBLIC_ enum ndr_err_code ndr_token_store(TALLOC_CTX *mem_ctx,
- struct ndr_token_list **list,
- const void *key,
- uint32_t value)
-{
- struct ndr_token_list *tok;
- tok = talloc(mem_ctx, struct ndr_token_list);
- NDR_ERR_HAVE_NO_MEMORY(tok);
- tok->key = key;
- tok->value = value;
- DLIST_ADD((*list), tok);
- return NDR_ERR_SUCCESS;
-}
-
-/*
- retrieve a token from a ndr context, using cmp_fn to match the tokens
-*/
-_PUBLIC_ enum ndr_err_code ndr_token_retrieve_cmp_fn(struct ndr_token_list **list, const void *key, uint32_t *v,
- comparison_fn_t _cmp_fn, bool _remove_tok)
-{
- struct ndr_token_list *tok;
- for (tok=*list;tok;tok=tok->next) {
- if (_cmp_fn && _cmp_fn(tok->key,key)==0) goto found;
- else if (!_cmp_fn && tok->key == key) goto found;
- }
- return NDR_ERR_TOKEN;
-found:
- *v = tok->value;
- if (_remove_tok) {
- DLIST_REMOVE((*list), tok);
- talloc_free(tok);
- }
- return NDR_ERR_SUCCESS;
-}
-
-/*
- retrieve a token from a ndr context
-*/
-_PUBLIC_ enum ndr_err_code ndr_token_retrieve(struct ndr_token_list **list, const void *key, uint32_t *v)
-{
- return ndr_token_retrieve_cmp_fn(list, key, v, NULL, true);
-}
-
-/*
- peek at but don't removed a token from a ndr context
-*/
-_PUBLIC_ uint32_t ndr_token_peek(struct ndr_token_list **list, const void *key)
-{
- enum ndr_err_code status;
- uint32_t v;
-
- status = ndr_token_retrieve_cmp_fn(list, key, &v, NULL, false);
- if (!NDR_ERR_CODE_IS_SUCCESS(status)) {
- return 0;
- }
-
- return v;
-}
-
-/*
- pull an array size field and add it to the array_size_list token list
-*/
-_PUBLIC_ enum ndr_err_code ndr_pull_array_size(struct ndr_pull *ndr, const void *p)
-{
- uint32_t size;
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &size));
- return ndr_token_store(ndr, &ndr->array_size_list, p, size);
-}
-
-/*
- get the stored array size field
-*/
-_PUBLIC_ uint32_t ndr_get_array_size(struct ndr_pull *ndr, const void *p)
-{
- return ndr_token_peek(&ndr->array_size_list, p);
-}
-
-/*
- check the stored array size field
-*/
-_PUBLIC_ enum ndr_err_code ndr_check_array_size(struct ndr_pull *ndr, void *p, uint32_t size)
-{
- uint32_t stored;
- stored = ndr_token_peek(&ndr->array_size_list, p);
- if (stored != size) {
- return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE,
- "Bad array size - got %u expected %u\n",
- stored, size);
- }
- return NDR_ERR_SUCCESS;
-}
-
-/*
- pull an array length field and add it to the array_length_list token list
-*/
-_PUBLIC_ enum ndr_err_code ndr_pull_array_length(struct ndr_pull *ndr, const void *p)
-{
- uint32_t length, offset;
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &offset));
- if (offset != 0) {
- return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE,
- "non-zero array offset %u\n", offset);
- }
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &length));
- return ndr_token_store(ndr, &ndr->array_length_list, p, length);
-}
-
-/*
- get the stored array length field
-*/
-_PUBLIC_ uint32_t ndr_get_array_length(struct ndr_pull *ndr, const void *p)
-{
- return ndr_token_peek(&ndr->array_length_list, p);
-}
-
-/*
- check the stored array length field
-*/
-_PUBLIC_ enum ndr_err_code ndr_check_array_length(struct ndr_pull *ndr, void *p, uint32_t length)
-{
- uint32_t stored;
- stored = ndr_token_peek(&ndr->array_length_list, p);
- if (stored != length) {
- return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE,
- "Bad array length - got %u expected %u\n",
- stored, length);
- }
- return NDR_ERR_SUCCESS;
-}
-
-/*
- store a switch value
- */
-_PUBLIC_ enum ndr_err_code ndr_push_set_switch_value(struct ndr_push *ndr, const void *p, uint32_t val)
-{
- return ndr_token_store(ndr, &ndr->switch_list, p, val);
-}
-
-_PUBLIC_ enum ndr_err_code ndr_pull_set_switch_value(struct ndr_pull *ndr, const void *p, uint32_t val)
-{
- return ndr_token_store(ndr, &ndr->switch_list, p, val);
-}
-
-_PUBLIC_ enum ndr_err_code ndr_print_set_switch_value(struct ndr_print *ndr, const void *p, uint32_t val)
-{
- return ndr_token_store(ndr, &ndr->switch_list, p, val);
-}
-
-/*
- retrieve a switch value
- */
-_PUBLIC_ uint32_t ndr_push_get_switch_value(struct ndr_push *ndr, const void *p)
-{
- return ndr_token_peek(&ndr->switch_list, p);
-}
-
-_PUBLIC_ uint32_t ndr_pull_get_switch_value(struct ndr_pull *ndr, const void *p)
-{
- return ndr_token_peek(&ndr->switch_list, p);
-}
-
-_PUBLIC_ uint32_t ndr_print_get_switch_value(struct ndr_print *ndr, const void *p)
-{
- return ndr_token_peek(&ndr->switch_list, p);
-}
-
-/*
- pull a struct from a blob using NDR
-*/
-_PUBLIC_ enum ndr_err_code ndr_pull_struct_blob(const DATA_BLOB *blob,
- TALLOC_CTX *mem_ctx,
- struct smb_iconv_convenience *iconv_convenience,
- void *p,
- ndr_pull_flags_fn_t fn)
-{
- struct ndr_pull *ndr;
- ndr = ndr_pull_init_blob(blob, mem_ctx, iconv_convenience);
- NDR_ERR_HAVE_NO_MEMORY(ndr);
- NDR_CHECK(fn(ndr, NDR_SCALARS|NDR_BUFFERS, p));
- return NDR_ERR_SUCCESS;
-}
-
-/*
- pull a struct from a blob using NDR - failing if all bytes are not consumed
-*/
-_PUBLIC_ enum ndr_err_code ndr_pull_struct_blob_all(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx,
- struct smb_iconv_convenience *iconv_convenience,
- void *p, ndr_pull_flags_fn_t fn)
-{
- struct ndr_pull *ndr;
- ndr = ndr_pull_init_blob(blob, mem_ctx, iconv_convenience);
- NDR_ERR_HAVE_NO_MEMORY(ndr);
- NDR_CHECK(fn(ndr, NDR_SCALARS|NDR_BUFFERS, p));
- if (ndr->offset < ndr->data_size) {
- return ndr_pull_error(ndr, NDR_ERR_UNREAD_BYTES,
- "not all bytes consumed ofs[%u] size[%u]",
- ndr->offset, ndr->data_size);
- }
- return NDR_ERR_SUCCESS;
-}
-
-/*
- pull a union from a blob using NDR, given the union discriminator
-*/
-_PUBLIC_ enum ndr_err_code ndr_pull_union_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p,
- uint32_t level, ndr_pull_flags_fn_t fn)
-{
- struct ndr_pull *ndr;
- ndr = ndr_pull_init_blob(blob, mem_ctx, NULL);
- NDR_ERR_HAVE_NO_MEMORY(ndr);
- NDR_CHECK(ndr_pull_set_switch_value(ndr, p, level));
- NDR_CHECK(fn(ndr, NDR_SCALARS|NDR_BUFFERS, p));
- return NDR_ERR_SUCCESS;
-}
-
-/*
- pull a union from a blob using NDR, given the union discriminator,
- failing if all bytes are not consumed
-*/
-_PUBLIC_ enum ndr_err_code ndr_pull_union_blob_all(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p,
- uint32_t level, ndr_pull_flags_fn_t fn)
-{
- struct ndr_pull *ndr;
- ndr = ndr_pull_init_blob(blob, mem_ctx, NULL);
- NDR_ERR_HAVE_NO_MEMORY(ndr);
- NDR_CHECK(ndr_pull_set_switch_value(ndr, p, level));
- NDR_CHECK(fn(ndr, NDR_SCALARS|NDR_BUFFERS, p));
- if (ndr->offset < ndr->data_size) {
- return ndr_pull_error(ndr, NDR_ERR_UNREAD_BYTES,
- "not all bytes consumed ofs[%u] size[%u]",
- ndr->offset, ndr->data_size);
- }
- return NDR_ERR_SUCCESS;
-}
-
-/*
- push a struct to a blob using NDR
-*/
-_PUBLIC_ enum ndr_err_code ndr_push_struct_blob(DATA_BLOB *blob,
- TALLOC_CTX *mem_ctx,
- struct smb_iconv_convenience *iconv_convenience,
- const void *p,
- ndr_push_flags_fn_t fn)
-{
- struct ndr_push *ndr;
- ndr = ndr_push_init_ctx(mem_ctx);
- NDR_ERR_HAVE_NO_MEMORY(ndr);
-
- NDR_CHECK(fn(ndr, NDR_SCALARS|NDR_BUFFERS, p));
-
- *blob = ndr_push_blob(ndr);
- talloc_steal(mem_ctx, blob->data);
- talloc_free(ndr);
-
- return NDR_ERR_SUCCESS;
-}
-
-/*
- push a union to a blob using NDR
-*/
-_PUBLIC_ enum ndr_err_code ndr_push_union_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p,
- uint32_t level, ndr_push_flags_fn_t fn)
-{
- struct ndr_push *ndr;
- ndr = ndr_push_init_ctx(mem_ctx);
- NDR_ERR_HAVE_NO_MEMORY(ndr);
-
- NDR_CHECK(ndr_push_set_switch_value(ndr, p, level));
- NDR_CHECK(fn(ndr, NDR_SCALARS|NDR_BUFFERS, p));
-
- *blob = ndr_push_blob(ndr);
- talloc_steal(mem_ctx, blob->data);
- talloc_free(ndr);
-
- return NDR_ERR_SUCCESS;
-}
-
-/*
- generic ndr_size_*() handler for structures
-*/
-_PUBLIC_ size_t ndr_size_struct(const void *p, int flags, ndr_push_flags_fn_t push)
-{
- struct ndr_push *ndr;
- enum ndr_err_code status;
- size_t ret;
-
- /* avoid recursion */
- if (flags & LIBNDR_FLAG_NO_NDR_SIZE) return 0;
-
- ndr = ndr_push_init_ctx(NULL);
- if (!ndr) return 0;
- ndr->flags |= flags | LIBNDR_FLAG_NO_NDR_SIZE;
- status = push(ndr, NDR_SCALARS|NDR_BUFFERS, discard_const(p));
- if (!NDR_ERR_CODE_IS_SUCCESS(status)) {
- talloc_free(ndr);
- return 0;
- }
- ret = ndr->offset;
- talloc_free(ndr);
- return ret;
-}
-
-/*
- generic ndr_size_*() handler for unions
-*/
-_PUBLIC_ size_t ndr_size_union(const void *p, int flags, uint32_t level, ndr_push_flags_fn_t push)
-{
- struct ndr_push *ndr;
- enum ndr_err_code status;
- size_t ret;
-
- /* avoid recursion */
- if (flags & LIBNDR_FLAG_NO_NDR_SIZE) return 0;
-
- ndr = ndr_push_init_ctx(NULL);
- if (!ndr) return 0;
- ndr->flags |= flags | LIBNDR_FLAG_NO_NDR_SIZE;
-
- status = ndr_push_set_switch_value(ndr, p, level);
- if (!NDR_ERR_CODE_IS_SUCCESS(status)) {
- talloc_free(ndr);
- return 0;
- }
- status = push(ndr, NDR_SCALARS|NDR_BUFFERS, p);
- if (!NDR_ERR_CODE_IS_SUCCESS(status)) {
- talloc_free(ndr);
- return 0;
- }
- ret = ndr->offset;
- talloc_free(ndr);
- return ret;
-}
-
-/*
- get the current base for relative pointers for the push
-*/
-_PUBLIC_ uint32_t ndr_push_get_relative_base_offset(struct ndr_push *ndr)
-{
- return ndr->relative_base_offset;
-}
-
-/*
- restore the old base for relative pointers for the push
-*/
-_PUBLIC_ void ndr_push_restore_relative_base_offset(struct ndr_push *ndr, uint32_t offset)
-{
- ndr->relative_base_offset = offset;
-}
-
-/*
- setup the current base for relative pointers for the push
- called in the NDR_SCALAR stage
-*/
-_PUBLIC_ enum ndr_err_code ndr_push_setup_relative_base_offset1(struct ndr_push *ndr, const void *p, uint32_t offset)
-{
- ndr->relative_base_offset = offset;
- return ndr_token_store(ndr, &ndr->relative_base_list, p, offset);
-}
-
-/*
- setup the current base for relative pointers for the push
- called in the NDR_BUFFERS stage
-*/
-_PUBLIC_ enum ndr_err_code ndr_push_setup_relative_base_offset2(struct ndr_push *ndr, const void *p)
-{
- return ndr_token_retrieve(&ndr->relative_base_list, p, &ndr->relative_base_offset);
-}
-
-/*
- push a relative object - stage1
- this is called during SCALARS processing
-*/
-_PUBLIC_ enum ndr_err_code ndr_push_relative_ptr1(struct ndr_push *ndr, const void *p)
-{
- if (p == NULL) {
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
- return NDR_ERR_SUCCESS;
- }
- NDR_CHECK(ndr_push_align(ndr, 4));
- NDR_CHECK(ndr_token_store(ndr, &ndr->relative_list, p, ndr->offset));
- return ndr_push_uint32(ndr, NDR_SCALARS, 0xFFFFFFFF);
-}
-
-/*
- push a relative object - stage2
- this is called during buffers processing
-*/
-_PUBLIC_ enum ndr_err_code ndr_push_relative_ptr2(struct ndr_push *ndr, const void *p)
-{
- struct ndr_push_save save;
- uint32_t ptr_offset = 0xFFFFFFFF;
- if (p == NULL) {
- return NDR_ERR_SUCCESS;
- }
- ndr_push_save(ndr, &save);
- NDR_CHECK(ndr_token_retrieve(&ndr->relative_list, p, &ptr_offset));
- if (ptr_offset > ndr->offset) {
- return ndr_push_error(ndr, NDR_ERR_BUFSIZE,
- "ndr_push_relative_ptr2 ptr_offset(%u) > ndr->offset(%u)",
- ptr_offset, ndr->offset);
- }
- ndr->offset = ptr_offset;
- if (save.offset < ndr->relative_base_offset) {
- return ndr_push_error(ndr, NDR_ERR_BUFSIZE,
- "ndr_push_relative_ptr2 save.offset(%u) < ndr->relative_base_offset(%u)",
- save.offset, ndr->relative_base_offset);
- }
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, save.offset - ndr->relative_base_offset));
- ndr_push_restore(ndr, &save);
- return NDR_ERR_SUCCESS;
-}
-
-/*
- get the current base for relative pointers for the pull
-*/
-_PUBLIC_ uint32_t ndr_pull_get_relative_base_offset(struct ndr_pull *ndr)
-{
- return ndr->relative_base_offset;
-}
-
-/*
- restore the old base for relative pointers for the pull
-*/
-_PUBLIC_ void ndr_pull_restore_relative_base_offset(struct ndr_pull *ndr, uint32_t offset)
-{
- ndr->relative_base_offset = offset;
-}
-
-/*
- setup the current base for relative pointers for the pull
- called in the NDR_SCALAR stage
-*/
-_PUBLIC_ enum ndr_err_code ndr_pull_setup_relative_base_offset1(struct ndr_pull *ndr, const void *p, uint32_t offset)
-{
- ndr->relative_base_offset = offset;
- return ndr_token_store(ndr, &ndr->relative_base_list, p, offset);
-}
-
-/*
- setup the current base for relative pointers for the pull
- called in the NDR_BUFFERS stage
-*/
-_PUBLIC_ enum ndr_err_code ndr_pull_setup_relative_base_offset2(struct ndr_pull *ndr, const void *p)
-{
- return ndr_token_retrieve(&ndr->relative_base_list, p, &ndr->relative_base_offset);
-}
-
-/*
- pull a relative object - stage1
- called during SCALARS processing
-*/
-_PUBLIC_ enum ndr_err_code ndr_pull_relative_ptr1(struct ndr_pull *ndr, const void *p, uint32_t rel_offset)
-{
- rel_offset += ndr->relative_base_offset;
- if (rel_offset > ndr->data_size) {
- return ndr_pull_error(ndr, NDR_ERR_BUFSIZE,
- "ndr_pull_relative_ptr1 rel_offset(%u) > ndr->data_size(%u)",
- rel_offset, ndr->data_size);
- }
- return ndr_token_store(ndr, &ndr->relative_list, p, rel_offset);
-}
-
-/*
- pull a relative object - stage2
- called during BUFFERS processing
-*/
-_PUBLIC_ enum ndr_err_code ndr_pull_relative_ptr2(struct ndr_pull *ndr, const void *p)
-{
- uint32_t rel_offset;
- NDR_CHECK(ndr_token_retrieve(&ndr->relative_list, p, &rel_offset));
- return ndr_pull_set_offset(ndr, rel_offset);
-}
diff --git a/source3/librpc/ndr/ndr_basic.c b/source3/librpc/ndr/ndr_basic.c
deleted file mode 100644
index c8fa70b185..0000000000
--- a/source3/librpc/ndr/ndr_basic.c
+++ /dev/null
@@ -1,859 +0,0 @@
-/*
- Unix SMB/CIFS implementation.
-
- routines for marshalling/unmarshalling basic types
-
- Copyright (C) Andrew Tridgell 2003
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "includes.h"
-#include "system/network.h"
-#include "librpc/ndr/libndr.h"
-
-#define NDR_SVAL(ndr, ofs) (NDR_BE(ndr)?RSVAL(ndr->data,ofs):SVAL(ndr->data,ofs))
-#define NDR_IVAL(ndr, ofs) (NDR_BE(ndr)?RIVAL(ndr->data,ofs):IVAL(ndr->data,ofs))
-#define NDR_IVALS(ndr, ofs) (NDR_BE(ndr)?RIVALS(ndr->data,ofs):IVALS(ndr->data,ofs))
-#define NDR_SSVAL(ndr, ofs, v) do { if (NDR_BE(ndr)) { RSSVAL(ndr->data,ofs,v); } else SSVAL(ndr->data,ofs,v); } while (0)
-#define NDR_SIVAL(ndr, ofs, v) do { if (NDR_BE(ndr)) { RSIVAL(ndr->data,ofs,v); } else SIVAL(ndr->data,ofs,v); } while (0)
-#define NDR_SIVALS(ndr, ofs, v) do { if (NDR_BE(ndr)) { RSIVALS(ndr->data,ofs,v); } else SIVALS(ndr->data,ofs,v); } while (0)
-
-
-/*
- check for data leaks from the server by looking for non-zero pad bytes
- these could also indicate that real structure elements have been
- mistaken for padding in the IDL
-*/
-_PUBLIC_ void ndr_check_padding(struct ndr_pull *ndr, size_t n)
-{
- size_t ofs2 = (ndr->offset + (n-1)) & ~(n-1);
- int i;
- for (i=ndr->offset;i<ofs2;i++) {
- if (ndr->data[i] != 0) {
- break;
- }
- }
- if (i<ofs2) {
- DEBUG(0,("WARNING: Non-zero padding to %d: ", (int)n));
- for (i=ndr->offset;i<ofs2;i++) {
- DEBUG(0,("%02x ", ndr->data[i]));
- }
- DEBUG(0,("\n"));
- }
-
-}
-
-/*
- parse a int8_t
-*/
-_PUBLIC_ enum ndr_err_code ndr_pull_int8(struct ndr_pull *ndr, int ndr_flags, int8_t *v)
-{
- NDR_PULL_NEED_BYTES(ndr, 1);
- *v = (int8_t)CVAL(ndr->data, ndr->offset);
- ndr->offset += 1;
- return NDR_ERR_SUCCESS;
-}
-
-/*
- parse a uint8_t
-*/
-_PUBLIC_ enum ndr_err_code ndr_pull_uint8(struct ndr_pull *ndr, int ndr_flags, uint8_t *v)
-{
- NDR_PULL_NEED_BYTES(ndr, 1);
- *v = CVAL(ndr->data, ndr->offset);
- ndr->offset += 1;
- return NDR_ERR_SUCCESS;
-}
-
-/*
- parse a int16_t
-*/
-_PUBLIC_ enum ndr_err_code ndr_pull_int16(struct ndr_pull *ndr, int ndr_flags, int16_t *v)
-{
- NDR_PULL_ALIGN(ndr, 2);
- NDR_PULL_NEED_BYTES(ndr, 2);
- *v = (uint16_t)NDR_SVAL(ndr, ndr->offset);
- ndr->offset += 2;
- return NDR_ERR_SUCCESS;
-}
-
-/*
- parse a uint16_t
-*/
-_PUBLIC_ enum ndr_err_code ndr_pull_uint16(struct ndr_pull *ndr, int ndr_flags, uint16_t *v)
-{
- NDR_PULL_ALIGN(ndr, 2);
- NDR_PULL_NEED_BYTES(ndr, 2);
- *v = NDR_SVAL(ndr, ndr->offset);
- ndr->offset += 2;
- return NDR_ERR_SUCCESS;
-}
-
-/*
- parse a int32_t
-*/
-_PUBLIC_ enum ndr_err_code ndr_pull_int32(struct ndr_pull *ndr, int ndr_flags, int32_t *v)
-{
- NDR_PULL_ALIGN(ndr, 4);
- NDR_PULL_NEED_BYTES(ndr, 4);
- *v = NDR_IVALS(ndr, ndr->offset);
- ndr->offset += 4;
- return NDR_ERR_SUCCESS;
-}
-
-/*
- parse a uint32_t
-*/
-_PUBLIC_ enum ndr_err_code ndr_pull_uint32(struct ndr_pull *ndr, int ndr_flags, uint32_t *v)
-{
- NDR_PULL_ALIGN(ndr, 4);
- NDR_PULL_NEED_BYTES(ndr, 4);
- *v = NDR_IVAL(ndr, ndr->offset);
- ndr->offset += 4;
- return NDR_ERR_SUCCESS;
-}
-
-/*
- parse a pointer referent identifier
-*/
-_PUBLIC_ enum ndr_err_code ndr_pull_generic_ptr(struct ndr_pull *ndr, uint32_t *v)
-{
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, v));
- if (*v != 0) {
- ndr->ptr_count++;
- }
- return NDR_ERR_SUCCESS;
-}
-
-/*
- parse a ref pointer referent identifier
-*/
-_PUBLIC_ enum ndr_err_code ndr_pull_ref_ptr(struct ndr_pull *ndr, uint32_t *v)
-{
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, v));
- /* ref pointers always point to data */
- *v = 1;
- return NDR_ERR_SUCCESS;
-}
-
-/*
- parse a udlong
-*/
-_PUBLIC_ enum ndr_err_code ndr_pull_udlong(struct ndr_pull *ndr, int ndr_flags, uint64_t *v)
-{
- NDR_PULL_ALIGN(ndr, 4);
- NDR_PULL_NEED_BYTES(ndr, 8);
- *v = NDR_IVAL(ndr, ndr->offset);
- *v |= (uint64_t)(NDR_IVAL(ndr, ndr->offset+4)) << 32;
- ndr->offset += 8;
- return NDR_ERR_SUCCESS;
-}
-
-/*
- parse a udlongr
-*/
-_PUBLIC_ enum ndr_err_code ndr_pull_udlongr(struct ndr_pull *ndr, int ndr_flags, uint64_t *v)
-{
- NDR_PULL_ALIGN(ndr, 4);
- NDR_PULL_NEED_BYTES(ndr, 8);
- *v = ((uint64_t)NDR_IVAL(ndr, ndr->offset)) << 32;
- *v |= NDR_IVAL(ndr, ndr->offset+4);
- ndr->offset += 8;
- return NDR_ERR_SUCCESS;
-}
-
-/*
- parse a dlong
-*/
-_PUBLIC_ enum ndr_err_code ndr_pull_dlong(struct ndr_pull *ndr, int ndr_flags, int64_t *v)
-{
- return ndr_pull_udlong(ndr, ndr_flags, (uint64_t *)v);
-}
-
-/*
- parse a hyper
-*/
-_PUBLIC_ enum ndr_err_code ndr_pull_hyper(struct ndr_pull *ndr, int ndr_flags, uint64_t *v)
-{
- NDR_PULL_ALIGN(ndr, 8);
- return ndr_pull_udlong(ndr, ndr_flags, v);
-}
-
-/*
- parse a pointer
-*/
-_PUBLIC_ enum ndr_err_code ndr_pull_pointer(struct ndr_pull *ndr, int ndr_flags, void* *v)
-{
- uintptr_t h;
- NDR_PULL_ALIGN(ndr, sizeof(h));
- NDR_PULL_NEED_BYTES(ndr, sizeof(h));
- memcpy(&h, ndr->data+ndr->offset, sizeof(h));
- ndr->offset += sizeof(h);
- *v = (void *)h;
- return NDR_ERR_SUCCESS;
-}
-
-/*
- pull a NTSTATUS
-*/
-_PUBLIC_ enum ndr_err_code ndr_pull_NTSTATUS(struct ndr_pull *ndr, int ndr_flags, NTSTATUS *status)
-{
- uint32_t v;
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
- *status = NT_STATUS(v);
- return NDR_ERR_SUCCESS;
-}
-
-/*
- push a NTSTATUS
-*/
-_PUBLIC_ enum ndr_err_code ndr_push_NTSTATUS(struct ndr_push *ndr, int ndr_flags, NTSTATUS status)
-{
- return ndr_push_uint32(ndr, ndr_flags, NT_STATUS_V(status));
-}
-
-_PUBLIC_ void ndr_print_NTSTATUS(struct ndr_print *ndr, const char *name, NTSTATUS r)
-{
- ndr->print(ndr, "%-25s: %s", name, nt_errstr(r));
-}
-
-/*
- pull a WERROR
-*/
-_PUBLIC_ enum ndr_err_code ndr_pull_WERROR(struct ndr_pull *ndr, int ndr_flags, WERROR *status)
-{
- uint32_t v;
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
- *status = W_ERROR(v);
- return NDR_ERR_SUCCESS;
-}
-
-/*
- push a WERROR
-*/
-_PUBLIC_ enum ndr_err_code ndr_push_WERROR(struct ndr_push *ndr, int ndr_flags, WERROR status)
-{
- return ndr_push_uint32(ndr, NDR_SCALARS, W_ERROR_V(status));
-}
-
-_PUBLIC_ void ndr_print_WERROR(struct ndr_print *ndr, const char *name, WERROR r)
-{
- ndr->print(ndr, "%-25s: %s", name, win_errstr(r));
-}
-
-/*
- parse a set of bytes
-*/
-_PUBLIC_ enum ndr_err_code ndr_pull_bytes(struct ndr_pull *ndr, uint8_t *data, uint32_t n)
-{
- NDR_PULL_NEED_BYTES(ndr, n);
- memcpy(data, ndr->data + ndr->offset, n);
- ndr->offset += n;
- return NDR_ERR_SUCCESS;
-}
-
-/*
- pull an array of uint8
-*/
-_PUBLIC_ enum ndr_err_code ndr_pull_array_uint8(struct ndr_pull *ndr, int ndr_flags, uint8_t *data, uint32_t n)
-{
- if (!(ndr_flags & NDR_SCALARS)) {
- return NDR_ERR_SUCCESS;
- }
- return ndr_pull_bytes(ndr, data, n);
-}
-
-/*
- push a int8_t
-*/
-_PUBLIC_ enum ndr_err_code ndr_push_int8(struct ndr_push *ndr, int ndr_flags, int8_t v)
-{
- NDR_PUSH_NEED_BYTES(ndr, 1);
- SCVAL(ndr->data, ndr->offset, (uint8_t)v);
- ndr->offset += 1;
- return NDR_ERR_SUCCESS;
-}
-
-/*
- push a uint8_t
-*/
-_PUBLIC_ enum ndr_err_code ndr_push_uint8(struct ndr_push *ndr, int ndr_flags, uint8_t v)
-{
- NDR_PUSH_NEED_BYTES(ndr, 1);
- SCVAL(ndr->data, ndr->offset, v);
- ndr->offset += 1;
- return NDR_ERR_SUCCESS;
-}
-
-/*
- push a int16_t
-*/
-_PUBLIC_ enum ndr_err_code ndr_push_int16(struct ndr_push *ndr, int ndr_flags, int16_t v)
-{
- NDR_PUSH_ALIGN(ndr, 2);
- NDR_PUSH_NEED_BYTES(ndr, 2);
- NDR_SSVAL(ndr, ndr->offset, (uint16_t)v);
- ndr->offset += 2;
- return NDR_ERR_SUCCESS;
-}
-
-/*
- push a uint16_t
-*/
-_PUBLIC_ enum ndr_err_code ndr_push_uint16(struct ndr_push *ndr, int ndr_flags, uint16_t v)
-{
- NDR_PUSH_ALIGN(ndr, 2);
- NDR_PUSH_NEED_BYTES(ndr, 2);
- NDR_SSVAL(ndr, ndr->offset, v);
- ndr->offset += 2;
- return NDR_ERR_SUCCESS;
-}
-
-/*
- push a int32_t
-*/
-_PUBLIC_ enum ndr_err_code ndr_push_int32(struct ndr_push *ndr, int ndr_flags, int32_t v)
-{
- NDR_PUSH_ALIGN(ndr, 4);
- NDR_PUSH_NEED_BYTES(ndr, 4);
- NDR_SIVALS(ndr, ndr->offset, v);
- ndr->offset += 4;
- return NDR_ERR_SUCCESS;
-}
-
-/*
- push a uint32_t
-*/
-_PUBLIC_ enum ndr_err_code ndr_push_uint32(struct ndr_push *ndr, int ndr_flags, uint32_t v)
-{
- NDR_PUSH_ALIGN(ndr, 4);
- NDR_PUSH_NEED_BYTES(ndr, 4);
- NDR_SIVAL(ndr, ndr->offset, v);
- ndr->offset += 4;
- return NDR_ERR_SUCCESS;
-}
-
-/*
- push a udlong
-*/
-_PUBLIC_ enum ndr_err_code ndr_push_udlong(struct ndr_push *ndr, int ndr_flags, uint64_t v)
-{
- NDR_PUSH_ALIGN(ndr, 4);
- NDR_PUSH_NEED_BYTES(ndr, 8);
- NDR_SIVAL(ndr, ndr->offset, (v & 0xFFFFFFFF));
- NDR_SIVAL(ndr, ndr->offset+4, (v>>32));
- ndr->offset += 8;
- return NDR_ERR_SUCCESS;
-}
-
-/*
- push a udlongr
-*/
-_PUBLIC_ enum ndr_err_code ndr_push_udlongr(struct ndr_push *ndr, int ndr_flags, uint64_t v)
-{
- NDR_PUSH_ALIGN(ndr, 4);
- NDR_PUSH_NEED_BYTES(ndr, 8);
- NDR_SIVAL(ndr, ndr->offset, (v>>32));
- NDR_SIVAL(ndr, ndr->offset+4, (v & 0xFFFFFFFF));
- ndr->offset += 8;
- return NDR_ERR_SUCCESS;
-}
-
-/*
- push a dlong
-*/
-_PUBLIC_ enum ndr_err_code ndr_push_dlong(struct ndr_push *ndr, int ndr_flags, int64_t v)
-{
- return ndr_push_udlong(ndr, NDR_SCALARS, (uint64_t)v);
-}
-
-/*
- push a hyper
-*/
-_PUBLIC_ enum ndr_err_code ndr_push_hyper(struct ndr_push *ndr, int ndr_flags, uint64_t v)
-{
- NDR_PUSH_ALIGN(ndr, 8);
- return ndr_push_udlong(ndr, NDR_SCALARS, v);
-}
-
-/*
- push a pointer
-*/
-_PUBLIC_ enum ndr_err_code ndr_push_pointer(struct ndr_push *ndr, int ndr_flags, void* v)
-{
- uintptr_t h = (intptr_t)v;
- NDR_PUSH_ALIGN(ndr, sizeof(h));
- NDR_PUSH_NEED_BYTES(ndr, sizeof(h));
- memcpy(ndr->data+ndr->offset, &h, sizeof(h));
- ndr->offset += sizeof(h);
- return NDR_ERR_SUCCESS;
-}
-
-_PUBLIC_ enum ndr_err_code ndr_push_align(struct ndr_push *ndr, size_t size)
-{
- NDR_PUSH_ALIGN(ndr, size);
- return NDR_ERR_SUCCESS;
-}
-
-_PUBLIC_ enum ndr_err_code ndr_pull_align(struct ndr_pull *ndr, size_t size)
-{
- NDR_PULL_ALIGN(ndr, size);
- return NDR_ERR_SUCCESS;
-}
-
-/*
- push some bytes
-*/
-_PUBLIC_ enum ndr_err_code ndr_push_bytes(struct ndr_push *ndr, const uint8_t *data, uint32_t n)
-{
- NDR_PUSH_NEED_BYTES(ndr, n);
- memcpy(ndr->data + ndr->offset, data, n);
- ndr->offset += n;
- return NDR_ERR_SUCCESS;
-}
-
-/*
- push some zero bytes
-*/
-_PUBLIC_ enum ndr_err_code ndr_push_zero(struct ndr_push *ndr, uint32_t n)
-{
- NDR_PUSH_NEED_BYTES(ndr, n);
- memset(ndr->data + ndr->offset, 0, n);
- ndr->offset += n;
- return NDR_ERR_SUCCESS;
-}
-
-/*
- push an array of uint8
-*/
-_PUBLIC_ enum ndr_err_code ndr_push_array_uint8(struct ndr_push *ndr, int ndr_flags, const uint8_t *data, uint32_t n)
-{
- if (!(ndr_flags & NDR_SCALARS)) {
- return NDR_ERR_SUCCESS;
- }
- return ndr_push_bytes(ndr, data, n);
-}
-
-/*
- save the current position
- */
-_PUBLIC_ void ndr_push_save(struct ndr_push *ndr, struct ndr_push_save *save)
-{
- save->offset = ndr->offset;
-}
-
-/*
- restore the position
- */
-_PUBLIC_ void ndr_push_restore(struct ndr_push *ndr, struct ndr_push_save *save)
-{
- ndr->offset = save->offset;
-}
-
-/*
- push a unique non-zero value if a pointer is non-NULL, otherwise 0
-*/
-_PUBLIC_ enum ndr_err_code ndr_push_unique_ptr(struct ndr_push *ndr, const void *p)
-{
- uint32_t ptr = 0;
- if (p) {
- ptr = ndr->ptr_count * 4;
- ptr |= 0x00020000;
- ndr->ptr_count++;
- }
- return ndr_push_uint32(ndr, NDR_SCALARS, ptr);
-}
-
-/*
- push a 'simple' full non-zero value if a pointer is non-NULL, otherwise 0
-*/
-_PUBLIC_ enum ndr_err_code ndr_push_full_ptr(struct ndr_push *ndr, const void *p)
-{
- uint32_t ptr = 0;
- if (p) {
- /* Check if the pointer already exists and has an id */
- ptr = ndr_token_peek(&ndr->full_ptr_list, p);
- if (ptr == 0) {
- ndr->ptr_count++;
- ptr = ndr->ptr_count;
- ndr_token_store(ndr, &ndr->full_ptr_list, p, ptr);
- }
- }
- return ndr_push_uint32(ndr, NDR_SCALARS, ptr);
-}
-
-/*
- push always a 0, if a pointer is NULL it's a fatal error
-*/
-_PUBLIC_ enum ndr_err_code ndr_push_ref_ptr(struct ndr_push *ndr)
-{
- return ndr_push_uint32(ndr, NDR_SCALARS, 0xAEF1AEF1);
-}
-
-
-/*
- push a NTTIME
-*/
-_PUBLIC_ enum ndr_err_code ndr_push_NTTIME(struct ndr_push *ndr, int ndr_flags, NTTIME t)
-{
- NDR_CHECK(ndr_push_udlong(ndr, ndr_flags, t));
- return NDR_ERR_SUCCESS;
-}
-
-/*
- pull a NTTIME
-*/
-_PUBLIC_ enum ndr_err_code ndr_pull_NTTIME(struct ndr_pull *ndr, int ndr_flags, NTTIME *t)
-{
- NDR_CHECK(ndr_pull_udlong(ndr, ndr_flags, t));
- return NDR_ERR_SUCCESS;
-}
-
-/*
- push a NTTIME
-*/
-_PUBLIC_ enum ndr_err_code ndr_push_NTTIME_1sec(struct ndr_push *ndr, int ndr_flags, NTTIME t)
-{
- t /= 10000000;
- NDR_CHECK(ndr_push_hyper(ndr, ndr_flags, t));
- return NDR_ERR_SUCCESS;
-}
-
-/*
- pull a NTTIME_1sec
-*/
-_PUBLIC_ enum ndr_err_code ndr_pull_NTTIME_1sec(struct ndr_pull *ndr, int ndr_flags, NTTIME *t)
-{
- NDR_CHECK(ndr_pull_hyper(ndr, ndr_flags, t));
- (*t) *= 10000000;
- return NDR_ERR_SUCCESS;
-}
-
-/*
- pull a NTTIME_hyper
-*/
-_PUBLIC_ enum ndr_err_code ndr_pull_NTTIME_hyper(struct ndr_pull *ndr, int ndr_flags, NTTIME *t)
-{
- NDR_CHECK(ndr_pull_hyper(ndr, ndr_flags, t));
- return NDR_ERR_SUCCESS;
-}
-
-/*
- push a NTTIME_hyper
-*/
-_PUBLIC_ enum ndr_err_code ndr_push_NTTIME_hyper(struct ndr_push *ndr, int ndr_flags, NTTIME t)
-{
- NDR_CHECK(ndr_push_hyper(ndr, ndr_flags, t));
- return NDR_ERR_SUCCESS;
-}
-
-/*
- push a time_t
-*/
-_PUBLIC_ enum ndr_err_code ndr_push_time_t(struct ndr_push *ndr, int ndr_flags, time_t t)
-{
- return ndr_push_uint32(ndr, ndr_flags, t);
-}
-
-/*
- pull a time_t
-*/
-_PUBLIC_ enum ndr_err_code ndr_pull_time_t(struct ndr_pull *ndr, int ndr_flags, time_t *t)
-{
- uint32_t tt;
- NDR_CHECK(ndr_pull_uint32(ndr, ndr_flags, &tt));
- *t = tt;
- return NDR_ERR_SUCCESS;
-}
-
-
-/*
- pull a ipv4address
-*/
-_PUBLIC_ enum ndr_err_code ndr_pull_ipv4address(struct ndr_pull *ndr, int ndr_flags, const char **address)
-{
- struct in_addr in;
- NDR_CHECK(ndr_pull_uint32(ndr, ndr_flags, &in.s_addr));
- in.s_addr = htonl(in.s_addr);
- *address = talloc_strdup(ndr->current_mem_ctx, inet_ntoa(in));
- NDR_ERR_HAVE_NO_MEMORY(*address);
- return NDR_ERR_SUCCESS;
-}
-
-/*
- push a ipv4address
-*/
-_PUBLIC_ enum ndr_err_code ndr_push_ipv4address(struct ndr_push *ndr, int ndr_flags, const char *address)
-{
- uint32_t addr;
- if (!is_ipaddress(address)) {
- return ndr_push_error(ndr, NDR_ERR_IPV4ADDRESS,
- "Invalid IPv4 address: '%s'",
- address);
- }
- addr = inet_addr(address);
- NDR_CHECK(ndr_push_uint32(ndr, ndr_flags, htonl(addr)));
- return NDR_ERR_SUCCESS;
-}
-
-/*
- print a ipv4address
-*/
-_PUBLIC_ void ndr_print_ipv4address(struct ndr_print *ndr, const char *name,
- const char *address)
-{
- ndr->print(ndr, "%-25s: %s", name, address);
-}
-
-
-_PUBLIC_ void ndr_print_struct(struct ndr_print *ndr, const char *name, const char *type)
-{
- ndr->print(ndr, "%s: struct %s", name, type);
-}
-
-_PUBLIC_ void ndr_print_enum(struct ndr_print *ndr, const char *name, const char *type,
- const char *val, uint32_t value)
-{
- if (ndr->flags & LIBNDR_PRINT_ARRAY_HEX) {
- ndr->print(ndr, "%-25s: %s (0x%X)", name, val?val:"UNKNOWN_ENUM_VALUE", value);
- } else {
- ndr->print(ndr, "%-25s: %s (%d)", name, val?val:"UNKNOWN_ENUM_VALUE", value);
- }
-}
-
-_PUBLIC_ void ndr_print_bitmap_flag(struct ndr_print *ndr, size_t size, const char *flag_name, uint32_t flag, uint32_t value)
-{
- /* this is an attempt to support multi-bit bitmap masks */
- value &= flag;
-
- while (!(flag & 1)) {
- flag >>= 1;
- value >>= 1;
- }
- if (flag == 1) {
- ndr->print(ndr, " %d: %-25s", value, flag_name);
- } else {
- ndr->print(ndr, "0x%02x: %-25s (%d)", value, flag_name, value);
- }
-}
-
-_PUBLIC_ void ndr_print_int8(struct ndr_print *ndr, const char *name, int8_t v)
-{
- ndr->print(ndr, "%-25s: %d", name, v);
-}
-
-_PUBLIC_ void ndr_print_uint8(struct ndr_print *ndr, const char *name, uint8_t v)
-{
- ndr->print(ndr, "%-25s: 0x%02x (%u)", name, v, v);
-}
-
-_PUBLIC_ void ndr_print_int16(struct ndr_print *ndr, const char *name, int16_t v)
-{
- ndr->print(ndr, "%-25s: %d", name, v);
-}
-
-_PUBLIC_ void ndr_print_uint16(struct ndr_print *ndr, const char *name, uint16_t v)
-{
- ndr->print(ndr, "%-25s: 0x%04x (%u)", name, v, v);
-}
-
-_PUBLIC_ void ndr_print_int32(struct ndr_print *ndr, const char *name, int32_t v)
-{
- ndr->print(ndr, "%-25s: %d", name, v);
-}
-
-_PUBLIC_ void ndr_print_uint32(struct ndr_print *ndr, const char *name, uint32_t v)
-{
- ndr->print(ndr, "%-25s: 0x%08x (%u)", name, v, v);
-}
-
-_PUBLIC_ void ndr_print_udlong(struct ndr_print *ndr, const char *name, uint64_t v)
-{
- ndr->print(ndr, "%-25s: 0x%016llx (%llu)", name, (unsigned long long)v, (unsigned long long)v);
-}
-
-_PUBLIC_ void ndr_print_udlongr(struct ndr_print *ndr, const char *name, uint64_t v)
-{
- ndr_print_udlong(ndr, name, v);
-}
-
-_PUBLIC_ void ndr_print_dlong(struct ndr_print *ndr, const char *name, int64_t v)
-{
- ndr->print(ndr, "%-25s: 0x%016llx (%lld)", name, (unsigned long long)v, (long long)v);
-}
-
-_PUBLIC_ void ndr_print_hyper(struct ndr_print *ndr, const char *name, uint64_t v)
-{
- ndr_print_dlong(ndr, name, v);
-}
-
-_PUBLIC_ void ndr_print_pointer(struct ndr_print *ndr, const char *name, void *v)
-{
- ndr->print(ndr, "%-25s: %p", name, v);
-}
-
-_PUBLIC_ void ndr_print_ptr(struct ndr_print *ndr, const char *name, const void *p)
-{
- if (p) {
- ndr->print(ndr, "%-25s: *", name);
- } else {
- ndr->print(ndr, "%-25s: NULL", name);
- }
-}
-
-_PUBLIC_ void ndr_print_NTTIME(struct ndr_print *ndr, const char *name, NTTIME t)
-{
- ndr->print(ndr, "%-25s: %s", name, nt_time_string(ndr, t));
-}
-
-_PUBLIC_ void ndr_print_NTTIME_1sec(struct ndr_print *ndr, const char *name, NTTIME t)
-{
- /* this is a standard NTTIME here
- * as it's already converted in the pull/push code
- */
- ndr_print_NTTIME(ndr, name, t);
-}
-
-_PUBLIC_ void ndr_print_NTTIME_hyper(struct ndr_print *ndr, const char *name, NTTIME t)
-{
- ndr_print_NTTIME(ndr, name, t);
-}
-
-_PUBLIC_ void ndr_print_time_t(struct ndr_print *ndr, const char *name, time_t t)
-{
- if (t == (time_t)-1 || t == 0) {
- ndr->print(ndr, "%-25s: (time_t)%d", name, (int)t);
- } else {
- ndr->print(ndr, "%-25s: %s", name, timestring(ndr, t));
- }
-}
-
-_PUBLIC_ void ndr_print_union(struct ndr_print *ndr, const char *name, int level, const char *type)
-{
- if (ndr->flags & LIBNDR_PRINT_ARRAY_HEX) {
- ndr->print(ndr, "%-25s: union %s(case 0x%X)", name, type, level);
- } else {
- ndr->print(ndr, "%-25s: union %s(case %d)", name, type, level);
- }
-}
-
-_PUBLIC_ void ndr_print_bad_level(struct ndr_print *ndr, const char *name, uint16_t level)
-{
- ndr->print(ndr, "UNKNOWN LEVEL %u", level);
-}
-
-_PUBLIC_ void ndr_print_array_uint8(struct ndr_print *ndr, const char *name,
- const uint8_t *data, uint32_t count)
-{
- int i;
-
- if (count <= 600 && (ndr->flags & LIBNDR_PRINT_ARRAY_HEX)) {
- char s[1202];
- for (i=0;i<count;i++) {
- snprintf(&s[i*2], 3, "%02x", data[i]);
- }
- s[i*2] = 0;
- ndr->print(ndr, "%-25s: %s", name, s);
- return;
- }
-
- ndr->print(ndr, "%s: ARRAY(%d)", name, count);
- ndr->depth++;
- for (i=0;i<count;i++) {
- char *idx=NULL;
- if (asprintf(&idx, "[%d]", i) != -1) {
- ndr_print_uint8(ndr, idx, data[i]);
- free(idx);
- }
- }
- ndr->depth--;
-}
-
-_PUBLIC_ void ndr_print_DATA_BLOB(struct ndr_print *ndr, const char *name, DATA_BLOB r)
-{
- ndr->print(ndr, "%-25s: DATA_BLOB length=%u", name, (unsigned)r.length);
- if (r.length) {
- dump_data(10, r.data, r.length);
- }
-}
-
-
-/*
- push a DATA_BLOB onto the wire.
-*/
-_PUBLIC_ enum ndr_err_code ndr_push_DATA_BLOB(struct ndr_push *ndr, int ndr_flags, DATA_BLOB blob)
-{
- if (ndr->flags & LIBNDR_ALIGN_FLAGS) {
- if (ndr->flags & LIBNDR_FLAG_ALIGN2) {
- blob.length = NDR_ALIGN(ndr, 2);
- } else if (ndr->flags & LIBNDR_FLAG_ALIGN4) {
- blob.length = NDR_ALIGN(ndr, 4);
- } else if (ndr->flags & LIBNDR_FLAG_ALIGN8) {
- blob.length = NDR_ALIGN(ndr, 8);
- }
- NDR_PUSH_ALLOC_SIZE(ndr, blob.data, blob.length);
- data_blob_clear(&blob);
- } else if (!(ndr->flags & LIBNDR_FLAG_REMAINING)) {
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, blob.length));
- }
- NDR_CHECK(ndr_push_bytes(ndr, blob.data, blob.length));
- return NDR_ERR_SUCCESS;
-}
-
-/*
- pull a DATA_BLOB from the wire.
-*/
-_PUBLIC_ enum ndr_err_code ndr_pull_DATA_BLOB(struct ndr_pull *ndr, int ndr_flags, DATA_BLOB *blob)
-{
- uint32_t length = 0;
-
- if (ndr->flags & LIBNDR_ALIGN_FLAGS) {
- if (ndr->flags & LIBNDR_FLAG_ALIGN2) {
- length = NDR_ALIGN(ndr, 2);
- } else if (ndr->flags & LIBNDR_FLAG_ALIGN4) {
- length = NDR_ALIGN(ndr, 4);
- } else if (ndr->flags & LIBNDR_FLAG_ALIGN8) {
- length = NDR_ALIGN(ndr, 8);
- }
- if (ndr->data_size - ndr->offset < length) {
- length = ndr->data_size - ndr->offset;
- }
- } else if (ndr->flags & LIBNDR_FLAG_REMAINING) {
- length = ndr->data_size - ndr->offset;
- } else {
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &length));
- }
- NDR_PULL_NEED_BYTES(ndr, length);
- *blob = data_blob_talloc(ndr->current_mem_ctx, ndr->data+ndr->offset, length);
- ndr->offset += length;
- return NDR_ERR_SUCCESS;
-}
-
-_PUBLIC_ uint32_t ndr_size_DATA_BLOB(int ret, const DATA_BLOB *data, int flags)
-{
- if (!data) return ret;
- return ret + data->length;
-}
-
-_PUBLIC_ void ndr_print_bool(struct ndr_print *ndr, const char *name, const bool b)
-{
- ndr->print(ndr, "%-25s: %s", name, b?"true":"false");
-}
-
-_PUBLIC_ void ndr_print_sockaddr_storage(struct ndr_print *ndr, const char *name, const struct sockaddr_storage *ss)
-{
- char addr[INET6_ADDRSTRLEN];
- ndr->print(ndr, "%-25s: %s", name, print_sockaddr(addr, sizeof(addr), ss));
-}
diff --git a/source3/librpc/ndr/ndr_compression.c b/source3/librpc/ndr/ndr_compression.c
deleted file mode 100644
index c1eae0bb00..0000000000
--- a/source3/librpc/ndr/ndr_compression.c
+++ /dev/null
@@ -1,293 +0,0 @@
-/*
- Unix SMB/CIFS implementation.
-
- libndr compression support
-
- Copyright (C) Stefan Metzmacher 2005
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "includes.h"
-#include "../compression/mszip.h"
-#include "librpc/ndr/libndr.h"
-#include "librpc/ndr/ndr_compression.h"
-
-static enum ndr_err_code ndr_pull_compression_mszip_chunk(struct ndr_pull *ndrpull,
- struct ndr_push *ndrpush,
- struct decomp_state *decomp_state,
- bool *last)
-{
- DATA_BLOB comp_chunk;
- uint32_t comp_chunk_offset;
- uint32_t comp_chunk_size;
- DATA_BLOB plain_chunk;
- uint32_t plain_chunk_offset;
- uint32_t plain_chunk_size;
- int ret;
-
- NDR_CHECK(ndr_pull_uint32(ndrpull, NDR_SCALARS, &plain_chunk_size));
- if (plain_chunk_size > 0x00008000) {
- return ndr_pull_error(ndrpull, NDR_ERR_COMPRESSION, "Bad MSZIP plain chunk size %08X > 0x00008000 (PULL)",
- plain_chunk_size);
- }
-
- NDR_CHECK(ndr_pull_uint32(ndrpull, NDR_SCALARS, &comp_chunk_size));
-
- DEBUG(10,("MSZIP plain_chunk_size: %08X (%u) comp_chunk_size: %08X (%u)\n",
- plain_chunk_size, plain_chunk_size, comp_chunk_size, comp_chunk_size));
-
- comp_chunk_offset = ndrpull->offset;
- NDR_CHECK(ndr_pull_advance(ndrpull, comp_chunk_size));
- comp_chunk.length = comp_chunk_size;
- comp_chunk.data = ndrpull->data + comp_chunk_offset;
-
- plain_chunk_offset = ndrpush->offset;
- NDR_CHECK(ndr_push_zero(ndrpush, plain_chunk_size));
- plain_chunk.length = plain_chunk_size;
- plain_chunk.data = ndrpush->data + plain_chunk_offset;
-
- ret = ZIPdecompress(decomp_state, &comp_chunk, &plain_chunk);
- if (ret != DECR_OK) {
- return ndr_pull_error(ndrpull, NDR_ERR_COMPRESSION, "Bad ZIPdecompress() error %d (PULL)",
- ret);
- }
-
- if ((plain_chunk_size < 0x00008000) || (ndrpull->offset+4 >= ndrpull->data_size)) {
- /* this is the last chunk */
- *last = true;
- }
-
- return NDR_ERR_SUCCESS;
-}
-
-static enum ndr_err_code ndr_pull_compression_mszip(struct ndr_pull *subndr,
- struct ndr_pull **_comndr,
- ssize_t decompressed_len)
-{
- struct ndr_push *ndrpush;
- struct ndr_pull *comndr;
- DATA_BLOB uncompressed;
- uint32_t payload_header[4];
- uint32_t payload_size;
- uint32_t payload_offset;
- uint8_t *payload;
- struct decomp_state *decomp_state;
- bool last = false;
-
- ndrpush = ndr_push_init_ctx(subndr);
- NDR_ERR_HAVE_NO_MEMORY(ndrpush);
-
- decomp_state = ZIPdecomp_state(subndr);
- NDR_ERR_HAVE_NO_MEMORY(decomp_state);
-
- while (!last) {
- NDR_CHECK(ndr_pull_compression_mszip_chunk(subndr, ndrpush, decomp_state, &last));
- }
-
- uncompressed = ndr_push_blob(ndrpush);
-
- if (uncompressed.length != decompressed_len) {
- return ndr_pull_error(subndr, NDR_ERR_COMPRESSION, "Bad MSZIP uncompressed_len [%u] != [%d] (PULL)",
- (int)uncompressed.length, (int)decompressed_len);
- }
-
- comndr = talloc_zero(subndr, struct ndr_pull);
- NDR_ERR_HAVE_NO_MEMORY(comndr);
- comndr->flags = subndr->flags;
- comndr->current_mem_ctx = subndr->current_mem_ctx;
-
- comndr->data = uncompressed.data;
- comndr->data_size = uncompressed.length;
- comndr->offset = 0;
-
- NDR_CHECK(ndr_pull_uint32(comndr, NDR_SCALARS, &payload_header[0]));
- NDR_CHECK(ndr_pull_uint32(comndr, NDR_SCALARS, &payload_header[1]));
- NDR_CHECK(ndr_pull_uint32(comndr, NDR_SCALARS, &payload_header[2]));
- NDR_CHECK(ndr_pull_uint32(comndr, NDR_SCALARS, &payload_header[3]));
-
- if (payload_header[0] != 0x00081001) {
- return ndr_pull_error(subndr, NDR_ERR_COMPRESSION, "Bad MSZIP payload_header[0] [0x%08X] != [0x00081001] (PULL)",
- payload_header[0]);
- }
- if (payload_header[1] != 0xCCCCCCCC) {
- return ndr_pull_error(subndr, NDR_ERR_COMPRESSION, "Bad MSZIP payload_header[1] [0x%08X] != [0xCCCCCCCC] (PULL)",
- payload_header[1]);
- }
-
- payload_size = payload_header[2];
-
- if (payload_header[3] != 0x00000000) {
- return ndr_pull_error(subndr, NDR_ERR_COMPRESSION, "Bad MSZIP payload_header[3] [0x%08X] != [0x00000000] (PULL)",
- payload_header[3]);
- }
-
- payload_offset = comndr->offset;
- NDR_CHECK(ndr_pull_advance(comndr, payload_size));
- payload = comndr->data + payload_offset;
-
- comndr->data = payload;
- comndr->data_size = payload_size;
- comndr->offset = 0;
-
- *_comndr = comndr;
- return NDR_ERR_SUCCESS;
-}
-
-static enum ndr_err_code ndr_push_compression_mszip(struct ndr_push *subndr,
- struct ndr_push *comndr)
-{
- return ndr_push_error(subndr, NDR_ERR_COMPRESSION, "Sorry MSZIP compression is not supported yet (PUSH)");
-}
-
-static enum ndr_err_code ndr_pull_compression_xpress_chunk(struct ndr_pull *ndrpull,
- struct ndr_push *ndrpush,
- bool *last)
-{
- DATA_BLOB comp_chunk;
- uint32_t comp_chunk_offset;
- uint32_t comp_chunk_size;
- uint32_t plain_chunk_size;
-
- comp_chunk_offset = ndrpull->offset;
-
- NDR_CHECK(ndr_pull_uint32(ndrpull, NDR_SCALARS, &plain_chunk_size));
- if (plain_chunk_size > 0x00010000) {
- return ndr_pull_error(ndrpull, NDR_ERR_COMPRESSION, "Bad XPRESS plain chunk size %08X > 0x00010000 (PULL)",
- plain_chunk_size);
- }
-
- NDR_CHECK(ndr_pull_uint32(ndrpull, NDR_SCALARS, &comp_chunk_size));
-
- NDR_CHECK(ndr_pull_advance(ndrpull, comp_chunk_size));
- comp_chunk.length = comp_chunk_size + 8;
- comp_chunk.data = ndrpull->data + comp_chunk_offset;
-
- DEBUG(10,("XPRESS plain_chunk_size: %08X (%u) comp_chunk_size: %08X (%u)\n",
- plain_chunk_size, plain_chunk_size, comp_chunk_size, comp_chunk_size));
-
- /* For now, we just copy over the compressed blob */
- NDR_CHECK(ndr_push_bytes(ndrpush, comp_chunk.data, comp_chunk.length));
-
- if ((plain_chunk_size < 0x00010000) || (ndrpull->offset+4 >= ndrpull->data_size)) {
- /* this is the last chunk */
- *last = true;
- }
-
- return NDR_ERR_SUCCESS;
-}
-
-static enum ndr_err_code ndr_pull_compression_xpress(struct ndr_pull *subndr,
- struct ndr_pull **_comndr,
- ssize_t decompressed_len)
-{
- struct ndr_push *ndrpush;
- struct ndr_pull *comndr;
- DATA_BLOB uncompressed;
- bool last = false;
-
- ndrpush = ndr_push_init_ctx(subndr);
- NDR_ERR_HAVE_NO_MEMORY(ndrpush);
-
- while (!last) {
- NDR_CHECK(ndr_pull_compression_xpress_chunk(subndr, ndrpush, &last));
- }
-
- uncompressed = ndr_push_blob(ndrpush);
-
- comndr = talloc_zero(subndr, struct ndr_pull);
- NDR_ERR_HAVE_NO_MEMORY(comndr);
- comndr->flags = subndr->flags;
- comndr->current_mem_ctx = subndr->current_mem_ctx;
-
- comndr->data = uncompressed.data;
- comndr->data_size = uncompressed.length;
- comndr->offset = 0;
-
- *_comndr = comndr;
- return NDR_ERR_SUCCESS;
-}
-
-static enum ndr_err_code ndr_push_compression_xpress(struct ndr_push *subndr,
- struct ndr_push *comndr)
-{
- return ndr_push_error(subndr, NDR_ERR_COMPRESSION, "XPRESS compression is not supported yet (PUSH)");
-}
-
-/*
- handle compressed subcontext buffers, which in midl land are user-marshalled, but
- we use magic in pidl to make them easier to cope with
-*/
-enum ndr_err_code ndr_pull_compression_start(struct ndr_pull *subndr,
- struct ndr_pull **_comndr,
- enum ndr_compression_alg compression_alg,
- ssize_t decompressed_len)
-{
- switch (compression_alg) {
- case NDR_COMPRESSION_MSZIP:
- return ndr_pull_compression_mszip(subndr, _comndr, decompressed_len);
- case NDR_COMPRESSION_XPRESS:
- return ndr_pull_compression_xpress(subndr, _comndr, decompressed_len);
- default:
- return ndr_pull_error(subndr, NDR_ERR_COMPRESSION, "Bad compression algorithm %d (PULL)",
- compression_alg);
- }
- return NDR_ERR_SUCCESS;
-}
-
-enum ndr_err_code ndr_pull_compression_end(struct ndr_pull *subndr,
- struct ndr_pull *comndr,
- enum ndr_compression_alg compression_alg,
- ssize_t decompressed_len)
-{
- return NDR_ERR_SUCCESS;
-}
-
-/*
- push a compressed subcontext
-*/
-enum ndr_err_code ndr_push_compression_start(struct ndr_push *subndr,
- struct ndr_push **_comndr,
- enum ndr_compression_alg compression_alg,
- ssize_t decompressed_len)
-{
- struct ndr_push *comndr;
-
- comndr = ndr_push_init_ctx(subndr);
- NDR_ERR_HAVE_NO_MEMORY(comndr);
- comndr->flags = subndr->flags;
-
- *_comndr = comndr;
- return NDR_ERR_SUCCESS;
-}
-
-/*
- push a compressed subcontext
-*/
-enum ndr_err_code ndr_push_compression_end(struct ndr_push *subndr,
- struct ndr_push *comndr,
- enum ndr_compression_alg compression_alg,
- ssize_t decompressed_len)
-{
- switch (compression_alg) {
- case NDR_COMPRESSION_MSZIP:
- return ndr_push_compression_mszip(subndr, comndr);
- case NDR_COMPRESSION_XPRESS:
- return ndr_push_compression_xpress(subndr, comndr);
- default:
- return ndr_push_error(subndr, NDR_ERR_COMPRESSION, "Bad compression algorithm %d (PUSH)",
- compression_alg);
- }
- return NDR_ERR_SUCCESS;
-}
diff --git a/source3/librpc/ndr/ndr_compression.h b/source3/librpc/ndr/ndr_compression.h
deleted file mode 100644
index 4cebbe190c..0000000000
--- a/source3/librpc/ndr/ndr_compression.h
+++ /dev/null
@@ -1,51 +0,0 @@
-#ifndef __LIBRPC_NDR_NDR_COMPRESSION_H__
-#define __LIBRPC_NDR_NDR_COMPRESSION_H__
-
-#undef _PRINTF_ATTRIBUTE
-#define _PRINTF_ATTRIBUTE(a1, a2) PRINTF_ATTRIBUTE(a1, a2)
-/* This file was automatically generated by mkproto.pl. DO NOT EDIT */
-
-#ifndef _PUBLIC_
-#define _PUBLIC_
-#endif
-
-#ifndef _PURE_
-#define _PURE_
-#endif
-
-#ifndef _NORETURN_
-#define _NORETURN_
-#endif
-
-#ifndef _DEPRECATED_
-#define _DEPRECATED_
-#endif
-
-#ifndef _WARN_UNUSED_RESULT_
-#define _WARN_UNUSED_RESULT_
-#endif
-
-
-/* The following definitions come from librpc/ndr/ndr_compression.c */
-
-enum ndr_err_code ndr_pull_compression_start(struct ndr_pull *subndr,
- struct ndr_pull **_comndr,
- enum ndr_compression_alg compression_alg,
- ssize_t decompressed_len);
-enum ndr_err_code ndr_pull_compression_end(struct ndr_pull *subndr,
- struct ndr_pull *comndr,
- enum ndr_compression_alg compression_alg,
- ssize_t decompressed_len);
-enum ndr_err_code ndr_push_compression_start(struct ndr_push *subndr,
- struct ndr_push **_comndr,
- enum ndr_compression_alg compression_alg,
- ssize_t decompressed_len);
-enum ndr_err_code ndr_push_compression_end(struct ndr_push *subndr,
- struct ndr_push *comndr,
- enum ndr_compression_alg compression_alg,
- ssize_t decompressed_len);
-#undef _PRINTF_ATTRIBUTE
-#define _PRINTF_ATTRIBUTE(a1, a2)
-
-#endif /* __LIBRPC_NDR_NDR_COMPRESSION_H__ */
-
diff --git a/source3/librpc/ndr/ndr_drsuapi.c b/source3/librpc/ndr/ndr_drsuapi.c
deleted file mode 100644
index aeb81c87bd..0000000000
--- a/source3/librpc/ndr/ndr_drsuapi.c
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- Unix SMB/CIFS implementation.
-
- routines for printing some linked list structs in DRSUAPI
-
- Copyright (C) Stefan (metze) Metzmacher 2005
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-
-#include "includes.h"
-#include "librpc/gen_ndr/ndr_drsuapi.h"
-#include "librpc/gen_ndr/ndr_misc.h"
-
-void ndr_print_drsuapi_DsReplicaObjectListItem(struct ndr_print *ndr, const char *name,
- const struct drsuapi_DsReplicaObjectListItem *r)
-{
- ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjectListItem");
- ndr->depth++;
- ndr_print_ptr(ndr, "next_object", r->next_object);
- ndr_print_drsuapi_DsReplicaObject(ndr, "object", &r->object);
- ndr->depth--;
- if (r->next_object) {
- ndr_print_drsuapi_DsReplicaObjectListItem(ndr, "next_object", r->next_object);
- }
-}
-
-void ndr_print_drsuapi_DsReplicaObjectListItemEx(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjectListItemEx *r)
-{
- ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjectListItemEx");
- ndr->depth++;
- ndr_print_ptr(ndr, "next_object", r->next_object);
- ndr_print_drsuapi_DsReplicaObject(ndr, "object", &r->object);
- ndr_print_uint32(ndr, "is_nc_prefix", r->is_nc_prefix);
- ndr_print_ptr(ndr, "parent_object_guid", r->parent_object_guid);
- ndr->depth++;
- if (r->parent_object_guid) {
- ndr_print_GUID(ndr, "parent_object_guid", r->parent_object_guid);
- }
- ndr->depth--;
- ndr_print_ptr(ndr, "meta_data_ctr", r->meta_data_ctr);
- ndr->depth++;
- if (r->meta_data_ctr) {
- ndr_print_drsuapi_DsReplicaMetaDataCtr(ndr, "meta_data_ctr", r->meta_data_ctr);
- }
- ndr->depth--;
- ndr->depth--;
- if (r->next_object) {
- ndr_print_drsuapi_DsReplicaObjectListItemEx(ndr, "next_object", r->next_object);
- }
-}
-
-#define _OID_PUSH_CHECK(call) do { \
- bool _status; \
- _status = call; \
- if (_status != true) { \
- return ndr_push_error(ndr, NDR_ERR_SUBCONTEXT, "OID Conversion Error: %s\n", __location__); \
- } \
-} while (0)
-
-#define _OID_PULL_CHECK(call) do { \
- bool _status; \
- _status = call; \
- if (_status != true) { \
- return ndr_pull_error(ndr, NDR_ERR_SUBCONTEXT, "OID Conversion Error: %s\n", __location__); \
- } \
-} while (0)
-
-enum ndr_err_code ndr_push_drsuapi_DsReplicaOID(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaOID *r)
-{
- if (ndr_flags & NDR_SCALARS) {
- NDR_CHECK(ndr_push_align(ndr, 4));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_drsuapi_DsReplicaOID_oid(r->oid, 0)));
- NDR_CHECK(ndr_push_unique_ptr(ndr, r->oid));
- }
- if (ndr_flags & NDR_BUFFERS) {
- if (r->oid) {
- DATA_BLOB blob;
-
- if (StrnCaseCmp("ff", r->oid, 2) == 0) {
- blob = strhex_to_data_blob(NULL, r->oid);
- if (!blob.data) {
- return ndr_push_error(ndr, NDR_ERR_SUBCONTEXT,
- "HEX String Conversion Error: %s\n",
- __location__);
- }
- } else {
- _OID_PUSH_CHECK(ber_write_OID_String(&blob, r->oid));
- }
- talloc_steal(ndr, blob.data);
-
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, blob.length));
- NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, blob.data, blob.length));
- }
- }
- return NDR_ERR_SUCCESS;
-}
-
-enum ndr_err_code ndr_pull_drsuapi_DsReplicaOID(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaOID *r)
-{
- uint32_t _ptr_oid;
- TALLOC_CTX *_mem_save_oid_0;
- if (ndr_flags & NDR_SCALARS) {
- NDR_CHECK(ndr_pull_align(ndr, 4));
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size));
- if (r->__ndr_size < 0 || r->__ndr_size > 10000) {
- return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
- }
- NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_oid));
- if (_ptr_oid) {
- NDR_PULL_ALLOC(ndr, r->oid);
- } else {
- r->oid = NULL;
- }
- }
- if (ndr_flags & NDR_BUFFERS) {
- if (r->oid) {
- DATA_BLOB _oid_array;
- const char *_oid;
-
- _mem_save_oid_0 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, ndr, 0);
- NDR_CHECK(ndr_pull_array_size(ndr, &r->oid));
- _oid_array.length = ndr_get_array_size(ndr, &r->oid);
- NDR_PULL_ALLOC_N(ndr, _oid_array.data, _oid_array.length);
- NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, _oid_array.data, _oid_array.length));
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_oid_0, 0);
-
- if (_oid_array.length && _oid_array.data[0] == 0xFF) {
- _oid = data_blob_hex_string(ndr, &_oid_array);
- NDR_ERR_HAVE_NO_MEMORY(_oid);
- } else {
- _OID_PULL_CHECK(ber_read_OID_String(ndr, _oid_array, &_oid));
- }
- TALLOC_FREE(_oid_array.data);
- talloc_steal(r->oid, _oid);
- r->oid = _oid;
- }
- if (r->oid) {
- NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->oid, r->__ndr_size));
- }
- }
- return NDR_ERR_SUCCESS;
-}
-
-size_t ndr_size_drsuapi_DsReplicaOID_oid(const char *oid, int flags)
-{
- DATA_BLOB _blob;
- size_t ret = 0;
-
- if (!oid) return 0;
-
- if (StrnCaseCmp("ff", oid, 2) == 0) {
- _blob = strhex_to_data_blob(NULL, oid);
- if (_blob.data) {
- ret = _blob.length;
- }
- } else {
- if (ber_write_OID_String(&_blob, oid)) {
- ret = _blob.length;
- }
- }
- data_blob_free(&_blob);
- return ret;
-}
diff --git a/source3/librpc/ndr/ndr_drsuapi.h b/source3/librpc/ndr/ndr_drsuapi.h
deleted file mode 100644
index c663eadd7a..0000000000
--- a/source3/librpc/ndr/ndr_drsuapi.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- Unix SMB/CIFS implementation.
-
- routines for printing some linked list structs in DRSUAPI
-
- Copyright (C) Stefan (metze) Metzmacher 2005-2006
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef _LIBRPC_NDR_NDR_DRSUAPI_H
-#define _LIBRPC_NDR_NDR_DRSUAPI_H
-
-void ndr_print_drsuapi_DsReplicaObjectListItem(struct ndr_print *ndr, const char *name,
- const struct drsuapi_DsReplicaObjectListItem *r);
-
-void ndr_print_drsuapi_DsReplicaObjectListItemEx(struct ndr_print *ndr, const char *name,
- const struct drsuapi_DsReplicaObjectListItemEx *r);
-
-enum ndr_err_code ndr_push_drsuapi_DsReplicaOID(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaOID *r);
-enum ndr_err_code ndr_pull_drsuapi_DsReplicaOID(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaOID *r);
-size_t ndr_size_drsuapi_DsReplicaOID_oid(const char *oid, int flags);
-
-#endif /* _LIBRPC_NDR_NDR_DRSUAPI_H */
diff --git a/source3/librpc/ndr/ndr_krb5pac.c b/source3/librpc/ndr/ndr_krb5pac.c
deleted file mode 100644
index b0eab44012..0000000000
--- a/source3/librpc/ndr/ndr_krb5pac.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- Unix SMB/CIFS implementation.
-
- routines for marshalling/unmarshalling spoolss subcontext buffer structures
-
- Copyright (C) Stefan Metzmacher 2005
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-
-#include "includes.h"
-
-#include "librpc/gen_ndr/ndr_krb5pac.h"
-
-static size_t _ndr_size_PAC_INFO(const union PAC_INFO *r, uint32_t level, int flags)
-{
- size_t s = ndr_size_PAC_INFO(r, level, flags);
- switch (level) {
- case PAC_TYPE_LOGON_INFO:
- return NDR_ROUND(s,8);
- default:
- return s;
- }
-}
-
-static size_t _subcontext_size_PAC_INFO(const union PAC_INFO *r, uint32_t level, int flags)
-{
- size_t s = ndr_size_PAC_INFO(r, level, flags);
- return NDR_ROUND(s,8);
-}
-
-enum ndr_err_code ndr_push_PAC_BUFFER(struct ndr_push *ndr, int ndr_flags, const struct PAC_BUFFER *r)
-{
- if (ndr_flags & NDR_SCALARS) {
- NDR_CHECK(ndr_push_align(ndr, 4));
- NDR_CHECK(ndr_push_PAC_TYPE(ndr, NDR_SCALARS, r->type));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, _ndr_size_PAC_INFO(r->info,r->type,0)));
- {
- uint32_t _flags_save_PAC_INFO = ndr->flags;
- ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8);
- NDR_CHECK(ndr_push_relative_ptr1(ndr, r->info));
- ndr->flags = _flags_save_PAC_INFO;
- }
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
- }
- if (ndr_flags & NDR_BUFFERS) {
- {
- uint32_t _flags_save_PAC_INFO = ndr->flags;
- ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8);
- if (r->info) {
- NDR_CHECK(ndr_push_relative_ptr2(ndr, r->info));
- {
- struct ndr_push *_ndr_info;
- NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_info, 0, _subcontext_size_PAC_INFO(r->info,r->type,0)));
- NDR_CHECK(ndr_push_set_switch_value(_ndr_info, r->info, r->type));
- NDR_CHECK(ndr_push_PAC_INFO(_ndr_info, NDR_SCALARS|NDR_BUFFERS, r->info));
- NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info, 0, _subcontext_size_PAC_INFO(r->info,r->type,0)));
- }
- }
- ndr->flags = _flags_save_PAC_INFO;
- }
- }
- return NDR_ERR_SUCCESS;
-}
-
-enum ndr_err_code ndr_pull_PAC_BUFFER(struct ndr_pull *ndr, int ndr_flags, struct PAC_BUFFER *r)
-{
- uint32_t _ptr_info;
- TALLOC_CTX *_mem_save_info_0;
- if (ndr_flags & NDR_SCALARS) {
- NDR_CHECK(ndr_pull_align(ndr, 4));
- NDR_CHECK(ndr_pull_PAC_TYPE(ndr, NDR_SCALARS, &r->type));
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_ndr_size));
- {
- uint32_t _flags_save_PAC_INFO = ndr->flags;
- ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8);
- NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
- if (_ptr_info) {
- NDR_PULL_ALLOC(ndr, r->info);
- NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->info, _ptr_info));
- } else {
- r->info = NULL;
- }
- ndr->flags = _flags_save_PAC_INFO;
- }
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_pad));
- }
- if (ndr_flags & NDR_BUFFERS) {
- {
- uint32_t _flags_save_PAC_INFO = ndr->flags;
- ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8);
- if (r->info) {
- uint32_t _relative_save_offset;
- _relative_save_offset = ndr->offset;
- NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->info));
- _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, r->info, 0);
- {
- struct ndr_pull *_ndr_info;
- NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_info, 0, r->_ndr_size));
- NDR_CHECK(ndr_pull_set_switch_value(_ndr_info, r->info, r->type));
- NDR_CHECK(ndr_pull_PAC_INFO(_ndr_info, NDR_SCALARS|NDR_BUFFERS, r->info));
- NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_info, 0, r->_ndr_size));
- }
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0);
- ndr->offset = _relative_save_offset;
- }
- ndr->flags = _flags_save_PAC_INFO;
- }
- }
- return NDR_ERR_SUCCESS;
-}
-
-void ndr_print_PAC_BUFFER(struct ndr_print *ndr, const char *name, const struct PAC_BUFFER *r)
-{
- ndr_print_struct(ndr, name, "PAC_BUFFER");
- ndr->depth++;
- ndr_print_PAC_TYPE(ndr, "type", r->type);
- ndr_print_uint32(ndr, "_ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?_ndr_size_PAC_INFO(r->info,r->type,0):r->_ndr_size);
- ndr_print_ptr(ndr, "info", r->info);
- ndr->depth++;
- if (r->info) {
- ndr_print_set_switch_value(ndr, r->info, r->type);
- ndr_print_PAC_INFO(ndr, "info", r->info);
- }
- ndr->depth--;
- ndr_print_uint32(ndr, "_pad", r->_pad);
- ndr->depth--;
-}
diff --git a/source3/librpc/ndr/ndr_misc.c b/source3/librpc/ndr/ndr_misc.c
deleted file mode 100644
index e86842527c..0000000000
--- a/source3/librpc/ndr/ndr_misc.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- Unix SMB/CIFS implementation.
-
- UUID/GUID/policy_handle functions
-
- Copyright (C) Theodore Ts'o 1996, 1997,
- Copyright (C) Jim McDonough 2002.
- Copyright (C) Andrew Tridgell 2003.
- Copyright (C) Stefan (metze) Metzmacher 2004.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "includes.h"
-
-/**
- * see if a range of memory is all zero. A NULL pointer is considered
- * to be all zero
- */
-bool all_zero(const uint8_t *ptr, size_t size)
-{
- int i;
- if (!ptr) return True;
- for (i=0;i<size;i++) {
- if (ptr[i]) return False;
- }
- return True;
-}
-
-void ndr_print_GUID(struct ndr_print *ndr, const char *name, const struct GUID *guid)
-{
- ndr->print(ndr, "%-25s: %s", name, GUID_string(ndr, guid));
-}
-
-bool ndr_syntax_id_equal(const struct ndr_syntax_id *i1,
- const struct ndr_syntax_id *i2)
-{
- return GUID_equal(&i1->uuid, &i2->uuid)
- && (i1->if_version == i2->if_version);
-}
-
-enum ndr_err_code ndr_push_server_id(struct ndr_push *ndr, int ndr_flags, const struct server_id *r)
-{
- if (ndr_flags & NDR_SCALARS) {
- NDR_CHECK(ndr_push_align(ndr, 4));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS,
- (uint32_t)r->pid));
-#ifdef CLUSTER_SUPPORT
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS,
- (uint32_t)r->vnn));
-#endif
- }
- if (ndr_flags & NDR_BUFFERS) {
- }
- return NDR_ERR_SUCCESS;
-}
-
-enum ndr_err_code ndr_pull_server_id(struct ndr_pull *ndr, int ndr_flags, struct server_id *r)
-{
- if (ndr_flags & NDR_SCALARS) {
- uint32_t pid;
- NDR_CHECK(ndr_pull_align(ndr, 4));
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &pid));
-#ifdef CLUSTER_SUPPORT
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->vnn));
-#endif
- r->pid = (pid_t)pid;
- }
- if (ndr_flags & NDR_BUFFERS) {
- }
- return NDR_ERR_SUCCESS;
-}
-
-void ndr_print_server_id(struct ndr_print *ndr, const char *name, const struct server_id *r)
-{
- ndr_print_struct(ndr, name, "server_id");
- ndr->depth++;
- ndr_print_uint32(ndr, "id", (uint32_t)r->pid);
-#ifdef CLUSTER_SUPPORT
- ndr_print_uint32(ndr, "vnn", (uint32_t)r->vnn);
-#endif
- ndr->depth--;
-}
diff --git a/source3/librpc/ndr/ndr_string.c b/source3/librpc/ndr/ndr_string.c
index e2c9ed5946..86d7b26586 100644
--- a/source3/librpc/ndr/ndr_string.c
+++ b/source3/librpc/ndr/ndr_string.c
@@ -89,7 +89,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_string(struct ndr_pull *ndr, int ndr_flags,
&converted_size, false))
{
return ndr_pull_error(ndr, NDR_ERR_CHARCNV,
- "Bad char conversion");
+ "Bad character conversion");
}
}
NDR_CHECK(ndr_pull_advance(ndr, (len2 + c_len_term)*byte_mul));
@@ -127,7 +127,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_string(struct ndr_pull *ndr, int ndr_flags,
&converted_size, false))
{
return ndr_pull_error(ndr, NDR_ERR_CHARCNV,
- "Bad char conversion");
+ "Bad character conversion");
}
}
NDR_CHECK(ndr_pull_advance(ndr, (len1 + c_len_term)*byte_mul));
@@ -166,7 +166,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_string(struct ndr_pull *ndr, int ndr_flags,
&converted_size, false))
{
return ndr_pull_error(ndr, NDR_ERR_CHARCNV,
- "Bad char conversion");
+ "Bad character conversion");
}
}
NDR_CHECK(ndr_pull_advance(ndr, (len1 + c_len_term)*byte_mul));
@@ -201,7 +201,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_string(struct ndr_pull *ndr, int ndr_flags,
&converted_size, false))
{
return ndr_pull_error(ndr, NDR_ERR_CHARCNV,
- "Bad char conversion");
+ "Bad character conversion");
}
}
NDR_CHECK(ndr_pull_advance(ndr, (len3 + c_len_term)*byte_mul));
@@ -233,7 +233,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_string(struct ndr_pull *ndr, int ndr_flags,
&converted_size, false))
{
return ndr_pull_error(ndr, NDR_ERR_CHARCNV,
- "Bad char conversion");
+ "Bad character conversion");
}
}
NDR_CHECK(ndr_pull_advance(ndr, len3));
@@ -252,28 +252,12 @@ _PUBLIC_ enum ndr_err_code ndr_pull_string(struct ndr_pull *ndr, int ndr_flags,
&converted_size, false))
{
return ndr_pull_error(ndr, NDR_ERR_CHARCNV,
- "Bad char conversion");
+ "Bad character conversion");
}
NDR_CHECK(ndr_pull_advance(ndr, len1));
*s = as;
break;
- case LIBNDR_FLAG_STR_FIXLEN15:
- case LIBNDR_FLAG_STR_FIXLEN32:
- len1 = (flags & LIBNDR_FLAG_STR_FIXLEN32)?32:15;
- NDR_PULL_NEED_BYTES(ndr, len1*byte_mul);
- if (!convert_string_talloc(ndr->current_mem_ctx, chset, CH_UNIX,
- ndr->data+ndr->offset, len1*byte_mul,
- (void **)(void *)&as,
- &converted_size, false))
- {
- return ndr_pull_error(ndr, NDR_ERR_CHARCNV,
- "Bad char conversion");
- }
- NDR_CHECK(ndr_pull_advance(ndr, len1*byte_mul));
- *s = as;
- break;
-
case LIBNDR_FLAG_STR_NOTERM:
if (!(ndr->flags & LIBNDR_FLAG_REMAINING)) {
return ndr_pull_error(ndr, NDR_ERR_STRING, "Bad string flags 0x%x (missing NDR_REMAINING)\n",
@@ -293,7 +277,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_string(struct ndr_pull *ndr, int ndr_flags,
&converted_size, false))
{
return ndr_pull_error(ndr, NDR_ERR_CHARCNV,
- "Bad char conversion");
+ "Bad character conversion");
}
}
NDR_CHECK(ndr_pull_advance(ndr, len1));
@@ -346,17 +330,14 @@ _PUBLIC_ enum ndr_err_code ndr_push_string(struct ndr_push *ndr, int ndr_flags,
flags &= ~LIBNDR_FLAG_STR_CONFORMANT;
- if (!(flags &
- (LIBNDR_FLAG_STR_NOTERM |
- LIBNDR_FLAG_STR_FIXLEN15 |
- LIBNDR_FLAG_STR_FIXLEN32))) {
+ if (!(flags & LIBNDR_FLAG_STR_NOTERM)) {
s_len++;
}
if (!convert_string_talloc(ndr, CH_UNIX, chset, s, s_len,
(void **)(void *)&dest, &d_len, false))
{
return ndr_push_error(ndr, NDR_ERR_CHARCNV,
- "Bad char conversion");
+ "Bad character conversion");
}
if (flags & LIBNDR_FLAG_STR_BYTESIZE) {
@@ -397,21 +378,6 @@ _PUBLIC_ enum ndr_err_code ndr_push_string(struct ndr_push *ndr, int ndr_flags,
NDR_CHECK(ndr_push_bytes(ndr, dest, d_len));
break;
- case LIBNDR_FLAG_STR_FIXLEN15:
- case LIBNDR_FLAG_STR_FIXLEN32: {
- ssize_t fix_len = (flags & LIBNDR_FLAG_STR_FIXLEN32)?32:15;
- uint32_t pad_len = fix_len - d_len;
- if (d_len > fix_len) {
- return ndr_push_error(ndr, NDR_ERR_CHARCNV,
- "Bad char conversion");
- }
- NDR_CHECK(ndr_push_bytes(ndr, dest, d_len));
- if (pad_len != 0) {
- NDR_CHECK(ndr_push_zero(ndr, pad_len));
- }
- break;
- }
-
default:
if (ndr->flags & LIBNDR_FLAG_REMAINING) {
NDR_CHECK(ndr_push_bytes(ndr, dest, d_len));
@@ -437,13 +403,6 @@ _PUBLIC_ size_t ndr_string_array_size(struct ndr_push *ndr, const char *s)
unsigned byte_mul = 2;
unsigned c_len_term = 1;
- if (flags & LIBNDR_FLAG_STR_FIXLEN32) {
- return 32;
- }
- if (flags & LIBNDR_FLAG_STR_FIXLEN15) {
- return 15;
- }
-
c_len = s?strlen_m(s):0;
if (flags & (LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_UTF8)) {
@@ -653,21 +612,21 @@ _PUBLIC_ uint32_t ndr_string_length(const void *_var, uint32_t element_size)
_PUBLIC_ enum ndr_err_code ndr_check_string_terminator(struct ndr_pull *ndr, uint32_t count, uint32_t element_size)
{
uint32_t i;
- struct ndr_pull_save save_offset;
+ uint32_t save_offset;
- ndr_pull_save(ndr, &save_offset);
+ save_offset = ndr->offset;
ndr_pull_advance(ndr, (count - 1) * element_size);
NDR_PULL_NEED_BYTES(ndr, element_size);
for (i = 0; i < element_size; i++) {
if (ndr->data[ndr->offset+i] != 0) {
- ndr_pull_restore(ndr, &save_offset);
+ ndr->offset = save_offset;
return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "String terminator not present or outside string boundaries");
}
}
- ndr_pull_restore(ndr, &save_offset);
+ ndr->offset = save_offset;
return NDR_ERR_SUCCESS;
}
@@ -693,7 +652,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_charset(struct ndr_pull *ndr, int ndr_flags,
&converted_size, false))
{
return ndr_pull_error(ndr, NDR_ERR_CHARCNV,
- "Bad char conversion");
+ "Bad character conversion");
}
NDR_CHECK(ndr_pull_advance(ndr, length*byte_mul));
@@ -716,7 +675,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_charset(struct ndr_push *ndr, int ndr_flags,
ndr->data+ndr->offset, required, false);
if (ret == -1) {
return ndr_push_error(ndr, NDR_ERR_CHARCNV,
- "Bad char conversion");
+ "Bad character conversion");
}
/* Make sure the remaining part of the string is filled with zeroes */
diff --git a/source3/librpc/ndr/util.c b/source3/librpc/ndr/util.c
new file mode 100644
index 0000000000..457615ce22
--- /dev/null
+++ b/source3/librpc/ndr/util.c
@@ -0,0 +1,174 @@
+/*
+ Unix SMB/CIFS implementation.
+
+ libndr interface
+
+ Copyright (C) Andrew Tridgell 2003
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "includes.h"
+
+NTSTATUS ndr_map_error2ntstatus(enum ndr_err_code ndr_err)
+{
+ switch (ndr_err) {
+ case NDR_ERR_SUCCESS:
+ return NT_STATUS_OK;
+ case NDR_ERR_BUFSIZE:
+ return NT_STATUS_BUFFER_TOO_SMALL;
+ case NDR_ERR_TOKEN:
+ return NT_STATUS_INTERNAL_ERROR;
+ case NDR_ERR_ALLOC:
+ return NT_STATUS_NO_MEMORY;
+ case NDR_ERR_ARRAY_SIZE:
+ return NT_STATUS_ARRAY_BOUNDS_EXCEEDED;
+ case NDR_ERR_INVALID_POINTER:
+ return NT_STATUS_INVALID_PARAMETER_MIX;
+ case NDR_ERR_UNREAD_BYTES:
+ return NT_STATUS_PORT_MESSAGE_TOO_LONG;
+ default:
+ break;
+ }
+
+ /* we should map all error codes to different status codes */
+ return NT_STATUS_INVALID_PARAMETER;
+}
+
+/*
+ * Convert an ndr error to string
+ */
+
+const char *ndr_errstr(enum ndr_err_code err)
+{
+ switch (err) {
+ case NDR_ERR_SUCCESS:
+ return "NDR_ERR_SUCCESS";
+ break;
+ case NDR_ERR_ARRAY_SIZE:
+ return "NDR_ERR_ARRAY_SIZE";
+ break;
+ case NDR_ERR_BAD_SWITCH:
+ return "NDR_ERR_BAD_SWITCH";
+ break;
+ case NDR_ERR_OFFSET:
+ return "NDR_ERR_OFFSET";
+ break;
+ case NDR_ERR_RELATIVE:
+ return "NDR_ERR_RELATIVE";
+ break;
+ case NDR_ERR_CHARCNV:
+ return "NDR_ERR_CHARCNV";
+ break;
+ case NDR_ERR_LENGTH:
+ return "NDR_ERR_LENGTH";
+ break;
+ case NDR_ERR_SUBCONTEXT:
+ return "NDR_ERR_SUBCONTEXT";
+ break;
+ case NDR_ERR_COMPRESSION:
+ return "NDR_ERR_COMPRESSION";
+ break;
+ case NDR_ERR_STRING:
+ return "NDR_ERR_STRING";
+ break;
+ case NDR_ERR_VALIDATE:
+ return "NDR_ERR_VALIDATE";
+ break;
+ case NDR_ERR_BUFSIZE:
+ return "NDR_ERR_BUFSIZE";
+ break;
+ case NDR_ERR_ALLOC:
+ return "NDR_ERR_ALLOC";
+ break;
+ case NDR_ERR_RANGE:
+ return "NDR_ERR_RANGE";
+ break;
+ case NDR_ERR_TOKEN:
+ return "NDR_ERR_TOKEN";
+ break;
+ case NDR_ERR_IPV4ADDRESS:
+ return "NDR_ERR_IPV4ADDRESS";
+ break;
+ case NDR_ERR_INVALID_POINTER:
+ return "NDR_ERR_INVALID_POINTER";
+ break;
+ case NDR_ERR_UNREAD_BYTES:
+ return "NDR_ERR_UNREAD_BYTES";
+ break;
+ }
+
+ return talloc_asprintf(talloc_tos(), "Unknown NDR error: %d", err);
+}
+
+enum ndr_err_code ndr_push_server_id(struct ndr_push *ndr, int ndr_flags, const struct server_id *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS,
+ (uint32_t)r->pid));
+#ifdef CLUSTER_SUPPORT
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS,
+ (uint32_t)r->vnn));
+#endif
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+enum ndr_err_code ndr_pull_server_id(struct ndr_pull *ndr, int ndr_flags, struct server_id *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ uint32_t pid;
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &pid));
+#ifdef CLUSTER_SUPPORT
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->vnn));
+#endif
+ r->pid = (pid_t)pid;
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+void ndr_print_server_id(struct ndr_print *ndr, const char *name, const struct server_id *r)
+{
+ ndr_print_struct(ndr, name, "server_id");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "id", (uint32_t)r->pid);
+#ifdef CLUSTER_SUPPORT
+ ndr_print_uint32(ndr, "vnn", (uint32_t)r->vnn);
+#endif
+ ndr->depth--;
+}
+
+_PUBLIC_ void ndr_print_bool(struct ndr_print *ndr, const char *name, const bool b)
+{
+ ndr->print(ndr, "%-25s: %s", name, b?"true":"false");
+}
+
+_PUBLIC_ void ndr_print_sockaddr_storage(struct ndr_print *ndr, const char *name, const struct sockaddr_storage *ss)
+{
+ char addr[INET6_ADDRSTRLEN];
+ ndr->print(ndr, "%-25s: %s", name, print_sockaddr(addr, sizeof(addr), ss));
+}
+
+void *global_loadparm;
+void *cmdline_lp_ctx;
+struct smb_iconv_convenience *lp_iconv_convenience(void *lp_ctx)
+{
+ return NULL;
+}
diff --git a/source3/librpc/ndr/uuid.c b/source3/librpc/ndr/uuid.c
deleted file mode 100644
index e92df22494..0000000000
--- a/source3/librpc/ndr/uuid.c
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- Unix SMB/CIFS implementation.
-
- UUID/GUID functions
-
- Copyright (C) Theodore Ts'o 1996, 1997,
- Copyright (C) Jim McDonough 2002.
- Copyright (C) Andrew Tridgell 2003.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "includes.h"
-#include "librpc/ndr/libndr.h"
-
-/**
- build a GUID from a string
-*/
-_PUBLIC_ NTSTATUS GUID_from_string(const char *s, struct GUID *guid)
-{
- NTSTATUS status = NT_STATUS_INVALID_PARAMETER;
- uint32_t time_low;
- uint32_t time_mid, time_hi_and_version;
- uint32_t clock_seq[2];
- uint32_t node[6];
- int i;
-
- if (s == NULL) {
- return NT_STATUS_INVALID_PARAMETER;
- }
-
- if (11 == sscanf(s, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
- &time_low, &time_mid, &time_hi_and_version,
- &clock_seq[0], &clock_seq[1],
- &node[0], &node[1], &node[2], &node[3], &node[4], &node[5])) {
- status = NT_STATUS_OK;
- } else if (11 == sscanf(s, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
- &time_low, &time_mid, &time_hi_and_version,
- &clock_seq[0], &clock_seq[1],
- &node[0], &node[1], &node[2], &node[3], &node[4], &node[5])) {
- status = NT_STATUS_OK;
- }
-
- if (!NT_STATUS_IS_OK(status)) {
- return status;
- }
-
- guid->time_low = time_low;
- guid->time_mid = time_mid;
- guid->time_hi_and_version = time_hi_and_version;
- guid->clock_seq[0] = clock_seq[0];
- guid->clock_seq[1] = clock_seq[1];
- for (i=0;i<6;i++) {
- guid->node[i] = node[i];
- }
-
- return NT_STATUS_OK;
-}
-
-/**
- build a GUID from a string
-*/
-_PUBLIC_ NTSTATUS NS_GUID_from_string(const char *s, struct GUID *guid)
-{
- NTSTATUS status = NT_STATUS_INVALID_PARAMETER;
- uint32_t time_low;
- uint32_t time_mid, time_hi_and_version;
- uint32_t clock_seq[2];
- uint32_t node[6];
- int i;
-
- if (s == NULL) {
- return NT_STATUS_INVALID_PARAMETER;
- }
-
- if (11 == sscanf(s, "%08x-%04x%04x-%02x%02x%02x%02x-%02x%02x%02x%02x",
- &time_low, &time_mid, &time_hi_and_version,
- &clock_seq[0], &clock_seq[1],
- &node[0], &node[1], &node[2], &node[3], &node[4], &node[5])) {
- status = NT_STATUS_OK;
- }
-
- if (!NT_STATUS_IS_OK(status)) {
- return status;
- }
-
- guid->time_low = time_low;
- guid->time_mid = time_mid;
- guid->time_hi_and_version = time_hi_and_version;
- guid->clock_seq[0] = clock_seq[0];
- guid->clock_seq[1] = clock_seq[1];
- for (i=0;i<6;i++) {
- guid->node[i] = node[i];
- }
-
- return NT_STATUS_OK;
-}
-
-/**
- * generate a random GUID
- */
-struct GUID GUID_random(void)
-{
- struct GUID guid;
-
- generate_random_buffer((uint8_t *)&guid, sizeof(guid));
- guid.clock_seq[0] = (guid.clock_seq[0] & 0x3F) | 0x80;
- guid.time_hi_and_version = (guid.time_hi_and_version & 0x0FFF) | 0x4000;
-
- return guid;
-}
-
-/**
- * generate an empty GUID
- */
-_PUBLIC_ struct GUID GUID_zero(void)
-{
- struct GUID guid;
-
- ZERO_STRUCT(guid);
-
- return guid;
-}
-
-_PUBLIC_ bool GUID_all_zero(const struct GUID *u)
-{
- if (u->time_low != 0 ||
- u->time_mid != 0 ||
- u->time_hi_and_version != 0 ||
- u->clock_seq[0] != 0 ||
- u->clock_seq[1] != 0 ||
- !all_zero(u->node, 6)) {
- return false;
- }
- return true;
-}
-
-_PUBLIC_ bool GUID_equal(const struct GUID *u1, const struct GUID *u2)
-{
- if (u1->time_low != u2->time_low ||
- u1->time_mid != u2->time_mid ||
- u1->time_hi_and_version != u2->time_hi_and_version ||
- u1->clock_seq[0] != u2->clock_seq[0] ||
- u1->clock_seq[1] != u2->clock_seq[1] ||
- memcmp(u1->node, u2->node, 6) != 0) {
- return false;
- }
- return true;
-}
-
-_PUBLIC_ int GUID_compare(const struct GUID *u1, const struct GUID *u2)
-{
- if (u1->time_low != u2->time_low) {
- return u1->time_low - u2->time_low;
- }
-
- if (u1->time_mid != u2->time_mid) {
- return u1->time_mid - u2->time_mid;
- }
-
- if (u1->time_hi_and_version != u2->time_hi_and_version) {
- return u1->time_hi_and_version - u2->time_hi_and_version;
- }
-
- if (u1->clock_seq[0] != u2->clock_seq[0]) {
- return u1->clock_seq[0] - u2->clock_seq[0];
- }
-
- if (u1->clock_seq[1] != u2->clock_seq[1]) {
- return u1->clock_seq[1] - u2->clock_seq[1];
- }
-
- return memcmp(u1->node, u2->node, 6);
-}
-
-/**
- its useful to be able to display these in debugging messages
-*/
-_PUBLIC_ char *GUID_string(TALLOC_CTX *mem_ctx, const struct GUID *guid)
-{
- return talloc_asprintf(mem_ctx,
- "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
- guid->time_low, guid->time_mid,
- guid->time_hi_and_version,
- guid->clock_seq[0],
- guid->clock_seq[1],
- guid->node[0], guid->node[1],
- guid->node[2], guid->node[3],
- guid->node[4], guid->node[5]);
-}
-
-_PUBLIC_ char *GUID_string2(TALLOC_CTX *mem_ctx, const struct GUID *guid)
-{
- char *ret, *s = GUID_string(mem_ctx, guid);
- ret = talloc_asprintf(mem_ctx, "{%s}", s);
- talloc_free(s);
- return ret;
-}
-
-_PUBLIC_ char *NS_GUID_string(TALLOC_CTX *mem_ctx, const struct GUID *guid)
-{
- return talloc_asprintf(mem_ctx,
- "%08x-%04x%04x-%02x%02x%02x%02x-%02x%02x%02x%02x",
- guid->time_low, guid->time_mid,
- guid->time_hi_and_version,
- guid->clock_seq[0],
- guid->clock_seq[1],
- guid->node[0], guid->node[1],
- guid->node[2], guid->node[3],
- guid->node[4], guid->node[5]);
-}
-
-_PUBLIC_ bool policy_handle_empty(struct policy_handle *h)
-{
- return (h->handle_type == 0 && GUID_all_zero(&h->uuid));
-}
diff --git a/source3/librpc/rpc/binding.c b/source3/librpc/rpc/binding.c
deleted file mode 100644
index 469c5db8d5..0000000000
--- a/source3/librpc/rpc/binding.c
+++ /dev/null
@@ -1,709 +0,0 @@
-/*
- Unix SMB/CIFS implementation.
-
- dcerpc utility functions
-
- Copyright (C) Andrew Tridgell 2003
- Copyright (C) Jelmer Vernooij 2004
- Copyright (C) Andrew Bartlett <abartlet@samba.org> 2005
- Copyright (C) Rafal Szczesniak 2006
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "includes.h"
-
-#define MAX_PROTSEQ 10
-
-static const struct {
- const char *name;
- enum dcerpc_transport_t transport;
- int num_protocols;
- enum epm_protocol protseq[MAX_PROTSEQ];
-} transports[] = {
- { "ncacn_np", NCACN_NP, 3,
- { EPM_PROTOCOL_NCACN, EPM_PROTOCOL_SMB, EPM_PROTOCOL_NETBIOS }},
- { "ncacn_ip_tcp", NCACN_IP_TCP, 3,
- { EPM_PROTOCOL_NCACN, EPM_PROTOCOL_TCP, EPM_PROTOCOL_IP } },
- { "ncacn_http", NCACN_HTTP, 3,
- { EPM_PROTOCOL_NCACN, EPM_PROTOCOL_HTTP, EPM_PROTOCOL_IP } },
- { "ncadg_ip_udp", NCACN_IP_UDP, 3,
- { EPM_PROTOCOL_NCADG, EPM_PROTOCOL_UDP, EPM_PROTOCOL_IP } },
- { "ncalrpc", NCALRPC, 2,
- { EPM_PROTOCOL_NCALRPC, EPM_PROTOCOL_PIPE } },
- { "ncacn_unix_stream", NCACN_UNIX_STREAM, 2,
- { EPM_PROTOCOL_NCACN, EPM_PROTOCOL_UNIX_DS } },
- { "ncadg_unix_dgram", NCADG_UNIX_DGRAM, 2,
- { EPM_PROTOCOL_NCADG, EPM_PROTOCOL_UNIX_DS } },
- { "ncacn_at_dsp", NCACN_AT_DSP, 3,
- { EPM_PROTOCOL_NCACN, EPM_PROTOCOL_APPLETALK, EPM_PROTOCOL_DSP } },
- { "ncadg_at_ddp", NCADG_AT_DDP, 3,
- { EPM_PROTOCOL_NCADG, EPM_PROTOCOL_APPLETALK, EPM_PROTOCOL_DDP } },
- { "ncacn_vns_ssp", NCACN_VNS_SPP, 3,
- { EPM_PROTOCOL_NCACN, EPM_PROTOCOL_STREETTALK, EPM_PROTOCOL_VINES_SPP } },
- { "ncacn_vns_ipc", NCACN_VNS_IPC, 3,
- { EPM_PROTOCOL_NCACN, EPM_PROTOCOL_STREETTALK, EPM_PROTOCOL_VINES_IPC }, },
- { "ncadg_ipx", NCADG_IPX, 2,
- { EPM_PROTOCOL_NCADG, EPM_PROTOCOL_IPX },
- },
- { "ncacn_spx", NCACN_SPX, 3,
- /* I guess some MS programmer confused the identifier for
- * EPM_PROTOCOL_UUID (0x0D or 13) with the one for
- * EPM_PROTOCOL_SPX (0x13) here. -- jelmer*/
- { EPM_PROTOCOL_NCACN, EPM_PROTOCOL_NCALRPC, EPM_PROTOCOL_UUID },
- },
-};
-
-static const struct {
- const char *name;
- uint32_t flag;
-} ncacn_options[] = {
- { "", 0 }
-};
-
-const char *epm_floor_string(TALLOC_CTX *mem_ctx, struct epm_floor *epm_floor)
-{
- struct ndr_syntax_id syntax;
- NTSTATUS status;
-
- switch(epm_floor->lhs.protocol) {
- case EPM_PROTOCOL_UUID:
- status = dcerpc_floor_get_lhs_data(epm_floor, &syntax);
- if (NT_STATUS_IS_OK(status)) {
- /* lhs is used: UUID */
- char *uuidstr;
-
- if (GUID_equal(&syntax.uuid, &ndr_transfer_syntax.uuid)) {
- return "NDR";
- }
-
- if (GUID_equal(&syntax.uuid, &ndr64_transfer_syntax.uuid)) {
- return "NDR64";
- }
-
- uuidstr = GUID_string(mem_ctx, &syntax.uuid);
-
- return talloc_asprintf(mem_ctx, " uuid %s/0x%02x", uuidstr, syntax.if_version);
- } else { /* IPX */
- return NULL;
- }
-
- case EPM_PROTOCOL_NCACN:
- return "RPC-C";
-
- case EPM_PROTOCOL_NCADG:
- return "RPC";
-
- case EPM_PROTOCOL_NCALRPC:
- return "NCALRPC";
-
- case EPM_PROTOCOL_DNET_NSP:
- return "DNET/NSP";
-
- case EPM_PROTOCOL_IP:
- return talloc_asprintf(mem_ctx, "IP:%s", epm_floor->rhs.ip.ipaddr);
-
- case EPM_PROTOCOL_PIPE:
- return talloc_asprintf(mem_ctx, "PIPE:%s", epm_floor->rhs.pipe.path);
-
- case EPM_PROTOCOL_SMB:
- return talloc_asprintf(mem_ctx, "SMB:%s", epm_floor->rhs.smb.unc);
-
- case EPM_PROTOCOL_UNIX_DS:
- return talloc_asprintf(mem_ctx, "Unix:%s", epm_floor->rhs.unix_ds.path);
-
- case EPM_PROTOCOL_NETBIOS:
- return talloc_asprintf(mem_ctx, "NetBIOS:%s", epm_floor->rhs.netbios.name);
-
- case EPM_PROTOCOL_NETBEUI:
- return "NETBeui";
-
- case EPM_PROTOCOL_SPX:
- return "SPX";
-
- case EPM_PROTOCOL_NB_IPX:
- return "NB_IPX";
-
- case EPM_PROTOCOL_HTTP:
- return talloc_asprintf(mem_ctx, "HTTP:%d", epm_floor->rhs.http.port);
-
- case EPM_PROTOCOL_TCP:
- return talloc_asprintf(mem_ctx, "TCP:%d", epm_floor->rhs.tcp.port);
-
- case EPM_PROTOCOL_UDP:
- return talloc_asprintf(mem_ctx, "UDP:%d", epm_floor->rhs.udp.port);
-
- default:
- return talloc_asprintf(mem_ctx, "UNK(%02x):", epm_floor->lhs.protocol);
- }
-}
-
-
-/*
- form a binding string from a binding structure
-*/
-_PUBLIC_ char *dcerpc_binding_string(TALLOC_CTX *mem_ctx, const struct dcerpc_binding *b)
-{
- char *s = talloc_strdup(mem_ctx, "");
- int i;
- const char *t_name = NULL;
-
- if (b->transport != NCA_UNKNOWN) {
- for (i=0;i<ARRAY_SIZE(transports);i++) {
- if (transports[i].transport == b->transport) {
- t_name = transports[i].name;
- }
- }
- if (!t_name) {
- return NULL;
- }
- }
-
- if (!GUID_all_zero(&b->object.uuid)) {
- s = talloc_asprintf(s, "%s@",
- GUID_string(mem_ctx, &b->object.uuid));
- }
-
- if (t_name != NULL) {
- s = talloc_asprintf_append_buffer(s, "%s:", t_name);
- if (s == NULL) {
- return NULL;
- }
- }
-
- if (b->host) {
- s = talloc_asprintf_append_buffer(s, "%s", b->host);
- }
-
- if (!b->endpoint && !b->options && !b->flags) {
- return s;
- }
-
- s = talloc_asprintf_append_buffer(s, "[");
-
- if (b->endpoint) {
- s = talloc_asprintf_append_buffer(s, "%s", b->endpoint);
- }
-
- /* this is a *really* inefficent way of dealing with strings,
- but this is rarely called and the strings are always short,
- so I don't care */
- for (i=0;b->options && b->options[i];i++) {
- s = talloc_asprintf_append_buffer(s, ",%s", b->options[i]);
- if (!s) return NULL;
- }
-
- for (i=0;i<ARRAY_SIZE(ncacn_options);i++) {
- if (b->flags & ncacn_options[i].flag) {
- s = talloc_asprintf_append_buffer(s, ",%s", ncacn_options[i].name);
- if (!s) return NULL;
- }
- }
-
- s = talloc_asprintf_append_buffer(s, "]");
-
- return s;
-}
-
-/*
- parse a binding string into a dcerpc_binding structure
-*/
-_PUBLIC_ NTSTATUS dcerpc_parse_binding(TALLOC_CTX *mem_ctx, const char *s, struct dcerpc_binding **b_out)
-{
- struct dcerpc_binding *b;
- char *options;
- char *p;
- int i, j, comma_count;
-
- b = talloc(mem_ctx, struct dcerpc_binding);
- if (!b) {
- return NT_STATUS_NO_MEMORY;
- }
-
- p = strchr(s, '@');
-
- if (p && PTR_DIFF(p, s) == 36) { /* 36 is the length of a UUID */
- NTSTATUS status;
-
- status = GUID_from_string(s, &b->object.uuid);
-
- if (NT_STATUS_IS_ERR(status)) {
- DEBUG(0, ("Failed parsing UUID\n"));
- return status;
- }
-
- s = p + 1;
- } else {
- ZERO_STRUCT(b->object);
- }
-
- b->object.if_version = 0;
-
- p = strchr(s, ':');
-
- if (p == NULL) {
- b->transport = NCA_UNKNOWN;
- } else {
- char *type = talloc_strndup(mem_ctx, s, PTR_DIFF(p, s));
- if (!type) {
- return NT_STATUS_NO_MEMORY;
- }
-
- for (i=0;i<ARRAY_SIZE(transports);i++) {
- if (strcmp(type, transports[i].name) == 0) {
- b->transport = transports[i].transport;
- break;
- }
- }
-
- if (i==ARRAY_SIZE(transports)) {
- DEBUG(0,("Unknown dcerpc transport '%s'\n", type));
- return NT_STATUS_INVALID_PARAMETER;
- }
-
- talloc_free(type);
-
- s = p+1;
- }
-
- p = strchr(s, '[');
- if (p) {
- b->host = talloc_strndup(b, s, PTR_DIFF(p, s));
- options = talloc_strdup(mem_ctx, p+1);
- if (options[strlen(options)-1] != ']') {
- return NT_STATUS_INVALID_PARAMETER;
- }
- options[strlen(options)-1] = 0;
- } else {
- b->host = talloc_strdup(b, s);
- options = NULL;
- }
- if (!b->host) {
- return NT_STATUS_NO_MEMORY;
- }
-
- b->target_hostname = b->host;
-
- b->options = NULL;
- b->flags = 0;
- b->assoc_group_id = 0;
- b->endpoint = NULL;
-
- if (!options) {
- *b_out = b;
- return NT_STATUS_OK;
- }
-
- comma_count = count_chars(options, ',');
-
- b->options = talloc_array(b, const char *, comma_count+2);
- if (!b->options) {
- return NT_STATUS_NO_MEMORY;
- }
-
- for (i=0; (p = strchr(options, ',')); i++) {
- b->options[i] = talloc_strndup(b, options, PTR_DIFF(p, options));
- if (!b->options[i]) {
- return NT_STATUS_NO_MEMORY;
- }
- options = p+1;
- }
- b->options[i] = options;
- b->options[i+1] = NULL;
-
- /* some options are pre-parsed for convenience */
- for (i=0;b->options[i];i++) {
- for (j=0;j<ARRAY_SIZE(ncacn_options);j++) {
- if (strcmp(ncacn_options[j].name, b->options[i]) == 0) {
- int k;
- b->flags |= ncacn_options[j].flag;
- for (k=i;b->options[k];k++) {
- b->options[k] = b->options[k+1];
- }
- i--;
- break;
- }
- }
- }
-
- if (b->options[0]) {
- /* Endpoint is first option */
- b->endpoint = b->options[0];
- if (strlen(b->endpoint) == 0) b->endpoint = NULL;
-
- for (i=0;b->options[i];i++) {
- b->options[i] = b->options[i+1];
- }
- }
-
- if (b->options[0] == NULL)
- b->options = NULL;
-
- *b_out = b;
- return NT_STATUS_OK;
-}
-
-_PUBLIC_ NTSTATUS dcerpc_floor_get_lhs_data(struct epm_floor *epm_floor, struct ndr_syntax_id *syntax)
-{
- TALLOC_CTX *mem_ctx = talloc_init("floor_get_lhs_data");
- struct ndr_pull *ndr = ndr_pull_init_blob(&epm_floor->lhs.lhs_data, mem_ctx, NULL);
- enum ndr_err_code ndr_err;
- uint16_t if_version=0;
-
- ndr->flags |= LIBNDR_FLAG_NOALIGN;
-
- ndr_err = ndr_pull_GUID(ndr, NDR_SCALARS | NDR_BUFFERS, &syntax->uuid);
- if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
- talloc_free(mem_ctx);
- return ndr_map_error2ntstatus(ndr_err);
- }
-
- ndr_err = ndr_pull_uint16(ndr, NDR_SCALARS, &if_version);
- if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
- talloc_free(mem_ctx);
- return ndr_map_error2ntstatus(ndr_err);
- }
-
- syntax->if_version = if_version;
-
- talloc_free(mem_ctx);
-
- return NT_STATUS_OK;
-}
-
-static DATA_BLOB dcerpc_floor_pack_lhs_data(TALLOC_CTX *mem_ctx, const struct ndr_syntax_id *syntax)
-{
- struct ndr_push *ndr = ndr_push_init_ctx(mem_ctx);
-
- ndr->flags |= LIBNDR_FLAG_NOALIGN;
-
- ndr_push_GUID(ndr, NDR_SCALARS | NDR_BUFFERS, &syntax->uuid);
- ndr_push_uint16(ndr, NDR_SCALARS, syntax->if_version);
-
- return ndr_push_blob(ndr);
-}
-
-const char *dcerpc_floor_get_rhs_data(TALLOC_CTX *mem_ctx, struct epm_floor *epm_floor)
-{
- switch (epm_floor->lhs.protocol) {
- case EPM_PROTOCOL_TCP:
- if (epm_floor->rhs.tcp.port == 0) return NULL;
- return talloc_asprintf(mem_ctx, "%d", epm_floor->rhs.tcp.port);
-
- case EPM_PROTOCOL_UDP:
- if (epm_floor->rhs.udp.port == 0) return NULL;
- return talloc_asprintf(mem_ctx, "%d", epm_floor->rhs.udp.port);
-
- case EPM_PROTOCOL_HTTP:
- if (epm_floor->rhs.http.port == 0) return NULL;
- return talloc_asprintf(mem_ctx, "%d", epm_floor->rhs.http.port);
-
- case EPM_PROTOCOL_IP:
- return talloc_strdup(mem_ctx, epm_floor->rhs.ip.ipaddr);
-
- case EPM_PROTOCOL_NCACN:
- return NULL;
-
- case EPM_PROTOCOL_NCADG:
- return NULL;
-
- case EPM_PROTOCOL_SMB:
- if (strlen(epm_floor->rhs.smb.unc) == 0) return NULL;
- return talloc_strdup(mem_ctx, epm_floor->rhs.smb.unc);
-
- case EPM_PROTOCOL_PIPE:
- if (strlen(epm_floor->rhs.pipe.path) == 0) return NULL;
- return talloc_strdup(mem_ctx, epm_floor->rhs.pipe.path);
-
- case EPM_PROTOCOL_NETBIOS:
- if (strlen(epm_floor->rhs.netbios.name) == 0) return NULL;
- return talloc_strdup(mem_ctx, epm_floor->rhs.netbios.name);
-
- case EPM_PROTOCOL_NCALRPC:
- return NULL;
-
- case EPM_PROTOCOL_VINES_SPP:
- return talloc_asprintf(mem_ctx, "%d", epm_floor->rhs.vines_spp.port);
-
- case EPM_PROTOCOL_VINES_IPC:
- return talloc_asprintf(mem_ctx, "%d", epm_floor->rhs.vines_ipc.port);
-
- case EPM_PROTOCOL_STREETTALK:
- return talloc_strdup(mem_ctx, epm_floor->rhs.streettalk.streettalk);
-
- case EPM_PROTOCOL_UNIX_DS:
- if (strlen(epm_floor->rhs.unix_ds.path) == 0) return NULL;
- return talloc_strdup(mem_ctx, epm_floor->rhs.unix_ds.path);
-
- case EPM_PROTOCOL_NULL:
- return NULL;
-
- default:
- DEBUG(0,("Unsupported lhs protocol %d\n", epm_floor->lhs.protocol));
- break;
- }
-
- return NULL;
-}
-
-static NTSTATUS dcerpc_floor_set_rhs_data(TALLOC_CTX *mem_ctx,
- struct epm_floor *epm_floor,
- const char *data)
-{
- switch (epm_floor->lhs.protocol) {
- case EPM_PROTOCOL_TCP:
- epm_floor->rhs.tcp.port = atoi(data);
- return NT_STATUS_OK;
-
- case EPM_PROTOCOL_UDP:
- epm_floor->rhs.udp.port = atoi(data);
- return NT_STATUS_OK;
-
- case EPM_PROTOCOL_HTTP:
- epm_floor->rhs.http.port = atoi(data);
- return NT_STATUS_OK;
-
- case EPM_PROTOCOL_IP:
- epm_floor->rhs.ip.ipaddr = talloc_strdup(mem_ctx, data);
- NT_STATUS_HAVE_NO_MEMORY(epm_floor->rhs.ip.ipaddr);
- return NT_STATUS_OK;
-
- case EPM_PROTOCOL_NCACN:
- epm_floor->rhs.ncacn.minor_version = 0;
- return NT_STATUS_OK;
-
- case EPM_PROTOCOL_NCADG:
- epm_floor->rhs.ncadg.minor_version = 0;
- return NT_STATUS_OK;
-
- case EPM_PROTOCOL_SMB:
- epm_floor->rhs.smb.unc = talloc_strdup(mem_ctx, data);
- NT_STATUS_HAVE_NO_MEMORY(epm_floor->rhs.smb.unc);
- return NT_STATUS_OK;
-
- case EPM_PROTOCOL_PIPE:
- epm_floor->rhs.pipe.path = talloc_strdup(mem_ctx, data);
- NT_STATUS_HAVE_NO_MEMORY(epm_floor->rhs.pipe.path);
- return NT_STATUS_OK;
-
- case EPM_PROTOCOL_NETBIOS:
- epm_floor->rhs.netbios.name = talloc_strdup(mem_ctx, data);
- NT_STATUS_HAVE_NO_MEMORY(epm_floor->rhs.netbios.name);
- return NT_STATUS_OK;
-
- case EPM_PROTOCOL_NCALRPC:
- return NT_STATUS_OK;
-
- case EPM_PROTOCOL_VINES_SPP:
- epm_floor->rhs.vines_spp.port = atoi(data);
- return NT_STATUS_OK;
-
- case EPM_PROTOCOL_VINES_IPC:
- epm_floor->rhs.vines_ipc.port = atoi(data);
- return NT_STATUS_OK;
-
- case EPM_PROTOCOL_STREETTALK:
- epm_floor->rhs.streettalk.streettalk = talloc_strdup(mem_ctx, data);
- NT_STATUS_HAVE_NO_MEMORY(epm_floor->rhs.streettalk.streettalk);
- return NT_STATUS_OK;
-
- case EPM_PROTOCOL_UNIX_DS:
- epm_floor->rhs.unix_ds.path = talloc_strdup(mem_ctx, data);
- NT_STATUS_HAVE_NO_MEMORY(epm_floor->rhs.unix_ds.path);
- return NT_STATUS_OK;
-
- case EPM_PROTOCOL_NULL:
- return NT_STATUS_OK;
-
- default:
- DEBUG(0,("Unsupported lhs protocol %d\n", epm_floor->lhs.protocol));
- break;
- }
-
- return NT_STATUS_NOT_SUPPORTED;
-}
-
-enum dcerpc_transport_t dcerpc_transport_by_endpoint_protocol(int prot)
-{
- int i;
-
- /* Find a transport that has 'prot' as 4th protocol */
- for (i=0;i<ARRAY_SIZE(transports);i++) {
- if (transports[i].num_protocols >= 2 &&
- transports[i].protseq[1] == prot) {
- return transports[i].transport;
- }
- }
-
- /* Unknown transport */
- return (unsigned int)-1;
-}
-
-_PUBLIC_ enum dcerpc_transport_t dcerpc_transport_by_tower(struct epm_tower *tower)
-{
- int i;
-
- /* Find a transport that matches this tower */
- for (i=0;i<ARRAY_SIZE(transports);i++) {
- int j;
- if (transports[i].num_protocols != tower->num_floors - 2) {
- continue;
- }
-
- for (j = 0; j < transports[i].num_protocols; j++) {
- if (transports[i].protseq[j] != tower->floors[j+2].lhs.protocol) {
- break;
- }
- }
-
- if (j == transports[i].num_protocols) {
- return transports[i].transport;
- }
- }
-
- /* Unknown transport */
- return (unsigned int)-1;
-}
-
-_PUBLIC_ NTSTATUS dcerpc_binding_from_tower(TALLOC_CTX *mem_ctx,
- struct epm_tower *tower,
- struct dcerpc_binding **b_out)
-{
- NTSTATUS status;
- struct dcerpc_binding *binding;
-
- binding = talloc(mem_ctx, struct dcerpc_binding);
- NT_STATUS_HAVE_NO_MEMORY(binding);
-
- ZERO_STRUCT(binding->object);
- binding->options = NULL;
- binding->host = NULL;
- binding->target_hostname = NULL;
- binding->flags = 0;
- binding->assoc_group_id = 0;
-
- binding->transport = dcerpc_transport_by_tower(tower);
-
- if (binding->transport == (unsigned int)-1) {
- return NT_STATUS_NOT_SUPPORTED;
- }
-
- if (tower->num_floors < 1) {
- return NT_STATUS_OK;
- }
-
- /* Set object uuid */
- status = dcerpc_floor_get_lhs_data(&tower->floors[0], &binding->object);
-
- if (!NT_STATUS_IS_OK(status)) {
- DEBUG(1, ("Error pulling object uuid and version: %s", nt_errstr(status)));
- return status;
- }
-
- /* Ignore floor 1, it contains the NDR version info */
-
- binding->options = NULL;
-
- /* Set endpoint */
- if (tower->num_floors >= 4) {
- binding->endpoint = dcerpc_floor_get_rhs_data(mem_ctx, &tower->floors[3]);
- } else {
- binding->endpoint = NULL;
- }
-
- /* Set network address */
- if (tower->num_floors >= 5) {
- binding->host = dcerpc_floor_get_rhs_data(mem_ctx, &tower->floors[4]);
- NT_STATUS_HAVE_NO_MEMORY(binding->host);
- binding->target_hostname = binding->host;
- }
- *b_out = binding;
- return NT_STATUS_OK;
-}
-
-_PUBLIC_ NTSTATUS dcerpc_binding_build_tower(TALLOC_CTX *mem_ctx, struct dcerpc_binding *binding, struct epm_tower *tower)
-{
- const enum epm_protocol *protseq = NULL;
- int num_protocols = -1, i;
- NTSTATUS status;
-
- /* Find transport */
- for (i=0;i<ARRAY_SIZE(transports);i++) {
- if (transports[i].transport == binding->transport) {
- protseq = transports[i].protseq;
- num_protocols = transports[i].num_protocols;
- break;
- }
- }
-
- if (num_protocols == -1) {
- DEBUG(0, ("Unable to find transport with id '%d'\n", binding->transport));
- return NT_STATUS_UNSUCCESSFUL;
- }
-
- tower->num_floors = 2 + num_protocols;
- tower->floors = talloc_array(mem_ctx, struct epm_floor, tower->num_floors);
-
- /* Floor 0 */
- tower->floors[0].lhs.protocol = EPM_PROTOCOL_UUID;
-
- tower->floors[0].lhs.lhs_data = dcerpc_floor_pack_lhs_data(mem_ctx, &binding->object);
-
- tower->floors[0].rhs.uuid.unknown = data_blob_talloc_zero(mem_ctx, 2);
-
- /* Floor 1 */
- tower->floors[1].lhs.protocol = EPM_PROTOCOL_UUID;
-
- tower->floors[1].lhs.lhs_data = dcerpc_floor_pack_lhs_data(mem_ctx,
- &ndr_transfer_syntax);
-
- tower->floors[1].rhs.uuid.unknown = data_blob_talloc_zero(mem_ctx, 2);
-
- /* Floor 2 to num_protocols */
- for (i = 0; i < num_protocols; i++) {
- tower->floors[2 + i].lhs.protocol = protseq[i];
- tower->floors[2 + i].lhs.lhs_data = data_blob_talloc(mem_ctx, NULL, 0);
- ZERO_STRUCT(tower->floors[2 + i].rhs);
- dcerpc_floor_set_rhs_data(mem_ctx, &tower->floors[2 + i], "");
- }
-
- /* The 4th floor contains the endpoint */
- if (num_protocols >= 2 && binding->endpoint) {
- status = dcerpc_floor_set_rhs_data(mem_ctx, &tower->floors[3], binding->endpoint);
- if (NT_STATUS_IS_ERR(status)) {
- return status;
- }
- }
-
- /* The 5th contains the network address */
- if (num_protocols >= 3 && binding->host) {
- if (is_ipaddress(binding->host)) {
- status = dcerpc_floor_set_rhs_data(mem_ctx, &tower->floors[4],
- binding->host);
- } else {
- /* note that we don't attempt to resolve the
- name here - when we get a hostname here we
- are in the client code, and want to put in
- a wildcard all-zeros IP for the server to
- fill in */
- status = dcerpc_floor_set_rhs_data(mem_ctx, &tower->floors[4],
- "0.0.0.0");
- }
- if (NT_STATUS_IS_ERR(status)) {
- return status;
- }
- }
-
- return NT_STATUS_OK;
-}
diff --git a/source3/librpc/rpc/dcerpc.c b/source3/librpc/rpc/dcerpc.c
index 7a870981fd..77bb7b33a2 100644
--- a/source3/librpc/rpc/dcerpc.c
+++ b/source3/librpc/rpc/dcerpc.c
@@ -43,7 +43,7 @@ struct rpc_request *dcerpc_ndr_request_send(struct dcerpc_pipe *p, const struct
ret->call = call;
ret->r = r;
- push = ndr_push_init_ctx(mem_ctx);
+ push = ndr_push_init_ctx(mem_ctx, NULL);
if (!push) {
return NULL;
}
diff --git a/source3/librpc/rpc/dcerpc.h b/source3/librpc/rpc/dcerpc.h
index 739e60a341..1a1fd83060 100644
--- a/source3/librpc/rpc/dcerpc.h
+++ b/source3/librpc/rpc/dcerpc.h
@@ -72,4 +72,52 @@ struct dcerpc_binding {
uint32_t assoc_group_id;
};
+
+/* dcerpc pipe flags */
+#define DCERPC_DEBUG_PRINT_IN (1<<0)
+#define DCERPC_DEBUG_PRINT_OUT (1<<1)
+#define DCERPC_DEBUG_PRINT_BOTH (DCERPC_DEBUG_PRINT_IN | DCERPC_DEBUG_PRINT_OUT)
+
+#define DCERPC_DEBUG_VALIDATE_IN (1<<2)
+#define DCERPC_DEBUG_VALIDATE_OUT (1<<3)
+#define DCERPC_DEBUG_VALIDATE_BOTH (DCERPC_DEBUG_VALIDATE_IN | DCERPC_DEBUG_VALIDATE_OUT)
+
+#define DCERPC_CONNECT (1<<4)
+#define DCERPC_SIGN (1<<5)
+#define DCERPC_SEAL (1<<6)
+
+#define DCERPC_PUSH_BIGENDIAN (1<<7)
+#define DCERPC_PULL_BIGENDIAN (1<<8)
+
+#define DCERPC_SCHANNEL (1<<9)
+
+/* use a 128 bit session key */
+#define DCERPC_SCHANNEL_128 (1<<12)
+
+/* check incoming pad bytes */
+#define DCERPC_DEBUG_PAD_CHECK (1<<13)
+
+/* set LIBNDR_FLAG_REF_ALLOC flag when decoding NDR */
+#define DCERPC_NDR_REF_ALLOC (1<<14)
+
+#define DCERPC_AUTH_OPTIONS (DCERPC_SEAL|DCERPC_SIGN|DCERPC_SCHANNEL|DCERPC_AUTH_SPNEGO|DCERPC_AUTH_KRB5|DCERPC_AUTH_NTLM)
+
+/* select spnego auth */
+#define DCERPC_AUTH_SPNEGO (1<<15)
+
+/* select krb5 auth */
+#define DCERPC_AUTH_KRB5 (1<<16)
+
+#define DCERPC_SMB2 (1<<17)
+
+/* select NTLM auth */
+#define DCERPC_AUTH_NTLM (1<<18)
+
+/* this triggers the DCERPC_PFC_FLAG_CONC_MPX flag in the bind request */
+#define DCERPC_CONCURRENT_MULTIPLEX (1<<19)
+
+/* this triggers the DCERPC_PFC_FLAG_SUPPORT_HEADER_SIGN flag in the bind request */
+#define DCERPC_HEADER_SIGNING (1<<20)
+
+
#endif /* __DCERPC_H__ */
diff --git a/source3/librpc/rpc/dcerpc_util.c b/source3/librpc/rpc/dcerpc_util.c
deleted file mode 100644
index 3b8768ccc2..0000000000
--- a/source3/librpc/rpc/dcerpc_util.c
+++ /dev/null
@@ -1,1438 +0,0 @@
-/*
- Unix SMB/CIFS implementation.
-
- dcerpc utility functions
-
- Copyright (C) Andrew Tridgell 2003
- Copyright (C) Jelmer Vernooij 2004
- Copyright (C) Andrew Bartlett <abartlet@samba.org> 2005
- Copyright (C) Rafal Szczesniak 2006
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "includes.h"
-#include "lib/events/events.h"
-#include "libcli/composite/composite.h"
-#include "librpc/gen_ndr/ndr_epmapper_c.h"
-#include "librpc/gen_ndr/ndr_dcerpc.h"
-#include "librpc/gen_ndr/ndr_misc.h"
-#include "librpc/rpc/dcerpc_proto.h"
-#include "auth/credentials/credentials.h"
-#include "param/param.h"
-
-/*
- find a dcerpc call on an interface by name
-*/
-const struct ndr_interface_call *dcerpc_iface_find_call(const struct ndr_interface_table *iface,
- const char *name)
-{
- int i;
- for (i=0;i<iface->num_calls;i++) {
- if (strcmp(iface->calls[i].name, name) == 0) {
- return &iface->calls[i];
- }
- }
- return NULL;
-}
-
-/*
- push a ncacn_packet into a blob, potentially with auth info
-*/
-NTSTATUS ncacn_push_auth(DATA_BLOB *blob, TALLOC_CTX *mem_ctx,
- struct smb_iconv_convenience *iconv_convenience,
- struct ncacn_packet *pkt,
- struct dcerpc_auth *auth_info)
-{
- struct ndr_push *ndr;
- enum ndr_err_code ndr_err;
-
- ndr = ndr_push_init_ctx(mem_ctx, iconv_convenience);
- if (!ndr) {
- return NT_STATUS_NO_MEMORY;
- }
-
- if (!(pkt->drep[0] & DCERPC_DREP_LE)) {
- ndr->flags |= LIBNDR_FLAG_BIGENDIAN;
- }
-
- if (pkt->pfc_flags & DCERPC_PFC_FLAG_OBJECT_UUID) {
- ndr->flags |= LIBNDR_FLAG_OBJECT_PRESENT;
- }
-
- if (auth_info) {
- pkt->auth_length = auth_info->credentials.length;
- } else {
- pkt->auth_length = 0;
- }
-
- ndr_err = ndr_push_ncacn_packet(ndr, NDR_SCALARS|NDR_BUFFERS, pkt);
- if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
- return ndr_map_error2ntstatus(ndr_err);
- }
-
- if (auth_info) {
- ndr_err = ndr_push_dcerpc_auth(ndr, NDR_SCALARS|NDR_BUFFERS, auth_info);
- if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
- return ndr_map_error2ntstatus(ndr_err);
- }
- }
-
- *blob = ndr_push_blob(ndr);
-
- /* fill in the frag length */
- dcerpc_set_frag_length(blob, blob->length);
-
- return NT_STATUS_OK;
-}
-
-#define MAX_PROTSEQ 10
-
-static const struct {
- const char *name;
- enum dcerpc_transport_t transport;
- int num_protocols;
- enum epm_protocol protseq[MAX_PROTSEQ];
-} transports[] = {
- { "ncacn_np", NCACN_NP, 3,
- { EPM_PROTOCOL_NCACN, EPM_PROTOCOL_SMB, EPM_PROTOCOL_NETBIOS }},
- { "ncacn_ip_tcp", NCACN_IP_TCP, 3,
- { EPM_PROTOCOL_NCACN, EPM_PROTOCOL_TCP, EPM_PROTOCOL_IP } },
- { "ncacn_http", NCACN_HTTP, 3,
- { EPM_PROTOCOL_NCACN, EPM_PROTOCOL_HTTP, EPM_PROTOCOL_IP } },
- { "ncadg_ip_udp", NCACN_IP_UDP, 3,
- { EPM_PROTOCOL_NCADG, EPM_PROTOCOL_UDP, EPM_PROTOCOL_IP } },
- { "ncalrpc", NCALRPC, 2,
- { EPM_PROTOCOL_NCALRPC, EPM_PROTOCOL_PIPE } },
- { "ncacn_unix_stream", NCACN_UNIX_STREAM, 2,
- { EPM_PROTOCOL_NCACN, EPM_PROTOCOL_UNIX_DS } },
- { "ncadg_unix_dgram", NCADG_UNIX_DGRAM, 2,
- { EPM_PROTOCOL_NCADG, EPM_PROTOCOL_UNIX_DS } },
- { "ncacn_at_dsp", NCACN_AT_DSP, 3,
- { EPM_PROTOCOL_NCACN, EPM_PROTOCOL_APPLETALK, EPM_PROTOCOL_DSP } },
- { "ncadg_at_ddp", NCADG_AT_DDP, 3,
- { EPM_PROTOCOL_NCADG, EPM_PROTOCOL_APPLETALK, EPM_PROTOCOL_DDP } },
- { "ncacn_vns_ssp", NCACN_VNS_SPP, 3,
- { EPM_PROTOCOL_NCACN, EPM_PROTOCOL_STREETTALK, EPM_PROTOCOL_VINES_SPP } },
- { "ncacn_vns_ipc", NCACN_VNS_IPC, 3,
- { EPM_PROTOCOL_NCACN, EPM_PROTOCOL_STREETTALK, EPM_PROTOCOL_VINES_IPC }, },
- { "ncadg_ipx", NCADG_IPX, 2,
- { EPM_PROTOCOL_NCADG, EPM_PROTOCOL_IPX },
- },
- { "ncacn_spx", NCACN_SPX, 3,
- /* I guess some MS programmer confused the identifier for
- * EPM_PROTOCOL_UUID (0x0D or 13) with the one for
- * EPM_PROTOCOL_SPX (0x13) here. -- jelmer*/
- { EPM_PROTOCOL_NCACN, EPM_PROTOCOL_NCALRPC, EPM_PROTOCOL_UUID },
- },
-};
-
-static const struct {
- const char *name;
- uint32_t flag;
-} ncacn_options[] = {
- {"sign", DCERPC_SIGN},
- {"seal", DCERPC_SEAL},
- {"connect", DCERPC_CONNECT},
- {"spnego", DCERPC_AUTH_SPNEGO},
- {"ntlm", DCERPC_AUTH_NTLM},
- {"krb5", DCERPC_AUTH_KRB5},
- {"validate", DCERPC_DEBUG_VALIDATE_BOTH},
- {"print", DCERPC_DEBUG_PRINT_BOTH},
- {"padcheck", DCERPC_DEBUG_PAD_CHECK},
- {"bigendian", DCERPC_PUSH_BIGENDIAN},
- {"smb2", DCERPC_SMB2}
-};
-
-const char *epm_floor_string(TALLOC_CTX *mem_ctx, struct epm_floor *epm_floor)
-{
- struct ndr_syntax_id syntax;
- NTSTATUS status;
-
- switch(epm_floor->lhs.protocol) {
- case EPM_PROTOCOL_UUID:
- status = dcerpc_floor_get_lhs_data(epm_floor, &syntax);
- if (NT_STATUS_IS_OK(status)) {
- /* lhs is used: UUID */
- char *uuidstr;
-
- if (GUID_equal(&syntax.uuid, &ndr_transfer_syntax.uuid)) {
- return "NDR";
- }
-
- if (GUID_equal(&syntax.uuid, &ndr64_transfer_syntax.uuid)) {
- return "NDR64";
- }
-
- uuidstr = GUID_string(mem_ctx, &syntax.uuid);
-
- return talloc_asprintf(mem_ctx, " uuid %s/0x%02x", uuidstr, syntax.if_version);
- } else { /* IPX */
- return talloc_asprintf(mem_ctx, "IPX:%s",
- data_blob_hex_string(mem_ctx, &epm_floor->rhs.uuid.unknown));
- }
-
- case EPM_PROTOCOL_NCACN:
- return "RPC-C";
-
- case EPM_PROTOCOL_NCADG:
- return "RPC";
-
- case EPM_PROTOCOL_NCALRPC:
- return "NCALRPC";
-
- case EPM_PROTOCOL_DNET_NSP:
- return "DNET/NSP";
-
- case EPM_PROTOCOL_IP:
- return talloc_asprintf(mem_ctx, "IP:%s", epm_floor->rhs.ip.ipaddr);
-
- case EPM_PROTOCOL_PIPE:
- return talloc_asprintf(mem_ctx, "PIPE:%s", epm_floor->rhs.pipe.path);
-
- case EPM_PROTOCOL_SMB:
- return talloc_asprintf(mem_ctx, "SMB:%s", epm_floor->rhs.smb.unc);
-
- case EPM_PROTOCOL_UNIX_DS:
- return talloc_asprintf(mem_ctx, "Unix:%s", epm_floor->rhs.unix_ds.path);
-
- case EPM_PROTOCOL_NETBIOS:
- return talloc_asprintf(mem_ctx, "NetBIOS:%s", epm_floor->rhs.netbios.name);
-
- case EPM_PROTOCOL_NETBEUI:
- return "NETBeui";
-
- case EPM_PROTOCOL_SPX:
- return "SPX";
-
- case EPM_PROTOCOL_NB_IPX:
- return "NB_IPX";
-
- case EPM_PROTOCOL_HTTP:
- return talloc_asprintf(mem_ctx, "HTTP:%d", epm_floor->rhs.http.port);
-
- case EPM_PROTOCOL_TCP:
- return talloc_asprintf(mem_ctx, "TCP:%d", epm_floor->rhs.tcp.port);
-
- case EPM_PROTOCOL_UDP:
- return talloc_asprintf(mem_ctx, "UDP:%d", epm_floor->rhs.udp.port);
-
- default:
- return talloc_asprintf(mem_ctx, "UNK(%02x):", epm_floor->lhs.protocol);
- }
-}
-
-
-/*
- form a binding string from a binding structure
-*/
-_PUBLIC_ char *dcerpc_binding_string(TALLOC_CTX *mem_ctx, const struct dcerpc_binding *b)
-{
- char *s = talloc_strdup(mem_ctx, "");
- int i;
- const char *t_name = NULL;
-
- if (b->transport != NCA_UNKNOWN) {
- for (i=0;i<ARRAY_SIZE(transports);i++) {
- if (transports[i].transport == b->transport) {
- t_name = transports[i].name;
- }
- }
- if (!t_name) {
- return NULL;
- }
- }
-
- if (!GUID_all_zero(&b->object.uuid)) {
- s = talloc_asprintf(s, "%s@",
- GUID_string(mem_ctx, &b->object.uuid));
- }
-
- if (t_name != NULL) {
- s = talloc_asprintf_append_buffer(s, "%s:", t_name);
- if (s == NULL) {
- return NULL;
- }
- }
-
- if (b->host) {
- s = talloc_asprintf_append_buffer(s, "%s", b->host);
- }
-
- if (!b->endpoint && !b->options && !b->flags) {
- return s;
- }
-
- s = talloc_asprintf_append_buffer(s, "[");
-
- if (b->endpoint) {
- s = talloc_asprintf_append_buffer(s, "%s", b->endpoint);
- }
-
- /* this is a *really* inefficent way of dealing with strings,
- but this is rarely called and the strings are always short,
- so I don't care */
- for (i=0;b->options && b->options[i];i++) {
- s = talloc_asprintf_append_buffer(s, ",%s", b->options[i]);
- if (!s) return NULL;
- }
-
- for (i=0;i<ARRAY_SIZE(ncacn_options);i++) {
- if (b->flags & ncacn_options[i].flag) {
- s = talloc_asprintf_append_buffer(s, ",%s", ncacn_options[i].name);
- if (!s) return NULL;
- }
- }
-
- s = talloc_asprintf_append_buffer(s, "]");
-
- return s;
-}
-
-/*
- parse a binding string into a dcerpc_binding structure
-*/
-_PUBLIC_ NTSTATUS dcerpc_parse_binding(TALLOC_CTX *mem_ctx, const char *s, struct dcerpc_binding **b_out)
-{
- struct dcerpc_binding *b;
- char *options;
- char *p;
- int i, j, comma_count;
-
- b = talloc(mem_ctx, struct dcerpc_binding);
- if (!b) {
- return NT_STATUS_NO_MEMORY;
- }
-
- p = strchr(s, '@');
-
- if (p && PTR_DIFF(p, s) == 36) { /* 36 is the length of a UUID */
- NTSTATUS status;
-
- status = GUID_from_string(s, &b->object.uuid);
-
- if (NT_STATUS_IS_ERR(status)) {
- DEBUG(0, ("Failed parsing UUID\n"));
- return status;
- }
-
- s = p + 1;
- } else {
- ZERO_STRUCT(b->object);
- }
-
- b->object.if_version = 0;
-
- p = strchr(s, ':');
-
- if (p == NULL) {
- b->transport = NCA_UNKNOWN;
- } else {
- char *type = talloc_strndup(mem_ctx, s, PTR_DIFF(p, s));
- if (!type) {
- return NT_STATUS_NO_MEMORY;
- }
-
- for (i=0;i<ARRAY_SIZE(transports);i++) {
- if (strcasecmp(type, transports[i].name) == 0) {
- b->transport = transports[i].transport;
- break;
- }
- }
-
- if (i==ARRAY_SIZE(transports)) {
- DEBUG(0,("Unknown dcerpc transport '%s'\n", type));
- return NT_STATUS_INVALID_PARAMETER;
- }
-
- talloc_free(type);
-
- s = p+1;
- }
-
- p = strchr(s, '[');
- if (p) {
- b->host = talloc_strndup(b, s, PTR_DIFF(p, s));
- options = talloc_strdup(mem_ctx, p+1);
- if (options[strlen(options)-1] != ']') {
- return NT_STATUS_INVALID_PARAMETER;
- }
- options[strlen(options)-1] = 0;
- } else {
- b->host = talloc_strdup(b, s);
- options = NULL;
- }
- if (!b->host) {
- return NT_STATUS_NO_MEMORY;
- }
-
- b->target_hostname = b->host;
-
- b->options = NULL;
- b->flags = 0;
- b->assoc_group_id = 0;
- b->endpoint = NULL;
-
- if (!options) {
- *b_out = b;
- return NT_STATUS_OK;
- }
-
- comma_count = count_chars(options, ',');
-
- b->options = talloc_array(b, const char *, comma_count+2);
- if (!b->options) {
- return NT_STATUS_NO_MEMORY;
- }
-
- for (i=0; (p = strchr(options, ',')); i++) {
- b->options[i] = talloc_strndup(b, options, PTR_DIFF(p, options));
- if (!b->options[i]) {
- return NT_STATUS_NO_MEMORY;
- }
- options = p+1;
- }
- b->options[i] = options;
- b->options[i+1] = NULL;
-
- /* some options are pre-parsed for convenience */
- for (i=0;b->options[i];i++) {
- for (j=0;j<ARRAY_SIZE(ncacn_options);j++) {
- if (strcasecmp(ncacn_options[j].name, b->options[i]) == 0) {
- int k;
- b->flags |= ncacn_options[j].flag;
- for (k=i;b->options[k];k++) {
- b->options[k] = b->options[k+1];
- }
- i--;
- break;
- }
- }
- }
-
- if (b->options[0]) {
- /* Endpoint is first option */
- b->endpoint = b->options[0];
- if (strlen(b->endpoint) == 0) b->endpoint = NULL;
-
- for (i=0;b->options[i];i++) {
- b->options[i] = b->options[i+1];
- }
- }
-
- if (b->options[0] == NULL)
- b->options = NULL;
-
- *b_out = b;
- return NT_STATUS_OK;
-}
-
-_PUBLIC_ NTSTATUS dcerpc_floor_get_lhs_data(struct epm_floor *epm_floor, struct ndr_syntax_id *syntax)
-{
- TALLOC_CTX *mem_ctx = talloc_init("floor_get_lhs_data");
- struct ndr_pull *ndr = ndr_pull_init_blob(&epm_floor->lhs.lhs_data, mem_ctx, NULL);
- enum ndr_err_code ndr_err;
- uint16_t if_version=0;
-
- ndr->flags |= LIBNDR_FLAG_NOALIGN;
-
- ndr_err = ndr_pull_GUID(ndr, NDR_SCALARS | NDR_BUFFERS, &syntax->uuid);
- if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
- talloc_free(mem_ctx);
- return ndr_map_error2ntstatus(ndr_err);
- }
-
- ndr_err = ndr_pull_uint16(ndr, NDR_SCALARS, &if_version);
- if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
- talloc_free(mem_ctx);
- return ndr_map_error2ntstatus(ndr_err);
- }
-
- syntax->if_version = if_version;
-
- talloc_free(mem_ctx);
-
- return NT_STATUS_OK;
-}
-
-static DATA_BLOB dcerpc_floor_pack_lhs_data(TALLOC_CTX *mem_ctx, const struct ndr_syntax_id *syntax)
-{
- struct ndr_push *ndr = ndr_push_init_ctx(mem_ctx, NULL);
-
- ndr->flags |= LIBNDR_FLAG_NOALIGN;
-
- ndr_push_GUID(ndr, NDR_SCALARS | NDR_BUFFERS, &syntax->uuid);
- ndr_push_uint16(ndr, NDR_SCALARS, syntax->if_version);
-
- return ndr_push_blob(ndr);
-}
-
-const char *dcerpc_floor_get_rhs_data(TALLOC_CTX *mem_ctx, struct epm_floor *epm_floor)
-{
- switch (epm_floor->lhs.protocol) {
- case EPM_PROTOCOL_TCP:
- if (epm_floor->rhs.tcp.port == 0) return NULL;
- return talloc_asprintf(mem_ctx, "%d", epm_floor->rhs.tcp.port);
-
- case EPM_PROTOCOL_UDP:
- if (epm_floor->rhs.udp.port == 0) return NULL;
- return talloc_asprintf(mem_ctx, "%d", epm_floor->rhs.udp.port);
-
- case EPM_PROTOCOL_HTTP:
- if (epm_floor->rhs.http.port == 0) return NULL;
- return talloc_asprintf(mem_ctx, "%d", epm_floor->rhs.http.port);
-
- case EPM_PROTOCOL_IP:
- return talloc_strdup(mem_ctx, epm_floor->rhs.ip.ipaddr);
-
- case EPM_PROTOCOL_NCACN:
- return NULL;
-
- case EPM_PROTOCOL_NCADG:
- return NULL;
-
- case EPM_PROTOCOL_SMB:
- if (strlen(epm_floor->rhs.smb.unc) == 0) return NULL;
- return talloc_strdup(mem_ctx, epm_floor->rhs.smb.unc);
-
- case EPM_PROTOCOL_PIPE:
- if (strlen(epm_floor->rhs.pipe.path) == 0) return NULL;
- return talloc_strdup(mem_ctx, epm_floor->rhs.pipe.path);
-
- case EPM_PROTOCOL_NETBIOS:
- if (strlen(epm_floor->rhs.netbios.name) == 0) return NULL;
- return talloc_strdup(mem_ctx, epm_floor->rhs.netbios.name);
-
- case EPM_PROTOCOL_NCALRPC:
- return NULL;
-
- case EPM_PROTOCOL_VINES_SPP:
- return talloc_asprintf(mem_ctx, "%d", epm_floor->rhs.vines_spp.port);
-
- case EPM_PROTOCOL_VINES_IPC:
- return talloc_asprintf(mem_ctx, "%d", epm_floor->rhs.vines_ipc.port);
-
- case EPM_PROTOCOL_STREETTALK:
- return talloc_strdup(mem_ctx, epm_floor->rhs.streettalk.streettalk);
-
- case EPM_PROTOCOL_UNIX_DS:
- if (strlen(epm_floor->rhs.unix_ds.path) == 0) return NULL;
- return talloc_strdup(mem_ctx, epm_floor->rhs.unix_ds.path);
-
- case EPM_PROTOCOL_NULL:
- return NULL;
-
- default:
- DEBUG(0,("Unsupported lhs protocol %d\n", epm_floor->lhs.protocol));
- break;
- }
-
- return NULL;
-}
-
-static NTSTATUS dcerpc_floor_set_rhs_data(TALLOC_CTX *mem_ctx,
- struct epm_floor *epm_floor,
- const char *data)
-{
- switch (epm_floor->lhs.protocol) {
- case EPM_PROTOCOL_TCP:
- epm_floor->rhs.tcp.port = atoi(data);
- return NT_STATUS_OK;
-
- case EPM_PROTOCOL_UDP:
- epm_floor->rhs.udp.port = atoi(data);
- return NT_STATUS_OK;
-
- case EPM_PROTOCOL_HTTP:
- epm_floor->rhs.http.port = atoi(data);
- return NT_STATUS_OK;
-
- case EPM_PROTOCOL_IP:
- epm_floor->rhs.ip.ipaddr = talloc_strdup(mem_ctx, data);
- NT_STATUS_HAVE_NO_MEMORY(epm_floor->rhs.ip.ipaddr);
- return NT_STATUS_OK;
-
- case EPM_PROTOCOL_NCACN:
- epm_floor->rhs.ncacn.minor_version = 0;
- return NT_STATUS_OK;
-
- case EPM_PROTOCOL_NCADG:
- epm_floor->rhs.ncadg.minor_version = 0;
- return NT_STATUS_OK;
-
- case EPM_PROTOCOL_SMB:
- epm_floor->rhs.smb.unc = talloc_strdup(mem_ctx, data);
- NT_STATUS_HAVE_NO_MEMORY(epm_floor->rhs.smb.unc);
- return NT_STATUS_OK;
-
- case EPM_PROTOCOL_PIPE:
- epm_floor->rhs.pipe.path = talloc_strdup(mem_ctx, data);
- NT_STATUS_HAVE_NO_MEMORY(epm_floor->rhs.pipe.path);
- return NT_STATUS_OK;
-
- case EPM_PROTOCOL_NETBIOS:
- epm_floor->rhs.netbios.name = talloc_strdup(mem_ctx, data);
- NT_STATUS_HAVE_NO_MEMORY(epm_floor->rhs.netbios.name);
- return NT_STATUS_OK;
-
- case EPM_PROTOCOL_NCALRPC:
- return NT_STATUS_OK;
-
- case EPM_PROTOCOL_VINES_SPP:
- epm_floor->rhs.vines_spp.port = atoi(data);
- return NT_STATUS_OK;
-
- case EPM_PROTOCOL_VINES_IPC:
- epm_floor->rhs.vines_ipc.port = atoi(data);
- return NT_STATUS_OK;
-
- case EPM_PROTOCOL_STREETTALK:
- epm_floor->rhs.streettalk.streettalk = talloc_strdup(mem_ctx, data);
- NT_STATUS_HAVE_NO_MEMORY(epm_floor->rhs.streettalk.streettalk);
- return NT_STATUS_OK;
-
- case EPM_PROTOCOL_UNIX_DS:
- epm_floor->rhs.unix_ds.path = talloc_strdup(mem_ctx, data);
- NT_STATUS_HAVE_NO_MEMORY(epm_floor->rhs.unix_ds.path);
- return NT_STATUS_OK;
-
- case EPM_PROTOCOL_NULL:
- return NT_STATUS_OK;
-
- default:
- DEBUG(0,("Unsupported lhs protocol %d\n", epm_floor->lhs.protocol));
- break;
- }
-
- return NT_STATUS_NOT_SUPPORTED;
-}
-
-enum dcerpc_transport_t dcerpc_transport_by_endpoint_protocol(int prot)
-{
- int i;
-
- /* Find a transport that has 'prot' as 4th protocol */
- for (i=0;i<ARRAY_SIZE(transports);i++) {
- if (transports[i].num_protocols >= 2 &&
- transports[i].protseq[1] == prot) {
- return transports[i].transport;
- }
- }
-
- /* Unknown transport */
- return (unsigned int)-1;
-}
-
-_PUBLIC_ enum dcerpc_transport_t dcerpc_transport_by_tower(struct epm_tower *tower)
-{
- int i;
-
- /* Find a transport that matches this tower */
- for (i=0;i<ARRAY_SIZE(transports);i++) {
- int j;
- if (transports[i].num_protocols != tower->num_floors - 2) {
- continue;
- }
-
- for (j = 0; j < transports[i].num_protocols; j++) {
- if (transports[i].protseq[j] != tower->floors[j+2].lhs.protocol) {
- break;
- }
- }
-
- if (j == transports[i].num_protocols) {
- return transports[i].transport;
- }
- }
-
- /* Unknown transport */
- return (unsigned int)-1;
-}
-
-_PUBLIC_ NTSTATUS dcerpc_binding_from_tower(TALLOC_CTX *mem_ctx,
- struct epm_tower *tower,
- struct dcerpc_binding **b_out)
-{
- NTSTATUS status;
- struct dcerpc_binding *binding;
-
- binding = talloc(mem_ctx, struct dcerpc_binding);
- NT_STATUS_HAVE_NO_MEMORY(binding);
-
- ZERO_STRUCT(binding->object);
- binding->options = NULL;
- binding->host = NULL;
- binding->target_hostname = NULL;
- binding->flags = 0;
- binding->assoc_group_id = 0;
-
- binding->transport = dcerpc_transport_by_tower(tower);
-
- if (binding->transport == (unsigned int)-1) {
- return NT_STATUS_NOT_SUPPORTED;
- }
-
- if (tower->num_floors < 1) {
- return NT_STATUS_OK;
- }
-
- /* Set object uuid */
- status = dcerpc_floor_get_lhs_data(&tower->floors[0], &binding->object);
-
- if (!NT_STATUS_IS_OK(status)) {
- DEBUG(1, ("Error pulling object uuid and version: %s", nt_errstr(status)));
- return status;
- }
-
- /* Ignore floor 1, it contains the NDR version info */
-
- binding->options = NULL;
-
- /* Set endpoint */
- if (tower->num_floors >= 4) {
- binding->endpoint = dcerpc_floor_get_rhs_data(mem_ctx, &tower->floors[3]);
- } else {
- binding->endpoint = NULL;
- }
-
- /* Set network address */
- if (tower->num_floors >= 5) {
- binding->host = dcerpc_floor_get_rhs_data(mem_ctx, &tower->floors[4]);
- NT_STATUS_HAVE_NO_MEMORY(binding->host);
- binding->target_hostname = binding->host;
- }
- *b_out = binding;
- return NT_STATUS_OK;
-}
-
-_PUBLIC_ NTSTATUS dcerpc_binding_build_tower(TALLOC_CTX *mem_ctx, struct dcerpc_binding *binding, struct epm_tower *tower)
-{
- const enum epm_protocol *protseq = NULL;
- int num_protocols = -1, i;
- NTSTATUS status;
-
- /* Find transport */
- for (i=0;i<ARRAY_SIZE(transports);i++) {
- if (transports[i].transport == binding->transport) {
- protseq = transports[i].protseq;
- num_protocols = transports[i].num_protocols;
- break;
- }
- }
-
- if (num_protocols == -1) {
- DEBUG(0, ("Unable to find transport with id '%d'\n", binding->transport));
- return NT_STATUS_UNSUCCESSFUL;
- }
-
- tower->num_floors = 2 + num_protocols;
- tower->floors = talloc_array(mem_ctx, struct epm_floor, tower->num_floors);
-
- /* Floor 0 */
- tower->floors[0].lhs.protocol = EPM_PROTOCOL_UUID;
-
- tower->floors[0].lhs.lhs_data = dcerpc_floor_pack_lhs_data(mem_ctx, &binding->object);
-
- tower->floors[0].rhs.uuid.unknown = data_blob_talloc_zero(mem_ctx, 2);
-
- /* Floor 1 */
- tower->floors[1].lhs.protocol = EPM_PROTOCOL_UUID;
-
- tower->floors[1].lhs.lhs_data = dcerpc_floor_pack_lhs_data(mem_ctx,
- &ndr_transfer_syntax);
-
- tower->floors[1].rhs.uuid.unknown = data_blob_talloc_zero(mem_ctx, 2);
-
- /* Floor 2 to num_protocols */
- for (i = 0; i < num_protocols; i++) {
- tower->floors[2 + i].lhs.protocol = protseq[i];
- tower->floors[2 + i].lhs.lhs_data = data_blob_talloc(mem_ctx, NULL, 0);
- ZERO_STRUCT(tower->floors[2 + i].rhs);
- dcerpc_floor_set_rhs_data(mem_ctx, &tower->floors[2 + i], "");
- }
-
- /* The 4th floor contains the endpoint */
- if (num_protocols >= 2 && binding->endpoint) {
- status = dcerpc_floor_set_rhs_data(mem_ctx, &tower->floors[3], binding->endpoint);
- if (NT_STATUS_IS_ERR(status)) {
- return status;
- }
- }
-
- /* The 5th contains the network address */
- if (num_protocols >= 3 && binding->host) {
- if (is_ipaddress(binding->host)) {
- status = dcerpc_floor_set_rhs_data(mem_ctx, &tower->floors[4],
- binding->host);
- } else {
- /* note that we don't attempt to resolve the
- name here - when we get a hostname here we
- are in the client code, and want to put in
- a wildcard all-zeros IP for the server to
- fill in */
- status = dcerpc_floor_set_rhs_data(mem_ctx, &tower->floors[4],
- "0.0.0.0");
- }
- if (NT_STATUS_IS_ERR(status)) {
- return status;
- }
- }
-
- return NT_STATUS_OK;
-}
-
-
-struct epm_map_binding_state {
- struct dcerpc_binding *binding;
- const struct ndr_interface_table *table;
- struct dcerpc_pipe *pipe;
- struct policy_handle handle;
- struct GUID guid;
- struct epm_twr_t twr;
- struct epm_twr_t *twr_r;
- struct epm_Map r;
-};
-
-
-static void continue_epm_recv_binding(struct composite_context *ctx);
-static void continue_epm_map(struct rpc_request *req);
-
-
-/*
- Stage 2 of epm_map_binding: Receive connected rpc pipe and send endpoint
- mapping rpc request
-*/
-static void continue_epm_recv_binding(struct composite_context *ctx)
-{
- struct rpc_request *map_req;
-
- struct composite_context *c = talloc_get_type(ctx->async.private_data,
- struct composite_context);
- struct epm_map_binding_state *s = talloc_get_type(c->private_data,
- struct epm_map_binding_state);
-
- /* receive result of rpc pipe connect request */
- c->status = dcerpc_pipe_connect_b_recv(ctx, c, &s->pipe);
- if (!composite_is_ok(c)) return;
-
- s->pipe->conn->flags |= DCERPC_NDR_REF_ALLOC;
-
- /* prepare requested binding parameters */
- s->binding->object = s->table->syntax_id;
-
- c->status = dcerpc_binding_build_tower(s->pipe, s->binding, &s->twr.tower);
- if (!composite_is_ok(c)) return;
-
- /* with some nice pretty paper around it of course */
- s->r.in.object = &s->guid;
- s->r.in.map_tower = &s->twr;
- s->r.in.entry_handle = &s->handle;
- s->r.in.max_towers = 1;
- s->r.out.entry_handle = &s->handle;
-
- /* send request for an endpoint mapping - a rpc request on connected pipe */
- map_req = dcerpc_epm_Map_send(s->pipe, c, &s->r);
- if (composite_nomem(map_req, c)) return;
-
- composite_continue_rpc(c, map_req, continue_epm_map, c);
-}
-
-
-/*
- Stage 3 of epm_map_binding: Receive endpoint mapping and provide binding details
-*/
-static void continue_epm_map(struct rpc_request *req)
-{
- struct composite_context *c = talloc_get_type(req->async.private_data,
- struct composite_context);
- struct epm_map_binding_state *s = talloc_get_type(c->private_data,
- struct epm_map_binding_state);
-
- /* receive result of a rpc request */
- c->status = dcerpc_ndr_request_recv(req);
- if (!composite_is_ok(c)) return;
-
- /* check the details */
- if (s->r.out.result != 0 || *s->r.out.num_towers != 1) {
- composite_error(c, NT_STATUS_PORT_UNREACHABLE);
- return;
- }
-
- s->twr_r = s->r.out.towers[0].twr;
- if (s->twr_r == NULL) {
- composite_error(c, NT_STATUS_PORT_UNREACHABLE);
- return;
- }
-
- if (s->twr_r->tower.num_floors != s->twr.tower.num_floors ||
- s->twr_r->tower.floors[3].lhs.protocol != s->twr.tower.floors[3].lhs.protocol) {
- composite_error(c, NT_STATUS_PORT_UNREACHABLE);
- return;
- }
-
- /* get received endpoint */
- s->binding->endpoint = talloc_reference(s->binding,
- dcerpc_floor_get_rhs_data(c, &s->twr_r->tower.floors[3]));
- if (composite_nomem(s->binding->endpoint, c)) return;
-
- composite_done(c);
-}
-
-
-/*
- Request for endpoint mapping of dcerpc binding - try to request for endpoint
- unless there is default one.
-*/
-struct composite_context *dcerpc_epm_map_binding_send(TALLOC_CTX *mem_ctx,
- struct dcerpc_binding *binding,
- const struct ndr_interface_table *table,
- struct event_context *ev,
- struct loadparm_context *lp_ctx)
-{
- struct composite_context *c;
- struct epm_map_binding_state *s;
- struct composite_context *pipe_connect_req;
- struct cli_credentials *anon_creds;
- struct event_context *new_ev = NULL;
-
- NTSTATUS status;
- struct dcerpc_binding *epmapper_binding;
- int i;
-
- /* Try to find event context in memory context in case passed
- * event_context (argument) was NULL. If there's none, just
- * create a new one.
- */
- if (ev == NULL) {
- ev = event_context_find(mem_ctx);
- if (ev == NULL) {
- new_ev = event_context_init(mem_ctx);
- if (new_ev == NULL) return NULL;
- ev = new_ev;
- }
- }
-
- /* composite context allocation and setup */
- c = composite_create(mem_ctx, ev);
- if (c == NULL) {
- talloc_free(new_ev);
- return NULL;
- }
- talloc_steal(c, new_ev);
-
- s = talloc_zero(c, struct epm_map_binding_state);
- if (composite_nomem(s, c)) return c;
- c->private_data = s;
-
- s->binding = binding;
- s->table = table;
-
- /* anonymous credentials for rpc connection used to get endpoint mapping */
- anon_creds = cli_credentials_init(mem_ctx);
- cli_credentials_set_event_context(anon_creds, ev);
- cli_credentials_set_anonymous(anon_creds);
-
- /*
- First, check if there is a default endpoint specified in the IDL
- */
- if (table != NULL) {
- struct dcerpc_binding *default_binding;
-
- /* Find one of the default pipes for this interface */
- for (i = 0; i < table->endpoints->count; i++) {
- status = dcerpc_parse_binding(mem_ctx, table->endpoints->names[i], &default_binding);
-
- if (NT_STATUS_IS_OK(status)) {
- if (binding->transport == NCA_UNKNOWN)
- binding->transport = default_binding->transport;
- if (default_binding->transport == binding->transport &&
- default_binding->endpoint) {
- binding->endpoint = talloc_reference(binding, default_binding->endpoint);
- talloc_free(default_binding);
-
- composite_done(c);
- return c;
-
- } else {
- talloc_free(default_binding);
- }
- }
- }
- }
-
- epmapper_binding = talloc_zero(c, struct dcerpc_binding);
- if (composite_nomem(epmapper_binding, c)) return c;
-
- /* basic endpoint mapping data */
- epmapper_binding->transport = binding->transport;
- epmapper_binding->host = talloc_reference(epmapper_binding, binding->host);
- epmapper_binding->target_hostname = epmapper_binding->host;
- epmapper_binding->options = NULL;
- epmapper_binding->flags = 0;
- epmapper_binding->assoc_group_id = 0;
- epmapper_binding->endpoint = NULL;
-
- /* initiate rpc pipe connection */
- pipe_connect_req = dcerpc_pipe_connect_b_send(c, epmapper_binding,
- &ndr_table_epmapper,
- anon_creds, c->event_ctx,
- lp_ctx);
- if (composite_nomem(pipe_connect_req, c)) return c;
-
- composite_continue(c, pipe_connect_req, continue_epm_recv_binding, c);
- return c;
-}
-
-
-/*
- Receive result of endpoint mapping request
- */
-NTSTATUS dcerpc_epm_map_binding_recv(struct composite_context *c)
-{
- NTSTATUS status = composite_wait(c);
-
- talloc_free(c);
- return status;
-}
-
-
-/*
- Get endpoint mapping for rpc connection
-*/
-_PUBLIC_ NTSTATUS dcerpc_epm_map_binding(TALLOC_CTX *mem_ctx, struct dcerpc_binding *binding,
- const struct ndr_interface_table *table, struct event_context *ev,
- struct loadparm_context *lp_ctx)
-{
- struct composite_context *c;
-
- c = dcerpc_epm_map_binding_send(mem_ctx, binding, table, ev, lp_ctx);
- return dcerpc_epm_map_binding_recv(c);
-}
-
-
-struct pipe_auth_state {
- struct dcerpc_pipe *pipe;
- struct dcerpc_binding *binding;
- const struct ndr_interface_table *table;
- struct loadparm_context *lp_ctx;
- struct cli_credentials *credentials;
-};
-
-
-static void continue_auth_schannel(struct composite_context *ctx);
-static void continue_auth(struct composite_context *ctx);
-static void continue_auth_none(struct composite_context *ctx);
-static void continue_ntlmssp_connection(struct composite_context *ctx);
-static void continue_spnego_after_wrong_pass(struct composite_context *ctx);
-
-
-/*
- Stage 2 of pipe_auth: Receive result of schannel bind request
-*/
-static void continue_auth_schannel(struct composite_context *ctx)
-{
- struct composite_context *c = talloc_get_type(ctx->async.private_data,
- struct composite_context);
-
- c->status = dcerpc_bind_auth_schannel_recv(ctx);
- if (!composite_is_ok(c)) return;
-
- composite_done(c);
-}
-
-
-/*
- Stage 2 of pipe_auth: Receive result of authenticated bind request
-*/
-static void continue_auth(struct composite_context *ctx)
-{
- struct composite_context *c = talloc_get_type(ctx->async.private_data,
- struct composite_context);
-
- c->status = dcerpc_bind_auth_recv(ctx);
- if (!composite_is_ok(c)) return;
-
- composite_done(c);
-}
-/*
- Stage 2 of pipe_auth: Receive result of authenticated bind request, but handle fallbacks:
- SPNEGO -> NTLMSSP
-*/
-static void continue_auth_auto(struct composite_context *ctx)
-{
- struct composite_context *c = talloc_get_type(ctx->async.private_data,
- struct composite_context);
- struct pipe_auth_state *s = talloc_get_type(c->private_data, struct pipe_auth_state);
- struct composite_context *sec_conn_req;
-
- c->status = dcerpc_bind_auth_recv(ctx);
- if (NT_STATUS_EQUAL(c->status, NT_STATUS_INVALID_PARAMETER)) {
- /*
- * Retry with NTLMSSP auth as fallback
- * send a request for secondary rpc connection
- */
- sec_conn_req = dcerpc_secondary_connection_send(s->pipe,
- s->binding);
- composite_continue(c, sec_conn_req, continue_ntlmssp_connection, c);
- return;
- } else if (NT_STATUS_EQUAL(c->status, NT_STATUS_LOGON_FAILURE)) {
- if (cli_credentials_wrong_password(s->credentials)) {
- /*
- * Retry SPNEGO with a better password
- * send a request for secondary rpc connection
- */
- sec_conn_req = dcerpc_secondary_connection_send(s->pipe,
- s->binding);
- composite_continue(c, sec_conn_req, continue_spnego_after_wrong_pass, c);
- return;
- }
- }
-
- if (!composite_is_ok(c)) return;
-
- composite_done(c);
-}
-
-/*
- Stage 3 of pipe_auth (fallback to NTLMSSP case): Receive secondary
- rpc connection (the first one can't be used any more, due to the
- bind nak) and perform authenticated bind request
-*/
-static void continue_ntlmssp_connection(struct composite_context *ctx)
-{
- struct composite_context *c;
- struct pipe_auth_state *s;
- struct composite_context *auth_req;
- struct dcerpc_pipe *p2;
-
- c = talloc_get_type(ctx->async.private_data, struct composite_context);
- s = talloc_get_type(c->private_data, struct pipe_auth_state);
-
- /* receive secondary rpc connection */
- c->status = dcerpc_secondary_connection_recv(ctx, &p2);
- if (!composite_is_ok(c)) return;
-
- talloc_steal(s, p2);
- talloc_steal(p2, s->pipe);
- s->pipe = p2;
-
- /* initiate a authenticated bind */
- auth_req = dcerpc_bind_auth_send(c, s->pipe, s->table,
- s->credentials, s->lp_ctx,
- DCERPC_AUTH_TYPE_NTLMSSP,
- dcerpc_auth_level(s->pipe->conn),
- s->table->authservices->names[0]);
- composite_continue(c, auth_req, continue_auth, c);
-}
-
-/*
- Stage 3 of pipe_auth (retry on wrong password): Receive secondary
- rpc connection (the first one can't be used any more, due to the
- bind nak) and perform authenticated bind request
-*/
-static void continue_spnego_after_wrong_pass(struct composite_context *ctx)
-{
- struct composite_context *c;
- struct pipe_auth_state *s;
- struct composite_context *auth_req;
- struct dcerpc_pipe *p2;
-
- c = talloc_get_type(ctx->async.private_data, struct composite_context);
- s = talloc_get_type(c->private_data, struct pipe_auth_state);
-
- /* receive secondary rpc connection */
- c->status = dcerpc_secondary_connection_recv(ctx, &p2);
- if (!composite_is_ok(c)) return;
-
- talloc_steal(s, p2);
- talloc_steal(p2, s->pipe);
- s->pipe = p2;
-
- /* initiate a authenticated bind */
- auth_req = dcerpc_bind_auth_send(c, s->pipe, s->table,
- s->credentials, s->lp_ctx, DCERPC_AUTH_TYPE_SPNEGO,
- dcerpc_auth_level(s->pipe->conn),
- s->table->authservices->names[0]);
- composite_continue(c, auth_req, continue_auth, c);
-}
-
-
-/*
- Stage 2 of pipe_auth: Receive result of non-authenticated bind request
-*/
-static void continue_auth_none(struct composite_context *ctx)
-{
- struct composite_context *c = talloc_get_type(ctx->async.private_data,
- struct composite_context);
-
- c->status = dcerpc_bind_auth_none_recv(ctx);
- if (!composite_is_ok(c)) return;
-
- composite_done(c);
-}
-
-
-/*
- Request to perform an authenticated bind if required. Authentication
- is determined using credentials passed and binding flags.
-*/
-struct composite_context *dcerpc_pipe_auth_send(struct dcerpc_pipe *p,
- struct dcerpc_binding *binding,
- const struct ndr_interface_table *table,
- struct cli_credentials *credentials,
- struct loadparm_context *lp_ctx)
-{
- struct composite_context *c;
- struct pipe_auth_state *s;
- struct composite_context *auth_schannel_req;
- struct composite_context *auth_req;
- struct composite_context *auth_none_req;
- struct dcerpc_connection *conn;
- uint8_t auth_type;
-
- /* composite context allocation and setup */
- c = composite_create(p, p->conn->event_ctx);
- if (c == NULL) return NULL;
-
- s = talloc_zero(c, struct pipe_auth_state);
- if (composite_nomem(s, c)) return c;
- c->private_data = s;
-
- /* store parameters in state structure */
- s->binding = binding;
- s->table = table;
- s->credentials = credentials;
- s->pipe = p;
- s->lp_ctx = lp_ctx;
-
- conn = s->pipe->conn;
- conn->flags = binding->flags;
-
- /* remember the binding string for possible secondary connections */
- conn->binding_string = dcerpc_binding_string(p, binding);
-
- if (cli_credentials_is_anonymous(s->credentials)) {
- auth_none_req = dcerpc_bind_auth_none_send(c, s->pipe, s->table);
- composite_continue(c, auth_none_req, continue_auth_none, c);
- return c;
- }
-
- if ((binding->flags & DCERPC_SCHANNEL) &&
- !cli_credentials_get_netlogon_creds(s->credentials)) {
- /* If we don't already have netlogon credentials for
- * the schannel bind, then we have to get these
- * first */
- auth_schannel_req = dcerpc_bind_auth_schannel_send(c, s->pipe, s->table,
- s->credentials, s->lp_ctx,
- dcerpc_auth_level(conn));
- composite_continue(c, auth_schannel_req, continue_auth_schannel, c);
- return c;
- }
-
- /*
- * we rely on the already authenticated CIFS connection
- * if not doing sign or seal
- */
- if (conn->transport.transport == NCACN_NP &&
- !(s->binding->flags & (DCERPC_SIGN|DCERPC_SEAL))) {
- auth_none_req = dcerpc_bind_auth_none_send(c, s->pipe, s->table);
- composite_continue(c, auth_none_req, continue_auth_none, c);
- return c;
- }
-
-
- /* Perform an authenticated DCE-RPC bind
- */
- if (!(conn->flags & (DCERPC_SIGN|DCERPC_SEAL))) {
- /*
- we are doing an authenticated connection,
- but not using sign or seal. We must force
- the CONNECT dcerpc auth type as a NONE auth
- type doesn't allow authentication
- information to be passed.
- */
- conn->flags |= DCERPC_CONNECT;
- }
-
- if (s->binding->flags & DCERPC_AUTH_SPNEGO) {
- auth_type = DCERPC_AUTH_TYPE_SPNEGO;
-
- } else if (s->binding->flags & DCERPC_AUTH_KRB5) {
- auth_type = DCERPC_AUTH_TYPE_KRB5;
-
- } else if (s->binding->flags & DCERPC_SCHANNEL) {
- auth_type = DCERPC_AUTH_TYPE_SCHANNEL;
-
- } else if (s->binding->flags & DCERPC_AUTH_NTLM) {
- auth_type = DCERPC_AUTH_TYPE_NTLMSSP;
-
- } else {
- /* try SPNEGO with fallback to NTLMSSP */
- auth_req = dcerpc_bind_auth_send(c, s->pipe, s->table,
- s->credentials, s->lp_ctx, DCERPC_AUTH_TYPE_SPNEGO,
- dcerpc_auth_level(conn),
- s->table->authservices->names[0]);
- composite_continue(c, auth_req, continue_auth_auto, c);
- return c;
- }
-
- auth_req = dcerpc_bind_auth_send(c, s->pipe, s->table,
- s->credentials, s->lp_ctx, auth_type,
- dcerpc_auth_level(conn),
- s->table->authservices->names[0]);
- composite_continue(c, auth_req, continue_auth, c);
- return c;
-}
-
-
-/*
- Receive result of authenticated bind request on dcerpc pipe
-
- This returns *p, which may be different to the one originally
- supllied, as it rebinds to a new pipe due to authentication fallback
-
-*/
-NTSTATUS dcerpc_pipe_auth_recv(struct composite_context *c, TALLOC_CTX *mem_ctx,
- struct dcerpc_pipe **p)
-{
- NTSTATUS status;
-
- struct pipe_auth_state *s = talloc_get_type(c->private_data,
- struct pipe_auth_state);
- status = composite_wait(c);
- if (!NT_STATUS_IS_OK(status)) {
- char *uuid_str = GUID_string(s->pipe, &s->table->syntax_id.uuid);
- DEBUG(0, ("Failed to bind to uuid %s - %s\n", uuid_str, nt_errstr(status)));
- talloc_free(uuid_str);
- } else {
- talloc_steal(mem_ctx, s->pipe);
- *p = s->pipe;
- }
-
- talloc_free(c);
- return status;
-}
-
-
-/*
- Perform an authenticated bind if needed - sync version
-
- This may change *p, as it rebinds to a new pipe due to authentication fallback
-*/
-_PUBLIC_ NTSTATUS dcerpc_pipe_auth(TALLOC_CTX *mem_ctx,
- struct dcerpc_pipe **p,
- struct dcerpc_binding *binding,
- const struct ndr_interface_table *table,
- struct cli_credentials *credentials,
- struct loadparm_context *lp_ctx)
-{
- struct composite_context *c;
-
- c = dcerpc_pipe_auth_send(*p, binding, table, credentials, lp_ctx);
- return dcerpc_pipe_auth_recv(c, mem_ctx, p);
-}
-
-
-NTSTATUS dcerpc_generic_session_key(struct dcerpc_connection *c,
- DATA_BLOB *session_key)
-{
- /* this took quite a few CPU cycles to find ... */
- session_key->data = discard_const_p(unsigned char, "SystemLibraryDTC");
- session_key->length = 16;
- return NT_STATUS_OK;
-}
-
-/*
- fetch the user session key - may be default (above) or the SMB session key
-*/
-_PUBLIC_ NTSTATUS dcerpc_fetch_session_key(struct dcerpc_pipe *p,
- DATA_BLOB *session_key)
-{
- return p->conn->security_state.session_key(p->conn, session_key);
-}
-
-
-/*
- log a rpc packet in a format suitable for ndrdump. This is especially useful
- for sealed packets, where ethereal cannot easily see the contents
-
- this triggers on a debug level of >= 10
-*/
-_PUBLIC_ void dcerpc_log_packet(const struct ndr_interface_table *ndr,
- uint32_t opnum, uint32_t flags,
- DATA_BLOB *pkt)
-{
- const int num_examples = 20;
- int i;
-
- if (DEBUGLEVEL < 10) return;
-
- for (i=0;i<num_examples;i++) {
- char *name=NULL;
- asprintf(&name, "%s/rpclog/%s-%u.%d.%s",
- lp_lockdir(global_loadparm), ndr->name, opnum, i,
- (flags&NDR_IN)?"in":"out");
- if (name == NULL) {
- return;
- }
- if (!file_exist(name)) {
- if (file_save(name, pkt->data, pkt->length)) {
- DEBUG(10,("Logged rpc packet to %s\n", name));
- }
- free(name);
- break;
- }
- free(name);
- }
-}
-
-
-
-/*
- create a secondary context from a primary connection
-
- this uses dcerpc_alter_context() to create a new dcerpc context_id
-*/
-_PUBLIC_ NTSTATUS dcerpc_secondary_context(struct dcerpc_pipe *p,
- struct dcerpc_pipe **pp2,
- const struct ndr_interface_table *table)
-{
- NTSTATUS status;
- struct dcerpc_pipe *p2;
-
- p2 = talloc_zero(p, struct dcerpc_pipe);
- if (p2 == NULL) {
- return NT_STATUS_NO_MEMORY;
- }
- p2->conn = talloc_reference(p2, p->conn);
- p2->request_timeout = p->request_timeout;
-
- p2->context_id = ++p->conn->next_context_id;
-
- p2->syntax = table->syntax_id;
-
- p2->transfer_syntax = ndr_transfer_syntax;
-
- p2->binding = talloc_reference(p2, p->binding);
-
- status = dcerpc_alter_context(p2, p2, &p2->syntax, &p2->transfer_syntax);
- if (!NT_STATUS_IS_OK(status)) {
- talloc_free(p2);
- return status;
- }
-
- *pp2 = p2;
-
- return NT_STATUS_OK;
-}
diff --git a/source3/librpc/tools/ndrdump.c b/source3/librpc/tools/ndrdump.c
index 08b969ae76..5b96e152bb 100644
--- a/source3/librpc/tools/ndrdump.c
+++ b/source3/librpc/tools/ndrdump.c
@@ -281,11 +281,7 @@ static const struct ndr_interface_table *load_iface_from_plugin(const char *plug
exit(1);
}
-#if (_SAMBA_BUILD_ >= 4)
- data = (uint8_t *)file_load(ctx_filename, &size, mem_ctx);
-#else
- data = (uint8_t *)file_load(ctx_filename, &size, 0);
-#endif
+ data = (uint8_t *)file_load(ctx_filename, &size, 0, mem_ctx);
if (!data) {
perror(ctx_filename);
exit(1);
@@ -312,11 +308,7 @@ static const struct ndr_interface_table *load_iface_from_plugin(const char *plug
}
if (filename)
-#if (_SAMBA_BUILD_ >= 4)
- data = (uint8_t *)file_load(filename, &size, mem_ctx);
-#else
- data = (uint8_t *)file_load(filename, &size, 0);
-#endif
+ data = (uint8_t *)file_load(filename, &size, 0, mem_ctx);
else
data = (uint8_t *)stdin_load(mem_ctx, &size);
@@ -368,7 +360,7 @@ static const struct ndr_interface_table *load_iface_from_plugin(const char *plug
uint8_t byte_a, byte_b;
bool differ;
- ndr_v_push = ndr_push_init_ctx(mem_ctx);
+ ndr_v_push = ndr_push_init_ctx(mem_ctx, NULL);
ndr_err = f->ndr_push(ndr_v_push, flags, st);
status = ndr_map_error2ntstatus(ndr_err);
diff --git a/source3/libsmb/async_smb.c b/source3/libsmb/async_smb.c
index 68495076b6..d371e057e3 100644
--- a/source3/libsmb/async_smb.c
+++ b/source3/libsmb/async_smb.c
@@ -697,7 +697,7 @@ NTSTATUS cli_pull_reply(struct async_req *req,
*/
-static NTSTATUS validate_smb_crypto(struct cli_state *cli, uint8_t *pdu)
+static NTSTATUS validate_smb_crypto(struct cli_state *cli, char *pdu)
{
NTSTATUS status;
@@ -710,7 +710,7 @@ static NTSTATUS validate_smb_crypto(struct cli_state *cli, uint8_t *pdu)
if (cli_encryption_on(cli) && CVAL(pdu, 0) == 0) {
uint16_t enc_ctx_num;
- status = get_enc_ctx_num(pdu, &enc_ctx_num);
+ status = get_enc_ctx_num((uint8_t *)pdu, &enc_ctx_num);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(10, ("get_enc_ctx_num returned %s\n",
nt_errstr(status)));
diff --git a/source3/libsmb/clidgram.c b/source3/libsmb/clidgram.c
index 611ae0870c..349a8331b4 100644
--- a/source3/libsmb/clidgram.c
+++ b/source3/libsmb/clidgram.c
@@ -249,7 +249,7 @@ bool receive_getdc_response(TALLOC_CTX *mem_ctx,
blob.data += 4;
blob.length -= 4;
- ndr_err = ndr_pull_union_blob_all(&blob, mem_ctx, &p, DGRAM_SMB,
+ ndr_err = ndr_pull_union_blob_all(&blob, mem_ctx, NULL, &p, DGRAM_SMB,
(ndr_pull_flags_fn_t)ndr_pull_dgram_smb_packet);
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
DEBUG(0,("failed to parse packet\n"));
diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c
index d3819af444..1c525363f7 100644
--- a/source3/libsmb/clifile.c
+++ b/source3/libsmb/clifile.c
@@ -1234,7 +1234,7 @@ bool cli_unlock(struct cli_state *cli, int fnum, uint32 offset, uint32 len)
****************************************************************************/
bool cli_lock64(struct cli_state *cli, int fnum,
- SMB_BIG_UINT offset, SMB_BIG_UINT len, int timeout, enum brl_type lock_type)
+ uint64_t offset, uint64_t len, int timeout, enum brl_type lock_type)
{
char *p;
int saved_timeout = cli->timeout;
@@ -1294,7 +1294,7 @@ bool cli_lock64(struct cli_state *cli, int fnum,
Unlock a file with 64 bit offsets.
****************************************************************************/
-bool cli_unlock64(struct cli_state *cli, int fnum, SMB_BIG_UINT offset, SMB_BIG_UINT len)
+bool cli_unlock64(struct cli_state *cli, int fnum, uint64_t offset, uint64_t len)
{
char *p;
@@ -1341,7 +1341,7 @@ bool cli_unlock64(struct cli_state *cli, int fnum, SMB_BIG_UINT offset, SMB_BIG_
****************************************************************************/
static bool cli_posix_lock_internal(struct cli_state *cli, int fnum,
- SMB_BIG_UINT offset, SMB_BIG_UINT len, bool wait_lock, enum brl_type lock_type)
+ uint64_t offset, uint64_t len, bool wait_lock, enum brl_type lock_type)
{
unsigned int param_len = 4;
unsigned int data_len = POSIX_LOCK_DATA_SIZE;
@@ -1412,7 +1412,7 @@ static bool cli_posix_lock_internal(struct cli_state *cli, int fnum,
****************************************************************************/
bool cli_posix_lock(struct cli_state *cli, int fnum,
- SMB_BIG_UINT offset, SMB_BIG_UINT len,
+ uint64_t offset, uint64_t len,
bool wait_lock, enum brl_type lock_type)
{
if (lock_type != READ_LOCK && lock_type != WRITE_LOCK) {
@@ -1425,7 +1425,7 @@ bool cli_posix_lock(struct cli_state *cli, int fnum,
POSIX Unlock a file.
****************************************************************************/
-bool cli_posix_unlock(struct cli_state *cli, int fnum, SMB_BIG_UINT offset, SMB_BIG_UINT len)
+bool cli_posix_unlock(struct cli_state *cli, int fnum, uint64_t offset, uint64_t len)
{
return cli_posix_lock_internal(cli, fnum, offset, len, False, UNLOCK_LOCK);
}
@@ -1434,7 +1434,7 @@ bool cli_posix_unlock(struct cli_state *cli, int fnum, SMB_BIG_UINT offset, SMB_
POSIX Get any lock covering a file.
****************************************************************************/
-bool cli_posix_getlock(struct cli_state *cli, int fnum, SMB_BIG_UINT *poffset, SMB_BIG_UINT *plen)
+bool cli_posix_getlock(struct cli_state *cli, int fnum, uint64_t *poffset, uint64_t *plen)
{
return True;
}
diff --git a/source3/libsmb/clikrb5.c b/source3/libsmb/clikrb5.c
index b8afb57977..790e8d5369 100644
--- a/source3/libsmb/clikrb5.c
+++ b/source3/libsmb/clikrb5.c
@@ -607,7 +607,7 @@ static bool ads_cleanup_expired_creds(krb5_context context,
DEBUG(3, ("ads_cleanup_expired_creds: Ticket in ccache[%s:%s] expiration %s\n",
cc_type, krb5_cc_get_name(context, ccache),
- http_timestring(credsp->times.endtime)));
+ http_timestring(talloc_tos(), credsp->times.endtime)));
/* we will probably need new tickets if the current ones
will expire within 10 seconds.
@@ -704,7 +704,7 @@ static krb5_error_code ads_krb5_mk_req(krb5_context context,
DEBUG(10,("ads_krb5_mk_req: Ticket (%s) in ccache (%s:%s) is valid until: (%s - %u)\n",
principal, krb5_cc_get_type(context, ccache), krb5_cc_get_name(context, ccache),
- http_timestring((unsigned)credsp->times.endtime),
+ http_timestring(talloc_tos(), (unsigned)credsp->times.endtime),
(unsigned)credsp->times.endtime));
if (expire_time) {
diff --git a/source3/libsmb/cliquota.c b/source3/libsmb/cliquota.c
index dcdfec241d..1462aa7a6a 100644
--- a/source3/libsmb/cliquota.c
+++ b/source3/libsmb/cliquota.c
@@ -78,10 +78,10 @@ static bool parse_user_quota_record(const char *rdata, unsigned int rdata_count,
* maybe its the change time in NTTIME
*/
- /* the used space 8 bytes (SMB_BIG_UINT)*/
- qt.usedspace = (SMB_BIG_UINT)IVAL(rdata,16);
+ /* the used space 8 bytes (uint64_t)*/
+ qt.usedspace = (uint64_t)IVAL(rdata,16);
#ifdef LARGE_SMB_OFF_T
- qt.usedspace |= (((SMB_BIG_UINT)IVAL(rdata,20)) << 32);
+ qt.usedspace |= (((uint64_t)IVAL(rdata,20)) << 32);
#else /* LARGE_SMB_OFF_T */
if ((IVAL(rdata,20) != 0)&&
((qt.usedspace != 0xFFFFFFFF)||
@@ -91,10 +91,10 @@ static bool parse_user_quota_record(const char *rdata, unsigned int rdata_count,
}
#endif /* LARGE_SMB_OFF_T */
- /* the soft quotas 8 bytes (SMB_BIG_UINT)*/
- qt.softlim = (SMB_BIG_UINT)IVAL(rdata,24);
+ /* the soft quotas 8 bytes (uint64_t)*/
+ qt.softlim = (uint64_t)IVAL(rdata,24);
#ifdef LARGE_SMB_OFF_T
- qt.softlim |= (((SMB_BIG_UINT)IVAL(rdata,28)) << 32);
+ qt.softlim |= (((uint64_t)IVAL(rdata,28)) << 32);
#else /* LARGE_SMB_OFF_T */
if ((IVAL(rdata,28) != 0)&&
((qt.softlim != 0xFFFFFFFF)||
@@ -104,10 +104,10 @@ static bool parse_user_quota_record(const char *rdata, unsigned int rdata_count,
}
#endif /* LARGE_SMB_OFF_T */
- /* the hard quotas 8 bytes (SMB_BIG_UINT)*/
- qt.hardlim = (SMB_BIG_UINT)IVAL(rdata,32);
+ /* the hard quotas 8 bytes (uint64_t)*/
+ qt.hardlim = (uint64_t)IVAL(rdata,32);
#ifdef LARGE_SMB_OFF_T
- qt.hardlim |= (((SMB_BIG_UINT)IVAL(rdata,36)) << 32);
+ qt.hardlim |= (((uint64_t)IVAL(rdata,36)) << 32);
#else /* LARGE_SMB_OFF_T */
if ((IVAL(rdata,36) != 0)&&
((qt.hardlim != 0xFFFFFFFF)||
@@ -216,7 +216,7 @@ bool cli_set_user_quota(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_STRUC
sid_len = ndr_size_dom_sid(&pqt->sid, 0);
SIVAL(data,0,0);
SIVAL(data,4,sid_len);
- SBIG_UINT(data, 8,(SMB_BIG_UINT)0);
+ SBIG_UINT(data, 8,(uint64_t)0);
SBIG_UINT(data,16,pqt->usedspace);
SBIG_UINT(data,24,pqt->softlim);
SBIG_UINT(data,32,pqt->hardlim);
@@ -458,10 +458,10 @@ bool cli_get_fs_quota_info(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_ST
/* unknown_1 24 NULL bytes in pdata*/
- /* the soft quotas 8 bytes (SMB_BIG_UINT)*/
- qt.softlim = (SMB_BIG_UINT)IVAL(rdata,24);
+ /* the soft quotas 8 bytes (uint64_t)*/
+ qt.softlim = (uint64_t)IVAL(rdata,24);
#ifdef LARGE_SMB_OFF_T
- qt.softlim |= (((SMB_BIG_UINT)IVAL(rdata,28)) << 32);
+ qt.softlim |= (((uint64_t)IVAL(rdata,28)) << 32);
#else /* LARGE_SMB_OFF_T */
if ((IVAL(rdata,28) != 0)&&
((qt.softlim != 0xFFFFFFFF)||
@@ -471,10 +471,10 @@ bool cli_get_fs_quota_info(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_ST
}
#endif /* LARGE_SMB_OFF_T */
- /* the hard quotas 8 bytes (SMB_BIG_UINT)*/
- qt.hardlim = (SMB_BIG_UINT)IVAL(rdata,32);
+ /* the hard quotas 8 bytes (uint64_t)*/
+ qt.hardlim = (uint64_t)IVAL(rdata,32);
#ifdef LARGE_SMB_OFF_T
- qt.hardlim |= (((SMB_BIG_UINT)IVAL(rdata,36)) << 32);
+ qt.hardlim |= (((uint64_t)IVAL(rdata,36)) << 32);
#else /* LARGE_SMB_OFF_T */
if ((IVAL(rdata,36) != 0)&&
((qt.hardlim != 0xFFFFFFFF)||
@@ -562,18 +562,14 @@ cleanup:
return ret;
}
-static const char *quota_str_static(SMB_BIG_UINT val, bool special, bool _numeric)
+static const char *quota_str_static(uint64_t val, bool special, bool _numeric)
{
const char *result;
if (!_numeric&&special&&(val == SMB_NTQUOTAS_NO_LIMIT)) {
return "NO LIMIT";
}
-#if defined(HAVE_LONGLONG)
- result = talloc_asprintf(talloc_tos(), "%llu", val);
-#else
- result = talloc_asprintf(talloc_tos(), "%lu", val);
-#endif
+ result = talloc_asprintf(talloc_tos(), "%"PRIu64, val);
SMB_ASSERT(result != NULL);
return result;
}
diff --git a/source3/libsmb/clireadwrite.c b/source3/libsmb/clireadwrite.c
index ec63281630..cc982683d0 100644
--- a/source3/libsmb/clireadwrite.c
+++ b/source3/libsmb/clireadwrite.c
@@ -70,10 +70,10 @@ struct async_req *cli_read_andx_send(TALLOC_CTX *mem_ctx,
SSVAL(vwv + 8, 0, 0);
SSVAL(vwv + 9, 0, 0);
- if ((SMB_BIG_UINT)offset >> 32) {
+ if ((uint64_t)offset >> 32) {
bigoffset = True;
SIVAL(vwv + 10, 0,
- (((SMB_BIG_UINT)offset)>>32) & 0xffffffff);
+ (((uint64_t)offset)>>32) & 0xffffffff);
wct += 2;
}
@@ -543,7 +543,7 @@ static bool cli_issue_write(struct cli_state *cli,
smb_buf(cli->outbuf) - smb_base(cli->outbuf) + 1);
if (large_writex) {
- SIVAL(cli->outbuf,smb_vwv12,(((SMB_BIG_UINT)offset)>>32) & 0xffffffff);
+ SIVAL(cli->outbuf,smb_vwv12,(((uint64_t)offset)>>32) & 0xffffffff);
}
p = smb_base(cli->outbuf) + SVAL(cli->outbuf,smb_vwv11) -1;
diff --git a/source3/libsmb/ntlmssp_sign.c b/source3/libsmb/ntlmssp_sign.c
index 1abdf61b7f..d3d358d332 100644
--- a/source3/libsmb/ntlmssp_sign.c
+++ b/source3/libsmb/ntlmssp_sign.c
@@ -35,6 +35,12 @@
*
*/
+static void dump_arc4_state(const char *description,
+ struct arcfour_state *state)
+{
+ dump_data_pw(description, state->sbox, sizeof(state->sbox));
+}
+
static void calc_ntlmv2_key(unsigned char subkey[16],
DATA_BLOB session_key,
const char *constant)
@@ -101,10 +107,10 @@ static NTSTATUS ntlmssp_make_packet_signature(NTLMSSP_STATE *ntlmssp_state,
if (encrypt_sig && (ntlmssp_state->neg_flags & NTLMSSP_NEGOTIATE_KEY_EXCH)) {
switch (direction) {
case NTLMSSP_SEND:
- smb_arc4_crypt(ntlmssp_state->send_seal_arc4_state, digest, 8);
+ arcfour_crypt_sbox(&ntlmssp_state->send_seal_arc4_state, digest, 8);
break;
case NTLMSSP_RECEIVE:
- smb_arc4_crypt(ntlmssp_state->recv_seal_arc4_state, digest, 8);
+ arcfour_crypt_sbox(&ntlmssp_state->recv_seal_arc4_state, digest, 8);
break;
}
}
@@ -124,9 +130,8 @@ static NTSTATUS ntlmssp_make_packet_signature(NTLMSSP_STATE *ntlmssp_state,
ntlmssp_state->ntlmv1_seq_num++;
- dump_data_pw("ntlmssp hash:\n", ntlmssp_state->ntlmv1_arc4_state,
- sizeof(ntlmssp_state->ntlmv1_arc4_state));
- smb_arc4_crypt(ntlmssp_state->ntlmv1_arc4_state, sig->data+4, sig->length-4);
+ dump_arc4_state("ntlmssp hash: \n", &ntlmssp_state->ntlmv1_arc4_state);
+ arcfour_crypt_sbox(&ntlmssp_state->ntlmv1_arc4_state, sig->data+4, sig->length-4);
}
return NT_STATUS_OK;
}
@@ -259,9 +264,9 @@ NTSTATUS ntlmssp_seal_packet(NTLMSSP_STATE *ntlmssp_state,
return nt_status;
}
- smb_arc4_crypt(ntlmssp_state->send_seal_arc4_state, data, length);
+ arcfour_crypt_sbox(&ntlmssp_state->send_seal_arc4_state, data, length);
if (ntlmssp_state->neg_flags & NTLMSSP_NEGOTIATE_KEY_EXCH) {
- smb_arc4_crypt(ntlmssp_state->send_seal_arc4_state, sig->data+4, 8);
+ arcfour_crypt_sbox(&ntlmssp_state->send_seal_arc4_state, sig->data+4, 8);
}
} else {
uint32 crc;
@@ -274,14 +279,14 @@ NTSTATUS ntlmssp_seal_packet(NTLMSSP_STATE *ntlmssp_state,
then seal the sequence number - this is becouse the ntlmv1_arc4_state is not
constant, but is is rather updated with each iteration */
- dump_data_pw("ntlmv1 arc4 state:\n", ntlmssp_state->ntlmv1_arc4_state,
- sizeof(ntlmssp_state->ntlmv1_arc4_state));
- smb_arc4_crypt(ntlmssp_state->ntlmv1_arc4_state, data, length);
+ dump_arc4_state("ntlmv1 arc4 state:\n",
+ &ntlmssp_state->ntlmv1_arc4_state);
+ arcfour_crypt_sbox(&ntlmssp_state->ntlmv1_arc4_state, data, length);
- dump_data_pw("ntlmv1 arc4 state:\n", ntlmssp_state->ntlmv1_arc4_state,
- sizeof(ntlmssp_state->ntlmv1_arc4_state));
+ dump_arc4_state("ntlmv1 arc4 state:\n",
+ &ntlmssp_state->ntlmv1_arc4_state);
- smb_arc4_crypt(ntlmssp_state->ntlmv1_arc4_state, sig->data+4, sig->length-4);
+ arcfour_crypt_sbox(&ntlmssp_state->ntlmv1_arc4_state, sig->data+4, sig->length-4);
ntlmssp_state->ntlmv1_seq_num++;
}
@@ -311,10 +316,10 @@ NTSTATUS ntlmssp_unseal_packet(NTLMSSP_STATE *ntlmssp_state,
if (ntlmssp_state->neg_flags & NTLMSSP_NEGOTIATE_NTLM2) {
/* First unseal the data. */
- smb_arc4_crypt(ntlmssp_state->recv_seal_arc4_state, data, length);
+ arcfour_crypt_sbox(&ntlmssp_state->recv_seal_arc4_state, data, length);
dump_data_pw("ntlmv2 clear data\n", data, length);
} else {
- smb_arc4_crypt(ntlmssp_state->ntlmv1_arc4_state, data, length);
+ arcfour_crypt_sbox(&ntlmssp_state->ntlmv1_arc4_state, data, length);
dump_data_pw("ntlmv1 clear data\n", data, length);
}
return ntlmssp_check_packet(ntlmssp_state, data, length, whole_pdu, pdu_length, sig);
@@ -349,6 +354,7 @@ NTSTATUS ntlmssp_sign_init(NTLMSSP_STATE *ntlmssp_state)
const char *send_seal_const;
const char *recv_sign_const;
const char *recv_seal_const;
+ DATA_BLOB send_seal_key_blob, recv_seal_blob;
switch (ntlmssp_state->role) {
case NTLMSSP_CLIENT:
@@ -397,12 +403,13 @@ NTSTATUS ntlmssp_sign_init(NTLMSSP_STATE *ntlmssp_state)
dump_data_pw("NTLMSSP send seal key:\n",
ntlmssp_state->send_seal_key, 16);
- smb_arc4_init(ntlmssp_state->send_seal_arc4_state,
- ntlmssp_state->send_seal_key, 16);
+ send_seal_key_blob.data = ntlmssp_state->send_seal_key;
+ send_seal_key_blob.length = 16;
+ arcfour_init(&ntlmssp_state->send_seal_arc4_state,
+ &send_seal_key_blob);
- dump_data_pw("NTLMSSP send seal arc4 state:\n",
- ntlmssp_state->send_seal_arc4_state,
- sizeof(ntlmssp_state->send_seal_arc4_state));
+ dump_arc4_state("NTLMSSP send seal arc4 state:\n",
+ &ntlmssp_state->send_seal_arc4_state);
/* RECV: sign key */
calc_ntlmv2_key(ntlmssp_state->recv_sign_key,
@@ -417,12 +424,13 @@ NTSTATUS ntlmssp_sign_init(NTLMSSP_STATE *ntlmssp_state)
dump_data_pw("NTLMSSP recv seal key:\n",
ntlmssp_state->recv_seal_key, 16);
- smb_arc4_init(ntlmssp_state->recv_seal_arc4_state,
- ntlmssp_state->recv_seal_key, 16);
+ recv_seal_blob.data = ntlmssp_state->recv_seal_key;
+ recv_seal_blob.length = 16;
+ arcfour_init(&ntlmssp_state->recv_seal_arc4_state,
+ &recv_seal_blob);
- dump_data_pw("NTLMSSP recv seal arc4 state:\n",
- ntlmssp_state->recv_seal_arc4_state,
- sizeof(ntlmssp_state->recv_seal_arc4_state));
+ dump_arc4_state("NTLMSSP recv seal arc4 state:\n",
+ &ntlmssp_state->recv_seal_arc4_state);
ntlmssp_state->ntlm2_send_seq_num = 0;
ntlmssp_state->ntlm2_recv_seq_num = 0;
@@ -454,11 +462,11 @@ NTSTATUS ntlmssp_sign_init(NTLMSSP_STATE *ntlmssp_state)
DEBUG(5, ("NTLMSSP Sign/Seal - using NTLM1\n"));
- smb_arc4_init(ntlmssp_state->ntlmv1_arc4_state,
- weak_session_key.data, weak_session_key.length);
+ arcfour_init(&ntlmssp_state->ntlmv1_arc4_state,
+ &weak_session_key);
- dump_data_pw("NTLMv1 arc4 state:\n", ntlmssp_state->ntlmv1_arc4_state,
- sizeof(ntlmssp_state->ntlmv1_arc4_state));
+ dump_arc4_state("NTLMv1 arc4 state:\n",
+ &ntlmssp_state->ntlmv1_arc4_state);
ntlmssp_state->ntlmv1_seq_num = 0;
}
diff --git a/source3/libsmb/smbdes.c b/source3/libsmb/smbdes.c
index 98d5cd05b7..8087d66799 100644
--- a/source3/libsmb/smbdes.c
+++ b/source3/libsmb/smbdes.c
@@ -388,18 +388,19 @@ void des_crypt112_16(unsigned char out[16], unsigned char in[16], const unsigned
void SamOEMhash( unsigned char *data, const unsigned char key[16], size_t len)
{
- unsigned char arc4_state[258];
+ struct arcfour_state arc4_state;
+ const DATA_BLOB keyblob = data_blob_const(key, 16);
- smb_arc4_init(arc4_state, key, 16);
- smb_arc4_crypt(arc4_state, data, len);
+ arcfour_init(&arc4_state, &keyblob);
+ arcfour_crypt_sbox(&arc4_state, data, len);
}
void SamOEMhashBlob( unsigned char *data, size_t len, DATA_BLOB *key)
{
- unsigned char arc4_state[258];
+ struct arcfour_state arc4_state;
- smb_arc4_init(arc4_state, key->data, key->length);
- smb_arc4_crypt(arc4_state, data, len);
+ arcfour_init(&arc4_state, key);
+ arcfour_crypt_sbox(&arc4_state, data, len);
}
/* Decode a sam password hash into a password. The password hash is the
diff --git a/source3/libsmb/smbencrypt.c b/source3/libsmb/smbencrypt.c
index 05fd808a32..ee162b1b2d 100644
--- a/source3/libsmb/smbencrypt.c
+++ b/source3/libsmb/smbencrypt.c
@@ -22,7 +22,7 @@
*/
#include "includes.h"
-#include "byteorder.h"
+#include "../lib/util/byteorder.h"
void SMBencrypt_hash(const uchar lm_hash[16], const uchar *c8, uchar p24[24])
{
diff --git a/source3/libsmb/trusts_util.c b/source3/libsmb/trusts_util.c
index 2f336f14e6..f0595695d2 100644
--- a/source3/libsmb/trusts_util.c
+++ b/source3/libsmb/trusts_util.c
@@ -33,13 +33,12 @@ NTSTATUS trust_pw_change_and_store_it(struct rpc_pipe_client *cli, TALLOC_CTX *m
{
unsigned char new_trust_passwd_hash[16];
char *new_trust_passwd;
- char *str;
NTSTATUS nt_status;
/* Create a random machine account password */
- str = generate_random_str(DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH);
+ new_trust_passwd = generate_random_str(mem_ctx, DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH);
- if ((new_trust_passwd = talloc_strdup(mem_ctx, str)) == NULL) {
+ if (new_trust_passwd == NULL) {
DEBUG(0, ("talloc_strdup failed\n"));
return NT_STATUS_NO_MEMORY;
}
diff --git a/source3/locking/locking.c b/source3/locking/locking.c
index 368ab1687c..33717f1bb9 100644
--- a/source3/locking/locking.c
+++ b/source3/locking/locking.c
@@ -77,8 +77,8 @@ const char *lock_flav_name(enum brl_flavour lock_flav)
bool is_locked(files_struct *fsp,
uint32 smbpid,
- SMB_BIG_UINT count,
- SMB_BIG_UINT offset,
+ uint64_t count,
+ uint64_t offset,
enum brl_type lock_type)
{
int strict_locking = lp_strict_locking(fsp->conn->params);
@@ -144,8 +144,8 @@ bool is_locked(files_struct *fsp,
NTSTATUS query_lock(files_struct *fsp,
uint32 *psmbpid,
- SMB_BIG_UINT *pcount,
- SMB_BIG_UINT *poffset,
+ uint64_t *pcount,
+ uint64_t *poffset,
enum brl_type *plock_type,
enum brl_flavour lock_flav)
{
@@ -184,8 +184,8 @@ NTSTATUS query_lock(files_struct *fsp,
struct byte_range_lock *do_lock(struct messaging_context *msg_ctx,
files_struct *fsp,
uint32 lock_pid,
- SMB_BIG_UINT count,
- SMB_BIG_UINT offset,
+ uint64_t count,
+ uint64_t offset,
enum brl_type lock_type,
enum brl_flavour lock_flav,
bool blocking_lock,
@@ -251,8 +251,8 @@ struct byte_range_lock *do_lock(struct messaging_context *msg_ctx,
NTSTATUS do_unlock(struct messaging_context *msg_ctx,
files_struct *fsp,
uint32 lock_pid,
- SMB_BIG_UINT count,
- SMB_BIG_UINT offset,
+ uint64_t count,
+ uint64_t offset,
enum brl_flavour lock_flav)
{
bool ok = False;
@@ -304,8 +304,8 @@ NTSTATUS do_unlock(struct messaging_context *msg_ctx,
NTSTATUS do_lock_cancel(files_struct *fsp,
uint32 lock_pid,
- SMB_BIG_UINT count,
- SMB_BIG_UINT offset,
+ uint64_t count,
+ uint64_t offset,
enum brl_flavour lock_flav)
{
bool ok = False;
diff --git a/source3/locking/posix.c b/source3/locking/posix.c
index 32e1ee9fbf..c036ee597c 100644
--- a/source3/locking/posix.c
+++ b/source3/locking/posix.c
@@ -79,7 +79,7 @@ static const char *posix_lock_type_name(int lock_type)
****************************************************************************/
static bool posix_lock_in_range(SMB_OFF_T *offset_out, SMB_OFF_T *count_out,
- SMB_BIG_UINT u_offset, SMB_BIG_UINT u_count)
+ uint64_t u_offset, uint64_t u_count)
{
SMB_OFF_T offset = (SMB_OFF_T)u_offset;
SMB_OFF_T count = (SMB_OFF_T)u_count;
@@ -132,9 +132,9 @@ static bool posix_lock_in_range(SMB_OFF_T *offset_out, SMB_OFF_T *count_out,
* ignore this lock.
*/
- if (u_offset & ~((SMB_BIG_UINT)max_positive_lock_offset)) {
+ if (u_offset & ~((uint64_t)max_positive_lock_offset)) {
DEBUG(10,("posix_lock_in_range: (offset = %.0f) offset > %.0f and we cannot handle this. Ignoring lock.\n",
- (double)u_offset, (double)((SMB_BIG_UINT)max_positive_lock_offset) ));
+ (double)u_offset, (double)((uint64_t)max_positive_lock_offset) ));
return False;
}
@@ -142,7 +142,7 @@ static bool posix_lock_in_range(SMB_OFF_T *offset_out, SMB_OFF_T *count_out,
* We must truncate the count to less than max_positive_lock_offset.
*/
- if (u_count & ~((SMB_BIG_UINT)max_positive_lock_offset)) {
+ if (u_count & ~((uint64_t)max_positive_lock_offset)) {
count = max_positive_lock_offset;
}
@@ -271,8 +271,8 @@ static bool posix_fcntl_getlock(files_struct *fsp, SMB_OFF_T *poffset, SMB_OFF_T
****************************************************************************/
bool is_posix_locked(files_struct *fsp,
- SMB_BIG_UINT *pu_offset,
- SMB_BIG_UINT *pu_count,
+ uint64_t *pu_offset,
+ uint64_t *pu_count,
enum brl_type *plock_type,
enum brl_flavour lock_flav)
{
@@ -302,8 +302,8 @@ bool is_posix_locked(files_struct *fsp,
if (lock_flav == POSIX_LOCK) {
/* Only POSIX lock queries need to know the details. */
- *pu_offset = (SMB_BIG_UINT)offset;
- *pu_count = (SMB_BIG_UINT)count;
+ *pu_offset = (uint64_t)offset;
+ *pu_count = (uint64_t)count;
*plock_type = (posix_lock_type == F_RDLCK) ? READ_LOCK : WRITE_LOCK;
}
return True;
@@ -929,8 +929,8 @@ lock: start = %.0f, size = %.0f", (double)l_curr->start, (double)l_curr->size, (
****************************************************************************/
bool set_posix_lock_windows_flavour(files_struct *fsp,
- SMB_BIG_UINT u_offset,
- SMB_BIG_UINT u_count,
+ uint64_t u_offset,
+ uint64_t u_count,
enum brl_type lock_type,
const struct lock_context *lock_ctx,
const struct lock_struct *plocks,
@@ -1066,8 +1066,8 @@ bool set_posix_lock_windows_flavour(files_struct *fsp,
****************************************************************************/
bool release_posix_lock_windows_flavour(files_struct *fsp,
- SMB_BIG_UINT u_offset,
- SMB_BIG_UINT u_count,
+ uint64_t u_offset,
+ uint64_t u_count,
enum brl_type deleted_lock_type,
const struct lock_context *lock_ctx,
const struct lock_struct *plocks,
@@ -1189,8 +1189,8 @@ bool release_posix_lock_windows_flavour(files_struct *fsp,
****************************************************************************/
bool set_posix_lock_posix_flavour(files_struct *fsp,
- SMB_BIG_UINT u_offset,
- SMB_BIG_UINT u_count,
+ uint64_t u_offset,
+ uint64_t u_count,
enum brl_type lock_type,
int *errno_ret)
{
@@ -1229,8 +1229,8 @@ bool set_posix_lock_posix_flavour(files_struct *fsp,
****************************************************************************/
bool release_posix_lock_posix_flavour(files_struct *fsp,
- SMB_BIG_UINT u_offset,
- SMB_BIG_UINT u_count,
+ uint64_t u_offset,
+ uint64_t u_count,
const struct lock_context *lock_ctx,
const struct lock_struct *plocks,
int num_locks)
diff --git a/source3/modules/vfs_cap.c b/source3/modules/vfs_cap.c
index 79537367d6..6950ab2168 100644
--- a/source3/modules/vfs_cap.c
+++ b/source3/modules/vfs_cap.c
@@ -28,15 +28,15 @@
static char *capencode(TALLOC_CTX *ctx, const char *from);
static char *capdecode(TALLOC_CTX *ctx, const char *from);
-static SMB_BIG_UINT cap_disk_free(vfs_handle_struct *handle, const char *path,
- bool small_query, SMB_BIG_UINT *bsize,
- SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
+static uint64_t cap_disk_free(vfs_handle_struct *handle, const char *path,
+ bool small_query, uint64_t *bsize,
+ uint64_t *dfree, uint64_t *dsize)
{
char *cappath = capencode(talloc_tos(), path);
if (!cappath) {
errno = ENOMEM;
- return (SMB_BIG_UINT)-1;
+ return (uint64_t)-1;
}
return SMB_VFS_NEXT_DISK_FREE(handle, cappath, small_query, bsize,
dfree, dsize);
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 372cdf2d53..275c2f53c4 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -40,10 +40,10 @@ static void vfswrap_disconnect(vfs_handle_struct *handle)
/* Disk operations */
-static SMB_BIG_UINT vfswrap_disk_free(vfs_handle_struct *handle, const char *path, bool small_query, SMB_BIG_UINT *bsize,
- SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
+static uint64_t vfswrap_disk_free(vfs_handle_struct *handle, const char *path, bool small_query, uint64_t *bsize,
+ uint64_t *dfree, uint64_t *dsize)
{
- SMB_BIG_UINT result;
+ uint64_t result;
result = sys_disk_free(handle->conn, path, small_query, bsize, dfree, dsize);
return result;
diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c
index 9fadcd9e0c..6342c4a14e 100644
--- a/source3/modules/vfs_full_audit.c
+++ b/source3/modules/vfs_full_audit.c
@@ -74,10 +74,10 @@ struct vfs_full_audit_private_data {
static int smb_full_audit_connect(vfs_handle_struct *handle,
const char *svc, const char *user);
static void smb_full_audit_disconnect(vfs_handle_struct *handle);
-static SMB_BIG_UINT smb_full_audit_disk_free(vfs_handle_struct *handle,
+static uint64_t smb_full_audit_disk_free(vfs_handle_struct *handle,
const char *path,
- bool small_query, SMB_BIG_UINT *bsize,
- SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize);
+ bool small_query, uint64_t *bsize,
+ uint64_t *dfree, uint64_t *dsize);
static int smb_full_audit_get_quota(struct vfs_handle_struct *handle,
enum SMB_QUOTA_TYPE qtype, unid_t id,
SMB_DISK_QUOTA *qt);
@@ -910,12 +910,12 @@ static void smb_full_audit_disconnect(vfs_handle_struct *handle)
return;
}
-static SMB_BIG_UINT smb_full_audit_disk_free(vfs_handle_struct *handle,
+static uint64_t smb_full_audit_disk_free(vfs_handle_struct *handle,
const char *path,
- bool small_query, SMB_BIG_UINT *bsize,
- SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
+ bool small_query, uint64_t *bsize,
+ uint64_t *dfree, uint64_t *dsize)
{
- SMB_BIG_UINT result;
+ uint64_t result;
result = SMB_VFS_NEXT_DISK_FREE(handle, path, small_query, bsize,
dfree, dsize);
diff --git a/source3/modules/vfs_smb_traffic_analyzer.c b/source3/modules/vfs_smb_traffic_analyzer.c
index 9b4c1b3e25..9456afb811 100644
--- a/source3/modules/vfs_smb_traffic_analyzer.c
+++ b/source3/modules/vfs_smb_traffic_analyzer.c
@@ -42,6 +42,7 @@ static enum sock_type smb_traffic_analyzer_connMode(vfs_handle_struct *handle)
}
}
+
/* Connect to an internet socket */
static int smb_traffic_analyzer_connect_inet_socket(vfs_handle_struct *handle,
@@ -160,6 +161,8 @@ static void smb_traffic_analyzer_send_data(vfs_handle_struct *handle,
struct tm *tm = NULL;
int seconds;
char *str = NULL;
+ char *username = NULL;
+ const char *anon_prefix = NULL;
size_t len;
SMB_VFS_HANDLE_GET_DATA(handle, rf_sock, struct refcounted_sock, return);
@@ -178,11 +181,29 @@ static void smb_traffic_analyzer_send_data(vfs_handle_struct *handle,
}
seconds=(float) (tv.tv_usec / 1000);
+ /* check if anonymization is required */
+
+ anon_prefix=lp_parm_const_string(SNUM(handle->conn),"smb_traffic_analyzer",\
+ "anonymize_prefix", NULL );
+ if (anon_prefix!=NULL) {
+ username = talloc_asprintf(talloc_tos(),
+ "%s%i",
+ anon_prefix,
+ str_checksum(
+ handle->conn->server_info->sanitized_username ) );
+ } else {
+ username = handle->conn->server_info->sanitized_username;
+ }
+
+ if (!username) {
+ return;
+ }
+
str = talloc_asprintf(talloc_tos(),
"V1,%u,\"%s\",\"%s\",\"%c\",\"%s\",\"%s\","
"\"%04d-%02d-%02d %02d:%02d:%02d.%03d\"\n",
(unsigned int)result,
- handle->conn->server_info->sanitized_username,
+ username,
pdb_get_domain(handle->conn->server_info->sam_account),
Write ? 'W' : 'R',
handle->conn->connectpath,
diff --git a/source3/modules/vfs_xattr_tdb.c b/source3/modules/vfs_xattr_tdb.c
index c707a1828f..8320a5820a 100644
--- a/source3/modules/vfs_xattr_tdb.c
+++ b/source3/modules/vfs_xattr_tdb.c
@@ -177,25 +177,25 @@ static ssize_t xattr_tdb_getattr(struct db_context *db_ctx,
return -1;
}
- for (i=0; i<attribs->num_xattrs; i++) {
- if (strcmp(attribs->xattrs[i].name, name) == 0) {
+ for (i=0; i<attribs->num_eas; i++) {
+ if (strcmp(attribs->eas[i].name, name) == 0) {
break;
}
}
- if (i == attribs->num_xattrs) {
+ if (i == attribs->num_eas) {
errno = ENOATTR;
goto fail;
}
- if (attribs->xattrs[i].value.length > size) {
+ if (attribs->eas[i].value.length > size) {
errno = ERANGE;
goto fail;
}
- memcpy(value, attribs->xattrs[i].value.data,
- attribs->xattrs[i].value.length);
- result = attribs->xattrs[i].value.length;
+ memcpy(value, attribs->eas[i].value.data,
+ attribs->eas[i].value.length);
+ result = attribs->eas[i].value.length;
fail:
TALLOC_FREE(attribs);
@@ -273,8 +273,8 @@ static int xattr_tdb_setattr(struct db_context *db_ctx,
return -1;
}
- for (i=0; i<attribs->num_xattrs; i++) {
- if (strcmp(attribs->xattrs[i].name, name) == 0) {
+ for (i=0; i<attribs->num_eas; i++) {
+ if (strcmp(attribs->eas[i].name, name) == 0) {
if (flags & XATTR_CREATE) {
TALLOC_FREE(rec);
errno = EEXIST;
@@ -284,8 +284,8 @@ static int xattr_tdb_setattr(struct db_context *db_ctx,
}
}
- if (i == attribs->num_xattrs) {
- struct tdb_xattr *tmp;
+ if (i == attribs->num_eas) {
+ struct xattr_EA *tmp;
if (flags & XATTR_REPLACE) {
TALLOC_FREE(rec);
@@ -294,8 +294,8 @@ static int xattr_tdb_setattr(struct db_context *db_ctx,
}
tmp = TALLOC_REALLOC_ARRAY(
- attribs, attribs->xattrs, struct tdb_xattr,
- attribs->num_xattrs + 1);
+ attribs, attribs->eas, struct xattr_EA,
+ attribs->num_eas+ 1);
if (tmp == NULL) {
DEBUG(0, ("TALLOC_REALLOC_ARRAY failed\n"));
@@ -304,13 +304,13 @@ static int xattr_tdb_setattr(struct db_context *db_ctx,
return -1;
}
- attribs->xattrs = tmp;
- attribs->num_xattrs += 1;
+ attribs->eas = tmp;
+ attribs->num_eas += 1;
}
- attribs->xattrs[i].name = name;
- attribs->xattrs[i].value.data = CONST_DISCARD(uint8 *, value);
- attribs->xattrs[i].value.length = size;
+ attribs->eas[i].name = name;
+ attribs->eas[i].value.data = CONST_DISCARD(uint8 *, value);
+ attribs->eas[i].value.length = size;
status = xattr_tdb_save_attrs(rec, attribs);
@@ -386,15 +386,15 @@ static ssize_t xattr_tdb_listattr(struct db_context *db_ctx,
}
DEBUG(10, ("xattr_tdb_listattr: Found %d xattrs\n",
- attribs->num_xattrs));
+ attribs->num_eas));
- for (i=0; i<attribs->num_xattrs; i++) {
+ for (i=0; i<attribs->num_eas; i++) {
size_t tmp;
DEBUG(10, ("xattr_tdb_listattr: xattrs[i].name: %s\n",
- attribs->xattrs[i].name));
+ attribs->eas[i].name));
- tmp = strlen(attribs->xattrs[i].name);
+ tmp = strlen(attribs->eas[i].name);
/*
* Try to protect against overflow
@@ -420,10 +420,10 @@ static ssize_t xattr_tdb_listattr(struct db_context *db_ctx,
len = 0;
- for (i=0; i<attribs->num_xattrs; i++) {
- strlcpy(list+len, attribs->xattrs[i].name,
+ for (i=0; i<attribs->num_eas; i++) {
+ strlcpy(list+len, attribs->eas[i].name,
size-len);
- len += (strlen(attribs->xattrs[i].name) + 1);
+ len += (strlen(attribs->eas[i].name) + 1);
}
TALLOC_FREE(attribs);
@@ -496,23 +496,23 @@ static int xattr_tdb_removeattr(struct db_context *db_ctx,
return -1;
}
- for (i=0; i<attribs->num_xattrs; i++) {
- if (strcmp(attribs->xattrs[i].name, name) == 0) {
+ for (i=0; i<attribs->num_eas; i++) {
+ if (strcmp(attribs->eas[i].name, name) == 0) {
break;
}
}
- if (i == attribs->num_xattrs) {
+ if (i == attribs->num_eas) {
TALLOC_FREE(rec);
errno = ENOATTR;
return -1;
}
- attribs->xattrs[i] =
- attribs->xattrs[attribs->num_xattrs-1];
- attribs->num_xattrs -= 1;
+ attribs->eas[i] =
+ attribs->eas[attribs->num_eas-1];
+ attribs->num_eas -= 1;
- if (attribs->num_xattrs == 0) {
+ if (attribs->num_eas == 0) {
rec->delete_rec(rec);
TALLOC_FREE(rec);
return 0;
diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c
index d9f2af4c10..28de212d69 100644
--- a/source3/nmbd/nmbd.c
+++ b/source3/nmbd/nmbd.c
@@ -332,7 +332,7 @@ static bool reload_nmbd_services(bool test)
if ( lp_loaded() ) {
const char *fname = lp_configfile();
- if (file_exist(fname,NULL) && !strcsequal(fname,get_dyn_CONFIGFILE())) {
+ if (file_exist(fname) && !strcsequal(fname,get_dyn_CONFIGFILE())) {
set_dyn_CONFIGFILE(fname);
test = False;
}
@@ -905,7 +905,7 @@ static bool open_sockets(bool isdaemon, int port)
}
#endif
- if (!directory_exist(lp_lockdir(), NULL)) {
+ if (!directory_exist(lp_lockdir())) {
mkdir(lp_lockdir(), 0755);
}
diff --git a/source3/nmbd/nmbd_processlogon.c b/source3/nmbd/nmbd_processlogon.c
index 814eaf7ca8..9ee0709cb5 100644
--- a/source3/nmbd/nmbd_processlogon.c
+++ b/source3/nmbd/nmbd_processlogon.c
@@ -442,7 +442,7 @@ reporting %s domain %s 0x%x ntversion=%x lm_nt token=%x lm_20 token=%x\n",
("get_mydnsdomname failed.\n"));
return;
}
- hostname = get_myname(talloc_tos());
+ hostname = talloc_get_myname(talloc_tos());
if (!hostname) {
DEBUG(2,
("get_myname failed.\n"));
diff --git a/source3/nmbd/nmbd_winsserver.c b/source3/nmbd/nmbd_winsserver.c
index 96938b011a..5ee6e83138 100644
--- a/source3/nmbd/nmbd_winsserver.c
+++ b/source3/nmbd/nmbd_winsserver.c
@@ -124,7 +124,7 @@ static struct name_record *wins_record_to_name_record(TDB_DATA key, TDB_DATA dat
namerec->data.refresh_time = (time_t)refresh_time;
namerec->data.id = id_low;
#if defined(HAVE_LONGLONG)
- namerec->data.id |= ((SMB_BIG_UINT)id_high << 32);
+ namerec->data.id |= ((uint64_t)id_high << 32);
#endif
namerec->data.wins_ip.s_addr = saddr;
namerec->data.wins_flags = wins_flags,
@@ -412,14 +412,14 @@ static void update_wins_flag(struct name_record *namerec, int flags)
Return the general ID value and increase it if requested.
*****************************************************************************/
-static void get_global_id_and_update(SMB_BIG_UINT *current_id, bool update)
+static void get_global_id_and_update(uint64_t *current_id, bool update)
{
/*
* it's kept as a static here, to prevent people from messing
* with the value directly
*/
- static SMB_BIG_UINT general_id = 1;
+ static uint64_t general_id = 1;
DEBUG(5,("get_global_id_and_update: updating version ID: %d\n", (int)general_id));
diff --git a/source3/nsswitch/winbind_nss_irix.c b/source3/nsswitch/winbind_nss_irix.c
index 4726c1e13f..5bc0fa54da 100644
--- a/source3/nsswitch/winbind_nss_irix.c
+++ b/source3/nsswitch/winbind_nss_irix.c
@@ -32,7 +32,6 @@ int asprintf(char **,const char *, ...) PRINTF_ATTRIBUTE(2,3);
#endif
#ifdef HAVE_NS_API_H
-#undef VOLATILE
#undef STATIC
#undef DYNAMIC
#include <ns_daemon.h>
diff --git a/source3/nsswitch/wins.c b/source3/nsswitch/wins.c
index 7d42381986..2f82997aaf 100644
--- a/source3/nsswitch/wins.c
+++ b/source3/nsswitch/wins.c
@@ -20,7 +20,6 @@
#include "includes.h"
#ifdef HAVE_NS_API_H
-#undef VOLATILE
#include <ns_daemon.h>
#endif
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 1191c3d3aa..d91d34d29b 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -6529,7 +6529,7 @@ static void copy_service(struct service *pserviceDest, struct service *pserviceS
break;
case P_LIST:
TALLOC_FREE(*((char ***)dest_ptr));
- str_list_copy(NULL, (char ***)dest_ptr,
+ *((char ***)dest_ptr) = str_list_copy(NULL,
*(const char ***)src_ptr);
break;
default:
@@ -6930,7 +6930,7 @@ static bool handle_include(int snum, const char *pszParmValue, char **ptr)
string_set(ptr, fname);
- if (file_exist(fname, NULL)) {
+ if (file_exist(fname)) {
bool ret = pm_process(fname, do_section, do_parameter, NULL);
SAFE_FREE(fname);
return ret;
@@ -7423,7 +7423,7 @@ static bool equal_parameter(parm_type type, void *ptr1, void *ptr2)
return (*((char *)ptr1) == *((char *)ptr2));
case P_LIST:
- return str_list_compare(*(char ***)ptr1, *(char ***)ptr2);
+ return str_list_equal(*(const char ***)ptr1, *(const char ***)ptr2);
case P_STRING:
case P_USTRING:
@@ -7512,8 +7512,8 @@ static bool is_default(int i)
return False;
switch (parm_table[i].type) {
case P_LIST:
- return str_list_compare (parm_table[i].def.lvalue,
- *(char ***)parm_table[i].ptr);
+ return str_list_equal((const char **)parm_table[i].def.lvalue,
+ *(const char ***)parm_table[i].ptr);
case P_STRING:
case P_USTRING:
return strequal(parm_table[i].def.svalue,
@@ -7927,9 +7927,8 @@ static void lp_save_defaults(void)
continue;
switch (parm_table[i].type) {
case P_LIST:
- str_list_copy(
- NULL, &(parm_table[i].def.lvalue),
- *(const char ***)parm_table[i].ptr);
+ parm_table[i].def.lvalue = str_list_copy(
+ NULL, *(const char ***)parm_table[i].ptr);
break;
case P_STRING:
case P_USTRING:
@@ -8386,7 +8385,7 @@ static int process_usershare_file(const char *dir_name, const char *file_name, i
return -1;
}
- lines = fd_lines_load(fd, &numlines, MAX_USERSHARE_FILE_SIZE);
+ lines = fd_lines_load(fd, &numlines, MAX_USERSHARE_FILE_SIZE, NULL);
close(fd);
if (lines == NULL) {
@@ -8401,7 +8400,7 @@ static int process_usershare_file(const char *dir_name, const char *file_name, i
/* Should we allow printers to be shared... ? */
ctx = talloc_init("usershare_sd_xctx");
if (!ctx) {
- file_lines_free(lines);
+ TALLOC_FREE(lines);
return 1;
}
@@ -8409,11 +8408,11 @@ static int process_usershare_file(const char *dir_name, const char *file_name, i
iService, lines, numlines, &sharepath,
&comment, &psd, &guest_ok) != USERSHARE_OK) {
talloc_destroy(ctx);
- file_lines_free(lines);
+ TALLOC_FREE(lines);
return -1;
}
- file_lines_free(lines);
+ TALLOC_FREE(lines);
/* Everything ok - add the service possibly using a template. */
if (iService < 0) {
diff --git a/source3/param/params.c b/source3/param/params.c
deleted file mode 100644
index 478376c9e9..0000000000
--- a/source3/param/params.c
+++ /dev/null
@@ -1,590 +0,0 @@
-/* -------------------------------------------------------------------------- **
- * Microsoft Network Services for Unix, AKA., Andrew Tridgell's SAMBA.
- *
- * This module Copyright (C) 1990-1998 Karl Auer
- *
- * Rewritten almost completely by Christopher R. Hertel, 1997.
- * This module Copyright (C) 1997-1998 by Christopher R. Hertel
- *
- * -------------------------------------------------------------------------- **
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- *
- * -------------------------------------------------------------------------- **
- *
- * Module name: params
- *
- * -------------------------------------------------------------------------- **
- *
- * This module performs lexical analysis and initial parsing of a
- * Windows-like parameter file. It recognizes and handles four token
- * types: section-name, parameter-name, parameter-value, and
- * end-of-file. Comments and line continuation are handled
- * internally.
- *
- * The entry point to the module is function pm_process(). This
- * function opens the source file, calls the Parse() function to parse
- * the input, and then closes the file when either the EOF is reached
- * or a fatal error is encountered.
- *
- * A sample parameter file might look like this:
- *
- * [section one]
- * parameter one = value string
- * parameter two = another value
- * [section two]
- * new parameter = some value or t'other
- *
- * The parameter file is divided into sections by section headers:
- * section names enclosed in square brackets (eg. [section one]).
- * Each section contains parameter lines, each of which consist of a
- * parameter name and value delimited by an equal sign. Roughly, the
- * syntax is:
- *
- * <file> :== { <section> } EOF
- *
- * <section> :== <section header> { <parameter line> }
- *
- * <section header> :== '[' NAME ']'
- *
- * <parameter line> :== NAME '=' VALUE '\n'
- *
- * Blank lines and comment lines are ignored. Comment lines are lines
- * beginning with either a semicolon (';') or a pound sign ('#').
- *
- * All whitespace in section names and parameter names is compressed
- * to single spaces. Leading and trailing whitespace is stipped from
- * both names and values.
- *
- * Only the first equals sign in a parameter line is significant.
- * Parameter values may contain equals signs, square brackets and
- * semicolons. Internal whitespace is retained in parameter values,
- * with the exception of the '\r' character, which is stripped for
- * historic reasons. Parameter names may not start with a left square
- * bracket, an equal sign, a pound sign, or a semicolon, because these
- * are used to identify other tokens.
- *
- * -------------------------------------------------------------------------- **
- */
-
-#include "includes.h"
-
-/* -------------------------------------------------------------------------- **
- * Constants...
- */
-
-#define BUFR_INC 1024
-
-
-/* -------------------------------------------------------------------------- **
- * Variables...
- *
- * DEBUGLEVEL - The ubiquitous DEBUGLEVEL. This determines which DEBUG()
- * messages will be produced.
- * bufr - pointer to a global buffer. This is probably a kludge,
- * but it was the nicest kludge I could think of (for now).
- * bSize - The size of the global buffer <bufr>.
- */
-
-/* we can't use FILE* due to the 256 fd limit - use this cheap hack
- instead */
-typedef struct {
- char *buf;
- char *p;
- size_t size;
- char *end_section_p;
-} myFILE;
-
-static int mygetc(myFILE *f)
-{
- if (f->p >= f->buf+f->size)
- return EOF;
- /* be sure to return chars >127 as positive values */
- return (int)( *(f->p++) & 0x00FF );
-}
-
-static void myfile_close(myFILE *f)
-{
- if (!f)
- return;
- SAFE_FREE(f->buf);
- SAFE_FREE(f);
-}
-
-/* Find the end of the section. We must use mb functions for this. */
-static int FindSectionEnd(myFILE *f)
-{
- f->end_section_p = strchr_m(f->p, ']');
- return f->end_section_p ? 1 : 0;
-}
-
-static int AtSectionEnd(myFILE *f)
-{
- if (f->p == f->end_section_p + 1) {
- f->end_section_p = NULL;
- return 1;
- }
- return 0;
-}
-
-/* -------------------------------------------------------------------------- **
- * Functions...
- */
- /* ------------------------------------------------------------------------ **
- * Scan past whitespace (see ctype(3C)) and return the first non-whitespace
- * character, or newline, or EOF.
- *
- * Input: InFile - Input source.
- *
- * Output: The next non-whitespace character in the input stream.
- *
- * Notes: Because the config files use a line-oriented grammar, we
- * explicitly exclude the newline character from the list of
- * whitespace characters.
- * - Note that both EOF (-1) and the nul character ('\0') are
- * considered end-of-file markers.
- *
- * ------------------------------------------------------------------------ **
- */
-
-static int EatWhitespace( myFILE *InFile )
-{
- int c;
-
- for( c = mygetc( InFile ); isspace( c ) && ('\n' != c); c = mygetc( InFile ) )
- ;
- return( c );
-}
-
- /* ------------------------------------------------------------------------ **
- * Scan to the end of a comment.
- *
- * Input: InFile - Input source.
- *
- * Output: The character that marks the end of the comment. Normally,
- * this will be a newline, but it *might* be an EOF.
- *
- * Notes: Because the config files use a line-oriented grammar, we
- * explicitly exclude the newline character from the list of
- * whitespace characters.
- * - Note that both EOF (-1) and the nul character ('\0') are
- * considered end-of-file markers.
- *
- * ------------------------------------------------------------------------ **
- */
-
-static int EatComment( myFILE *InFile )
-{
- int c;
-
- for( c = mygetc( InFile ); ('\n'!=c) && (EOF!=c) && (c>0); c = mygetc( InFile ) )
- ;
- return( c );
-}
-
-/*****************************************************************************
- * Scan backards within a string to discover if the last non-whitespace
- * character is a line-continuation character ('\\').
- *
- * Input: line - A pointer to a buffer containing the string to be
- * scanned.
- * pos - This is taken to be the offset of the end of the
- * string. This position is *not* scanned.
- *
- * Output: The offset of the '\\' character if it was found, or -1 to
- * indicate that it was not.
- *
- *****************************************************************************/
-
-static int Continuation(uint8_t *line, int pos )
-{
- pos--;
- while( (pos >= 0) && isspace((int)line[pos]))
- pos--;
-
- return (((pos >= 0) && ('\\' == line[pos])) ? pos : -1 );
-}
-
-/* ------------------------------------------------------------------------ **
- * Scan a section name, and pass the name to function sfunc().
- *
- * Input: InFile - Input source.
- * sfunc - Pointer to the function to be called if the section
- * name is successfully read.
- *
- * Output: True if the section name was read and True was returned from
- * <sfunc>. False if <sfunc> failed or if a lexical error was
- * encountered.
- *
- * ------------------------------------------------------------------------ **
- */
-
-static bool Section( DATA_BLOB *buf, myFILE *InFile, bool (*sfunc)(const char *, void *), void *userdata )
-{
- int c;
- int i;
- int end;
- const char *func = "params.c:Section() -";
-
- i = 0; /* <i> is the offset of the next free byte in bufr[] and */
- end = 0; /* <end> is the current "end of string" offset. In most */
- /* cases these will be the same, but if the last */
- /* character written to bufr[] is a space, then <end> */
- /* will be one less than <i>. */
-
-
- /* Find the end of the section. We must use mb functions for this. */
- if (!FindSectionEnd(InFile)) {
- DEBUG(0, ("%s No terminating ']' character in section.\n", func) );
- return False;
- }
-
- c = EatWhitespace( InFile ); /* We've already got the '['. Scan */
- /* past initial white space. */
-
- while( (EOF != c) && (c > 0) ) {
- /* Check that the buffer is big enough for the next character. */
- if( i > (buf->length - 2) ) {
- uint8_t *tb = (uint8_t *)SMB_REALLOC_KEEP_OLD_ON_ERROR(buf->data, buf->length+BUFR_INC );
- if(!tb) {
- DEBUG(0, ("%s Memory re-allocation failure.", func) );
- return False;
- }
- buf->data = tb;
- buf->length += BUFR_INC;
- }
-
- /* Handle a single character other than section end. */
- switch( c ) {
- case '\n': /* Got newline before closing ']'. */
- i = Continuation( buf->data, i ); /* Check for line continuation. */
- if( i < 0 ) {
- buf->data[end] = '\0';
- DEBUG(0, ("%s Badly formed line in configuration file: %s\n", func, buf->data ));
- return False;
- }
- end = ( (i > 0) && (' ' == buf->data[i - 1]) ) ? (i - 1) : (i);
- c = mygetc( InFile ); /* Continue with next line. */
- break;
-
- default: /* All else are a valid name chars. */
- if(isspace( c )) {
- /* One space per whitespace region. */
- buf->data[end] = ' ';
- i = end + 1;
- c = EatWhitespace( InFile );
- } else {
- buf->data[i++] = c;
- end = i;
- c = mygetc( InFile );
- }
- }
-
- if (AtSectionEnd(InFile)) {
- /* Got to the closing bracket. */
- buf->data[end] = '\0';
- if( 0 == end ) {
- /* Don't allow an empty name. */
- DEBUG(0, ("%s Empty section name in configuration file.\n", func ));
- return False;
- }
- if( !sfunc((char *)buf->data, userdata) ) /* Got a valid name. Deal with it. */
- return False;
- EatComment( InFile ); /* Finish off the line. */
- return True;
- }
-
- }
-
- /* We arrive here if we've met the EOF before the closing bracket. */
- DEBUG(0, ("%s Unexpected EOF in the configuration file: %s\n", func, buf->data ));
- return False;
-}
-
-/* ------------------------------------------------------------------------ **
- * Scan a parameter name and value, and pass these two fields to pfunc().
- *
- * Input: InFile - The input source.
- * pfunc - A pointer to the function that will be called to
- * process the parameter, once it has been scanned.
- * c - The first character of the parameter name, which
- * would have been read by Parse(). Unlike a comment
- * line or a section header, there is no lead-in
- * character that can be discarded.
- *
- * Output: True if the parameter name and value were scanned and processed
- * successfully, else False.
- *
- * Notes: This function is in two parts. The first loop scans the
- * parameter name. Internal whitespace is compressed, and an
- * equal sign (=) terminates the token. Leading and trailing
- * whitespace is discarded. The second loop scans the parameter
- * value. When both have been successfully identified, they are
- * passed to pfunc() for processing.
- *
- * ------------------------------------------------------------------------ **
- */
-
-static bool Parameter( DATA_BLOB *buf, myFILE *InFile, bool (*pfunc)(const char *, const char *, void *), int c, void *userdata )
-{
- int i = 0; /* Position within bufr. */
- int end = 0; /* bufr[end] is current end-of-string. */
- int vstart = 0; /* Starting position of the parameter value. */
- const char *func = "params.c:Parameter() -";
-
- /* Read the parameter name. */
- while( 0 == vstart ) {
- /* Loop until we've found the start of the value. */
- if( i > (buf->length - 2) ) {
- /* Ensure there's space for next char. */
- uint8_t *tb = (uint8_t *)SMB_REALLOC_KEEP_OLD_ON_ERROR( buf->data, buf->length + BUFR_INC );
- if (!tb) {
- DEBUG(0, ("%s Memory re-allocation failure.", func) );
- return False;
- }
- buf->data = tb;
- buf->length += BUFR_INC;
- }
-
- switch(c) {
- case '=': /* Equal sign marks end of param name. */
- if( 0 == end ) {
- /* Don't allow an empty name. */
- DEBUG(0, ("%s Invalid parameter name in config. file.\n", func ));
- return False;
- }
- buf->data[end++] = '\0'; /* Mark end of string & advance. */
- i = end; /* New string starts here. */
- vstart = end; /* New string is parameter value. */
- buf->data[i] = '\0'; /* New string is nul, for now. */
- break;
-
- case '\n': /* Find continuation char, else error. */
- i = Continuation( buf->data, i );
- if( i < 0 ) {
- buf->data[end] = '\0';
- DEBUG(1,("%s Ignoring badly formed line in configuration file: %s\n", func, buf->data ));
- return True;
- }
- end = ( (i > 0) && (' ' == buf->data[i - 1]) ) ? (i - 1) : (i);
- c = mygetc( InFile ); /* Read past eoln. */
- break;
-
- case '\0': /* Shouldn't have EOF within param name. */
- case EOF:
- buf->data[i] = '\0';
- DEBUG(1,("%s Unexpected end-of-file at: %s\n", func, buf->data ));
- return True;
-
- default:
- if(isspace( c )) {
- /* One ' ' per whitespace region. */
- buf->data[end] = ' ';
- i = end + 1;
- c = EatWhitespace( InFile );
- } else {
- buf->data[i++] = c;
- end = i;
- c = mygetc( InFile );
- }
- }
- }
-
- /* Now parse the value. */
- c = EatWhitespace( InFile ); /* Again, trim leading whitespace. */
- while( (EOF !=c) && (c > 0) ) {
- if( i > (buf->length - 2) ) {
- /* Make sure there's enough room. */
- uint8_t *tb = (uint8_t *)SMB_REALLOC_KEEP_OLD_ON_ERROR( buf->data, buf->length + BUFR_INC );
- if (!tb) {
- DEBUG(0, ("%s Memory re-allocation failure.", func));
- return False;
- }
- buf->data = tb;
- buf->length += BUFR_INC;
- }
-
- switch(c) {
- case '\r': /* Explicitly remove '\r' because the older */
- c = mygetc( InFile ); /* version called fgets_slash() which also */
- break; /* removes them. */
-
- case '\n': /* Marks end of value unless there's a '\'. */
- i = Continuation( buf->data, i );
- if( i < 0 ) {
- c = 0;
- } else {
- for( end = i; (end >= 0) && isspace((int)buf->data[end]); end-- )
- ;
- c = mygetc( InFile );
- }
- break;
-
- default: /* All others verbatim. Note that spaces do not advance <end>. This allows trimming */
- buf->data[i++] = c;
- if( !isspace( c ) ) /* of whitespace at the end of the line. */
- end = i;
- c = mygetc( InFile );
- break;
- }
- }
- buf->data[end] = '\0'; /* End of value. */
-
- return( pfunc( (char *)buf->data, (char *)&buf->data[vstart], userdata ) ); /* Pass name & value to pfunc(). */
-}
-
-/* ------------------------------------------------------------------------ **
- * Scan & parse the input.
- *
- * Input: InFile - Input source.
- * sfunc - Function to be called when a section name is scanned.
- * See Section().
- * pfunc - Function to be called when a parameter is scanned.
- * See Parameter().
- *
- * Output: True if the file was successfully scanned, else False.
- *
- * Notes: The input can be viewed in terms of 'lines'. There are four
- * types of lines:
- * Blank - May contain whitespace, otherwise empty.
- * Comment - First non-whitespace character is a ';' or '#'.
- * The remainder of the line is ignored.
- * Section - First non-whitespace character is a '['.
- * Parameter - The default case.
- *
- * ------------------------------------------------------------------------ **
- */
-
-static bool Parse( DATA_BLOB *buf, myFILE *InFile,
- bool (*sfunc)(const char *, void *),
- bool (*pfunc)(const char *, const char *, void *),
- void *userdata)
-{
- int c;
-
- c = EatWhitespace( InFile );
- while( (EOF != c) && (c > 0) ) {
- switch( c ) {
- case '\n': /* Blank line. */
- c = EatWhitespace( InFile );
- break;
-
- case ';': /* Comment line. */
- case '#':
- c = EatComment( InFile );
- break;
-
- case '[': /* Section Header. */
- if( !Section( buf, InFile, sfunc, userdata ) )
- return False;
- c = EatWhitespace( InFile );
- break;
-
- case '\\': /* Bogus backslash. */
- c = EatWhitespace( InFile );
- break;
-
- default: /* Parameter line. */
- if( !Parameter( buf, InFile, pfunc, c, userdata ) )
- return False;
- c = EatWhitespace( InFile );
- break;
- }
- }
- return True;
-}
-
-/* ------------------------------------------------------------------------ **
- * Open a configuration file.
- *
- * Input: FileName - The pathname of the config file to be opened.
- *
- * Output: A pointer of type (char **) to the lines of the file
- *
- * ------------------------------------------------------------------------ **
- */
-
-static myFILE *OpenConfFile( const char *FileName )
-{
- const char *func = "params.c:OpenConfFile() -";
- int lvl = lp_is_in_client() ? 1 : 0;
- myFILE *ret;
-
- ret = SMB_MALLOC_P(myFILE);
- if (!ret)
- return NULL;
-
- ret->buf = file_load(FileName, &ret->size, 0);
- if( NULL == ret->buf ) {
- DEBUG( lvl, ("%s Unable to open configuration file \"%s\":\n\t%s\n",
- func, FileName, strerror(errno)) );
- SAFE_FREE(ret);
- return NULL;
- }
-
- ret->p = ret->buf;
- ret->end_section_p = NULL;
- return( ret );
-}
-
-/* ------------------------------------------------------------------------ **
- * Process the named parameter file.
- *
- * Input: FileName - The pathname of the parameter file to be opened.
- * sfunc - A pointer to a function that will be called when
- * a section name is discovered.
- * pfunc - A pointer to a function that will be called when
- * a parameter name and value are discovered.
- *
- * Output: TRUE if the file was successfully parsed, else FALSE.
- *
- * ------------------------------------------------------------------------ **
- */
-
-bool pm_process( const char *FileName,
- bool (*sfunc)(const char *, void *),
- bool (*pfunc)(const char *, const char *, void *),
- void *userdata)
-{
- int result;
- myFILE *InFile;
- const char *func = "params.c:pm_process() -";
- DATA_BLOB buf;
-
- InFile = OpenConfFile( FileName ); /* Open the config file. */
- if( NULL == InFile )
- return False;
-
- DEBUG( 3, ("%s Processing configuration file \"%s\"\n", func, FileName) );
-
- buf = data_blob(NULL, 256);
-
- if (buf.data == NULL) {
- DEBUG(0,("%s memory allocation failure.\n", func));
- myfile_close(InFile);
- return False;
- }
-
- result = Parse( &buf, InFile, sfunc, pfunc, userdata );
- data_blob_free(&buf);
-
- myfile_close(InFile);
-
- if( !result ) {
- DEBUG(0,("%s Failed. Error returned from params.c:parse().\n", func));
- return False;
- }
-
- return True;
-}
diff --git a/source3/param/test_lp_load.c b/source3/param/test_lp_load.c
index db1bad4726..1ec123e70a 100644
--- a/source3/param/test_lp_load.c
+++ b/source3/param/test_lp_load.c
@@ -81,8 +81,8 @@ int main(int argc, const char **argv)
done:
- TALLOC_FREE(frame);
gfree_loadparm();
+ TALLOC_FREE(frame);
return ret;
}
diff --git a/source3/passdb/machine_sid.c b/source3/passdb/machine_sid.c
index ff2c9bcb0d..c7c3cc474b 100644
--- a/source3/passdb/machine_sid.c
+++ b/source3/passdb/machine_sid.c
@@ -41,15 +41,15 @@ static bool read_sid_from_file(const char *fname, DOM_SID *sid)
int numlines;
bool ret;
- lines = file_lines_load(fname, &numlines,0);
+ lines = file_lines_load(fname, &numlines,0, NULL);
if (!lines || numlines < 1) {
- if (lines) file_lines_free(lines);
+ if (lines) TALLOC_FREE(lines);
return False;
}
ret = string_to_sid(sid, lines[0]);
- file_lines_free(lines);
+ TALLOC_FREE(lines);
return ret;
}
diff --git a/source3/passdb/secrets.c b/source3/passdb/secrets.c
index 306d4d0a35..a6adb904e2 100644
--- a/source3/passdb/secrets.c
+++ b/source3/passdb/secrets.c
@@ -238,7 +238,7 @@ bool secrets_fetch_domain_guid(const char *domain, struct GUID *guid)
if (!dyn_guid) {
if (lp_server_role() == ROLE_DOMAIN_PDC) {
- smb_uuid_generate_random(&new_guid);
+ new_guid = GUID_random();
if (!secrets_store_domain_guid(domain, &new_guid))
return False;
dyn_guid = (struct GUID *)secrets_fetch(key, &size);
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index 850375e82b..c0e62eac19 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -1376,7 +1376,7 @@ static int file_version_is_newer(connection_struct *conn, fstring new_file, fstr
DEBUGADD(6,("file_version_is_newer: mod time = %ld sec\n", old_create_time));
}
}
- close_file(fsp, NORMAL_CLOSE);
+ close_file(NULL, fsp, NORMAL_CLOSE);
fsp = NULL;
/* Get file version info (if available) for new file */
@@ -1417,7 +1417,7 @@ static int file_version_is_newer(connection_struct *conn, fstring new_file, fstr
DEBUGADD(6,("file_version_is_newer: mod time = %ld sec\n", new_create_time));
}
}
- close_file(fsp, NORMAL_CLOSE);
+ close_file(NULL, fsp, NORMAL_CLOSE);
fsp = NULL;
if (use_version && (new_major != old_major || new_minor != old_minor)) {
@@ -1447,7 +1447,7 @@ static int file_version_is_newer(connection_struct *conn, fstring new_file, fstr
error_exit:
if(fsp)
- close_file(fsp, NORMAL_CLOSE);
+ close_file(NULL, fsp, NORMAL_CLOSE);
return -1;
}
@@ -1583,7 +1583,7 @@ static uint32 get_correct_cversion(const char *architecture, fstring driverpath_
DEBUG(10,("get_correct_cversion: Driver file [%s] cversion = %d\n",
driverpath, cversion));
- close_file(fsp, NORMAL_CLOSE);
+ close_file(NULL, fsp, NORMAL_CLOSE);
close_cnum(conn, user->vuid);
unbecome_user();
*perr = WERR_OK;
@@ -1593,7 +1593,7 @@ static uint32 get_correct_cversion(const char *architecture, fstring driverpath_
error_exit:
if(fsp)
- close_file(fsp, NORMAL_CLOSE);
+ close_file(NULL, fsp, NORMAL_CLOSE);
close_cnum(conn, user->vuid);
unbecome_user();
@@ -3221,7 +3221,7 @@ static void store_printer_guid(NT_PRINTER_INFO_LEVEL_2 *info2,
ZERO_STRUCT( unistr_guid );
- init_unistr2( &unistr_guid, smb_uuid_string(talloc_tos(), guid),
+ init_unistr2( &unistr_guid, GUID_string(talloc_tos(), &guid),
UNI_STR_TERMINATE );
regval_ctr_addvalue(ctr, "objectGUID", REG_SZ,
@@ -3536,7 +3536,7 @@ bool is_printer_published(Printer_entry *print_hnd, int snum,
case REG_SZ:
rpcstr_pull( guid_str, regval_data_p(guid_val),
sizeof(guid_str)-1, -1, STR_TERMINATE );
- ret = smb_string_to_uuid( guid_str, guid );
+ ret = NT_STATUS_IS_OK(GUID_from_string( guid_str, guid ));
break;
case REG_BINARY:
if ( regval_size(guid_val) != sizeof(struct GUID) ) {
@@ -3841,7 +3841,7 @@ static int unpack_values(NT_PRINTER_DATA *printer_data, const uint8 *buf, int bu
memcpy( &guid, data_p, sizeof(struct GUID) );
init_unistr2( &unistr_guid,
- smb_uuid_string(talloc_tos(), guid),
+ GUID_string(talloc_tos(), &guid),
UNI_STR_TERMINATE );
regval_ctr_addvalue( printer_data->keys[key_index].values,
@@ -3925,10 +3925,10 @@ static void map_to_os2_driver(fstring drivername)
return;
}
- lines = file_lines_load(mapfile, &numlines,0);
+ lines = file_lines_load(mapfile, &numlines,0,NULL);
if (numlines == 0 || lines == NULL) {
DEBUG(0,("No entries in OS/2 driver map %s\n",mapfile));
- SAFE_FREE(lines);
+ TALLOC_FREE(lines);
return;
}
@@ -3972,12 +3972,12 @@ static void map_to_os2_driver(fstring drivername)
DEBUG(3,("Mapped windows driver %s to os2 driver%s\n",drivername,os2_name));
set_last_from_to(drivername,os2_name);
fstrcpy(drivername,os2_name);
- file_lines_free(lines);
+ TALLOC_FREE(lines);
return;
}
}
- file_lines_free(lines);
+ TALLOC_FREE(lines);
}
/****************************************************************************
diff --git a/source3/printing/pcap.c b/source3/printing/pcap.c
index 10c1a2d608..b9e5ad56ad 100644
--- a/source3/printing/pcap.c
+++ b/source3/printing/pcap.c
@@ -282,5 +282,5 @@ void pcap_printer_fn_specific(const struct pcap_cache *pc,
void pcap_printer_fn(void (*fn)(const char *, const char *, void *), void *pdata)
{
- return pcap_printer_fn_specific(pcap_cache, fn, pdata);
+ pcap_printer_fn_specific(pcap_cache, fn, pdata);
}
diff --git a/source3/printing/print_generic.c b/source3/printing/print_generic.c
index 2a324fdd5c..5806b29206 100644
--- a/source3/printing/print_generic.c
+++ b/source3/printing/print_generic.c
@@ -104,7 +104,7 @@ static int generic_job_delete( const char *sharename, const char *lprm_command,
slprintf(jobstr, sizeof(jobstr)-1, "%d", pjob->sysjob);
return print_run_command( -1, sharename, False, lprm_command, NULL,
"%j", jobstr,
- "%T", http_timestring(pjob->starttime),
+ "%T", http_timestring(talloc_tos(), pjob->starttime),
NULL);
}
@@ -238,7 +238,7 @@ static int generic_queue_get(const char *printer_name,
}
numlines = 0;
- qlines = fd_lines_load(fd, &numlines,0);
+ qlines = fd_lines_load(fd, &numlines,0,NULL);
close(fd);
/* turn the lpq output into a series of job structures */
@@ -247,7 +247,7 @@ static int generic_queue_get(const char *printer_name,
if (numlines && qlines) {
queue = SMB_MALLOC_ARRAY(print_queue_struct, numlines+1);
if (!queue) {
- file_lines_free(qlines);
+ TALLOC_FREE(qlines);
*q = NULL;
return 0;
}
@@ -262,7 +262,7 @@ static int generic_queue_get(const char *printer_name,
}
}
- file_lines_free(qlines);
+ TALLOC_FREE(qlines);
*q = queue;
return qcount;
}
diff --git a/source3/printing/print_svid.c b/source3/printing/print_svid.c
index 7e91d3a677..681b2bf459 100644
--- a/source3/printing/print_svid.c
+++ b/source3/printing/print_svid.c
@@ -59,12 +59,12 @@ bool sysv_cache_reload(void)
scheduler = file_lines_pload("/usr/bin/lpstat -r", NULL);
if(!strcmp(*scheduler,"scheduler is running")){
DEBUG(3,("No Printers found!!!\n"));
- file_lines_free(scheduler);
+ TALLOC_FREE(scheduler);
return True;
}
else{
DEBUG(3,("Scheduler is not running!!!\n"));
- file_lines_free(scheduler);
+ TALLOC_FREE(scheduler);
return False;
}
#else
@@ -111,12 +111,12 @@ bool sysv_cache_reload(void)
/* add it to the cache */
if (!pcap_cache_add(name, NULL)) {
- file_lines_free(lines);
+ TALLOC_FREE(lines);
return False;
}
}
- file_lines_free(lines);
+ TALLOC_FREE(lines);
return True;
}
diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c
index c6749226fd..a247cd8427 100644
--- a/source3/printing/printfsp.c
+++ b/source3/printing/printfsp.c
@@ -25,7 +25,8 @@ open a print file and setup a fsp for it. This is a wrapper around
print_job_start().
***************************************************************************/
-NTSTATUS print_fsp_open(connection_struct *conn, const char *fname,
+NTSTATUS print_fsp_open(struct smb_request *req, connection_struct *conn,
+ const char *fname,
uint16_t current_vuid, files_struct **result)
{
int jobid;
@@ -34,7 +35,7 @@ NTSTATUS print_fsp_open(connection_struct *conn, const char *fname,
fstring name;
NTSTATUS status;
- status = file_new(conn, &fsp);
+ status = file_new(req, conn, &fsp);
if(!NT_STATUS_IS_OK(status)) {
return status;
}
@@ -52,7 +53,7 @@ NTSTATUS print_fsp_open(connection_struct *conn, const char *fname,
jobid = print_job_start(conn->server_info, SNUM(conn), name, NULL);
if (jobid == -1) {
status = map_nt_error_from_unix(errno);
- file_free(fsp);
+ file_free(req, fsp);
return status;
}
@@ -61,7 +62,7 @@ NTSTATUS print_fsp_open(connection_struct *conn, const char *fname,
if (fsp->rap_print_jobid == 0) {
/* We need to delete the entry in the tdb. */
pjob_delete(lp_const_servicename(SNUM(conn)), jobid);
- file_free(fsp);
+ file_free(req, fsp);
return NT_STATUS_ACCESS_DENIED; /* No errno around here */
}
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index 1016e6183d..3c8c60f0e0 100644
--- a/source3/printing/printing.c
+++ b/source3/printing/printing.c
@@ -2389,9 +2389,9 @@ uint32 print_job_start(struct auth_serversupplied_info *server_info, int snum,
/* see if we have sufficient disk space */
if (lp_minprintspace(snum)) {
- SMB_BIG_UINT dspace, dsize;
+ uint64_t dspace, dsize;
if (sys_fsusage(path, &dspace, &dsize) == 0 &&
- dspace < 2*(SMB_BIG_UINT)lp_minprintspace(snum)) {
+ dspace < 2*(uint64_t)lp_minprintspace(snum)) {
DEBUG(3, ("print_job_start: disk space check failed.\n"));
release_print_db(pdb);
errno = ENOSPC;
diff --git a/source3/registry/reg_perfcount.c b/source3/registry/reg_perfcount.c
index e608847048..eda44ace19 100644
--- a/source3/registry/reg_perfcount.c
+++ b/source3/registry/reg_perfcount.c
@@ -63,7 +63,7 @@ void perfcount_init_keys( void )
/* no registry keys; just create the perfmon directory */
- if ( !directory_exist( p, NULL ) )
+ if ( !directory_exist( p ) )
mkdir( p, 0755 );
return;
@@ -450,7 +450,7 @@ static uint32 _reg_perfcount_get_size_field(uint32 CounterType)
/*********************************************************************
*********************************************************************/
-static uint32 _reg_perfcount_compute_scale(SMB_BIG_INT data)
+static uint32 _reg_perfcount_compute_scale(int64_t data)
{
int scale = 0;
if(data == 0)
@@ -482,7 +482,7 @@ static bool _reg_perfcount_get_counter_info(PERF_DATA_BLOCK *block,
char buf[PERFCOUNT_MAX_LEN];
size_t dsize, padding;
long int data32, dbuf[2];
- SMB_BIG_INT data64;
+ int64_t data64;
uint32 counter_size;
obj->counters[obj->NumCounters].DefaultScale = 0;
@@ -521,7 +521,7 @@ static bool _reg_perfcount_get_counter_info(PERF_DATA_BLOCK *block,
memcpy(buf, data.dptr, data.dsize);
data32 = strtol(buf, NULL, 0);
if((obj->counters[obj->NumCounters].CounterType & 0x00000F00) == PERF_TYPE_NUMBER)
- obj->counters[obj->NumCounters].DefaultScale = _reg_perfcount_compute_scale((SMB_BIG_INT)data32);
+ obj->counters[obj->NumCounters].DefaultScale = _reg_perfcount_compute_scale((int64_t)data32);
else
obj->counters[obj->NumCounters].DefaultScale = 0;
dbuf[0] = data32;
@@ -823,7 +823,7 @@ static int _reg_perfcount_assemble_global(PERF_DATA_BLOCK *block,
/*********************************************************************
*********************************************************************/
-static bool _reg_perfcount_get_64(SMB_BIG_UINT *retval,
+static bool _reg_perfcount_get_64(uint64_t *retval,
TDB_CONTEXT *tdb,
int key_part1,
const char *key_part2)
@@ -855,7 +855,7 @@ static bool _reg_perfcount_get_64(SMB_BIG_UINT *retval,
static bool _reg_perfcount_init_data_block_perf(PERF_DATA_BLOCK *block,
TDB_CONTEXT *names)
{
- SMB_BIG_UINT PerfFreq, PerfTime, PerfTime100nSec;
+ uint64_t PerfFreq, PerfTime, PerfTime100nSec;
TDB_CONTEXT *counters;
bool status = False;
const char *fname = counters_directory( DATA_DB );
diff --git a/source3/rpc_client/cli_netlogon.c b/source3/rpc_client/cli_netlogon.c
index 23618efd9f..5f115e537b 100644
--- a/source3/rpc_client/cli_netlogon.c
+++ b/source3/rpc_client/cli_netlogon.c
@@ -146,7 +146,7 @@ NTSTATUS rpccli_netlogon_sam_logon(struct rpc_pipe_client *cli,
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
struct netr_Authenticator clnt_creds;
struct netr_Authenticator ret_creds;
- union netr_LogonInfo *logon;
+ union netr_LogonLevel *logon;
union netr_Validation validation;
uint8_t authoritative;
int validation_level = 3;
@@ -156,7 +156,7 @@ NTSTATUS rpccli_netlogon_sam_logon(struct rpc_pipe_client *cli,
ZERO_STRUCT(ret_creds);
ZERO_STRUCT(zeros);
- logon = TALLOC_ZERO_P(mem_ctx, union netr_LogonInfo);
+ logon = TALLOC_ZERO_P(mem_ctx, union netr_LogonLevel);
if (!logon) {
return NT_STATUS_NO_MEMORY;
}
@@ -172,7 +172,7 @@ NTSTATUS rpccli_netlogon_sam_logon(struct rpc_pipe_client *cli,
netlogon_creds_client_step(cli->dc, &clnt_creds);
switch (logon_type) {
- case INTERACTIVE_LOGON_TYPE: {
+ case NetlogonInteractiveInformation: {
struct netr_PasswordInfo *password_info;
@@ -231,7 +231,7 @@ NTSTATUS rpccli_netlogon_sam_logon(struct rpc_pipe_client *cli,
break;
}
- case NET_LOGON_TYPE: {
+ case NetlogonNetworkInformation: {
struct netr_NetworkInfo *network_info;
uint8 chal[8];
unsigned char local_lm_response[24];
@@ -327,7 +327,7 @@ NTSTATUS rpccli_netlogon_sam_network_logon(struct rpc_pipe_client *cli,
uint8 zeros[16];
struct netr_Authenticator clnt_creds;
struct netr_Authenticator ret_creds;
- union netr_LogonInfo *logon = NULL;
+ union netr_LogonLevel *logon = NULL;
struct netr_NetworkInfo *network_info;
uint8_t authoritative;
union netr_Validation validation;
@@ -342,7 +342,7 @@ NTSTATUS rpccli_netlogon_sam_network_logon(struct rpc_pipe_client *cli,
ZERO_STRUCT(lm);
ZERO_STRUCT(nt);
- logon = TALLOC_ZERO_P(mem_ctx, union netr_LogonInfo);
+ logon = TALLOC_ZERO_P(mem_ctx, union netr_LogonLevel);
if (!logon) {
return NT_STATUS_NO_MEMORY;
}
@@ -398,7 +398,7 @@ NTSTATUS rpccli_netlogon_sam_network_logon(struct rpc_pipe_client *cli,
global_myname(),
&clnt_creds,
&ret_creds,
- NET_LOGON_TYPE,
+ NetlogonNetworkInformation,
logon,
validation_level,
&validation,
@@ -447,7 +447,7 @@ NTSTATUS rpccli_netlogon_sam_network_logon_ex(struct rpc_pipe_client *cli,
const char *workstation_name_slash;
const char *server_name_slash;
uint8 zeros[16];
- union netr_LogonInfo *logon = NULL;
+ union netr_LogonLevel *logon = NULL;
struct netr_NetworkInfo *network_info;
uint8_t authoritative;
union netr_Validation validation;
@@ -462,7 +462,7 @@ NTSTATUS rpccli_netlogon_sam_network_logon_ex(struct rpc_pipe_client *cli,
ZERO_STRUCT(lm);
ZERO_STRUCT(nt);
- logon = TALLOC_ZERO_P(mem_ctx, union netr_LogonInfo);
+ logon = TALLOC_ZERO_P(mem_ctx, union netr_LogonLevel);
if (!logon) {
return NT_STATUS_NO_MEMORY;
}
@@ -514,7 +514,7 @@ NTSTATUS rpccli_netlogon_sam_network_logon_ex(struct rpc_pipe_client *cli,
result = rpccli_netr_LogonSamLogonEx(cli, mem_ctx,
server_name_slash,
global_myname(),
- NET_LOGON_TYPE,
+ NetlogonNetworkInformation,
logon,
validation_level,
&validation,
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c
index f32a33fdb6..ca9d3392e7 100644
--- a/source3/rpc_client/cli_pipe.c
+++ b/source3/rpc_client/cli_pipe.c
@@ -2810,7 +2810,7 @@ NTSTATUS rpc_pipe_open_ncalrpc(TALLOC_CTX *mem_ctx, const char *socket_path,
result->abstract_syntax = *abstract_syntax;
result->transfer_syntax = ndr_transfer_syntax;
- result->desthost = get_myname(result);
+ result->desthost = talloc_get_myname(result);
result->srv_name_slash = talloc_asprintf_strupper_m(
result, "\\\\%s", result->desthost);
if ((result->desthost == NULL) || (result->srv_name_slash == NULL)) {
@@ -2906,7 +2906,7 @@ static NTSTATUS rpc_pipe_open_np(struct cli_state *cli,
fnum = cli_nt_create(cli, result->trans.np.pipe_name,
DESIRED_ACCESS_PIPE);
if (fnum == -1) {
- DEBUG(1,("rpc_pipe_open_np: cli_nt_create failed on pipe %s "
+ DEBUG(3,("rpc_pipe_open_np: cli_nt_create failed on pipe %s "
"to machine %s. Error was %s\n",
result->trans.np.pipe_name, cli->desthost,
cli_errstr(cli)));
diff --git a/source3/rpc_client/cli_svcctl.c b/source3/rpc_client/cli_svcctl.c
index 3c29dcdee8..51678083d3 100644
--- a/source3/rpc_client/cli_svcctl.c
+++ b/source3/rpc_client/cli_svcctl.c
@@ -90,79 +90,3 @@ WERROR rpccli_svcctl_enumerate_services( struct rpc_pipe_client *cli, TALLOC_CTX
return out.status;
}
-
-/*******************************************************************
-*******************************************************************/
-
-WERROR rpccli_svcctl_query_config(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
- POLICY_HND *hService, SERVICE_CONFIG *config )
-{
- SVCCTL_Q_QUERY_SERVICE_CONFIG in;
- SVCCTL_R_QUERY_SERVICE_CONFIG out;
- prs_struct qbuf, rbuf;
-
- ZERO_STRUCT(in);
- ZERO_STRUCT(out);
-
- memcpy( &in.handle, hService, sizeof(POLICY_HND) );
- in.buffer_size = 0;
-
-
- CLI_DO_RPC_WERR( cli, mem_ctx, &ndr_table_svcctl.syntax_id,
- SVCCTL_QUERY_SERVICE_CONFIG_W,
- in, out,
- qbuf, rbuf,
- svcctl_io_q_query_service_config,
- svcctl_io_r_query_service_config,
- WERR_GENERAL_FAILURE );
-
- if ( W_ERROR_EQUAL( out.status, WERR_INSUFFICIENT_BUFFER ) ) {
- in.buffer_size = out.needed;
-
- CLI_DO_RPC_WERR( cli, mem_ctx, &ndr_table_svcctl.syntax_id,
- SVCCTL_QUERY_SERVICE_CONFIG_W,
- in, out,
- qbuf, rbuf,
- svcctl_io_q_query_service_config,
- svcctl_io_r_query_service_config,
- WERR_GENERAL_FAILURE );
- }
-
- if ( !W_ERROR_IS_OK( out.status ) )
- return out.status;
-
- memcpy( config, &out.config, sizeof(SERVICE_CONFIG) );
-
- config->executablepath = TALLOC_ZERO_P( mem_ctx, UNISTR2 );
- config->loadordergroup = TALLOC_ZERO_P( mem_ctx, UNISTR2 );
- config->dependencies = TALLOC_ZERO_P( mem_ctx, UNISTR2 );
- config->startname = TALLOC_ZERO_P( mem_ctx, UNISTR2 );
- config->displayname = TALLOC_ZERO_P( mem_ctx, UNISTR2 );
-
- if ( out.config.executablepath ) {
- config->executablepath = TALLOC_ZERO_P( mem_ctx, UNISTR2 );
- copy_unistr2( config->executablepath, out.config.executablepath );
- }
-
- if ( out.config.loadordergroup ) {
- config->loadordergroup = TALLOC_ZERO_P( mem_ctx, UNISTR2 );
- copy_unistr2( config->loadordergroup, out.config.loadordergroup );
- }
-
- if ( out.config.dependencies ) {
- config->dependencies = TALLOC_ZERO_P( mem_ctx, UNISTR2 );
- copy_unistr2( config->dependencies, out.config.dependencies );
- }
-
- if ( out.config.startname ) {
- config->startname = TALLOC_ZERO_P( mem_ctx, UNISTR2 );
- copy_unistr2( config->startname, out.config.startname );
- }
-
- if ( out.config.displayname ) {
- config->displayname = TALLOC_ZERO_P( mem_ctx, UNISTR2 );
- copy_unistr2( config->displayname, out.config.displayname );
- }
-
- return out.status;
-}
diff --git a/source3/rpc_client/init_samr.c b/source3/rpc_client/init_samr.c
index 2e757531ce..283be0d98b 100644
--- a/source3/rpc_client/init_samr.c
+++ b/source3/rpc_client/init_samr.c
@@ -41,21 +41,21 @@ void init_samr_DomInfo1(struct samr_DomInfo1 *r,
inits a structure.
********************************************************************/
-void init_samr_DomInfo2(struct samr_DomInfo2 *r,
- NTTIME force_logoff_time,
- const char *comment,
- const char *domain_name,
- const char *primary,
- uint64_t sequence_num,
- uint32_t unknown2,
- enum samr_Role role,
- uint32_t unknown3,
- uint32_t num_users,
- uint32_t num_groups,
- uint32_t num_aliases)
+void init_samr_DomGeneralInformation(struct samr_DomGeneralInformation *r,
+ NTTIME force_logoff_time,
+ const char *oem_information,
+ const char *domain_name,
+ const char *primary,
+ uint64_t sequence_num,
+ uint32_t unknown2,
+ enum samr_Role role,
+ uint32_t unknown3,
+ uint32_t num_users,
+ uint32_t num_groups,
+ uint32_t num_aliases)
{
r->force_logoff_time = force_logoff_time;
- init_lsa_String(&r->comment, comment);
+ init_lsa_String(&r->oem_information, oem_information);
init_lsa_String(&r->domain_name, domain_name);
init_lsa_String(&r->primary, primary);
r->sequence_num = sequence_num;
@@ -81,10 +81,10 @@ void init_samr_DomInfo3(struct samr_DomInfo3 *r,
inits a structure.
********************************************************************/
-void init_samr_DomInfo4(struct samr_DomInfo4 *r,
- const char *comment)
+void init_samr_DomOEMInformation(struct samr_DomOEMInformation *r,
+ const char *oem_information)
{
- init_lsa_String(&r->comment, comment);
+ init_lsa_String(&r->oem_information, oem_information);
}
/*******************************************************************
diff --git a/source3/rpc_client/ndr.c b/source3/rpc_client/ndr.c
index 5565ae3dc3..9ada47a3f5 100644
--- a/source3/rpc_client/ndr.c
+++ b/source3/rpc_client/ndr.c
@@ -41,7 +41,7 @@ NTSTATUS cli_do_rpc_ndr(struct rpc_pipe_client *cli,
call = &table->calls[opnum];
- push = ndr_push_init_ctx(mem_ctx);
+ push = ndr_push_init_ctx(mem_ctx, NULL);
if (!push) {
return NT_STATUS_NO_MEMORY;
}
diff --git a/source3/rpc_parse/parse_svcctl.c b/source3/rpc_parse/parse_svcctl.c
index c5d93864ba..7d31f4b2f0 100644
--- a/source3/rpc_parse/parse_svcctl.c
+++ b/source3/rpc_parse/parse_svcctl.c
@@ -58,51 +58,6 @@ static bool svcctl_io_service_status( const char *desc, SERVICE_STATUS *status,
/*******************************************************************
********************************************************************/
-static bool svcctl_io_service_config( const char *desc, SERVICE_CONFIG *config, prs_struct *ps, int depth )
-{
-
- prs_debug(ps, depth, desc, "svcctl_io_service_config");
- depth++;
-
- if(!prs_uint32("service_type", ps, depth, &config->service_type))
- return False;
- if(!prs_uint32("start_type", ps, depth, &config->start_type))
- return False;
- if(!prs_uint32("error_control", ps, depth, &config->error_control))
- return False;
-
- if (!prs_io_unistr2_p("", ps, depth, &config->executablepath))
- return False;
- if (!prs_io_unistr2_p("", ps, depth, &config->loadordergroup))
- return False;
-
- if(!prs_uint32("tag_id", ps, depth, &config->tag_id))
- return False;
-
- if (!prs_io_unistr2_p("", ps, depth, &config->dependencies))
- return False;
- if (!prs_io_unistr2_p("", ps, depth, &config->startname))
- return False;
- if (!prs_io_unistr2_p("", ps, depth, &config->displayname))
- return False;
-
- if (!prs_io_unistr2("", ps, depth, config->executablepath))
- return False;
- if (!prs_io_unistr2("", ps, depth, config->loadordergroup))
- return False;
- if (!prs_io_unistr2("", ps, depth, config->dependencies))
- return False;
- if (!prs_io_unistr2("", ps, depth, config->startname))
- return False;
- if (!prs_io_unistr2("", ps, depth, config->displayname))
- return False;
-
- return True;
-}
-
-/*******************************************************************
-********************************************************************/
-
bool svcctl_io_enum_services_status( const char *desc, ENUM_SERVICES_STATUS *enum_status, RPC_BUFFER *buffer, int depth )
{
prs_struct *ps=&buffer->prs;
@@ -175,26 +130,6 @@ static uint32 sizeof_unistr2( UNISTR2 *string )
return size;
}
-/********************************************************************
-********************************************************************/
-
-uint32 svcctl_sizeof_service_config( SERVICE_CONFIG *config )
-{
- uint32 size = 0;
-
- size = sizeof(uint32) * 4; /* static uint32 fields */
-
- /* now add the UNISTR2 + pointer sizes */
-
- size += sizeof(uint32) * sizeof_unistr2(config->executablepath);
- size += sizeof(uint32) * sizeof_unistr2(config->loadordergroup);
- size += sizeof(uint32) * sizeof_unistr2(config->dependencies);
- size += sizeof(uint32) * sizeof_unistr2(config->startname);
- size += sizeof(uint32) * sizeof_unistr2(config->displayname);
-
- return size;
-}
-
/*******************************************************************
********************************************************************/
@@ -262,57 +197,6 @@ bool svcctl_io_r_enum_services_status(const char *desc, SVCCTL_R_ENUM_SERVICES_S
/*******************************************************************
********************************************************************/
-bool svcctl_io_q_query_service_config(const char *desc, SVCCTL_Q_QUERY_SERVICE_CONFIG *q_u, prs_struct *ps, int depth)
-{
- if (q_u == NULL)
- return False;
-
- prs_debug(ps, depth, desc, "svcctl_io_q_query_service_config");
- depth++;
-
- if(!prs_align(ps))
- return False;
-
- if(!smb_io_pol_hnd("service_pol", &q_u->handle, ps, depth))
- return False;
-
- if(!prs_uint32("buffer_size", ps, depth, &q_u->buffer_size))
- return False;
-
- return True;
-}
-
-/*******************************************************************
-********************************************************************/
-
-bool svcctl_io_r_query_service_config(const char *desc, SVCCTL_R_QUERY_SERVICE_CONFIG *r_u, prs_struct *ps, int depth)
-{
- if (r_u == NULL)
- return False;
-
- prs_debug(ps, depth, desc, "svcctl_io_r_query_service_config");
- depth++;
-
-
- if(!prs_align(ps))
- return False;
-
- if(!svcctl_io_service_config("config", &r_u->config, ps, depth))
- return False;
-
- if(!prs_uint32("needed", ps, depth, &r_u->needed))
- return False;
-
- if(!prs_werror("status", ps, depth, &r_u->status))
- return False;
-
-
- return True;
-}
-
-/*******************************************************************
-********************************************************************/
-
bool svcctl_io_q_query_service_config2(const char *desc, SVCCTL_Q_QUERY_SERVICE_CONFIG2 *q_u, prs_struct *ps, int depth)
{
if (q_u == NULL)
diff --git a/source3/rpc_server/srv_eventlog_lib.c b/source3/rpc_server/srv_eventlog_lib.c
index e232a30078..9215a86d3f 100644
--- a/source3/rpc_server/srv_eventlog_lib.c
+++ b/source3/rpc_server/srv_eventlog_lib.c
@@ -344,7 +344,7 @@ ELOG_TDB *elog_open_tdb( char *logname, bool force_clear )
/* make sure that the eventlog dir exists */
eventlogdir = state_path( "eventlog" );
- if ( !directory_exist( eventlogdir, NULL ) )
+ if ( !directory_exist( eventlogdir ) )
mkdir( eventlogdir, 0755 );
/* get the path on disk */
diff --git a/source3/rpc_server/srv_lsa_nt.c b/source3/rpc_server/srv_lsa_nt.c
index 0e9d121242..317c1c17bb 100644
--- a/source3/rpc_server/srv_lsa_nt.c
+++ b/source3/rpc_server/srv_lsa_nt.c
@@ -430,7 +430,7 @@ NTSTATUS _lsa_OpenPolicy(pipes_struct *p,
lsa_get_generic_sd(p->mem_ctx, &psd, &sd_size);
if(!se_access_check(psd, p->pipe_user.nt_user_token, des_access, &acc_granted, &status)) {
- if (geteuid() != 0) {
+ if (p->pipe_user.ut.uid != sec_initial_uid()) {
return status;
}
DEBUG(4,("ACCESS should be DENIED (granted: %#010x; required: %#010x)\n",
@@ -1202,8 +1202,8 @@ NTSTATUS _lsa_LookupNames4(pipes_struct *p,
q.in.num_names = r->in.num_names;
q.in.names = r->in.names;
q.in.level = r->in.level;
- q.in.unknown1 = r->in.unknown1;
- q.in.unknown2 = r->in.unknown2;
+ q.in.lookup_options = r->in.lookup_options;
+ q.in.client_revision = r->in.client_revision;
q.in.sids = r->in.sids;
q.in.count = r->in.count;
@@ -1522,7 +1522,8 @@ NTSTATUS _lsa_CreateAccount(pipes_struct *p,
/* check to see if the pipe_user is a Domain Admin since
account_pol.tdb was already opened as root, this is all we have */
- if ( !nt_token_check_domain_rid( p->pipe_user.nt_user_token, DOMAIN_GROUP_RID_ADMINS ) )
+ if ( p->pipe_user.ut.uid != sec_initial_uid()
+ && !nt_token_check_domain_rid( p->pipe_user.nt_user_token, DOMAIN_GROUP_RID_ADMINS ) )
return NT_STATUS_ACCESS_DENIED;
if ( is_privileged_sid( r->in.sid ) )
@@ -1608,6 +1609,9 @@ NTSTATUS _lsa_EnumPrivsAccount(pipes_struct *p,
if (!find_policy_by_hnd(p, r->in.handle, (void **)(void *)&info))
return NT_STATUS_INVALID_HANDLE;
+ if (!(info->access & LSA_POLICY_VIEW_LOCAL_INFORMATION))
+ return NT_STATUS_ACCESS_DENIED;
+
if ( !get_privileges_for_sids( &mask, &info->sid, 1 ) )
return NT_STATUS_OBJECT_NAME_NOT_FOUND;
@@ -1668,6 +1672,9 @@ NTSTATUS _lsa_GetSystemAccessAccount(pipes_struct *p,
if (!find_policy_by_hnd(p, r->in.handle, (void **)(void *)&info))
return NT_STATUS_INVALID_HANDLE;
+ if (!(info->access & LSA_POLICY_VIEW_LOCAL_INFORMATION))
+ return NT_STATUS_ACCESS_DENIED;
+
if (!lookup_sid(p->mem_ctx, &info->sid, NULL, NULL, NULL))
return NT_STATUS_ACCESS_DENIED;
@@ -1702,7 +1709,8 @@ NTSTATUS _lsa_SetSystemAccessAccount(pipes_struct *p,
/* check to see if the pipe_user is a Domain Admin since
account_pol.tdb was already opened as root, this is all we have */
- if ( !nt_token_check_domain_rid( p->pipe_user.nt_user_token, DOMAIN_GROUP_RID_ADMINS ) )
+ if ( p->pipe_user.ut.uid != sec_initial_uid()
+ && !nt_token_check_domain_rid( p->pipe_user.nt_user_token, DOMAIN_GROUP_RID_ADMINS ) )
return NT_STATUS_ACCESS_DENIED;
if (!pdb_getgrsid(&map, info->sid))
@@ -1812,7 +1820,6 @@ NTSTATUS _lsa_QuerySecurity(pipes_struct *p,
if (!(handle->access & LSA_POLICY_VIEW_LOCAL_INFORMATION))
return NT_STATUS_ACCESS_DENIED;
-
switch (r->in.sec_info) {
case 1:
/* SD contains only the owner */
@@ -2070,6 +2077,9 @@ NTSTATUS _lsa_EnumAccountRights(pipes_struct *p,
if (!find_policy_by_hnd(p, r->in.handle, (void **)(void *)&info))
return NT_STATUS_INVALID_HANDLE;
+ if (!(info->access & LSA_POLICY_VIEW_LOCAL_INFORMATION))
+ return NT_STATUS_ACCESS_DENIED;
+
/* according to an NT4 PDC, you can add privileges to SIDs even without
call_lsa_create_account() first. And you can use any arbitrary SID. */
@@ -2112,6 +2122,9 @@ NTSTATUS _lsa_LookupPrivValue(pipes_struct *p,
if (!find_policy_by_hnd(p, r->in.handle, (void **)(void *)&info))
return NT_STATUS_INVALID_HANDLE;
+ if (!(info->access & LSA_POLICY_VIEW_LOCAL_INFORMATION))
+ return NT_STATUS_ACCESS_DENIED;
+
name = r->in.name->string;
DEBUG(10,("_lsa_lookup_priv_value: name = %s\n", name));
diff --git a/source3/rpc_server/srv_netlog_nt.c b/source3/rpc_server/srv_netlog_nt.c
index 4e211cfb81..2dc6cd6393 100644
--- a/source3/rpc_server/srv_netlog_nt.c
+++ b/source3/rpc_server/srv_netlog_nt.c
@@ -756,7 +756,7 @@ NTSTATUS _netr_LogonSamLogon(pipes_struct *p,
{
NTSTATUS status = NT_STATUS_OK;
struct netr_SamInfo3 *sam3 = NULL;
- union netr_LogonInfo *logon = r->in.logon;
+ union netr_LogonLevel *logon = r->in.logon;
fstring nt_username, nt_domain, nt_workstation;
auth_usersupplied_info *user_info = NULL;
auth_serversupplied_info *server_info = NULL;
@@ -838,7 +838,7 @@ NTSTATUS _netr_LogonSamLogon(pipes_struct *p,
}
switch (r->in.logon_level) {
- case INTERACTIVE_LOGON_TYPE:
+ case NetlogonInteractiveInformation:
fstrcpy(nt_username,
logon->password->identity_info.account_name.string);
fstrcpy(nt_domain,
@@ -848,7 +848,7 @@ NTSTATUS _netr_LogonSamLogon(pipes_struct *p,
DEBUG(3,("SAM Logon (Interactive). Domain:[%s]. ", lp_workgroup()));
break;
- case NET_LOGON_TYPE:
+ case NetlogonNetworkInformation:
fstrcpy(nt_username,
logon->network->identity_info.account_name.string);
fstrcpy(nt_domain,
@@ -873,7 +873,7 @@ NTSTATUS _netr_LogonSamLogon(pipes_struct *p,
status = NT_STATUS_OK;
switch (r->in.logon_level) {
- case NET_LOGON_TYPE:
+ case NetlogonNetworkInformation:
{
const char *wksname = nt_workstation;
@@ -902,7 +902,7 @@ NTSTATUS _netr_LogonSamLogon(pipes_struct *p,
}
break;
}
- case INTERACTIVE_LOGON_TYPE:
+ case NetlogonInteractiveInformation:
/* 'Interactive' authentication, supplies the password in its
MD4 form, encrypted with the session key. We will convert
this to challenge/response for the auth subsystem to chew
diff --git a/source3/rpc_server/srv_pipe_hnd.c b/source3/rpc_server/srv_pipe_hnd.c
index 3968d41168..c8037e6e43 100644
--- a/source3/rpc_server/srv_pipe_hnd.c
+++ b/source3/rpc_server/srv_pipe_hnd.c
@@ -24,30 +24,8 @@
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_RPC_SRV
-#define PIPE "\\PIPE\\"
-#define PIPELEN strlen(PIPE)
-
-static smb_np_struct *chain_p;
static int pipes_open;
-/*
- * Sometimes I can't decide if I hate Windows printer driver
- * writers more than I hate the Windows spooler service driver
- * writers. This gets around a combination of bugs in the spooler
- * and the HP 8500 PCL driver that causes a spooler spin. JRA.
- *
- * bumped up from 20 -> 64 after viewing traffic from WordPerfect
- * 2002 running on NT 4.- SP6
- * bumped up from 64 -> 256 after viewing traffic from con2prt
- * for lots of printers on a WinNT 4.x SP6 box.
- */
-
-#ifndef MAX_OPEN_SPOOLSS_PIPES
-#define MAX_OPEN_SPOOLSS_PIPES 256
-#endif
-static int current_spoolss_pipes_open;
-
-static smb_np_struct *Pipes;
static pipes_struct *InternalPipes;
static struct bitmap *bmap;
@@ -94,15 +72,6 @@ void set_pipe_handle_offset(int max_open_files)
}
/****************************************************************************
- Reset pipe chain handle number.
-****************************************************************************/
-
-void reset_chain_p(void)
-{
- chain_p = NULL;
-}
-
-/****************************************************************************
Initialise pipe handle states.
****************************************************************************/
@@ -145,132 +114,20 @@ static bool pipe_init_outgoing_data(pipes_struct *p)
}
/****************************************************************************
- Find first available pipe slot.
-****************************************************************************/
-
-smb_np_struct *open_rpc_pipe_p(const char *pipe_name,
- connection_struct *conn, uint16 vuid)
-{
- int i;
- smb_np_struct *p, *p_it;
- static int next_pipe;
- bool is_spoolss_pipe = False;
-
- DEBUG(4,("Open pipe requested %s (pipes_open=%d)\n",
- pipe_name, pipes_open));
-
- if (strstr(pipe_name, "spoolss")) {
- is_spoolss_pipe = True;
- }
-
- if (is_spoolss_pipe && current_spoolss_pipes_open >= MAX_OPEN_SPOOLSS_PIPES) {
- DEBUG(10,("open_rpc_pipe_p: spooler bug workaround. Denying open on pipe %s\n",
- pipe_name ));
- return NULL;
- }
-
- /* not repeating pipe numbers makes it easier to track things in
- log files and prevents client bugs where pipe numbers are reused
- over connection restarts */
-
- if (next_pipe == 0) {
- next_pipe = (sys_getpid() ^ time(NULL)) % MAX_OPEN_PIPES;
- }
-
- i = bitmap_find(bmap, next_pipe);
-
- if (i == -1) {
- DEBUG(0,("ERROR! Out of pipe structures\n"));
- return NULL;
- }
-
- next_pipe = (i+1) % MAX_OPEN_PIPES;
-
- for (p = Pipes; p; p = p->next) {
- DEBUG(5,("open_rpc_pipe_p: name %s pnum=%x\n", p->name, p->pnum));
- }
-
- p = talloc(NULL, smb_np_struct);
- if (!p) {
- DEBUG(0,("ERROR! no memory for smb_np_struct!\n"));
- return NULL;
- }
-
- ZERO_STRUCTP(p);
-
- p->name = talloc_strdup(p, pipe_name);
- if (p->name == NULL) {
- TALLOC_FREE(p);
- DEBUG(0,("ERROR! no memory for pipe name!\n"));
- return NULL;
- }
-
- /* add a dso mechanism instead of this, here */
-
- p->namedpipe_create = make_internal_rpc_pipe_p;
- p->namedpipe_read = read_from_internal_pipe;
- p->namedpipe_write = write_to_internal_pipe;
-
- p->np_state = p->namedpipe_create(pipe_name, conn->client_address,
- conn->server_info, vuid);
-
- if (p->np_state == NULL) {
- DEBUG(0,("open_rpc_pipe_p: make_internal_rpc_pipe_p failed.\n"));
- TALLOC_FREE(p);
- return NULL;
- }
-
- DLIST_ADD(Pipes, p);
-
- /*
- * Initialize the incoming RPC data buffer with one PDU worth of memory.
- * We cheat here and say we're marshalling, as we intend to add incoming
- * data directly into the prs_struct and we want it to auto grow. We will
- * change the type to UNMARSALLING before processing the stream.
- */
-
- bitmap_set(bmap, i);
- i += pipe_handle_offset;
-
- pipes_open++;
-
- p->pnum = i;
-
- p->open = True;
- p->device_state = 0;
- p->priority = 0;
- p->conn = conn;
- p->vuid = vuid;
-
- p->max_trans_reply = 0;
-
- DEBUG(4,("Opened pipe %s with handle %x (pipes_open=%d)\n",
- pipe_name, i, pipes_open));
-
- chain_p = p;
-
- /* Iterate over p_it as a temp variable, to display all open pipes */
- for (p_it = Pipes; p_it; p_it = p_it->next) {
- DEBUG(5,("open pipes: name %s pnum=%x\n", p_it->name, p_it->pnum));
- }
-
- return chain_p;
-}
-
-/****************************************************************************
Make an internal namedpipes structure
****************************************************************************/
-struct pipes_struct *make_internal_rpc_pipe_p(const char *pipe_name,
- const char *client_address,
- struct auth_serversupplied_info *server_info,
- uint16_t vuid)
+static struct pipes_struct *make_internal_rpc_pipe_p(TALLOC_CTX *mem_ctx,
+ const char *pipe_name,
+ const char *client_address,
+ struct auth_serversupplied_info *server_info,
+ uint16_t vuid)
{
pipes_struct *p;
DEBUG(4,("Create pipe requested %s\n", pipe_name));
- p = TALLOC_ZERO_P(NULL, pipes_struct);
+ p = TALLOC_ZERO_P(mem_ctx, struct pipes_struct);
if (!p) {
DEBUG(0,("ERROR! no memory for pipes_struct!\n"));
@@ -903,26 +760,10 @@ incoming data size = %u\n", (unsigned int)p->in_data.pdu_received_len, (unsigned
}
/****************************************************************************
- Accepts incoming data on an rpc pipe.
-****************************************************************************/
-
-ssize_t write_to_pipe(smb_np_struct *p, char *data, size_t n)
-{
- DEBUG(6,("write_to_pipe: %x", p->pnum));
-
- DEBUG(6,(" name: %s open: %s len: %d\n",
- p->name, BOOLSTR(p->open), (int)n));
-
- dump_data(50, (uint8 *)data, n);
-
- return p->namedpipe_write(p->np_state, data, n);
-}
-
-/****************************************************************************
Accepts incoming data on an internal rpc pipe.
****************************************************************************/
-ssize_t write_to_internal_pipe(struct pipes_struct *p, char *data, size_t n)
+static ssize_t write_to_internal_pipe(struct pipes_struct *p, char *data, size_t n)
{
size_t data_left = n;
@@ -957,32 +798,8 @@ ssize_t write_to_internal_pipe(struct pipes_struct *p, char *data, size_t n)
have been prepared into arrays of headers + data stream sections.
****************************************************************************/
-ssize_t read_from_pipe(smb_np_struct *p, char *data, size_t n,
- bool *is_data_outstanding)
-{
- if (!p || !p->open) {
- DEBUG(0,("read_from_pipe: pipe not open\n"));
- return -1;
- }
-
- DEBUG(6,("read_from_pipe: %x", p->pnum));
-
- return p->namedpipe_read(p->np_state, data, n, is_data_outstanding);
-}
-
-/****************************************************************************
- Replies to a request to read data from a pipe.
-
- Headers are interspersed with the data at PDU intervals. By the time
- this function is called, the start of the data could possibly have been
- read by an SMBtrans (file_offset != 0).
-
- Calling create_rpc_reply() here is a hack. The data should already
- have been prepared into arrays of headers + data stream sections.
-****************************************************************************/
-
-ssize_t read_from_internal_pipe(struct pipes_struct *p, char *data, size_t n,
- bool *is_data_outstanding)
+static ssize_t read_from_internal_pipe(struct pipes_struct *p, char *data, size_t n,
+ bool *is_data_outstanding)
{
uint32 pdu_remaining = 0;
ssize_t data_returned = 0;
@@ -1072,106 +889,6 @@ returning %d bytes.\n", p->name, (unsigned int)p->out_data.current_pdu_len,
}
/****************************************************************************
- Wait device state on a pipe. Exactly what this is for is unknown...
-****************************************************************************/
-
-bool wait_rpc_pipe_hnd_state(smb_np_struct *p, uint16 priority)
-{
- if (p == NULL) {
- return False;
- }
-
- if (p->open) {
- DEBUG(3,("wait_rpc_pipe_hnd_state: Setting pipe wait state priority=%x on pipe (name=%s)\n",
- priority, p->name));
-
- p->priority = priority;
-
- return True;
- }
-
- DEBUG(3,("wait_rpc_pipe_hnd_state: Error setting pipe wait state priority=%x (name=%s)\n",
- priority, p->name));
- return False;
-}
-
-
-/****************************************************************************
- Set device state on a pipe. Exactly what this is for is unknown...
-****************************************************************************/
-
-bool set_rpc_pipe_hnd_state(smb_np_struct *p, uint16 device_state)
-{
- if (p == NULL) {
- return False;
- }
-
- if (p->open) {
- DEBUG(3,("set_rpc_pipe_hnd_state: Setting pipe device state=%x on pipe (name=%s)\n",
- device_state, p->name));
-
- p->device_state = device_state;
-
- return True;
- }
-
- DEBUG(3,("set_rpc_pipe_hnd_state: Error setting pipe device state=%x (name=%s)\n",
- device_state, p->name));
- return False;
-}
-
-
-/****************************************************************************
- Close an rpc pipe.
-****************************************************************************/
-
-bool close_rpc_pipe_hnd(smb_np_struct *p)
-{
- if (!p) {
- DEBUG(0,("Invalid pipe in close_rpc_pipe_hnd\n"));
- return False;
- }
-
- TALLOC_FREE(p->np_state);
-
- bitmap_clear(bmap, p->pnum - pipe_handle_offset);
-
- pipes_open--;
-
- DEBUG(4,("closed pipe name %s pnum=%x (pipes_open=%d)\n",
- p->name, p->pnum, pipes_open));
-
- DLIST_REMOVE(Pipes, p);
-
- /* TODO: Remove from pipe open db */
-
- if ( !delete_pipe_opendb( p ) ) {
- DEBUG(3,("close_rpc_pipe_hnd: failed to delete %s "
- "pipe from open db.\n", p->name));
- }
-
- TALLOC_FREE(p);
-
- return True;
-}
-
-/****************************************************************************
- Close all pipes on a connection.
-****************************************************************************/
-
-void pipe_close_conn(connection_struct *conn)
-{
- smb_np_struct *p, *next;
-
- for (p=Pipes;p;p=next) {
- next = p->next;
- if (p->conn == conn) {
- close_rpc_pipe_hnd(p);
- }
- }
-}
-
-/****************************************************************************
Close an rpc pipe.
****************************************************************************/
@@ -1210,40 +927,92 @@ static int close_internal_rpc_pipe_hnd(struct pipes_struct *p)
return True;
}
-/****************************************************************************
- Find an rpc pipe given a pipe handle in a buffer and an offset.
-****************************************************************************/
+bool fsp_is_np(struct files_struct *fsp)
+{
+ return ((fsp != NULL)
+ && (fsp->fake_file_handle != NULL)
+ && (fsp->fake_file_handle->type == FAKE_FILE_TYPE_NAMED_PIPE));
+}
-smb_np_struct *get_rpc_pipe_p(uint16 pnum)
+NTSTATUS np_open(struct smb_request *smb_req, struct connection_struct *conn,
+ const char *name, struct files_struct **pfsp)
{
- if (chain_p) {
- return chain_p;
+ NTSTATUS status;
+ struct files_struct *fsp;
+ struct pipes_struct *p;
+
+ status = file_new(smb_req, conn, &fsp);
+ if (!NT_STATUS_IS_OK(status)) {
+ DEBUG(0, ("file_new failed: %s\n", nt_errstr(status)));
+ return status;
}
- return get_rpc_pipe(pnum);
-}
+ fsp->conn = conn;
+ fsp->fh->fd = -1;
+ fsp->vuid = smb_req->vuid;
+ fsp->can_lock = false;
+ fsp->access_mask = FILE_READ_DATA | FILE_WRITE_DATA;
+ string_set(&fsp->fsp_name, name);
-/****************************************************************************
- Find an rpc pipe given a pipe handle.
-****************************************************************************/
+ fsp->fake_file_handle = talloc(NULL, struct fake_file_handle);
+ if (fsp->fake_file_handle == NULL) {
+ file_free(smb_req, fsp);
+ return NT_STATUS_NO_MEMORY;
+ }
+ fsp->fake_file_handle->type = FAKE_FILE_TYPE_NAMED_PIPE;
-smb_np_struct *get_rpc_pipe(int pnum)
-{
- smb_np_struct *p;
+ p = make_internal_rpc_pipe_p(fsp->fake_file_handle, name,
+ conn->client_address, conn->server_info,
+ smb_req->vuid);
+ if (p == NULL) {
+ file_free(smb_req, fsp);
+ return NT_STATUS_PIPE_NOT_AVAILABLE;
+ }
+ fsp->fake_file_handle->private_data = p;
+
+ *pfsp = fsp;
- DEBUG(4,("search for pipe pnum=%x\n", pnum));
+ return NT_STATUS_OK;
+}
+
+NTSTATUS np_write(struct files_struct *fsp, uint8_t *data, size_t len,
+ ssize_t *nwritten)
+{
+ struct pipes_struct *p;
- for (p=Pipes;p;p=p->next) {
- DEBUG(5,("pipe name %s pnum=%x (pipes_open=%d)\n",
- p->name, p->pnum, pipes_open));
+ if (!fsp_is_np(fsp)) {
+ return NT_STATUS_INVALID_HANDLE;
}
- for (p=Pipes;p;p=p->next) {
- if (p->pnum == pnum) {
- chain_p = p;
- return p;
- }
+ p = talloc_get_type_abort(
+ fsp->fake_file_handle->private_data, struct pipes_struct);
+
+ DEBUG(6, ("np_write: %x name: %s len: %d\n", (int)fsp->fnum,
+ fsp->fsp_name, (int)len));
+ dump_data(50, data, len);
+
+ *nwritten = write_to_internal_pipe(p, (char *)data, len);
+
+ return ((*nwritten) >= 0)
+ ? NT_STATUS_OK : NT_STATUS_UNEXPECTED_IO_ERROR;
+}
+
+NTSTATUS np_read(struct files_struct *fsp, uint8_t *data, size_t len,
+ ssize_t *nread, bool *is_data_outstanding)
+{
+ struct pipes_struct *p;
+
+ if (!fsp_is_np(fsp)) {
+ return NT_STATUS_INVALID_HANDLE;
}
- return NULL;
+ p = talloc_get_type_abort(
+ fsp->fake_file_handle->private_data, struct pipes_struct);
+
+ *nread = read_from_internal_pipe(p, (char *)data, len,
+ is_data_outstanding);
+
+ return ((*nread) >= 0)
+ ? NT_STATUS_OK : NT_STATUS_UNEXPECTED_IO_ERROR;
+
}
diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c
index 6455f02374..6cf90be6d9 100644
--- a/source3/rpc_server/srv_samr_nt.c
+++ b/source3/rpc_server/srv_samr_nt.c
@@ -2437,7 +2437,7 @@ static NTSTATUS get_user_info_20(TALLOC_CTX *mem_ctx,
if (munged_dial) {
blob = base64_decode_data_blob(munged_dial);
} else {
- blob = data_blob_string_const("");
+ blob = data_blob_string_const_null("");
}
status = init_samr_parameters_string(mem_ctx, &blob, &parameters);
@@ -2546,7 +2546,7 @@ static NTSTATUS get_user_info_21(TALLOC_CTX *mem_ctx,
if (munged_dial) {
blob = base64_decode_data_blob(munged_dial);
} else {
- blob = data_blob_string_const("");
+ blob = data_blob_string_const_null("");
}
status = init_samr_parameters_string(mem_ctx, &blob, &parameters);
@@ -2942,18 +2942,18 @@ static NTSTATUS samr_QueryDomainInfo_internal(const char *fn_name,
if (lp_server_role() == ROLE_DOMAIN_BDC)
server_role = ROLE_DOMAIN_BDC;
- init_samr_DomInfo2(&dom_info->info2,
- nt_logout,
- lp_serverstring(),
- lp_workgroup(),
- global_myname(),
- seq_num,
- 1,
- server_role,
- 1,
- num_users,
- num_groups,
- num_aliases);
+ init_samr_DomGeneralInformation(&dom_info->general,
+ nt_logout,
+ lp_serverstring(),
+ lp_workgroup(),
+ global_myname(),
+ seq_num,
+ 1,
+ server_role,
+ 1,
+ num_users,
+ num_groups,
+ num_aliases);
break;
case 0x03:
@@ -2978,8 +2978,8 @@ static NTSTATUS samr_QueryDomainInfo_internal(const char *fn_name,
break;
case 0x04:
- init_samr_DomInfo4(&dom_info->info4,
- lp_serverstring());
+ init_samr_DomOEMInformation(&dom_info->oem,
+ lp_serverstring());
break;
case 0x05:
init_samr_DomInfo5(&dom_info->info5,
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 635898a9d5..af9246c49f 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -4373,7 +4373,7 @@ static bool construct_printer_info_7(Printer_entry *print_hnd, PRINTER_INFO_7 *p
if (is_printer_published(print_hnd, snum, &guid)) {
if (asprintf(&guid_str, "{%s}",
- smb_uuid_string(talloc_tos(), guid)) == -1) {
+ GUID_string(talloc_tos(), &guid)) == -1) {
return false;
}
strupper_m(guid_str);
@@ -6280,7 +6280,7 @@ bool add_printer_hook(TALLOC_CTX *ctx, NT_USER_TOKEN *token, NT_PRINTER_INFO_LEV
numlines = 0;
/* Get lines and convert them back to dos-codepage */
- qlines = fd_lines_load(fd, &numlines, 0);
+ qlines = fd_lines_load(fd, &numlines, 0, NULL);
DEBUGADD(10,("Lines returned = [%d]\n", numlines));
close(fd);
@@ -6293,7 +6293,7 @@ bool add_printer_hook(TALLOC_CTX *ctx, NT_USER_TOKEN *token, NT_PRINTER_INFO_LEV
DEBUGADD(6,("Line[0] = [%s]\n", qlines[0]));
}
- file_lines_free(qlines);
+ TALLOC_FREE(qlines);
return True;
}
@@ -7512,7 +7512,7 @@ WERROR enumports_hook(TALLOC_CTX *ctx, int *count, char ***lines )
}
numlines = 0;
- qlines = fd_lines_load(fd, &numlines, 0);
+ qlines = fd_lines_load(fd, &numlines, 0, NULL);
DEBUGADD(10,("Lines returned = [%d]\n", numlines));
close(fd);
}
@@ -7537,7 +7537,7 @@ static WERROR enumports_level_1(RPC_BUFFER *buffer, uint32 offered, uint32 *need
result = enumports_hook(talloc_tos(), &numlines, &qlines );
if (!W_ERROR_IS_OK(result)) {
- file_lines_free(qlines);
+ TALLOC_FREE(qlines);
return result;
}
@@ -7545,7 +7545,7 @@ static WERROR enumports_level_1(RPC_BUFFER *buffer, uint32 offered, uint32 *need
if((ports=SMB_MALLOC_ARRAY( PORT_INFO_1, numlines )) == NULL) {
DEBUG(10,("Returning WERR_NOMEM [%s]\n",
dos_errstr(WERR_NOMEM)));
- file_lines_free(qlines);
+ TALLOC_FREE(qlines);
return WERR_NOMEM;
}
@@ -7554,7 +7554,7 @@ static WERROR enumports_level_1(RPC_BUFFER *buffer, uint32 offered, uint32 *need
fill_port_1(&ports[i], qlines[i]);
}
}
- file_lines_free(qlines);
+ TALLOC_FREE(qlines);
*returned = numlines;
@@ -7603,13 +7603,13 @@ static WERROR enumports_level_2(RPC_BUFFER *buffer, uint32 offered, uint32 *need
result = enumports_hook(talloc_tos(), &numlines, &qlines );
if ( !W_ERROR_IS_OK(result)) {
- file_lines_free(qlines);
+ TALLOC_FREE(qlines);
return result;
}
if(numlines) {
if((ports=SMB_MALLOC_ARRAY( PORT_INFO_2, numlines)) == NULL) {
- file_lines_free(qlines);
+ TALLOC_FREE(qlines);
return WERR_NOMEM;
}
@@ -7619,7 +7619,7 @@ static WERROR enumports_level_2(RPC_BUFFER *buffer, uint32 offered, uint32 *need
}
}
- file_lines_free(qlines);
+ TALLOC_FREE(qlines);
*returned = numlines;
diff --git a/source3/rpc_server/srv_srvsvc_nt.c b/source3/rpc_server/srv_srvsvc_nt.c
index 47688b114c..b99c77c9b8 100644
--- a/source3/rpc_server/srv_srvsvc_nt.c
+++ b/source3/rpc_server/srv_srvsvc_nt.c
@@ -2112,7 +2112,7 @@ WERROR _srvsvc_NetGetFileSecurity(pipes_struct *p,
psd->dacl->revision = NT4_ACL_REVISION;
- close_file(fsp, NORMAL_CLOSE);
+ close_file(NULL, fsp, NORMAL_CLOSE);
vfs_ChDir(conn, oldcwd);
conn_free_internal(conn);
return WERR_OK;
@@ -2120,7 +2120,7 @@ WERROR _srvsvc_NetGetFileSecurity(pipes_struct *p,
error_exit:
if (fsp) {
- close_file(fsp, NORMAL_CLOSE);
+ close_file(NULL, fsp, NORMAL_CLOSE);
}
if (oldcwd) {
@@ -2231,7 +2231,7 @@ WERROR _srvsvc_NetSetFileSecurity(pipes_struct *p,
goto error_exit;
}
- close_file(fsp, NORMAL_CLOSE);
+ close_file(NULL, fsp, NORMAL_CLOSE);
vfs_ChDir(conn, oldcwd);
conn_free_internal(conn);
return WERR_OK;
@@ -2239,7 +2239,7 @@ WERROR _srvsvc_NetSetFileSecurity(pipes_struct *p,
error_exit:
if (fsp) {
- close_file(fsp, NORMAL_CLOSE);
+ close_file(NULL, fsp, NORMAL_CLOSE);
}
if (oldcwd) {
diff --git a/source3/rpc_server/srv_svcctl.c b/source3/rpc_server/srv_svcctl.c
index 483fb8e1e9..84864364f7 100644
--- a/source3/rpc_server/srv_svcctl.c
+++ b/source3/rpc_server/srv_svcctl.c
@@ -155,23 +155,7 @@ static bool api_svcctl_control_service(pipes_struct *p)
static bool api_svcctl_query_service_config(pipes_struct *p)
{
- SVCCTL_Q_QUERY_SERVICE_CONFIG q_u;
- SVCCTL_R_QUERY_SERVICE_CONFIG r_u;
- prs_struct *data = &p->in_data.data;
- prs_struct *rdata = &p->out_data.rdata;
-
- ZERO_STRUCT(q_u);
- ZERO_STRUCT(r_u);
-
- if(!svcctl_io_q_query_service_config("", &q_u, data, 0))
- return False;
-
- r_u.status = _svcctl_query_service_config(p, &q_u, &r_u);
-
- if(!svcctl_io_r_query_service_config("", &r_u, rdata, 0))
- return False;
-
- return True;
+ return proxy_svcctl_call(p, SVCCTL_QUERY_SERVICE_CONFIG_W);
}
/*******************************************************************
diff --git a/source3/rpc_server/srv_svcctl_nt.c b/source3/rpc_server/srv_svcctl_nt.c
index a57d0ff4a4..a7215ac686 100644
--- a/source3/rpc_server/srv_svcctl_nt.c
+++ b/source3/rpc_server/srv_svcctl_nt.c
@@ -6,6 +6,7 @@
*
* Largely Rewritten (Again) by:
* Copyright (C) Gerald (Jerry) Carter 2005.
+ * Copyright (C) Guenther Deschner 2008.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -61,7 +62,7 @@ static const struct generic_mapping svc_generic_map =
bool init_service_op_table( void )
{
const char **service_list = lp_svcctl_list();
- int num_services = SVCCTL_NUM_INTERNAL_SERVICES + str_list_count( service_list );
+ int num_services = SVCCTL_NUM_INTERNAL_SERVICES + str_list_length( service_list );
int i;
if ( !(svcctl_ops = TALLOC_ARRAY( NULL, struct service_control_op, num_services+1)) ) {
@@ -610,7 +611,9 @@ WERROR _svcctl_query_service_status_ex( pipes_struct *p, SVCCTL_Q_QUERY_SERVICE_
/********************************************************************
********************************************************************/
-static WERROR fill_svc_config( TALLOC_CTX *ctx, const char *name, SERVICE_CONFIG *config, NT_USER_TOKEN *token )
+static WERROR fill_svc_config( TALLOC_CTX *ctx, const char *name,
+ struct QUERY_SERVICE_CONFIG *config,
+ NT_USER_TOKEN *token )
{
REGVAL_CTR *values;
REGISTRY_VALUE *val;
@@ -622,20 +625,17 @@ static WERROR fill_svc_config( TALLOC_CTX *ctx, const char *name, SERVICE_CONFIG
/* now fill in the individual values */
- config->displayname = TALLOC_ZERO_P( ctx, UNISTR2 );
if ( (val = regval_ctr_getvalue( values, "DisplayName" )) != NULL )
- init_unistr2( config->displayname, regval_sz( val ), UNI_STR_TERMINATE );
+ config->displayname = regval_sz(val);
else
- init_unistr2( config->displayname, name, UNI_STR_TERMINATE );
+ config->displayname = name;
if ( (val = regval_ctr_getvalue( values, "ObjectName" )) != NULL ) {
- config->startname = TALLOC_ZERO_P( ctx, UNISTR2 );
- init_unistr2( config->startname, regval_sz( val ), UNI_STR_TERMINATE );
+ config->startname = regval_sz(val);
}
if ( (val = regval_ctr_getvalue( values, "ImagePath" )) != NULL ) {
- config->executablepath = TALLOC_ZERO_P( ctx, UNISTR2 );
- init_unistr2( config->executablepath, regval_sz( val ), UNI_STR_TERMINATE );
+ config->executablepath = regval_sz(val);
}
/* a few hard coded values */
@@ -663,11 +663,13 @@ static WERROR fill_svc_config( TALLOC_CTX *ctx, const char *name, SERVICE_CONFIG
}
/********************************************************************
+ _svcctl_QueryServiceConfigW
********************************************************************/
-WERROR _svcctl_query_service_config( pipes_struct *p, SVCCTL_Q_QUERY_SERVICE_CONFIG *q_u, SVCCTL_R_QUERY_SERVICE_CONFIG *r_u )
+WERROR _svcctl_QueryServiceConfigW(pipes_struct *p,
+ struct svcctl_QueryServiceConfigW *r)
{
- SERVICE_INFO *info = find_service_info_by_hnd( p, &q_u->handle );
+ SERVICE_INFO *info = find_service_info_by_hnd( p, r->in.handle );
uint32 buffer_size;
WERROR wresult;
@@ -682,17 +684,17 @@ WERROR _svcctl_query_service_config( pipes_struct *p, SVCCTL_Q_QUERY_SERVICE_CON
/* we have to set the outgoing buffer size to the same as the
incoming buffer size (even in the case of failure */
- r_u->needed = q_u->buffer_size;
+ *r->out.bytes_needed = r->in.buf_size;
- wresult = fill_svc_config( p->mem_ctx, info->name, &r_u->config, p->pipe_user.nt_user_token );
+ wresult = fill_svc_config( p->mem_ctx, info->name, r->out.query, p->pipe_user.nt_user_token );
if ( !W_ERROR_IS_OK(wresult) )
return wresult;
- buffer_size = svcctl_sizeof_service_config( &r_u->config );
- r_u->needed = (buffer_size > q_u->buffer_size) ? buffer_size : q_u->buffer_size;
+ buffer_size = ndr_size_QUERY_SERVICE_CONFIG(r->out.query, 0);
+ *r->out.bytes_needed = (buffer_size > r->in.buf_size) ? buffer_size : r->in.buf_size;
- if (buffer_size > q_u->buffer_size ) {
- ZERO_STRUCTP( &r_u->config );
+ if (buffer_size > r->in.buf_size ) {
+ TALLOC_FREE(r->out.query);
return WERR_INSUFFICIENT_BUFFER;
}
@@ -956,12 +958,6 @@ WERROR _svcctl_EnumServicesStatusW(pipes_struct *p, struct svcctl_EnumServicesSt
return WERR_NOT_SUPPORTED;
}
-WERROR _svcctl_QueryServiceConfigW(pipes_struct *p, struct svcctl_QueryServiceConfigW *r)
-{
- p->rng_fault_state = True;
- return WERR_NOT_SUPPORTED;
-}
-
WERROR _svcctl_QueryServiceLockStatusW(pipes_struct *p, struct svcctl_QueryServiceLockStatusW *r)
{
p->rng_fault_state = True;
diff --git a/source3/rpc_server/srv_winreg_nt.c b/source3/rpc_server/srv_winreg_nt.c
index 3991c5ae02..7e842ed54d 100644
--- a/source3/rpc_server/srv_winreg_nt.c
+++ b/source3/rpc_server/srv_winreg_nt.c
@@ -230,11 +230,11 @@ WERROR _winreg_QueryValue(pipes_struct *p, struct winreg_QueryValue *r)
if ( !regkey )
return WERR_BADFID;
- if ((r->out.value_length == NULL) || (r->out.type == NULL)) {
+ if ((r->out.data_length == NULL) || (r->out.type == NULL)) {
return WERR_INVALID_PARAM;
}
- *r->out.value_length = *r->out.type = REG_NONE;
+ *r->out.data_length = *r->out.type = REG_NONE;
DEBUG(7,("_reg_info: policy key name = [%s]\n", regkey->key->name));
DEBUG(7,("_reg_info: policy key type = [%08x]\n", regkey->key->type));
@@ -290,8 +290,8 @@ WERROR _winreg_QueryValue(pipes_struct *p, struct winreg_QueryValue *r)
if (r->out.data_size) {
*r->out.data_size = 0;
}
- if (r->out.value_length) {
- *r->out.value_length = 0;
+ if (r->out.data_length) {
+ *r->out.data_length = 0;
}
return status;
}
@@ -306,18 +306,18 @@ WERROR _winreg_QueryValue(pipes_struct *p, struct winreg_QueryValue *r)
*r->out.type = val->type;
}
- *r->out.value_length = outbuf_size;
+ *r->out.data_length = outbuf_size;
if ( *r->in.data_size == 0 || !r->out.data ) {
status = WERR_OK;
- } else if ( *r->out.value_length > *r->in.data_size ) {
+ } else if ( *r->out.data_length > *r->in.data_size ) {
status = WERR_MORE_DATA;
} else {
- memcpy( r->out.data, outbuf, *r->out.value_length );
+ memcpy( r->out.data, outbuf, *r->out.data_length );
status = WERR_OK;
}
- *r->out.data_size = *r->out.value_length;
+ *r->out.data_size = *r->out.data_length;
if (free_prs) prs_mem_free(&prs_hkpd);
if (free_buf) SAFE_FREE(outbuf);
@@ -514,8 +514,8 @@ WERROR _winreg_InitiateSystemShutdownEx(pipes_struct *p, struct winreg_InitiateS
/* pull the message string and perform necessary sanity checks on it */
- if ( r->in.message && r->in.message->name && r->in.message->name->name ) {
- if ( (msg = talloc_strdup(p->mem_ctx, r->in.message->name->name )) == NULL ) {
+ if ( r->in.message && r->in.message->string ) {
+ if ( (msg = talloc_strdup(p->mem_ctx, r->in.message->string )) == NULL ) {
return WERR_NOMEM;
}
chkmsg = TALLOC_ARRAY(p->mem_ctx, char, strlen(msg)+1);
diff --git a/source3/rpcclient/cmd_drsuapi.c b/source3/rpcclient/cmd_drsuapi.c
index 71757f5ea3..8fbd798ed0 100644
--- a/source3/rpcclient/cmd_drsuapi.c
+++ b/source3/rpcclient/cmd_drsuapi.c
@@ -103,7 +103,7 @@ static WERROR cmd_drsuapi_cracknames(struct rpc_pipe_client *cli,
werr = cracknames(cli, mem_ctx,
&bind_handle,
- DRSUAPI_DS_NAME_FORMAT_UKNOWN,
+ DRSUAPI_DS_NAME_FORMAT_UNKNOWN,
DRSUAPI_DS_NAME_FORMAT_FQDN_1779,
1,
argv+1,
@@ -419,7 +419,7 @@ static WERROR cmd_drsuapi_getncchanges(struct rpc_pipe_client *cli,
werr = cracknames(cli, mem_ctx,
&bind_handle,
- DRSUAPI_DS_NAME_FORMAT_UKNOWN,
+ DRSUAPI_DS_NAME_FORMAT_UNKNOWN,
DRSUAPI_DS_NAME_FORMAT_FQDN_1779,
1,
&name,
@@ -495,9 +495,9 @@ static WERROR cmd_drsuapi_getncchanges(struct rpc_pipe_client *cli,
if (level_out == 1) {
out_level = 1;
ctr1 = &ctr.ctr1;
- } else if (level_out == 2) {
+ } else if (level_out == 2 && ctr.ctr2.mszip1.ts) {
out_level = 1;
- ctr1 = ctr.ctr2.ctr.mszip1.ctr1;
+ ctr1 = &ctr.ctr2.mszip1.ts->ctr1;
}
status = cli_get_session_key(mem_ctx, cli, &session_key);
@@ -527,9 +527,16 @@ static WERROR cmd_drsuapi_getncchanges(struct rpc_pipe_client *cli,
ctr6 = &ctr.ctr6;
} else if (level_out == 7
&& ctr.ctr7.level == 6
- && ctr.ctr7.type == DRSUAPI_COMPRESSION_TYPE_MSZIP) {
+ && ctr.ctr7.type == DRSUAPI_COMPRESSION_TYPE_MSZIP
+ && ctr.ctr7.ctr.mszip6.ts) {
out_level = 6;
- ctr6 = ctr.ctr7.ctr.mszip6.ctr6;
+ ctr6 = &ctr.ctr7.ctr.mszip6.ts->ctr6;
+ } else if (level_out == 7
+ && ctr.ctr7.level == 6
+ && ctr.ctr7.type == DRSUAPI_COMPRESSION_TYPE_XPRESS
+ && ctr.ctr7.ctr.xpress6.ts) {
+ out_level = 6;
+ ctr6 = &ctr.ctr7.ctr.xpress6.ts->ctr6;
}
if (out_level == 6) {
diff --git a/source3/rpcclient/cmd_lsarpc.c b/source3/rpcclient/cmd_lsarpc.c
index 5b5b4ff78c..746fc25d7d 100644
--- a/source3/rpcclient/cmd_lsarpc.c
+++ b/source3/rpcclient/cmd_lsarpc.c
@@ -112,8 +112,8 @@ static void display_query_info_12(struct lsa_DnsDomainInfo *r)
d_printf("Domain DNS Name: %s\n", r->dns_domain.string);
d_printf("Domain Forest Name: %s\n", r->dns_forest.string);
d_printf("Domain Sid: %s\n", sid_string_tos(r->sid));
- d_printf("Domain GUID: %s\n", smb_uuid_string(talloc_tos(),
- r->domain_guid));
+ d_printf("Domain GUID: %s\n", GUID_string(talloc_tos(),
+ &r->domain_guid));
}
static void display_lsa_query_info(union lsa_PolicyInformation *info,
diff --git a/source3/rpcclient/cmd_netlogon.c b/source3/rpcclient/cmd_netlogon.c
index 87ba65c14b..cdcc0ec28d 100644
--- a/source3/rpcclient/cmd_netlogon.c
+++ b/source3/rpcclient/cmd_netlogon.c
@@ -688,7 +688,7 @@ static NTSTATUS cmd_netlogon_sam_logon(struct rpc_pipe_client *cli,
const char **argv)
{
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
- int logon_type = NET_LOGON_TYPE;
+ int logon_type = NetlogonNetworkInformation;
const char *username, *password;
int auth_level = 2;
uint32 logon_param = 0;
diff --git a/source3/rpcclient/cmd_samr.c b/source3/rpcclient/cmd_samr.c
index fa1e0fda4d..3494e9123a 100644
--- a/source3/rpcclient/cmd_samr.c
+++ b/source3/rpcclient/cmd_samr.c
@@ -79,17 +79,17 @@ static void display_samr_user_info_21(struct samr_UserInfo21 *r)
dump_data(0, (uint8_t *)r->parameters.array, r->parameters.length*2);
printf("\tLogon Time :\t%s\n",
- http_timestring(nt_time_to_unix(r->last_logon)));
+ http_timestring(talloc_tos(), nt_time_to_unix(r->last_logon)));
printf("\tLogoff Time :\t%s\n",
- http_timestring(nt_time_to_unix(r->last_logoff)));
+ http_timestring(talloc_tos(), nt_time_to_unix(r->last_logoff)));
printf("\tKickoff Time :\t%s\n",
- http_timestring(nt_time_to_unix(r->acct_expiry)));
+ http_timestring(talloc_tos(), nt_time_to_unix(r->acct_expiry)));
printf("\tPassword last set Time :\t%s\n",
- http_timestring(nt_time_to_unix(r->last_password_change)));
+ http_timestring(talloc_tos(), nt_time_to_unix(r->last_password_change)));
printf("\tPassword can change Time :\t%s\n",
- http_timestring(nt_time_to_unix(r->allow_password_change)));
+ http_timestring(talloc_tos(), nt_time_to_unix(r->allow_password_change)));
printf("\tPassword must change Time:\t%s\n",
- http_timestring(nt_time_to_unix(r->force_password_change)));
+ http_timestring(talloc_tos(), nt_time_to_unix(r->force_password_change)));
printf("\tunknown_2[0..31]...\n"); /* user passwords? */
@@ -146,24 +146,24 @@ static void display_sam_dom_info_1(struct samr_DomInfo1 *info1)
display_time(info1->min_password_age));
}
-static void display_sam_dom_info_2(struct samr_DomInfo2 *info2)
+static void display_sam_dom_info_2(struct samr_DomGeneralInformation *general)
{
- printf("Domain:\t\t%s\n", info2->domain_name.string);
- printf("Server:\t\t%s\n", info2->primary.string);
- printf("Comment:\t%s\n", info2->comment.string);
+ printf("Domain:\t\t%s\n", general->domain_name.string);
+ printf("Server:\t\t%s\n", general->primary.string);
+ printf("Comment:\t%s\n", general->oem_information.string);
- printf("Total Users:\t%d\n", info2->num_users);
- printf("Total Groups:\t%d\n", info2->num_groups);
- printf("Total Aliases:\t%d\n", info2->num_aliases);
+ printf("Total Users:\t%d\n", general->num_users);
+ printf("Total Groups:\t%d\n", general->num_groups);
+ printf("Total Aliases:\t%d\n", general->num_aliases);
- printf("Sequence No:\t%llu\n", (unsigned long long)info2->sequence_num);
+ printf("Sequence No:\t%llu\n", (unsigned long long)general->sequence_num);
printf("Force Logoff:\t%d\n",
- (int)nt_time_to_unix_abs(&info2->force_logoff_time));
+ (int)nt_time_to_unix_abs(&general->force_logoff_time));
- printf("Unknown 2:\t0x%x\n", info2->unknown2);
- printf("Server Role:\t%s\n", server_role_str(info2->role));
- printf("Unknown 3:\t0x%x\n", info2->unknown3);
+ printf("Unknown 2:\t0x%x\n", general->unknown2);
+ printf("Server Role:\t%s\n", server_role_str(general->role));
+ printf("Unknown 3:\t0x%x\n", general->unknown3);
}
static void display_sam_dom_info_3(struct samr_DomInfo3 *info3)
@@ -172,9 +172,9 @@ static void display_sam_dom_info_3(struct samr_DomInfo3 *info3)
(int)nt_time_to_unix_abs(&info3->force_logoff_time));
}
-static void display_sam_dom_info_4(struct samr_DomInfo4 *info4)
+static void display_sam_dom_info_4(struct samr_DomOEMInformation *oem)
{
- printf("Comment:\t%s\n", info4->comment.string);
+ printf("Comment:\t%s\n", oem->oem_information.string);
}
static void display_sam_dom_info_5(struct samr_DomInfo5 *info5)
@@ -196,7 +196,7 @@ static void display_sam_dom_info_8(struct samr_DomInfo8 *info8)
{
printf("Sequence No:\t%llu\n", (unsigned long long)info8->sequence_num);
printf("Domain Create Time:\t%s\n",
- http_timestring(nt_time_to_unix(info8->domain_create_time)));
+ http_timestring(talloc_tos(), nt_time_to_unix(info8->domain_create_time)));
}
static void display_sam_dom_info_9(struct samr_DomInfo9 *info9)
@@ -218,7 +218,7 @@ static void display_sam_dom_info_13(struct samr_DomInfo13 *info13)
{
printf("Sequence No:\t%llu\n", (unsigned long long)info13->sequence_num);
printf("Domain Create Time:\t%s\n",
- http_timestring(nt_time_to_unix(info13->domain_create_time)));
+ http_timestring(talloc_tos(), nt_time_to_unix(info13->domain_create_time)));
printf("Unknown1:\t%d\n", info13->unknown1);
printf("Unknown2:\t%d\n", info13->unknown2);
@@ -1607,13 +1607,13 @@ static NTSTATUS cmd_samr_query_dominfo(struct rpc_pipe_client *cli,
display_sam_dom_info_1(&info->info1);
break;
case 2:
- display_sam_dom_info_2(&info->info2);
+ display_sam_dom_info_2(&info->general);
break;
case 3:
display_sam_dom_info_3(&info->info3);
break;
case 4:
- display_sam_dom_info_4(&info->info4);
+ display_sam_dom_info_4(&info->oem);
break;
case 5:
display_sam_dom_info_5(&info->info5);
diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c
index 2a9f2b82bb..378ec891a7 100644
--- a/source3/rpcclient/cmd_spoolss.c
+++ b/source3/rpcclient/cmd_spoolss.c
@@ -691,7 +691,7 @@ static void display_reg_value(REGISTRY_VALUE value)
printf("%s: REG_SZ: %s\n", value.valuename, text ? text : "");
break;
case REG_BINARY: {
- char *hex = hex_encode(NULL, value.data_p, value.size);
+ char *hex = hex_encode_talloc(NULL, value.data_p, value.size);
size_t i, len;
printf("%s: REG_BINARY:", value.valuename);
len = strlen(hex);
diff --git a/source3/samba4.m4 b/source3/samba4.m4
index 81f1809210..05d655217f 100644
--- a/source3/samba4.m4
+++ b/source3/samba4.m4
@@ -3,25 +3,51 @@ AC_SUBST(BLDSHARED)
smbtorture4_path=bin/smbtorture4
m4_include(build/m4/public.m4)
+m4_include(build/m4/check_python.m4)
+
+m4_include(build/m4/ac_pkg_swig.m4)
+
+AC_PROG_SWIG(1.3.36)
+
+AC_SAMBA_PYTHON_DEVEL([
+SMB_EXT_LIB(EXT_LIB_PYTHON, [$PYTHON_LDFLAGS], [$PYTHON_CFLAGS])
+SMB_ENABLE(EXT_LIB_PYTHON,YES)
+SMB_ENABLE(LIBPYTHON,YES)
+],[
+AC_MSG_ERROR([Python not found. Please install Python 2.x and its development headers/libraries.])
+])
+
+AC_MSG_CHECKING(python library directory)
+pythondir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(1, 0, '\\${prefix}')"`
+AC_MSG_RESULT($pythondir)
+
+AC_SUBST(pythondir)
+
m4_include(lib/smbreadline/readline.m4)
m4_include(heimdal_build/internal.m4)
-m4_include(lib/util/fault.m4)
-m4_include(lib/util/signal.m4)
-m4_include(lib/util/util.m4)
-m4_include(lib/util/fsusage.m4)
-m4_include(lib/util/xattr.m4)
-m4_include(lib/util/capability.m4)
-m4_include(lib/util/time.m4)
+m4_include(../lib/util/fault.m4)
+m4_include(../lib/util/signal.m4)
+m4_include(../lib/util/util.m4)
+m4_include(../lib/util/fsusage.m4)
+m4_include(../lib/util/xattr.m4)
+m4_include(../lib/util/capability.m4)
+m4_include(../lib/util/time.m4)
m4_include(../lib/popt/samba.m4)
m4_include(lib/charset/config.m4)
m4_include(lib/socket/config.m4)
m4_include(nsswitch/nsstest.m4)
m4_include(../pidl/config.m4)
-m4_include(lib/zlib.m4)
+m4_include(../lib/zlib/zlib.m4)
+AC_ZLIB([
+SMB_EXT_LIB(ZLIB, [${ZLIB_LIBS}])
+],[
+SMB_INCLUDE_MK(lib/zlib.mk)
+])
+
AC_CONFIG_FILES(../source4/lib/registry/registry.pc)
AC_CONFIG_FILES(../source4/librpc/dcerpc.pc)
-AC_CONFIG_FILES(../source4/librpc/ndr.pc)
+AC_CONFIG_FILES(../librpc/ndr.pc)
AC_CONFIG_FILES(../source4/lib/torture/torture.pc)
AC_CONFIG_FILES(../source4/auth/gensec/gensec.pc)
AC_CONFIG_FILES(../source4/param/samba-hostconfig.pc)
@@ -87,7 +113,6 @@ eventsdir="../source4/lib/events"
m4_include(lib/events/libevents.m4)
dnl m4_include(auth/kerberos/config.m4)
-m4_include(scripting/python/config.m4)
m4_include(auth/gensec/config.m4)
m4_include(smbd/process_model.m4)
m4_include(ntvfs/posix/config.m4)
diff --git a/source3/samba4.mk b/source3/samba4.mk
index 524fc9f64c..93022c5239 100644
--- a/source3/samba4.mk
+++ b/source3/samba4.mk
@@ -11,7 +11,7 @@ samba4srcdir = $(srcdir)/../source4
# Flags used for the samba 4 files
# $(srcdir)/include is required for config.h
-SAMBA4_CFLAGS = -I$(samba4srcdir) -I$(samba4srcdir)/include \
+SAMBA4_CFLAGS = -I.. -I$(samba4srcdir) -I$(samba4srcdir)/include \
-I$(samba4srcdir)/../lib/replace -I$(samba4srcdir)/lib \
-I$(heimdalsrcdir)/lib/hcrypto -I$(tallocdir) \
-I$(srcdir)/include -D_SAMBA_BUILD_=4 -DHAVE_CONFIG_H
@@ -62,7 +62,7 @@ include $(pidldir)/config.mk
include samba4-config.mk
include samba4-templates.mk
-zlibsrcdir := $(samba4srcdir)/lib/zlib
+zlibsrcdir := $(samba4srcdir)/../lib/zlib
dynconfigsrcdir := $(samba4srcdir)/dynconfig
heimdalsrcdir := $(samba4srcdir)/heimdal
dsdbsrcdir := $(samba4srcdir)/dsdb
@@ -84,7 +84,7 @@ poptsrcdir := $(samba4srcdir)/../lib/popt
socketwrappersrcdir := $(samba4srcdir)/../lib/socket_wrapper
nsswrappersrcdir := $(samba4srcdir)/../lib/nss_wrapper
libstreamsrcdir := $(samba4srcdir)/lib/stream
-libutilsrcdir := $(samba4srcdir)/lib/util
+libutilsrcdir := $(samba4srcdir)/../lib/util
libtdrsrcdir := $(samba4srcdir)/lib/tdr
libdbwrapsrcdir := $(samba4srcdir)/lib/dbwrap
libcryptosrcdir := $(samba4srcdir)/../lib/crypto
diff --git a/source3/script/build_idl.sh b/source3/script/build_idl.sh
index 2027fd3937..34f262ee00 100755
--- a/source3/script/build_idl.sh
+++ b/source3/script/build_idl.sh
@@ -1,14 +1,14 @@
#!/bin/sh
-PIDL_ARGS="--outputdir librpc/gen_ndr --header --ndr-parser --samba3-ndr-server --samba3-ndr-client --"
-PIDL_EXTRA_ARGS="$*"
+ARGS="--includedir=../librpc/idl --outputdir librpc/gen_ndr --header --ndr-parser --samba3-ndr-server --samba3-ndr-client $PIDL_ARGS --"
+IDL_FILES="$*"
oldpwd=`pwd`
cd ${srcdir}
[ -d librpc/gen_ndr ] || mkdir -p librpc/gen_ndr || exit 1
-PIDL="$PIDL ${PIDL_ARGS} ${PIDL_EXTRA_ARGS}"
+PIDL="$PIDL $ARGS"
##
## Find newer files rather than rebuild all of them
@@ -20,11 +20,11 @@ for f in ${IDL_FILES}; do
ndr="librpc/gen_ndr/ndr_$basename.c"
if [ -f $ndr ]; then
- if [ "x`find librpc/idl/$f -newer $ndr -print`" = "xlibrpc/idl/$f" ]; then
- list="$list librpc/idl/$f"
+ if [ "x`find $f -newer $ndr -print`" = "x$f" ]; then
+ list="$list $f"
fi
else
- list="$list librpc/idl/$f"
+ list="$list $f"
fi
done
diff --git a/source3/smbd/blocking.c b/source3/smbd/blocking.c
index 479361a8c1..4374b50eac 100644
--- a/source3/smbd/blocking.c
+++ b/source3/smbd/blocking.c
@@ -33,10 +33,10 @@ typedef struct _blocking_lock_record {
files_struct *fsp;
struct timeval expire_time;
int lock_num;
- SMB_BIG_UINT offset;
- SMB_BIG_UINT count;
- uint32 lock_pid;
- uint32 blocking_pid; /* PID that blocks us. */
+ uint64_t offset;
+ uint64_t count;
+ uint32_t lock_pid;
+ uint32_t blocking_pid; /* PID that blocks us. */
enum brl_flavour lock_flav;
enum brl_type lock_type;
char *inbuf;
@@ -154,12 +154,12 @@ bool push_blocking_lock_request( struct byte_range_lock *br_lck,
files_struct *fsp,
int lock_timeout,
int lock_num,
- uint32 lock_pid,
+ uint32_t lock_pid,
enum brl_type lock_type,
enum brl_flavour lock_flav,
- SMB_BIG_UINT offset,
- SMB_BIG_UINT count,
- uint32 blocking_pid)
+ uint64_t offset,
+ uint64_t count,
+ uint32_t blocking_pid)
{
static bool set_lock_msg;
size_t length = smb_len(req->inbuf)+4;
@@ -331,7 +331,7 @@ static void reply_lockingX_error(blocking_lock_record *blr, NTSTATUS status)
char *inbuf = blr->inbuf;
files_struct *fsp = blr->fsp;
uint16 num_ulocks = SVAL(inbuf,smb_vwv6);
- SMB_BIG_UINT count = (SMB_BIG_UINT)0, offset = (SMB_BIG_UINT) 0;
+ uint64_t count = (uint64_t)0, offset = (uint64_t) 0;
uint32 lock_pid;
unsigned char locktype = CVAL(inbuf,smb_vwv3);
bool large_file_format = (locktype & LOCKING_ANDX_LARGE_FILES);
@@ -420,7 +420,7 @@ static bool process_lockingX(blocking_lock_record *blr)
files_struct *fsp = blr->fsp;
uint16 num_ulocks = SVAL(inbuf,smb_vwv6);
uint16 num_locks = SVAL(inbuf,smb_vwv7);
- SMB_BIG_UINT count = (SMB_BIG_UINT)0, offset = (SMB_BIG_UINT)0;
+ uint64_t count = (uint64_t)0, offset = (uint64_t)0;
uint32 lock_pid;
bool large_file_format = (locktype & LOCKING_ANDX_LARGE_FILES);
char *data;
@@ -704,7 +704,6 @@ static void process_blocking_lock_queue(void)
* sitting around....
*/
chain_size = 0;
- file_chain_reset();
fsp = blr->fsp;
conn = conn_find(SVAL(blr->inbuf,smb_tid));
@@ -875,8 +874,8 @@ static void process_blocking_lock_cancel_message(struct messaging_context *ctx,
bool blocking_lock_cancel(files_struct *fsp,
uint32 lock_pid,
- SMB_BIG_UINT offset,
- SMB_BIG_UINT count,
+ uint64_t offset,
+ uint64_t count,
enum brl_flavour lock_flav,
unsigned char locktype,
NTSTATUS err)
diff --git a/source3/smbd/chgpasswd.c b/source3/smbd/chgpasswd.c
index 2596e73380..64a4311256 100644
--- a/source3/smbd/chgpasswd.c
+++ b/source3/smbd/chgpasswd.c
@@ -1131,7 +1131,7 @@ NTSTATUS change_oem_password(struct samu *hnd, char *old_passwd, char *new_passw
if ((can_change_time != 0) && (time(NULL) < can_change_time)) {
DEBUG(1, ("user %s cannot change password now, must "
"wait until %s\n", username,
- http_timestring(can_change_time)));
+ http_timestring(talloc_tos(), can_change_time)));
if (samr_reject_reason) {
*samr_reject_reason = SAMR_REJECT_OTHER;
}
diff --git a/source3/smbd/close.c b/source3/smbd/close.c
index 818b4c70a8..d4c531ab19 100644
--- a/source3/smbd/close.c
+++ b/source3/smbd/close.c
@@ -505,7 +505,8 @@ static NTSTATUS update_write_time_on_close(struct files_struct *fsp)
delete on close is done on normal and shutdown close.
****************************************************************************/
-static NTSTATUS close_normal_file(files_struct *fsp, enum file_close_type close_type)
+static NTSTATUS close_normal_file(struct smb_request *req, files_struct *fsp,
+ enum file_close_type close_type)
{
NTSTATUS status = NT_STATUS_OK;
NTSTATUS saved_status1 = NT_STATUS_OK;
@@ -536,7 +537,7 @@ static NTSTATUS close_normal_file(files_struct *fsp, enum file_close_type close_
if (fsp->print_file) {
print_fsp_end(fsp, close_type);
- file_free(fsp);
+ file_free(req, fsp);
return NT_STATUS_OK;
}
@@ -585,7 +586,7 @@ static NTSTATUS close_normal_file(files_struct *fsp, enum file_close_type close_
conn->num_files_open,
nt_errstr(status) ));
- file_free(fsp);
+ file_free(req, fsp);
return status;
}
@@ -593,7 +594,8 @@ static NTSTATUS close_normal_file(files_struct *fsp, enum file_close_type close_
Close a directory opened by an NT SMB call.
****************************************************************************/
-static NTSTATUS close_directory(files_struct *fsp, enum file_close_type close_type)
+static NTSTATUS close_directory(struct smb_request *req, files_struct *fsp,
+ enum file_close_type close_type)
{
struct share_mode_lock *lck = 0;
bool delete_dir = False;
@@ -698,7 +700,7 @@ static NTSTATUS close_directory(files_struct *fsp, enum file_close_type close_ty
* Do the code common to files and directories.
*/
close_filestruct(fsp);
- file_free(fsp);
+ file_free(req, fsp);
return status;
}
@@ -706,17 +708,18 @@ static NTSTATUS close_directory(files_struct *fsp, enum file_close_type close_ty
Close a files_struct.
****************************************************************************/
-NTSTATUS close_file(files_struct *fsp, enum file_close_type close_type)
+NTSTATUS close_file(struct smb_request *req, files_struct *fsp,
+ enum file_close_type close_type)
{
NTSTATUS status;
struct files_struct *base_fsp = fsp->base_fsp;
if(fsp->is_directory) {
- status = close_directory(fsp, close_type);
+ status = close_directory(req, fsp, close_type);
} else if (fsp->fake_file_handle != NULL) {
- status = close_fake_file(fsp);
+ status = close_fake_file(req, fsp);
} else {
- status = close_normal_file(fsp, close_type);
+ status = close_normal_file(req, fsp, close_type);
}
if ((base_fsp != NULL) && (close_type != SHUTDOWN_CLOSE)) {
@@ -731,7 +734,7 @@ NTSTATUS close_file(files_struct *fsp, enum file_close_type close_type)
*/
SMB_ASSERT(base_fsp->base_fsp == NULL);
- close_file(base_fsp, close_type);
+ close_file(req, base_fsp, close_type);
}
return status;
@@ -768,5 +771,5 @@ void msg_close_file(struct messaging_context *msg_ctx,
DEBUG(10,("msg_close_file: failed to find file.\n"));
return;
}
- close_file(fsp, NORMAL_CLOSE);
+ close_file(NULL, fsp, NORMAL_CLOSE);
}
diff --git a/source3/smbd/connection.c b/source3/smbd/connection.c
index 8dd5964f5f..3b72a9505a 100644
--- a/source3/smbd/connection.c
+++ b/source3/smbd/connection.c
@@ -2,17 +2,17 @@
Unix SMB/CIFS implementation.
connection claim routines
Copyright (C) Andrew Tridgell 1998
-
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@@ -63,7 +63,7 @@ static int count_fn(struct db_record *rec,
void *udp)
{
struct count_stat *cs = (struct count_stat *)udp;
-
+
if (crec->cnum == -1) {
return 0;
}
@@ -159,7 +159,7 @@ bool claim_connection(connection_struct *conn, const char *name,
}
crec.start = time(NULL);
crec.bcast_msg_flags = msg_flags;
-
+
strlcpy(crec.machine,get_remote_machine_name(),sizeof(crec.machine));
strlcpy(crec.addr,conn?conn->client_address:
client_addr(get_client_fd(),addr,sizeof(addr)),
@@ -224,109 +224,3 @@ bool register_message_flags(bool doreg, uint32 msg_flags)
return True;
}
-
-/*********************************************************************
-*********************************************************************/
-
-static TDB_DATA* make_pipe_rec_key( struct pipe_open_rec *prec )
-{
- TDB_DATA *kbuf = NULL;
- fstring key_string;
-
- if ( !prec )
- return NULL;
-
- if ( (kbuf = TALLOC_P(prec, TDB_DATA)) == NULL ) {
- return NULL;
- }
-
- snprintf( key_string, sizeof(key_string), "%s/%d/%d",
- prec->name, procid_to_pid(&prec->pid), prec->pnum );
-
- *kbuf = string_term_tdb_data(talloc_strdup(prec, key_string));
- if (kbuf->dptr == NULL )
- return NULL;
-
- return kbuf;
-}
-
-/*********************************************************************
-*********************************************************************/
-
-static void fill_pipe_open_rec( struct pipe_open_rec *prec, smb_np_struct *p )
-{
- prec->pid = pid_to_procid(sys_getpid());
- prec->pnum = p->pnum;
- prec->uid = geteuid();
- fstrcpy( prec->name, p->name );
-
- return;
-}
-
-/*********************************************************************
-*********************************************************************/
-
-bool store_pipe_opendb( smb_np_struct *p )
-{
- struct db_record *dbrec;
- struct pipe_open_rec *prec;
- TDB_DATA *key;
- TDB_DATA data;
- bool ret = False;
-
- if ( (prec = TALLOC_P( NULL, struct pipe_open_rec)) == NULL ) {
- DEBUG(0,("store_pipe_opendb: talloc failed!\n"));
- return False;
- }
-
- fill_pipe_open_rec( prec, p );
- if ( (key = make_pipe_rec_key( prec )) == NULL ) {
- goto done;
- }
-
- data.dptr = (uint8 *)prec;
- data.dsize = sizeof(struct pipe_open_rec);
-
- if (!(dbrec = connections_fetch_record(prec, *key))) {
- DEBUG(0, ("connections_fetch_record failed\n"));
- goto done;
- }
-
- ret = NT_STATUS_IS_OK(dbrec->store(dbrec, data, TDB_REPLACE));
-
-done:
- TALLOC_FREE( prec );
- return ret;
-}
-
-/*********************************************************************
-*********************************************************************/
-
-bool delete_pipe_opendb( smb_np_struct *p )
-{
- struct db_record *dbrec;
- struct pipe_open_rec *prec;
- TDB_DATA *key;
- bool ret = False;
-
- if ( (prec = TALLOC_P( NULL, struct pipe_open_rec)) == NULL ) {
- DEBUG(0,("store_pipe_opendb: talloc failed!\n"));
- return False;
- }
-
- fill_pipe_open_rec( prec, p );
- if ( (key = make_pipe_rec_key( prec )) == NULL ) {
- goto done;
- }
-
- if (!(dbrec = connections_fetch_record(prec, *key))) {
- DEBUG(0, ("connections_fetch_record failed\n"));
- goto done;
- }
-
- ret = NT_STATUS_IS_OK(dbrec->delete_rec(dbrec));
-
-done:
- TALLOC_FREE( prec );
- return ret;
-}
diff --git a/source3/smbd/dfree.c b/source3/smbd/dfree.c
index 1ddcd48d40..cd09d73923 100644
--- a/source3/smbd/dfree.c
+++ b/source3/smbd/dfree.c
@@ -23,10 +23,10 @@
Normalise for DOS usage.
****************************************************************************/
-static void disk_norm(bool small_query, SMB_BIG_UINT *bsize,SMB_BIG_UINT *dfree,SMB_BIG_UINT *dsize)
+static void disk_norm(bool small_query, uint64_t *bsize,uint64_t *dfree,uint64_t *dsize)
{
/* check if the disk is beyond the max disk size */
- SMB_BIG_UINT maxdisksize = lp_maxdisksize();
+ uint64_t maxdisksize = lp_maxdisksize();
if (maxdisksize) {
/* convert to blocks - and don't overflow */
maxdisksize = ((maxdisksize*1024)/(*bsize))*1024;
@@ -62,13 +62,13 @@ static void disk_norm(bool small_query, SMB_BIG_UINT *bsize,SMB_BIG_UINT *dfree,
Return number of 1K blocks available on a path and total number.
****************************************************************************/
-SMB_BIG_UINT sys_disk_free(connection_struct *conn, const char *path, bool small_query,
- SMB_BIG_UINT *bsize,SMB_BIG_UINT *dfree,SMB_BIG_UINT *dsize)
+uint64_t sys_disk_free(connection_struct *conn, const char *path, bool small_query,
+ uint64_t *bsize,uint64_t *dfree,uint64_t *dsize)
{
- SMB_BIG_UINT dfree_retval;
- SMB_BIG_UINT dfree_q = 0;
- SMB_BIG_UINT bsize_q = 0;
- SMB_BIG_UINT dsize_q = 0;
+ uint64_t dfree_retval;
+ uint64_t dfree_q = 0;
+ uint64_t bsize_q = 0;
+ uint64_t dsize_q = 0;
const char *dfree_command;
(*dfree) = (*dsize) = 0;
@@ -90,7 +90,7 @@ SMB_BIG_UINT sys_disk_free(connection_struct *conn, const char *path, bool small
path);
if (!syscmd) {
- return (SMB_BIG_UINT)-1;
+ return (uint64_t)-1;
}
DEBUG (3, ("disk_free: Running command %s\n", syscmd));
@@ -112,7 +112,7 @@ SMB_BIG_UINT sys_disk_free(connection_struct *conn, const char *path, bool small
*bsize = STR_TO_SMB_BIG_UINT(p, NULL);
else
*bsize = 1024;
- file_lines_free(lines);
+ TALLOC_FREE(lines);
DEBUG (3, ("Parsed output of dfree, dsize=%u, dfree=%u, bsize=%u\n",
(unsigned int)*dsize, (unsigned int)*dfree, (unsigned int)*bsize));
@@ -126,14 +126,14 @@ SMB_BIG_UINT sys_disk_free(connection_struct *conn, const char *path, bool small
if (sys_fsusage(path, dfree, dsize) != 0) {
DEBUG (0, ("disk_free: sys_fsusage() failed. Error was : %s\n",
strerror(errno) ));
- return (SMB_BIG_UINT)-1;
+ return (uint64_t)-1;
}
}
} else {
if (sys_fsusage(path, dfree, dsize) != 0) {
DEBUG (0, ("disk_free: sys_fsusage() failed. Error was : %s\n",
strerror(errno) ));
- return (SMB_BIG_UINT)-1;
+ return (uint64_t)-1;
}
}
@@ -174,16 +174,16 @@ SMB_BIG_UINT sys_disk_free(connection_struct *conn, const char *path, bool small
Potentially returned cached dfree info.
****************************************************************************/
-SMB_BIG_UINT get_dfree_info(connection_struct *conn,
+uint64_t get_dfree_info(connection_struct *conn,
const char *path,
bool small_query,
- SMB_BIG_UINT *bsize,
- SMB_BIG_UINT *dfree,
- SMB_BIG_UINT *dsize)
+ uint64_t *bsize,
+ uint64_t *dfree,
+ uint64_t *dsize)
{
int dfree_cache_time = lp_dfree_cache_time(SNUM(conn));
struct dfree_cached_info *dfc = conn->dfree_info;
- SMB_BIG_UINT dfree_ret;
+ uint64_t dfree_ret;
if (!dfree_cache_time) {
return SMB_VFS_DISK_FREE(conn,path,small_query,bsize,dfree,dsize);
@@ -199,7 +199,7 @@ SMB_BIG_UINT get_dfree_info(connection_struct *conn,
dfree_ret = SMB_VFS_DISK_FREE(conn,path,small_query,bsize,dfree,dsize);
- if (dfree_ret == (SMB_BIG_UINT)-1) {
+ if (dfree_ret == (uint64_t)-1) {
/* Don't cache bad data. */
return dfree_ret;
}
diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c
index 88c6a51770..784b36d9bd 100644
--- a/source3/smbd/dosmode.c
+++ b/source3/smbd/dosmode.c
@@ -277,14 +277,15 @@ static bool set_ea_dos_attribute(connection_struct *conn, const char *path, SMB_
* are not violating security in doing the setxattr.
*/
- if (!NT_STATUS_IS_OK(open_file_fchmod(conn,path,sbuf,&fsp)))
+ if (!NT_STATUS_IS_OK(open_file_fchmod(NULL, conn, path, sbuf,
+ &fsp)))
return ret;
become_root();
if (SMB_VFS_SETXATTR(conn, path, SAMBA_XATTR_DOS_ATTRIB, attrstr, strlen(attrstr), 0) == 0) {
ret = True;
}
unbecome_root();
- close_file_fchmod(fsp);
+ close_file_fchmod(NULL, fsp);
return ret;
}
DEBUG(10,("set_ea_dos_attribute: set EA %s on file %s\n", attrstr, path));
@@ -540,12 +541,13 @@ int file_set_dosmode(connection_struct *conn, const char *fname,
* break batch oplocks open by others. JRA.
*/
files_struct *fsp;
- if (!NT_STATUS_IS_OK(open_file_fchmod(conn,fname,st,&fsp)))
+ if (!NT_STATUS_IS_OK(open_file_fchmod(NULL, conn, fname, st,
+ &fsp)))
return -1;
become_root();
ret = SMB_VFS_FCHMOD(fsp, unixmode);
unbecome_root();
- close_file_fchmod(fsp);
+ close_file_fchmod(NULL, fsp);
if (!newfile) {
notify_fname(conn, NOTIFY_ACTION_MODIFIED,
FILE_NOTIFY_CHANGE_ATTRIBUTES, fname);
diff --git a/source3/smbd/fake_file.c b/source3/smbd/fake_file.c
index 1761cb66a8..58b09604c4 100644
--- a/source3/smbd/fake_file.c
+++ b/source3/smbd/fake_file.c
@@ -98,7 +98,7 @@ enum FAKE_FILE_TYPE is_fake_file(const char *fname)
Open a fake quota file with a share mode.
****************************************************************************/
-NTSTATUS open_fake_file(connection_struct *conn,
+NTSTATUS open_fake_file(struct smb_request *req, connection_struct *conn,
uint16_t current_vuid,
enum FAKE_FILE_TYPE fake_file_type,
const char *fname,
@@ -118,7 +118,7 @@ NTSTATUS open_fake_file(connection_struct *conn,
}
- status = file_new(conn, &fsp);
+ status = file_new(req, conn, &fsp);
if(!NT_STATUS_IS_OK(status)) {
return status;
}
@@ -137,7 +137,7 @@ NTSTATUS open_fake_file(connection_struct *conn,
fsp->fake_file_handle = init_fake_file_handle(fake_file_type);
if (fsp->fake_file_handle==NULL) {
- file_free(fsp);
+ file_free(req, fsp);
return NT_STATUS_NO_MEMORY;
}
@@ -146,8 +146,8 @@ NTSTATUS open_fake_file(connection_struct *conn,
return NT_STATUS_OK;
}
-NTSTATUS close_fake_file(files_struct *fsp)
+NTSTATUS close_fake_file(struct smb_request *req, files_struct *fsp)
{
- file_free(fsp);
+ file_free(req, fsp);
return NT_STATUS_OK;
}
diff --git a/source3/smbd/files.c b/source3/smbd/files.c
index 519f4945f2..4a27d02cfe 100644
--- a/source3/smbd/files.c
+++ b/source3/smbd/files.c
@@ -28,9 +28,6 @@ static int real_max_open_files;
static struct bitmap *file_bmap;
static files_struct *Files;
-
-/* a fsp to use when chaining */
-static files_struct *chain_fsp = NULL;
static int files_used;
@@ -57,7 +54,8 @@ static unsigned long get_gen_count(void)
Find first available file slot.
****************************************************************************/
-NTSTATUS file_new(connection_struct *conn, files_struct **result)
+NTSTATUS file_new(struct smb_request *req, connection_struct *conn,
+ files_struct **result)
{
int i;
static int first_file;
@@ -120,7 +118,9 @@ NTSTATUS file_new(connection_struct *conn, files_struct **result)
DEBUG(5,("allocated file structure %d, fnum = %d (%d used)\n",
i, fsp->fnum, files_used));
- chain_fsp = fsp;
+ if (req != NULL) {
+ req->chain_fsp = fsp;
+ }
/* A new fsp invalidates the positive and
negative fsp_fi_cache as the new fsp is pushed
@@ -144,7 +144,7 @@ void file_close_conn(connection_struct *conn)
for (fsp=Files;fsp;fsp=next) {
next = fsp->next;
if (fsp->conn == conn) {
- close_file(fsp,SHUTDOWN_CLOSE);
+ close_file(NULL, fsp, SHUTDOWN_CLOSE);
}
}
}
@@ -160,7 +160,7 @@ void file_close_pid(uint16 smbpid, int vuid)
for (fsp=Files;fsp;fsp=next) {
next = fsp->next;
if ((fsp->file_pid == smbpid) && (fsp->vuid == vuid)) {
- close_file(fsp,SHUTDOWN_CLOSE);
+ close_file(NULL, fsp, SHUTDOWN_CLOSE);
}
}
}
@@ -218,7 +218,7 @@ void file_close_user(int vuid)
for (fsp=Files;fsp;fsp=next) {
next=fsp->next;
if (fsp->vuid == vuid) {
- close_file(fsp,SHUTDOWN_CLOSE);
+ close_file(NULL, fsp, SHUTDOWN_CLOSE);
}
}
}
@@ -394,7 +394,7 @@ void file_sync_all(connection_struct *conn)
Free up a fsp.
****************************************************************************/
-void file_free(files_struct *fsp)
+void file_free(struct smb_request *req, files_struct *fsp)
{
DLIST_REMOVE(Files, fsp);
@@ -429,8 +429,8 @@ void file_free(files_struct *fsp)
information */
ZERO_STRUCTP(fsp);
- if (fsp == chain_fsp) {
- chain_fsp = NULL;
+ if ((req != NULL) && (fsp == req->chain_fsp)) {
+ req->chain_fsp = NULL;
}
/* Closing a file can invalidate the positive cache. */
@@ -470,44 +470,33 @@ files_struct *file_fnum(uint16 fnum)
Get an fsp from a packet given the offset of a 16 bit fnum.
****************************************************************************/
-files_struct *file_fsp(uint16 fid)
+files_struct *file_fsp(struct smb_request *req, uint16 fid)
{
files_struct *fsp;
- if (chain_fsp) {
- return chain_fsp;
+ if ((req != NULL) && (req->chain_fsp != NULL)) {
+ return req->chain_fsp;
}
fsp = file_fnum(fid);
- if (fsp) {
- chain_fsp = fsp;
+ if ((fsp != NULL) && (req != NULL)) {
+ req->chain_fsp = fsp;
}
return fsp;
}
/****************************************************************************
- Reset the chained fsp - done at the start of a packet reply.
-****************************************************************************/
-
-void file_chain_reset(void)
-{
- chain_fsp = NULL;
-}
-
-/****************************************************************************
Duplicate the file handle part for a DOS or FCB open.
****************************************************************************/
-NTSTATUS dup_file_fsp(files_struct *fsp,
- uint32 access_mask,
- uint32 share_access,
- uint32 create_options,
- files_struct **result)
+NTSTATUS dup_file_fsp(struct smb_request *req, files_struct *fsp,
+ uint32 access_mask, uint32 share_access,
+ uint32 create_options, files_struct **result)
{
NTSTATUS status;
files_struct *dup_fsp;
- status = file_new(fsp->conn, &dup_fsp);
+ status = file_new(NULL, fsp->conn, &dup_fsp);
if (!NT_STATUS_IS_OK(status)) {
return status;
diff --git a/source3/smbd/ipc.c b/source3/smbd/ipc.c
index 0f2caad86f..0ce226809e 100644
--- a/source3/smbd/ipc.c
+++ b/source3/smbd/ipc.c
@@ -5,17 +5,17 @@
SMB Version handling
Copyright (C) John H Terpstra 1995-1998
-
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@@ -162,7 +162,7 @@ void send_trans_reply(connection_struct *conn, const uint8_t *inbuf,
copy_trans_params_and_data(outbuf, align,
rparam, tot_param_sent, this_lparam,
rdata, tot_data_sent, this_ldata);
-
+
SSVAL(outbuf,smb_vwv3,this_lparam);
SSVAL(outbuf,smb_vwv4,smb_offset(smb_buf(outbuf)+1,outbuf));
SSVAL(outbuf,smb_vwv5,tot_param_sent);
@@ -194,11 +194,15 @@ void send_trans_reply(connection_struct *conn, const uint8_t *inbuf,
Start the first part of an RPC reply which began with an SMBtrans request.
****************************************************************************/
-static void api_rpc_trans_reply(connection_struct *conn, struct smb_request *req, smb_np_struct *p)
+static void api_rpc_trans_reply(connection_struct *conn,
+ struct smb_request *req,
+ files_struct *fsp,
+ int max_trans_reply)
{
bool is_data_outstanding;
- char *rdata = (char *)SMB_MALLOC(p->max_trans_reply);
- int data_len;
+ uint8_t *rdata = SMB_MALLOC_ARRAY(uint8_t, max_trans_reply);
+ ssize_t data_len;
+ NTSTATUS status;
if(rdata == NULL) {
DEBUG(0,("api_rpc_trans_reply: malloc fail.\n"));
@@ -206,14 +210,15 @@ static void api_rpc_trans_reply(connection_struct *conn, struct smb_request *req
return;
}
- if((data_len = read_from_pipe( p, rdata, p->max_trans_reply,
- &is_data_outstanding)) < 0) {
+ status = np_read(fsp, rdata, max_trans_reply, &data_len,
+ &is_data_outstanding);
+ if (!NT_STATUS_IS_OK(status)) {
SAFE_FREE(rdata);
api_no_reply(conn,req);
return;
}
- send_trans_reply(conn, req->inbuf, NULL, 0, rdata, data_len,
+ send_trans_reply(conn, req->inbuf, NULL, 0, (char *)rdata, data_len,
is_data_outstanding);
SAFE_FREE(rdata);
return;
@@ -223,25 +228,18 @@ static void api_rpc_trans_reply(connection_struct *conn, struct smb_request *req
WaitNamedPipeHandleState
****************************************************************************/
-static void api_WNPHS(connection_struct *conn, struct smb_request *req, smb_np_struct *p,
- char *param, int param_len)
+static void api_WNPHS(connection_struct *conn, struct smb_request *req,
+ struct files_struct *fsp, char *param, int param_len)
{
- uint16 priority;
-
if (!param || param_len < 2) {
reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
return;
}
- priority = SVAL(param,0);
- DEBUG(4,("WaitNamedPipeHandleState priority %x\n", priority));
+ DEBUG(4,("WaitNamedPipeHandleState priority %x\n",
+ (int)SVAL(param,0)));
- if (wait_rpc_pipe_hnd_state(p, priority)) {
- /* now send the reply */
- send_trans_reply(conn, req->inbuf, NULL, 0, NULL, 0, False);
- return;
- }
- api_no_reply(conn,req);
+ send_trans_reply(conn, req->inbuf, NULL, 0, NULL, 0, False);
}
@@ -249,25 +247,17 @@ static void api_WNPHS(connection_struct *conn, struct smb_request *req, smb_np_s
SetNamedPipeHandleState
****************************************************************************/
-static void api_SNPHS(connection_struct *conn, struct smb_request *req, smb_np_struct *p,
- char *param, int param_len)
+static void api_SNPHS(connection_struct *conn, struct smb_request *req,
+ struct files_struct *fsp, char *param, int param_len)
{
- uint16 id;
-
if (!param || param_len < 2) {
reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
return;
}
- id = SVAL(param,0);
- DEBUG(4,("SetNamedPipeHandleState to code %x\n", id));
+ DEBUG(4,("SetNamedPipeHandleState to code %x\n", (int)SVAL(param,0)));
- if (set_rpc_pipe_hnd_state(p, id)) {
- /* now send the reply */
- send_trans_reply(conn, req->inbuf, NULL, 0, NULL, 0, False);
- return;
- }
- api_no_reply(conn,req);
+ send_trans_reply(conn, req->inbuf, NULL, 0, NULL, 0, False);
}
@@ -297,14 +287,14 @@ static void api_no_reply(connection_struct *conn, struct smb_request *req)
static void api_fd_reply(connection_struct *conn, uint16 vuid,
struct smb_request *req,
- uint16 *setup, char *data, char *params,
+ uint16 *setup, uint8_t *data, char *params,
int suwcnt, int tdscnt, int tpscnt,
int mdrcnt, int mprcnt)
{
- bool reply = False;
- smb_np_struct *p = NULL;
+ struct files_struct *fsp;
int pnum;
int subcommand;
+ NTSTATUS status;
DEBUG(5,("api_fd_reply\n"));
@@ -323,7 +313,9 @@ static void api_fd_reply(connection_struct *conn, uint16 vuid,
pnum = ((int)setup[1]) & 0xFFFF;
subcommand = ((int)setup[0]) & 0xFFFF;
- if(!(p = get_rpc_pipe(pnum))) {
+ fsp = file_fsp(req, pnum);
+
+ if (!fsp_is_np(fsp)) {
if (subcommand == TRANSACT_WAITNAMEDPIPEHANDLESTATE) {
/* Win9x does this call with a unicode pipe name, not a pnum. */
/* Just return success for now... */
@@ -338,37 +330,37 @@ static void api_fd_reply(connection_struct *conn, uint16 vuid,
return;
}
- if (vuid != p->vuid) {
+ if (vuid != fsp->vuid) {
DEBUG(1, ("Got pipe request (pnum %x) using invalid VUID %d, "
- "expected %d\n", pnum, vuid, p->vuid));
+ "expected %d\n", pnum, vuid, fsp->vuid));
reply_nterror(req, NT_STATUS_INVALID_HANDLE);
return;
}
- DEBUG(3,("Got API command 0x%x on pipe \"%s\" (pnum %x)\n", subcommand, p->name, pnum));
-
- /* record maximum data length that can be transmitted in an SMBtrans */
- p->max_trans_reply = mdrcnt;
+ DEBUG(3,("Got API command 0x%x on pipe \"%s\" (pnum %x)\n",
+ subcommand, fsp->fsp_name, pnum));
- DEBUG(10,("api_fd_reply: p:%p max_trans_reply: %d\n", p, p->max_trans_reply));
+ DEBUG(10, ("api_fd_reply: p:%p max_trans_reply: %d\n", fsp, mdrcnt));
switch (subcommand) {
- case TRANSACT_DCERPCCMD:
+ case TRANSACT_DCERPCCMD: {
/* dce/rpc command */
- reply = write_to_pipe(p, data, tdscnt);
- if (!reply) {
+ ssize_t nwritten;
+ status = np_write(fsp, data, tdscnt, &nwritten);
+ if (!NT_STATUS_IS_OK(status)) {
api_no_reply(conn, req);
return;
}
- api_rpc_trans_reply(conn, req, p);
+ api_rpc_trans_reply(conn, req, fsp, mdrcnt);
break;
+ }
case TRANSACT_WAITNAMEDPIPEHANDLESTATE:
/* Wait Named Pipe Handle state */
- api_WNPHS(conn, req, p, params, tpscnt);
+ api_WNPHS(conn, req, fsp, params, tpscnt);
break;
case TRANSACT_SETNAMEDPIPEHANDLESTATE:
/* Set Named Pipe Handle state */
- api_SNPHS(conn, req, p, params, tpscnt);
+ api_SNPHS(conn, req, fsp, params, tpscnt);
break;
default:
reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
@@ -406,7 +398,7 @@ static void named_pipe(connection_struct *conn, uint16 vuid,
DEBUG(4,("named pipe command from Win95 (wow!)\n"));
api_fd_reply(conn, vuid, req,
- setup, data, params,
+ setup, (uint8_t *)data, params,
suwcnt, tdscnt, tpscnt,
mdrcnt, mprcnt);
return;
@@ -414,7 +406,7 @@ static void named_pipe(connection_struct *conn, uint16 vuid,
if (strlen(name) < 1) {
api_fd_reply(conn, vuid, req,
- setup, data,
+ setup, (uint8_t *)data,
params, suwcnt, tdscnt,
tpscnt, mdrcnt, mprcnt);
return;
@@ -735,11 +727,11 @@ void reply_transs(struct smb_request *req)
state->received_param += pcnt;
state->received_data += dcnt;
-
+
if ((state->received_data > state->total_data) ||
(state->received_param > state->total_param))
goto bad_param;
-
+
if (pcnt) {
if (pdisp > state->total_param ||
pcnt > state->total_param ||
diff --git a/source3/smbd/lanman.c b/source3/smbd/lanman.c
index fe1d766b9d..0c866da706 100644
--- a/source3/smbd/lanman.c
+++ b/source3/smbd/lanman.c
@@ -1154,7 +1154,7 @@ static int get_server_info(uint32 servertype,
bool local_list_only;
int i;
- lines = file_lines_load(lock_path(SERVER_LIST), NULL, 0);
+ lines = file_lines_load(lock_path(SERVER_LIST), NULL, 0, NULL);
if (!lines) {
DEBUG(4,("Can't open %s - %s\n",lock_path(SERVER_LIST),strerror(errno)));
return 0;
@@ -1186,7 +1186,7 @@ static int get_server_info(uint32 servertype,
*servers = SMB_REALLOC_ARRAY(*servers,struct srv_info_struct, alloced);
if (!*servers) {
DEBUG(0,("get_server_info: failed to enlarge servers info struct!\n"));
- file_lines_free(lines);
+ TALLOC_FREE(lines);
return 0;
}
memset((char *)((*servers)+count),'\0',sizeof(**servers)*(alloced-count));
@@ -1267,7 +1267,7 @@ static int get_server_info(uint32 servertype,
}
}
- file_lines_free(lines);
+ TALLOC_FREE(lines);
return count;
}
diff --git a/source3/smbd/map_username.c b/source3/smbd/map_username.c
index 7536758bcb..a8899dd538 100644
--- a/source3/smbd/map_username.c
+++ b/source3/smbd/map_username.c
@@ -116,7 +116,7 @@ bool map_username(fstring user)
}
numlines = 0;
- qlines = fd_lines_load(fd, &numlines,0);
+ qlines = fd_lines_load(fd, &numlines,0, NULL);
DEBUGADD(10,("Lines returned = [%d]\n", numlines));
close(fd);
@@ -127,7 +127,7 @@ bool map_username(fstring user)
fstrcpy( user, qlines[0] );
}
- file_lines_free(qlines);
+ TALLOC_FREE(qlines);
return numlines != 0;
}
diff --git a/source3/smbd/noquotas.c b/source3/smbd/noquotas.c
index c8ff8edf62..392b32437a 100644
--- a/source3/smbd/noquotas.c
+++ b/source3/smbd/noquotas.c
@@ -23,14 +23,14 @@
* Needed for auto generation of proto.h.
*/
-bool disk_quotas(const char *path,SMB_BIG_UINT *bsize,SMB_BIG_UINT *dfree,SMB_BIG_UINT *dsize)
+bool disk_quotas(const char *path,uint64_t *bsize,uint64_t *dfree,uint64_t *dsize)
{
(*bsize) = 512; /* This value should be ignored */
/* And just to be sure we set some values that hopefully */
/* will be larger that any possible real-world value */
- (*dfree) = (SMB_BIG_UINT)-1;
- (*dsize) = (SMB_BIG_UINT)-1;
+ (*dfree) = (uint64_t)-1;
+ (*dsize) = (uint64_t)-1;
/* As we have select not to use quotas, allways fail */
return False;
diff --git a/source3/smbd/ntquotas.c b/source3/smbd/ntquotas.c
index c616c494dc..ae7034011e 100644
--- a/source3/smbd/ntquotas.c
+++ b/source3/smbd/ntquotas.c
@@ -22,14 +22,14 @@
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_QUOTA
-static SMB_BIG_UINT limit_nt2unix(SMB_BIG_UINT in, SMB_BIG_UINT bsize)
+static uint64_t limit_nt2unix(uint64_t in, uint64_t bsize)
{
- SMB_BIG_UINT ret = (SMB_BIG_UINT)0;
+ uint64_t ret = (uint64_t)0;
- ret = (SMB_BIG_UINT)(in/bsize);
+ ret = (uint64_t)(in/bsize);
if (in>0 && ret==0) {
/* we have to make sure that a overflow didn't set NO_LIMIT */
- ret = (SMB_BIG_UINT)1;
+ ret = (uint64_t)1;
}
if (in == SMB_NTQUOTAS_NO_LIMIT)
@@ -42,11 +42,11 @@ static SMB_BIG_UINT limit_nt2unix(SMB_BIG_UINT in, SMB_BIG_UINT bsize)
return ret;
}
-static SMB_BIG_UINT limit_unix2nt(SMB_BIG_UINT in, SMB_BIG_UINT bsize)
+static uint64_t limit_unix2nt(uint64_t in, uint64_t bsize)
{
- SMB_BIG_UINT ret = (SMB_BIG_UINT)0;
+ uint64_t ret = (uint64_t)0;
- ret = (SMB_BIG_UINT)(in*bsize);
+ ret = (uint64_t)(in*bsize);
if (ret < in) {
/* we overflow */
@@ -59,14 +59,14 @@ static SMB_BIG_UINT limit_unix2nt(SMB_BIG_UINT in, SMB_BIG_UINT bsize)
return ret;
}
-static SMB_BIG_UINT limit_blk2inodes(SMB_BIG_UINT in)
+static uint64_t limit_blk2inodes(uint64_t in)
{
- SMB_BIG_UINT ret = (SMB_BIG_UINT)0;
+ uint64_t ret = (uint64_t)0;
- ret = (SMB_BIG_UINT)(in/2);
+ ret = (uint64_t)(in/2);
if (ret == 0 && in != 0)
- ret = (SMB_BIG_UINT)1;
+ ret = (uint64_t)1;
return ret;
}
@@ -100,7 +100,7 @@ int vfs_get_ntquota(files_struct *fsp, enum SMB_QUOTA_TYPE qtype, DOM_SID *psid,
return ret;
}
- qt->usedspace = (SMB_BIG_UINT)D.curblocks*D.bsize;
+ qt->usedspace = (uint64_t)D.curblocks*D.bsize;
qt->softlim = limit_unix2nt(D.softlimit, D.bsize);
qt->hardlim = limit_unix2nt(D.hardlimit, D.bsize);
qt->qflags = D.qflags;
@@ -121,7 +121,7 @@ int vfs_set_ntquota(files_struct *fsp, enum SMB_QUOTA_TYPE qtype, DOM_SID *psid,
id.uid = -1;
- D.bsize = (SMB_BIG_UINT)QUOTABLOCK_SIZE;
+ D.bsize = (uint64_t)QUOTABLOCK_SIZE;
D.softlimit = limit_nt2unix(qt->softlim,D.bsize);
D.hardlimit = limit_nt2unix(qt->hardlim,D.bsize);
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index 061855876c..69ddcdae8d 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -22,6 +22,7 @@
extern int max_send;
extern enum protocol_types Protocol;
+extern const struct generic_mapping file_generic_mapping;
static char *nttrans_realloc(char **ptr, size_t size)
{
@@ -267,7 +268,8 @@ bool is_ntfs_stream_name(const char *fname)
static void nt_open_pipe(char *fname, connection_struct *conn,
struct smb_request *req, int *ppnum)
{
- smb_np_struct *p = NULL;
+ files_struct *fsp;
+ NTSTATUS status;
DEBUG(4,("nt_open_pipe: Opening pipe %s.\n", fname));
@@ -284,19 +286,13 @@ static void nt_open_pipe(char *fname, connection_struct *conn,
DEBUG(3,("nt_open_pipe: Known pipe %s opening.\n", fname));
- p = open_rpc_pipe_p(fname, conn, req->vuid);
- if (!p) {
- reply_doserror(req, ERRSRV, ERRnofids);
+ status = np_open(req, conn, fname, &fsp);
+ if (!NT_STATUS_IS_OK(status)) {
+ reply_nterror(req, status);
return;
}
- /* TODO: Add pipe to db */
-
- if ( !store_pipe_opendb( p ) ) {
- DEBUG(3,("nt_open_pipe: failed to store %s pipe open.\n", fname));
- }
-
- *ppnum = p->pnum;
+ *ppnum = fsp->fnum;
return;
}
@@ -390,7 +386,7 @@ void reply_ntcreate_and_X(struct smb_request *req)
uint32 create_disposition;
uint32 create_options;
uint16 root_dir_fid;
- SMB_BIG_UINT allocation_size;
+ uint64_t allocation_size;
/* Breakout the oplock request bits so we can set the
reply bits separately. */
uint32 fattr=0;
@@ -422,10 +418,10 @@ void reply_ntcreate_and_X(struct smb_request *req)
create_options = IVAL(req->inbuf,smb_ntcreate_CreateOptions);
root_dir_fid = (uint16)IVAL(req->inbuf,smb_ntcreate_RootDirectoryFid);
- allocation_size = (SMB_BIG_UINT)IVAL(req->inbuf,
+ allocation_size = (uint64_t)IVAL(req->inbuf,
smb_ntcreate_AllocationSize);
#ifdef LARGE_SMB_OFF_T
- allocation_size |= (((SMB_BIG_UINT)IVAL(
+ allocation_size |= (((uint64_t)IVAL(
req->inbuf,
smb_ntcreate_AllocationSize + 4)) << 32);
#endif
@@ -713,7 +709,6 @@ static void do_nt_transact_create_pipe(connection_struct *conn,
static NTSTATUS set_sd(files_struct *fsp, uint8 *data, uint32 sd_len,
uint32 security_info_sent)
{
- extern const struct generic_mapping file_generic_mapping;
SEC_DESC *psd = NULL;
NTSTATUS status;
@@ -819,7 +814,7 @@ static void call_nt_transact_create(connection_struct *conn,
struct ea_list *ea_list = NULL;
NTSTATUS status;
size_t param_len;
- SMB_BIG_UINT allocation_size;
+ uint64_t allocation_size;
int oplock_request;
uint8_t oplock_granted;
TALLOC_CTX *ctx = talloc_tos();
@@ -862,9 +857,9 @@ static void call_nt_transact_create(connection_struct *conn,
sd_len = IVAL(params,36);
ea_len = IVAL(params,40);
root_dir_fid = (uint16)IVAL(params,4);
- allocation_size = (SMB_BIG_UINT)IVAL(params,12);
+ allocation_size = (uint64_t)IVAL(params,12);
#ifdef LARGE_SMB_OFF_T
- allocation_size |= (((SMB_BIG_UINT)IVAL(params,16)) << 32);
+ allocation_size |= (((uint64_t)IVAL(params,16)) << 32);
#endif
/*
@@ -1188,7 +1183,7 @@ static NTSTATUS copy_internals(TALLOC_CTX *ctx,
&info, &fsp2);
if (!NT_STATUS_IS_OK(status)) {
- close_file(fsp1,ERROR_CLOSE);
+ close_file(NULL, fsp1, ERROR_CLOSE);
return status;
}
@@ -1202,12 +1197,12 @@ static NTSTATUS copy_internals(TALLOC_CTX *ctx,
* Thus we don't look at the error return from the
* close of fsp1.
*/
- close_file(fsp1,NORMAL_CLOSE);
+ close_file(NULL, fsp1, NORMAL_CLOSE);
/* Ensure the modtime is set correctly on the destination file. */
set_close_write_time(fsp2, get_mtimespec(&sbuf1));
- status = close_file(fsp2,NORMAL_CLOSE);
+ status = close_file(NULL, fsp2, NORMAL_CLOSE);
/* Grrr. We have to do this as open_file_ntcreate adds aARCH when it
creates the file. This isn't the correct thing to do in the copy
@@ -1399,7 +1394,7 @@ static void call_nt_transact_notify_change(connection_struct *conn,
return;
}
- fsp = file_fsp(SVAL(setup,4));
+ fsp = file_fsp(req, SVAL(setup,4));
filter = IVAL(setup, 0);
recursive = (SVAL(setup, 6) != 0) ? True : False;
@@ -1499,7 +1494,7 @@ static void call_nt_transact_rename(connection_struct *conn,
return;
}
- fsp = file_fsp(SVAL(params, 0));
+ fsp = file_fsp(req, SVAL(params, 0));
if (!check_fsp(conn, req, fsp)) {
return;
}
@@ -1568,7 +1563,7 @@ static void call_nt_transact_query_security_desc(connection_struct *conn,
return;
}
- fsp = file_fsp(SVAL(params,0));
+ fsp = file_fsp(req, SVAL(params,0));
if(!fsp) {
reply_doserror(req, ERRDOS, ERRbadfid);
return;
@@ -1664,7 +1659,7 @@ static void call_nt_transact_set_security_desc(connection_struct *conn,
return;
}
- if((fsp = file_fsp(SVAL(params,0))) == NULL) {
+ if((fsp = file_fsp(req, SVAL(params,0))) == NULL) {
reply_doserror(req, ERRDOS, ERRbadfid);
return;
}
@@ -1728,7 +1723,7 @@ static void call_nt_transact_ioctl(connection_struct *conn,
DEBUG(10,("call_nt_transact_ioctl: function[0x%08X] FID[0x%04X] isFSctl[0x%02X] compfilter[0x%02X]\n",
function, fidnum, isFSctl, compfilter));
- fsp=file_fsp(fidnum);
+ fsp=file_fsp(req, fidnum);
/* this check is done in each implemented function case for now
because I don't want to break anything... --metze
FSP_BELONGS_CONN(fsp,conn);*/
@@ -2035,7 +2030,7 @@ static void call_nt_transact_get_user_quota(connection_struct *conn,
}
/* maybe we can check the quota_fnum */
- fsp = file_fsp(SVAL(params,0));
+ fsp = file_fsp(req, SVAL(params,0));
if (!check_fsp_ntquota_handle(conn, req, fsp)) {
DEBUG(3,("TRANSACT_GET_USER_QUOTA: no valid QUOTA HANDLE\n"));
reply_nterror(req, NT_STATUS_INVALID_HANDLE);
@@ -2132,16 +2127,16 @@ static void call_nt_transact_get_user_quota(connection_struct *conn,
/* then the len of the SID 4 bytes */
SIVAL(entry,4,sid_len);
- /* unknown data 8 bytes SMB_BIG_UINT */
- SBIG_UINT(entry,8,(SMB_BIG_UINT)0); /* this is not 0 in windows...-metze*/
+ /* unknown data 8 bytes uint64_t */
+ SBIG_UINT(entry,8,(uint64_t)0); /* this is not 0 in windows...-metze*/
- /* the used disk space 8 bytes SMB_BIG_UINT */
+ /* the used disk space 8 bytes uint64_t */
SBIG_UINT(entry,16,tmp_list->quotas->usedspace);
- /* the soft quotas 8 bytes SMB_BIG_UINT */
+ /* the soft quotas 8 bytes uint64_t */
SBIG_UINT(entry,24,tmp_list->quotas->softlim);
- /* the hard quotas 8 bytes SMB_BIG_UINT */
+ /* the hard quotas 8 bytes uint64_t */
SBIG_UINT(entry,32,tmp_list->quotas->hardlim);
/* and now the SID */
@@ -2230,16 +2225,16 @@ static void call_nt_transact_get_user_quota(connection_struct *conn,
/* then the len of the SID 4 bytes */
SIVAL(entry,4,sid_len);
- /* unknown data 8 bytes SMB_BIG_UINT */
- SBIG_UINT(entry,8,(SMB_BIG_UINT)0); /* this is not 0 in windows...-mezte*/
+ /* unknown data 8 bytes uint64_t */
+ SBIG_UINT(entry,8,(uint64_t)0); /* this is not 0 in windows...-mezte*/
- /* the used disk space 8 bytes SMB_BIG_UINT */
+ /* the used disk space 8 bytes uint64_t */
SBIG_UINT(entry,16,qt.usedspace);
- /* the soft quotas 8 bytes SMB_BIG_UINT */
+ /* the soft quotas 8 bytes uint64_t */
SBIG_UINT(entry,24,qt.softlim);
- /* the hard quotas 8 bytes SMB_BIG_UINT */
+ /* the hard quotas 8 bytes uint64_t */
SBIG_UINT(entry,32,qt.hardlim);
/* and now the SID */
@@ -2302,7 +2297,7 @@ static void call_nt_transact_set_user_quota(connection_struct *conn,
}
/* maybe we can check the quota_fnum */
- fsp = file_fsp(SVAL(params,0));
+ fsp = file_fsp(req, SVAL(params,0));
if (!check_fsp_ntquota_handle(conn, req, fsp)) {
DEBUG(3,("TRANSACT_GET_USER_QUOTA: no valid QUOTA HANDLE\n"));
reply_nterror(req, NT_STATUS_INVALID_HANDLE);
@@ -2333,10 +2328,10 @@ static void call_nt_transact_set_user_quota(connection_struct *conn,
* maybe its the change time in NTTIME
*/
- /* the used space 8 bytes (SMB_BIG_UINT)*/
- qt.usedspace = (SMB_BIG_UINT)IVAL(pdata,16);
+ /* the used space 8 bytes (uint64_t)*/
+ qt.usedspace = (uint64_t)IVAL(pdata,16);
#ifdef LARGE_SMB_OFF_T
- qt.usedspace |= (((SMB_BIG_UINT)IVAL(pdata,20)) << 32);
+ qt.usedspace |= (((uint64_t)IVAL(pdata,20)) << 32);
#else /* LARGE_SMB_OFF_T */
if ((IVAL(pdata,20) != 0)&&
((qt.usedspace != 0xFFFFFFFF)||
@@ -2347,10 +2342,10 @@ static void call_nt_transact_set_user_quota(connection_struct *conn,
}
#endif /* LARGE_SMB_OFF_T */
- /* the soft quotas 8 bytes (SMB_BIG_UINT)*/
- qt.softlim = (SMB_BIG_UINT)IVAL(pdata,24);
+ /* the soft quotas 8 bytes (uint64_t)*/
+ qt.softlim = (uint64_t)IVAL(pdata,24);
#ifdef LARGE_SMB_OFF_T
- qt.softlim |= (((SMB_BIG_UINT)IVAL(pdata,28)) << 32);
+ qt.softlim |= (((uint64_t)IVAL(pdata,28)) << 32);
#else /* LARGE_SMB_OFF_T */
if ((IVAL(pdata,28) != 0)&&
((qt.softlim != 0xFFFFFFFF)||
@@ -2361,10 +2356,10 @@ static void call_nt_transact_set_user_quota(connection_struct *conn,
}
#endif /* LARGE_SMB_OFF_T */
- /* the hard quotas 8 bytes (SMB_BIG_UINT)*/
- qt.hardlim = (SMB_BIG_UINT)IVAL(pdata,32);
+ /* the hard quotas 8 bytes (uint64_t)*/
+ qt.hardlim = (uint64_t)IVAL(pdata,32);
#ifdef LARGE_SMB_OFF_T
- qt.hardlim |= (((SMB_BIG_UINT)IVAL(pdata,36)) << 32);
+ qt.hardlim |= (((uint64_t)IVAL(pdata,36)) << 32);
#else /* LARGE_SMB_OFF_T */
if ((IVAL(pdata,36) != 0)&&
((qt.hardlim != 0xFFFFFFFF)||
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 8727e80d5f..d858fb969f 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -890,7 +890,8 @@ static bool open_match_attributes(connection_struct *conn,
Try and find a duplicated file handle.
****************************************************************************/
-static files_struct *fcb_or_dos_open(connection_struct *conn,
+static files_struct *fcb_or_dos_open(struct smb_request *req,
+ connection_struct *conn,
const char *fname,
struct file_id id,
uint16 file_pid,
@@ -940,7 +941,7 @@ static files_struct *fcb_or_dos_open(connection_struct *conn,
}
/* We need to duplicate this fsp. */
- if (!NT_STATUS_IS_OK(dup_file_fsp(fsp, access_mask, share_access,
+ if (!NT_STATUS_IS_OK(dup_file_fsp(req, fsp, access_mask, share_access,
create_options, &dup_fsp))) {
return NULL;
}
@@ -1178,7 +1179,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
DEBUG(10, ("open_file_ntcreate: printer open fname=%s\n", fname));
- return print_fsp_open(conn, fname, req->vuid, result);
+ return print_fsp_open(req, conn, fname, req->vuid, result);
}
if (!parent_dirname_talloc(talloc_tos(), fname, &parent_dir,
@@ -1435,7 +1436,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
return NT_STATUS_ACCESS_DENIED;
}
- status = file_new(conn, &fsp);
+ status = file_new(req, conn, &fsp);
if(!NT_STATUS_IS_OK(status)) {
return status;
}
@@ -1464,7 +1465,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
fname, &old_write_time);
if (lck == NULL) {
- file_free(fsp);
+ file_free(req, fsp);
DEBUG(0, ("Could not get share mode lock\n"));
return NT_STATUS_SHARING_VIOLATION;
}
@@ -1475,7 +1476,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
oplock_request)) {
schedule_defer_open(lck, request_time, req);
TALLOC_FREE(lck);
- file_free(fsp);
+ file_free(req, fsp);
return NT_STATUS_SHARING_VIOLATION;
}
@@ -1495,7 +1496,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
oplock_request)) {
schedule_defer_open(lck, request_time, req);
TALLOC_FREE(lck);
- file_free(fsp);
+ file_free(req, fsp);
return NT_STATUS_SHARING_VIOLATION;
}
}
@@ -1503,7 +1504,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
if (NT_STATUS_EQUAL(status, NT_STATUS_DELETE_PENDING)) {
/* DELETE_PENDING is not deferred for a second */
TALLOC_FREE(lck);
- file_free(fsp);
+ file_free(req, fsp);
return status;
}
@@ -1524,13 +1525,13 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
DEBUG(0, ("DOS open without an SMB "
"request!\n"));
TALLOC_FREE(lck);
- file_free(fsp);
+ file_free(req, fsp);
return NT_STATUS_INTERNAL_ERROR;
}
/* Use the client requested access mask here,
* not the one we open with. */
- fsp_dup = fcb_or_dos_open(conn, fname, id,
+ fsp_dup = fcb_or_dos_open(req, conn, fname, id,
req->smbpid,
req->vuid,
access_mask,
@@ -1539,7 +1540,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
if (fsp_dup) {
TALLOC_FREE(lck);
- file_free(fsp);
+ file_free(req, fsp);
if (pinfo) {
*pinfo = FILE_WAS_OPENED;
}
@@ -1625,7 +1626,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
} else {
status = NT_STATUS_ACCESS_DENIED;
}
- file_free(fsp);
+ file_free(req, fsp);
return status;
}
@@ -1663,7 +1664,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
if (lck != NULL) {
TALLOC_FREE(lck);
}
- file_free(fsp);
+ file_free(req, fsp);
return fsp_open;
}
@@ -1694,7 +1695,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
DEBUG(0, ("open_file_ntcreate: Could not get share "
"mode lock for %s\n", fname));
fd_close(fsp);
- file_free(fsp);
+ file_free(req, fsp);
return NT_STATUS_SHARING_VIOLATION;
}
@@ -1705,7 +1706,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
schedule_defer_open(lck, request_time, req);
TALLOC_FREE(lck);
fd_close(fsp);
- file_free(fsp);
+ file_free(req, fsp);
return NT_STATUS_SHARING_VIOLATION;
}
@@ -1724,7 +1725,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
schedule_defer_open(lck, request_time, req);
TALLOC_FREE(lck);
fd_close(fsp);
- file_free(fsp);
+ file_free(req, fsp);
return NT_STATUS_SHARING_VIOLATION;
}
}
@@ -1733,7 +1734,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
struct deferred_open_record state;
fd_close(fsp);
- file_free(fsp);
+ file_free(req, fsp);
state.delayed_for_oplocks = False;
state.id = id;
@@ -1775,7 +1776,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
TALLOC_FREE(lck);
fd_close(fsp);
- file_free(fsp);
+ file_free(req, fsp);
return NT_STATUS_SHARING_VIOLATION;
}
@@ -1801,7 +1802,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
status = map_nt_error_from_unix(errno);
TALLOC_FREE(lck);
fd_close(fsp);
- file_free(fsp);
+ file_free(req, fsp);
return status;
}
}
@@ -1862,7 +1863,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
del_share_mode(lck, fsp);
TALLOC_FREE(lck);
fd_close(fsp);
- file_free(fsp);
+ file_free(req, fsp);
return status;
}
/* Note that here we set the *inital* delete on close flag,
@@ -1948,7 +1949,8 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
Open a file for for write to ensure that we can fchmod it.
****************************************************************************/
-NTSTATUS open_file_fchmod(connection_struct *conn, const char *fname,
+NTSTATUS open_file_fchmod(struct smb_request *req, connection_struct *conn,
+ const char *fname,
SMB_STRUCT_STAT *psbuf, files_struct **result)
{
files_struct *fsp = NULL;
@@ -1958,7 +1960,7 @@ NTSTATUS open_file_fchmod(connection_struct *conn, const char *fname,
return NT_STATUS_INVALID_PARAMETER;
}
- status = file_new(conn, &fsp);
+ status = file_new(req, conn, &fsp);
if(!NT_STATUS_IS_OK(status)) {
return status;
}
@@ -1975,7 +1977,7 @@ NTSTATUS open_file_fchmod(connection_struct *conn, const char *fname,
*/
if (!NT_STATUS_IS_OK(status)) {
- file_free(fsp);
+ file_free(req, fsp);
return status;
}
@@ -1987,10 +1989,10 @@ NTSTATUS open_file_fchmod(connection_struct *conn, const char *fname,
Close the fchmod file fd - ensure no locks are lost.
****************************************************************************/
-NTSTATUS close_file_fchmod(files_struct *fsp)
+NTSTATUS close_file_fchmod(struct smb_request *req, files_struct *fsp)
{
NTSTATUS status = fd_close(fsp);
- file_free(fsp);
+ file_free(req, fsp);
return status;
}
@@ -2198,7 +2200,7 @@ NTSTATUS open_directory(connection_struct *conn,
return NT_STATUS_NOT_A_DIRECTORY;
}
- status = file_new(conn, &fsp);
+ status = file_new(req, conn, &fsp);
if(!NT_STATUS_IS_OK(status)) {
return status;
}
@@ -2236,7 +2238,7 @@ NTSTATUS open_directory(connection_struct *conn,
if (lck == NULL) {
DEBUG(0, ("open_directory: Could not get share mode lock for %s\n", fname));
- file_free(fsp);
+ file_free(req, fsp);
return NT_STATUS_SHARING_VIOLATION;
}
@@ -2246,7 +2248,7 @@ NTSTATUS open_directory(connection_struct *conn,
if (!NT_STATUS_IS_OK(status)) {
TALLOC_FREE(lck);
- file_free(fsp);
+ file_free(req, fsp);
return status;
}
@@ -2259,7 +2261,7 @@ NTSTATUS open_directory(connection_struct *conn,
status = can_set_delete_on_close(fsp, True, 0);
if (!NT_STATUS_IS_OK(status) && !NT_STATUS_EQUAL(status, NT_STATUS_DIRECTORY_NOT_EMPTY)) {
TALLOC_FREE(lck);
- file_free(fsp);
+ file_free(req, fsp);
return status;
}
@@ -2300,7 +2302,7 @@ NTSTATUS create_directory(connection_struct *conn, struct smb_request *req, cons
&fsp);
if (NT_STATUS_IS_OK(status)) {
- close_file(fsp, NORMAL_CLOSE);
+ close_file(req, fsp, NORMAL_CLOSE);
}
return status;
@@ -2510,7 +2512,7 @@ static NTSTATUS open_streams_for_delete(connection_struct *conn,
DEBUG(10, ("Closing stream # %d, %s\n", i,
streams[i]->fsp_name));
- close_file(streams[i], NORMAL_CLOSE);
+ close_file(NULL, streams[i], NORMAL_CLOSE);
}
fail:
@@ -2531,7 +2533,7 @@ NTSTATUS create_file_unixpath(connection_struct *conn,
uint32_t create_options,
uint32_t file_attributes,
uint32_t oplock_request,
- SMB_BIG_UINT allocation_size,
+ uint64_t allocation_size,
struct security_descriptor *sd,
struct ea_list *ea_list,
@@ -2807,7 +2809,7 @@ NTSTATUS create_file_unixpath(connection_struct *conn,
}
} else {
fsp->initial_allocation_size = smb_roundup(
- fsp->conn, (SMB_BIG_UINT)sbuf.st_size);
+ fsp->conn, (uint64_t)sbuf.st_size);
}
}
@@ -2841,11 +2843,11 @@ NTSTATUS create_file_unixpath(connection_struct *conn,
DEBUG(10, ("create_file_unixpath: %s\n", nt_errstr(status)));
if (fsp != NULL) {
- close_file(fsp, ERROR_CLOSE);
+ close_file(req, fsp, ERROR_CLOSE);
fsp = NULL;
}
if (base_fsp != NULL) {
- close_file(base_fsp, ERROR_CLOSE);
+ close_file(req, base_fsp, ERROR_CLOSE);
base_fsp = NULL;
}
return status;
@@ -2861,7 +2863,7 @@ NTSTATUS create_file(connection_struct *conn,
uint32_t create_options,
uint32_t file_attributes,
uint32_t oplock_request,
- SMB_BIG_UINT allocation_size,
+ uint64_t allocation_size,
struct security_descriptor *sd,
struct ea_list *ea_list,
@@ -2899,7 +2901,7 @@ NTSTATUS create_file(connection_struct *conn,
* This filename is relative to a directory fid.
*/
char *parent_fname = NULL;
- files_struct *dir_fsp = file_fsp(root_dir_fid);
+ files_struct *dir_fsp = file_fsp(req, root_dir_fid);
if (dir_fsp == NULL) {
status = NT_STATUS_INVALID_HANDLE;
@@ -3000,7 +3002,7 @@ NTSTATUS create_file(connection_struct *conn,
* also tries a QUERY_FILE_INFO on the file and then
* close it
*/
- status = open_fake_file(conn, req->vuid,
+ status = open_fake_file(req, conn, req->vuid,
fake_file_type, fname,
access_mask, &fsp);
if (!NT_STATUS_IS_OK(status)) {
@@ -3092,7 +3094,7 @@ NTSTATUS create_file(connection_struct *conn,
DEBUG(10, ("create_file: %s\n", nt_errstr(status)));
if (fsp != NULL) {
- close_file(fsp, ERROR_CLOSE);
+ close_file(req, fsp, ERROR_CLOSE);
fsp = NULL;
}
return status;
diff --git a/source3/smbd/password.c b/source3/smbd/password.c
index 1d3514429f..88e7b766be 100644
--- a/source3/smbd/password.c
+++ b/source3/smbd/password.c
@@ -545,7 +545,7 @@ static bool user_ok(const char *user, int snum)
ret = True;
if (lp_invalid_users(snum)) {
- str_list_copy(talloc_tos(), &invalid, lp_invalid_users(snum));
+ invalid = str_list_copy(talloc_tos(), lp_invalid_users(snum));
if (invalid &&
str_list_substitute(invalid, "%S", lp_servicename(snum))) {
@@ -561,7 +561,7 @@ static bool user_ok(const char *user, int snum)
TALLOC_FREE(invalid);
if (ret && lp_valid_users(snum)) {
- str_list_copy(talloc_tos(), &valid, lp_valid_users(snum));
+ valid = str_list_copy(talloc_tos(), lp_valid_users(snum));
if ( valid &&
str_list_substitute(valid, "%S", lp_servicename(snum)) ) {
diff --git a/source3/smbd/pipes.c b/source3/smbd/pipes.c
index 4fdcdcc557..25a1fe2e63 100644
--- a/source3/smbd/pipes.c
+++ b/source3/smbd/pipes.c
@@ -32,18 +32,6 @@
#define MAX_PIPE_NAME_LEN 24
-/* PIPE/<name>/<pid>/<pnum> */
-#define PIPEDB_KEY_FORMAT "PIPE/%s/%u/%d"
-
-struct pipe_dbrec {
- struct server_id pid;
- int pnum;
- uid_t uid;
-
- char name[MAX_PIPE_NAME_LEN];
- fstring user;
-};
-
/****************************************************************************
Reply to an open and X on a named pipe.
This code is basically stolen from reply_open_and_X with some
@@ -54,9 +42,10 @@ void reply_open_pipe_and_X(connection_struct *conn, struct smb_request *req)
{
const char *fname = NULL;
char *pipe_name = NULL;
- smb_np_struct *p;
+ files_struct *fsp;
int size=0,fmode=0,mtime=0,rmode=0;
TALLOC_CTX *ctx = talloc_tos();
+ NTSTATUS status;
/* XXXX we need to handle passed times, sattr and flags */
srvstr_pull_buf_talloc(ctx, req->inbuf, req->flags2, &pipe_name,
@@ -101,9 +90,9 @@ void reply_open_pipe_and_X(connection_struct *conn, struct smb_request *req)
/* can be opened and add it in after the open. */
DEBUG(3,("Known pipe %s opening.\n",fname));
- p = open_rpc_pipe_p(fname, conn, req->vuid);
- if (!p) {
- reply_doserror(req, ERRSRV, ERRnofids);
+ status = np_open(req, conn, fname, &fsp);
+ if (!NT_STATUS_IS_OK(status)) {
+ reply_nterror(req, status);
return;
}
@@ -119,7 +108,7 @@ void reply_open_pipe_and_X(connection_struct *conn, struct smb_request *req)
rmode = 1;
}
- SSVAL(req->outbuf,smb_vwv2, p->pnum);
+ SSVAL(req->outbuf,smb_vwv2, fsp->fnum);
SSVAL(req->outbuf,smb_vwv3,fmode);
srv_put_dos_date3((char *)req->outbuf,smb_vwv4,mtime);
SIVAL(req->outbuf,smb_vwv6,size);
@@ -136,27 +125,32 @@ void reply_open_pipe_and_X(connection_struct *conn, struct smb_request *req)
void reply_pipe_write(struct smb_request *req)
{
- smb_np_struct *p = get_rpc_pipe_p(SVAL(req->inbuf,smb_vwv0));
+ files_struct *fsp = file_fsp(req, SVAL(req->inbuf,smb_vwv0));
size_t numtowrite = SVAL(req->inbuf,smb_vwv1);
- int nwritten;
- char *data;
+ ssize_t nwritten;
+ uint8_t *data;
- if (!p) {
+ if (!fsp_is_np(fsp)) {
reply_doserror(req, ERRDOS, ERRbadfid);
return;
}
- if (p->vuid != req->vuid) {
+ if (fsp->vuid != req->vuid) {
reply_nterror(req, NT_STATUS_INVALID_HANDLE);
return;
}
- data = smb_buf(req->inbuf) + 3;
+ data = (uint8_t *)smb_buf(req->inbuf) + 3;
if (numtowrite == 0) {
nwritten = 0;
} else {
- nwritten = write_to_pipe(p, data, numtowrite);
+ NTSTATUS status;
+ status = np_write(fsp, data, numtowrite, &nwritten);
+ if (!NT_STATUS_IS_OK(status)) {
+ reply_nterror(req, status);
+ return;
+ }
}
if ((nwritten == 0 && numtowrite != 0) || (nwritten < 0)) {
@@ -168,7 +162,8 @@ void reply_pipe_write(struct smb_request *req)
SSVAL(req->outbuf,smb_vwv0,nwritten);
- DEBUG(3,("write-IPC pnum=%04x nwritten=%d\n", p->pnum, nwritten));
+ DEBUG(3,("write-IPC pnum=%04x nwritten=%d\n", fsp->fnum,
+ (int)nwritten));
return;
}
@@ -182,31 +177,33 @@ void reply_pipe_write(struct smb_request *req)
void reply_pipe_write_and_X(struct smb_request *req)
{
- smb_np_struct *p = get_rpc_pipe_p(SVAL(req->inbuf,smb_vwv2));
+ files_struct *fsp = file_fsp(req, SVAL(req->inbuf, smb_vwv2));
size_t numtowrite = SVAL(req->inbuf,smb_vwv10);
- int nwritten = -1;
+ ssize_t nwritten;
int smb_doff = SVAL(req->inbuf, smb_vwv11);
bool pipe_start_message_raw =
((SVAL(req->inbuf, smb_vwv7)
& (PIPE_START_MESSAGE|PIPE_RAW_MODE))
== (PIPE_START_MESSAGE|PIPE_RAW_MODE));
- char *data;
+ uint8_t *data;
- if (!p) {
+ if (!fsp_is_np(fsp)) {
reply_doserror(req, ERRDOS, ERRbadfid);
return;
}
- if (p->vuid != req->vuid) {
+ if (fsp->vuid != req->vuid) {
reply_nterror(req, NT_STATUS_INVALID_HANDLE);
return;
}
- data = smb_base(req->inbuf) + smb_doff;
+ data = (uint8_t *)smb_base(req->inbuf) + smb_doff;
if (numtowrite == 0) {
nwritten = 0;
} else {
+ NTSTATUS status;
+
if(pipe_start_message_raw) {
/*
* For the start of a message in named pipe byte mode,
@@ -225,7 +222,11 @@ void reply_pipe_write_and_X(struct smb_request *req)
data += 2;
numtowrite -= 2;
}
- nwritten = write_to_pipe(p, data, numtowrite);
+ status = np_write(fsp, data, numtowrite, &nwritten);
+ if (!NT_STATUS_IS_OK(status)) {
+ reply_nterror(req, status);
+ return;
+ }
}
if ((nwritten == 0 && numtowrite != 0) || (nwritten < 0)) {
@@ -238,7 +239,8 @@ void reply_pipe_write_and_X(struct smb_request *req)
nwritten = (pipe_start_message_raw ? nwritten + 2 : nwritten);
SSVAL(req->outbuf,smb_vwv2,nwritten);
- DEBUG(3,("writeX-IPC pnum=%04x nwritten=%d\n", p->pnum, nwritten));
+ DEBUG(3,("writeX-IPC pnum=%04x nwritten=%d\n", fsp->fnum,
+ (int)nwritten));
chain_reply(req);
}
@@ -251,12 +253,13 @@ void reply_pipe_write_and_X(struct smb_request *req)
void reply_pipe_read_and_X(struct smb_request *req)
{
- smb_np_struct *p = get_rpc_pipe_p(SVAL(req->inbuf,smb_vwv2));
+ files_struct *fsp = file_fsp(req, SVAL(req->inbuf,smb_vwv0));
int smb_maxcnt = SVAL(req->inbuf,smb_vwv5);
int smb_mincnt = SVAL(req->inbuf,smb_vwv6);
- int nread = -1;
- char *data;
+ ssize_t nread;
+ uint8_t *data;
bool unused;
+ NTSTATUS status;
/* we don't use the offset given to use for pipe reads. This
is deliberate, instead we always return the next lump of
@@ -265,18 +268,23 @@ void reply_pipe_read_and_X(struct smb_request *req)
uint32 smb_offs = IVAL(req->inbuf,smb_vwv3);
#endif
- if (!p) {
+ if (!fsp_is_np(fsp)) {
reply_doserror(req, ERRDOS, ERRbadfid);
return;
}
+ if (fsp->vuid != req->vuid) {
+ reply_nterror(req, NT_STATUS_INVALID_HANDLE);
+ return;
+ }
+
reply_outbuf(req, 12, smb_maxcnt);
- data = smb_buf(req->outbuf);
+ data = (uint8_t *)smb_buf(req->outbuf);
- nread = read_from_pipe(p, data, smb_maxcnt, &unused);
+ status = np_read(fsp, data, smb_maxcnt, &nread, &unused);
- if (nread < 0) {
+ if (!NT_STATUS_IS_OK(status)) {
reply_doserror(req, ERRDOS, ERRnoaccess);
return;
}
@@ -288,33 +296,7 @@ void reply_pipe_read_and_X(struct smb_request *req)
SSVAL(smb_buf(req->outbuf),-2,nread);
DEBUG(3,("readX-IPC pnum=%04x min=%d max=%d nread=%d\n",
- p->pnum, smb_mincnt, smb_maxcnt, nread));
+ fsp->fnum, smb_mincnt, smb_maxcnt, (int)nread));
chain_reply(req);
}
-
-/****************************************************************************
- Reply to a close.
-****************************************************************************/
-
-void reply_pipe_close(connection_struct *conn, struct smb_request *req)
-{
- smb_np_struct *p = get_rpc_pipe_p(SVAL(req->inbuf,smb_vwv0));
-
- if (!p) {
- reply_doserror(req, ERRDOS, ERRbadfid);
- return;
- }
-
- DEBUG(5,("reply_pipe_close: pnum:%x\n", p->pnum));
-
- if (!close_rpc_pipe_hnd(p)) {
- reply_doserror(req, ERRDOS, ERRbadfid);
- return;
- }
-
- /* TODO: REMOVE PIPE FROM DB */
-
- reply_outbuf(req, 0, 0);
- return;
-}
diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c
index 4e35e9deaa..848d3e4a6d 100644
--- a/source3/smbd/posix_acls.c
+++ b/source3/smbd/posix_acls.c
@@ -3191,7 +3191,7 @@ int try_chown(connection_struct *conn, const char *fname, uid_t uid, gid_t gid)
return -1;
}
- if (!NT_STATUS_IS_OK(open_file_fchmod(conn,fname,&st,&fsp))) {
+ if (!NT_STATUS_IS_OK(open_file_fchmod(NULL, conn, fname, &st, &fsp))) {
return -1;
}
@@ -3206,7 +3206,7 @@ int try_chown(connection_struct *conn, const char *fname, uid_t uid, gid_t gid)
ret = SMB_VFS_FCHOWN(fsp, uid, (gid_t)-1);
unbecome_root();
- close_file_fchmod(fsp);
+ close_file_fchmod(NULL, fsp);
return ret;
}
@@ -3264,7 +3264,7 @@ NTSTATUS append_parent_acl(files_struct *fsp,
status = SMB_VFS_GET_NT_ACL(parent_fsp->conn, parent_fsp->fsp_name,
DACL_SECURITY_INFORMATION, &parent_sd );
- close_file(parent_fsp, NORMAL_CLOSE);
+ close_file(NULL, parent_fsp, NORMAL_CLOSE);
if (!NT_STATUS_IS_OK(status)) {
return status;
@@ -3510,6 +3510,10 @@ NTSTATUS set_nt_acl(files_struct *fsp, uint32 security_info_sent, const SEC_DESC
create_file_sids(&sbuf, &file_owner_sid, &file_grp_sid);
+ /* See here: http://www.codeproject.com/KB/winsdk/accessctrl2.aspx
+ * for details. JRA.
+ */
+
if ((security_info_sent & DACL_SECURITY_INFORMATION) &&
psd->dacl != NULL &&
(psd->type & (SE_DESC_DACL_AUTO_INHERITED|
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index 32629fd392..ceffd6f46c 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -376,6 +376,7 @@ void init_smb_request(struct smb_request *req,
req->unread_bytes = unread_bytes;
req->encrypted = encrypted;
req->conn = conn_find(req->tid);
+ req->chain_fsp = NULL;
/* Ensure we have at least wct words and 2 bytes of bcc. */
if (smb_size + req->wct*2 > req_size) {
@@ -742,7 +743,7 @@ static NTSTATUS receive_message_or_smb(TALLOC_CTX *mem_ctx, char **buffer,
pop_message = True;
} else {
struct timeval tv;
- SMB_BIG_INT tdif;
+ int64_t tdif;
GetTimeOfDay(&tv);
tdif = usec_time_diff(&msg->end_time, &tv);
@@ -1486,8 +1487,6 @@ static void construct_reply(char *inbuf, int size, size_t unread_bytes, bool enc
struct smb_request *req;
chain_size = 0;
- file_chain_reset();
- reset_chain_p();
if (!(req = talloc(talloc_tos(), struct smb_request))) {
smb_panic("could not allocate smb_request");
@@ -1733,6 +1732,7 @@ void chain_reply(struct smb_request *req)
smb_panic("could not allocate smb_request");
}
init_smb_request(req2, (uint8 *)inbuf2,0, req->encrypted);
+ req2->chain_fsp = req->chain_fsp;
/* process the request */
switch_message(smb_com2, req2, new_size);
diff --git a/source3/smbd/quotas.c b/source3/smbd/quotas.c
index b6f748da33..3aa4652508 100644
--- a/source3/smbd/quotas.c
+++ b/source3/smbd/quotas.c
@@ -45,7 +45,7 @@
* Declare here, define at end: reduces likely "include" interaction problems.
* David Lee <T.D.Lee@durham.ac.uk>
*/
-bool disk_quotas_vxfs(const char *name, char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize);
+bool disk_quotas_vxfs(const char *name, char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize);
#endif /* VXFS_QUOTA */
@@ -63,13 +63,13 @@ bool disk_quotas_vxfs(const char *name, char *path, SMB_BIG_UINT *bsize, SMB_BIG
#include "samba_linux_quota.h"
typedef struct _LINUX_SMB_DISK_QUOTA {
- SMB_BIG_UINT bsize;
- SMB_BIG_UINT hardlimit; /* In bsize units. */
- SMB_BIG_UINT softlimit; /* In bsize units. */
- SMB_BIG_UINT curblocks; /* In bsize units. */
- SMB_BIG_UINT ihardlimit; /* inode hard limit. */
- SMB_BIG_UINT isoftlimit; /* inode soft limit. */
- SMB_BIG_UINT curinodes; /* Current used inodes. */
+ uint64_t bsize;
+ uint64_t hardlimit; /* In bsize units. */
+ uint64_t softlimit; /* In bsize units. */
+ uint64_t curblocks; /* In bsize units. */
+ uint64_t ihardlimit; /* inode hard limit. */
+ uint64_t isoftlimit; /* inode soft limit. */
+ uint64_t curinodes; /* Current used inodes. */
} LINUX_SMB_DISK_QUOTA;
@@ -95,13 +95,13 @@ static int get_smb_linux_xfs_quota(char *path, uid_t euser_id, gid_t egrp_id, LI
if (ret)
return ret;
- dp->bsize = (SMB_BIG_UINT)512;
- dp->softlimit = (SMB_BIG_UINT)D.d_blk_softlimit;
- dp->hardlimit = (SMB_BIG_UINT)D.d_blk_hardlimit;
- dp->ihardlimit = (SMB_BIG_UINT)D.d_ino_hardlimit;
- dp->isoftlimit = (SMB_BIG_UINT)D.d_ino_softlimit;
- dp->curinodes = (SMB_BIG_UINT)D.d_icount;
- dp->curblocks = (SMB_BIG_UINT)D.d_bcount;
+ dp->bsize = (uint64_t)512;
+ dp->softlimit = (uint64_t)D.d_blk_softlimit;
+ dp->hardlimit = (uint64_t)D.d_blk_hardlimit;
+ dp->ihardlimit = (uint64_t)D.d_ino_hardlimit;
+ dp->isoftlimit = (uint64_t)D.d_ino_softlimit;
+ dp->curinodes = (uint64_t)D.d_icount;
+ dp->curblocks = (uint64_t)D.d_bcount;
return ret;
}
@@ -134,13 +134,13 @@ static int get_smb_linux_v1_quota(char *path, uid_t euser_id, gid_t egrp_id, LIN
if (ret && errno != EDQUOT)
return ret;
- dp->bsize = (SMB_BIG_UINT)QUOTABLOCK_SIZE;
- dp->softlimit = (SMB_BIG_UINT)D.dqb_bsoftlimit;
- dp->hardlimit = (SMB_BIG_UINT)D.dqb_bhardlimit;
- dp->ihardlimit = (SMB_BIG_UINT)D.dqb_ihardlimit;
- dp->isoftlimit = (SMB_BIG_UINT)D.dqb_isoftlimit;
- dp->curinodes = (SMB_BIG_UINT)D.dqb_curinodes;
- dp->curblocks = (SMB_BIG_UINT)D.dqb_curblocks;
+ dp->bsize = (uint64_t)QUOTABLOCK_SIZE;
+ dp->softlimit = (uint64_t)D.dqb_bsoftlimit;
+ dp->hardlimit = (uint64_t)D.dqb_bhardlimit;
+ dp->ihardlimit = (uint64_t)D.dqb_ihardlimit;
+ dp->isoftlimit = (uint64_t)D.dqb_isoftlimit;
+ dp->curinodes = (uint64_t)D.dqb_curinodes;
+ dp->curblocks = (uint64_t)D.dqb_curblocks;
return ret;
}
@@ -160,13 +160,13 @@ static int get_smb_linux_v2_quota(char *path, uid_t euser_id, gid_t egrp_id, LIN
if (ret && errno != EDQUOT)
return ret;
- dp->bsize = (SMB_BIG_UINT)QUOTABLOCK_SIZE;
- dp->softlimit = (SMB_BIG_UINT)D.dqb_bsoftlimit;
- dp->hardlimit = (SMB_BIG_UINT)D.dqb_bhardlimit;
- dp->ihardlimit = (SMB_BIG_UINT)D.dqb_ihardlimit;
- dp->isoftlimit = (SMB_BIG_UINT)D.dqb_isoftlimit;
- dp->curinodes = (SMB_BIG_UINT)D.dqb_curinodes;
- dp->curblocks = ((SMB_BIG_UINT)D.dqb_curspace) / dp->bsize;
+ dp->bsize = (uint64_t)QUOTABLOCK_SIZE;
+ dp->softlimit = (uint64_t)D.dqb_bsoftlimit;
+ dp->hardlimit = (uint64_t)D.dqb_bhardlimit;
+ dp->ihardlimit = (uint64_t)D.dqb_ihardlimit;
+ dp->isoftlimit = (uint64_t)D.dqb_isoftlimit;
+ dp->curinodes = (uint64_t)D.dqb_curinodes;
+ dp->curblocks = ((uint64_t)D.dqb_curspace) / dp->bsize;
return ret;
}
@@ -190,13 +190,13 @@ static int get_smb_linux_gen_quota(char *path, uid_t euser_id, gid_t egrp_id, LI
if (ret && errno != EDQUOT)
return ret;
- dp->bsize = (SMB_BIG_UINT)QUOTABLOCK_SIZE;
- dp->softlimit = (SMB_BIG_UINT)D.dqb_bsoftlimit;
- dp->hardlimit = (SMB_BIG_UINT)D.dqb_bhardlimit;
- dp->ihardlimit = (SMB_BIG_UINT)D.dqb_ihardlimit;
- dp->isoftlimit = (SMB_BIG_UINT)D.dqb_isoftlimit;
- dp->curinodes = (SMB_BIG_UINT)D.dqb_curinodes;
- dp->curblocks = ((SMB_BIG_UINT)D.dqb_curspace) / dp->bsize;
+ dp->bsize = (uint64_t)QUOTABLOCK_SIZE;
+ dp->softlimit = (uint64_t)D.dqb_bsoftlimit;
+ dp->hardlimit = (uint64_t)D.dqb_bhardlimit;
+ dp->ihardlimit = (uint64_t)D.dqb_ihardlimit;
+ dp->isoftlimit = (uint64_t)D.dqb_isoftlimit;
+ dp->curinodes = (uint64_t)D.dqb_curinodes;
+ dp->curblocks = ((uint64_t)D.dqb_curspace) / dp->bsize;
return ret;
}
@@ -205,7 +205,7 @@ static int get_smb_linux_gen_quota(char *path, uid_t euser_id, gid_t egrp_id, LI
Try to get the disk space from disk quotas (LINUX version).
****************************************************************************/
-bool disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
+bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize)
{
int r;
SMB_STRUCT_STAT S;
@@ -306,7 +306,7 @@ bool disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB
try to get the disk space from disk quotas (CRAY VERSION)
****************************************************************************/
-bool disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
+bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize)
{
struct mntent *mnt;
FILE *fd;
@@ -454,7 +454,7 @@ static int my_xdr_getquota_rslt(XDR *xdrsp, struct getquota_rslt *gqr)
}
/* Restricted to SUNOS5 for the moment, I haven`t access to others to test. */
-static bool nfs_quotas(char *nfspath, uid_t euser_id, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
+static bool nfs_quotas(char *nfspath, uid_t euser_id, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize)
{
uid_t uid = euser_id;
struct dqblk D;
@@ -468,7 +468,7 @@ static bool nfs_quotas(char *nfspath, uid_t euser_id, SMB_BIG_UINT *bsize, SMB_B
enum clnt_stat clnt_stat;
bool ret = True;
- *bsize = *dfree = *dsize = (SMB_BIG_UINT)0;
+ *bsize = *dfree = *dsize = (uint64_t)0;
len=strcspn(mnttype, ":");
pathname=strstr(mnttype, ":");
@@ -575,9 +575,9 @@ Quota code by Peter Urbanec (amiga@cse.unsw.edu.au).
****************************************************************************/
bool disk_quotas(const char *path,
- SMB_BIG_UINT *bsize,
- SMB_BIG_UINT *dfree,
- SMB_BIG_UINT *dsize)
+ uint64_t *bsize,
+ uint64_t *dfree,
+ uint64_t *dsize)
{
uid_t euser_id;
int ret;
@@ -750,7 +750,7 @@ bool disk_quotas(const char *path,
try to get the disk space from disk quotas - OSF1 version
****************************************************************************/
-bool disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
+bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize)
{
int r, save_errno;
struct dqblk D;
@@ -816,7 +816,7 @@ try to get the disk space from disk quotas (IRIX 6.2 version)
#include <sys/quota.h>
#include <mntent.h>
-bool disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
+bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize)
{
uid_t euser_id;
int r;
@@ -1009,7 +1009,7 @@ static int my_xdr_getquota_rslt(XDR *xdrsp, struct getquota_rslt *gqr)
}
/* Works on FreeBSD, too. :-) */
-static bool nfs_quotas(char *nfspath, uid_t euser_id, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
+static bool nfs_quotas(char *nfspath, uid_t euser_id, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize)
{
uid_t uid = euser_id;
struct dqblk D;
@@ -1023,7 +1023,7 @@ static bool nfs_quotas(char *nfspath, uid_t euser_id, SMB_BIG_UINT *bsize, SMB_B
enum clnt_stat clnt_stat;
bool ret = True;
- *bsize = *dfree = *dsize = (SMB_BIG_UINT)0;
+ *bsize = *dfree = *dsize = (uint64_t)0;
len=strcspn(mnttype, ":");
pathname=strstr(mnttype, ":");
@@ -1134,7 +1134,7 @@ static bool nfs_quotas(char *nfspath, uid_t euser_id, SMB_BIG_UINT *bsize, SMB_B
try to get the disk space from disk quotas - default version
****************************************************************************/
-bool disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
+bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize)
{
int r;
struct dqblk D;
@@ -1353,7 +1353,7 @@ Hints for porting:
#include <sys/fs/vx_aioctl.h>
#include <sys/fs/vx_ioctl.h>
-bool disk_quotas_vxfs(const char *name, char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
+bool disk_quotas_vxfs(const char *name, char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize)
{
uid_t user_id, euser_id;
int ret;
@@ -1437,14 +1437,14 @@ bool disk_quotas_vxfs(const char *name, char *path, SMB_BIG_UINT *bsize, SMB_BIG
#else /* WITH_QUOTAS */
-bool disk_quotas(const char *path,SMB_BIG_UINT *bsize,SMB_BIG_UINT *dfree,SMB_BIG_UINT *dsize)
+bool disk_quotas(const char *path,uint64_t *bsize,uint64_t *dfree,uint64_t *dsize)
{
(*bsize) = 512; /* This value should be ignored */
/* And just to be sure we set some values that hopefully */
/* will be larger that any possible real-world value */
- (*dfree) = (SMB_BIG_UINT)-1;
- (*dsize) = (SMB_BIG_UINT)-1;
+ (*dfree) = (uint64_t)-1;
+ (*dsize) = (uint64_t)-1;
/* As we have select not to use quotas, allways fail */
return false;
@@ -1455,7 +1455,7 @@ bool disk_quotas(const char *path,SMB_BIG_UINT *bsize,SMB_BIG_UINT *dfree,SMB_BI
/* wrapper to the new sys_quota interface
this file should be removed later
*/
-bool disk_quotas(const char *path,SMB_BIG_UINT *bsize,SMB_BIG_UINT *dfree,SMB_BIG_UINT *dsize)
+bool disk_quotas(const char *path,uint64_t *bsize,uint64_t *dfree,uint64_t *dsize)
{
int r;
SMB_DISK_QUOTA D;
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 48403073f7..9ccfaa7bcb 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -825,8 +825,8 @@ void reply_ioctl(struct smb_request *req)
switch (ioctl_code) {
case IOCTL_QUERY_JOB_INFO:
{
- files_struct *fsp = file_fsp(SVAL(req->inbuf,
- smb_vwv0));
+ files_struct *fsp = file_fsp(
+ req, SVAL(req->inbuf, smb_vwv0));
if (!fsp) {
reply_doserror(req, ERRDOS, ERRbadfid);
END_PROFILE(SMBioctl);
@@ -1178,10 +1178,10 @@ void reply_setatr(struct smb_request *req)
void reply_dskattr(struct smb_request *req)
{
connection_struct *conn = req->conn;
- SMB_BIG_UINT dfree,dsize,bsize;
+ uint64_t dfree,dsize,bsize;
START_PROFILE(SMBdskattr);
- if (get_dfree_info(conn,".",True,&bsize,&dfree,&dsize) == (SMB_BIG_UINT)-1) {
+ if (get_dfree_info(conn,".",True,&bsize,&dfree,&dsize) == (uint64_t)-1) {
reply_unixerror(req, ERRHRD, ERRgeneral);
END_PROFILE(SMBdskattr);
return;
@@ -1200,8 +1200,8 @@ void reply_dskattr(struct smb_request *req)
total_space = dsize * (double)bsize;
free_space = dfree * (double)bsize;
- dsize = (SMB_BIG_UINT)((total_space+63*512) / (64*512));
- dfree = (SMB_BIG_UINT)((free_space+63*512) / (64*512));
+ dsize = (uint64_t)((total_space+63*512) / (64*512));
+ dfree = (uint64_t)((free_space+63*512) / (64*512));
if (dsize > 0xFFFF) dsize = 0xFFFF;
if (dfree > 0xFFFF) dfree = 0xFFFF;
@@ -1687,7 +1687,7 @@ void reply_open(struct smb_request *req)
if (fattr & aDIR) {
DEBUG(3,("attempt to open a directory %s\n",fsp->fsp_name));
- close_file(fsp,ERROR_CLOSE);
+ close_file(req, fsp, ERROR_CLOSE);
reply_doserror(req, ERRDOS,ERRnoaccess);
END_PROFILE(SMBopen);
return;
@@ -1744,7 +1744,7 @@ void reply_open_and_X(struct smb_request *req)
int smb_action = 0;
files_struct *fsp;
NTSTATUS status;
- SMB_BIG_UINT allocation_size;
+ uint64_t allocation_size;
ssize_t retval = -1;
uint32 access_mask;
uint32 share_mode;
@@ -1767,7 +1767,7 @@ void reply_open_and_X(struct smb_request *req)
core_oplock_request = CORE_OPLOCK_REQUEST(req->inbuf);
oplock_request = ex_oplock_request | core_oplock_request;
smb_ofun = SVAL(req->inbuf,smb_vwv8);
- allocation_size = (SMB_BIG_UINT)IVAL(req->inbuf,smb_vwv9);
+ allocation_size = (uint64_t)IVAL(req->inbuf,smb_vwv9);
/* If it's an IPC, pass off the pipe handler. */
if (IS_IPC(conn)) {
@@ -1830,14 +1830,14 @@ void reply_open_and_X(struct smb_request *req)
if (((smb_action == FILE_WAS_CREATED) || (smb_action == FILE_WAS_OVERWRITTEN)) && allocation_size) {
fsp->initial_allocation_size = smb_roundup(fsp->conn, allocation_size);
if (vfs_allocate_file_space(fsp, fsp->initial_allocation_size) == -1) {
- close_file(fsp,ERROR_CLOSE);
+ close_file(req, fsp, ERROR_CLOSE);
reply_nterror(req, NT_STATUS_DISK_FULL);
END_PROFILE(SMBopenX);
return;
}
retval = vfs_set_filelen(fsp, (SMB_OFF_T)allocation_size);
if (retval < 0) {
- close_file(fsp,ERROR_CLOSE);
+ close_file(req, fsp, ERROR_CLOSE);
reply_nterror(req, NT_STATUS_DISK_FULL);
END_PROFILE(SMBopenX);
return;
@@ -1848,7 +1848,7 @@ void reply_open_and_X(struct smb_request *req)
fattr = dos_mode(conn,fsp->fsp_name,&sbuf);
mtime = sbuf.st_mtime;
if (fattr & aDIR) {
- close_file(fsp,ERROR_CLOSE);
+ close_file(req, fsp, ERROR_CLOSE);
reply_doserror(req, ERRDOS, ERRnoaccess);
END_PROFILE(SMBopenX);
return;
@@ -2363,11 +2363,11 @@ static NTSTATUS do_unlink(connection_struct *conn,
/* The set is across all open files on this dev/inode pair. */
if (!set_delete_on_close(fsp, True, &conn->server_info->utok)) {
- close_file(fsp, NORMAL_CLOSE);
+ close_file(req, fsp, NORMAL_CLOSE);
return NT_STATUS_ACCESS_DENIED;
}
- return close_file(fsp,NORMAL_CLOSE);
+ return close_file(req, fsp, NORMAL_CLOSE);
}
/****************************************************************************
@@ -2808,7 +2808,7 @@ void reply_readbraw(struct smb_request *req)
* return a zero length response here.
*/
- fsp = file_fsp(SVAL(req->inbuf,smb_vwv0));
+ fsp = file_fsp(req, SVAL(req->inbuf,smb_vwv0));
/*
* We have to do a check_fsp by hand here, as
@@ -2887,8 +2887,8 @@ void reply_readbraw(struct smb_request *req)
maxcount = MIN(65535,maxcount);
if (is_locked(fsp,(uint32)req->smbpid,
- (SMB_BIG_UINT)maxcount,
- (SMB_BIG_UINT)startpos,
+ (uint64_t)maxcount,
+ (uint64_t)startpos,
READ_LOCK)) {
reply_readbraw_error();
END_PROFILE(SMBreadbraw);
@@ -2950,7 +2950,7 @@ void reply_lockread(struct smb_request *req)
return;
}
- fsp = file_fsp(SVAL(req->inbuf,smb_vwv0));
+ fsp = file_fsp(req, SVAL(req->inbuf,smb_vwv0));
if (!check_fsp(conn, req, fsp)) {
END_PROFILE(SMBlockread);
@@ -2985,8 +2985,8 @@ void reply_lockread(struct smb_request *req)
br_lck = do_lock(smbd_messaging_context(),
fsp,
req->smbpid,
- (SMB_BIG_UINT)numtoread,
- (SMB_BIG_UINT)startpos,
+ (uint64_t)numtoread,
+ (uint64_t)startpos,
WRITE_LOCK,
WINDOWS_LOCK,
False, /* Non-blocking lock. */
@@ -3058,7 +3058,7 @@ void reply_read(struct smb_request *req)
return;
}
- fsp = file_fsp(SVAL(req->inbuf,smb_vwv0));
+ fsp = file_fsp(req, SVAL(req->inbuf,smb_vwv0));
if (!check_fsp(conn, req, fsp)) {
END_PROFILE(SMBread);
@@ -3090,8 +3090,8 @@ Returning short read of maximum allowed for compatibility with Windows 2000.\n",
data = smb_buf(req->outbuf) + 3;
- if (is_locked(fsp, (uint32)req->smbpid, (SMB_BIG_UINT)numtoread,
- (SMB_BIG_UINT)startpos, READ_LOCK)) {
+ if (is_locked(fsp, (uint32)req->smbpid, (uint64_t)numtoread,
+ (uint64_t)startpos, READ_LOCK)) {
reply_doserror(req, ERRDOS,ERRlock);
END_PROFILE(SMBread);
return;
@@ -3302,7 +3302,7 @@ void reply_read_and_X(struct smb_request *req)
return;
}
- fsp = file_fsp(SVAL(req->inbuf,smb_vwv2));
+ fsp = file_fsp(req, SVAL(req->inbuf,smb_vwv2));
startpos = IVAL_TO_SMB_OFF_T(req->inbuf,smb_vwv3);
smb_maxcnt = SVAL(req->inbuf,smb_vwv5);
@@ -3377,8 +3377,8 @@ void reply_read_and_X(struct smb_request *req)
}
- if (is_locked(fsp, (uint32)req->smbpid, (SMB_BIG_UINT)smb_maxcnt,
- (SMB_BIG_UINT)startpos, READ_LOCK)) {
+ if (is_locked(fsp, (uint32)req->smbpid, (uint64_t)smb_maxcnt,
+ (uint64_t)startpos, READ_LOCK)) {
END_PROFILE(SMBreadX);
reply_doserror(req, ERRDOS, ERRlock);
return;
@@ -3450,7 +3450,7 @@ void reply_writebraw(struct smb_request *req)
return;
}
- fsp = file_fsp(SVAL(req->inbuf,smb_vwv0));
+ fsp = file_fsp(req, SVAL(req->inbuf,smb_vwv0));
if (!check_fsp(conn, req, fsp)) {
error_to_writebrawerr(req);
END_PROFILE(SMBwritebraw);
@@ -3487,8 +3487,8 @@ void reply_writebraw(struct smb_request *req)
return;
}
- if (is_locked(fsp,(uint32)req->smbpid,(SMB_BIG_UINT)tcount,
- (SMB_BIG_UINT)startpos, WRITE_LOCK)) {
+ if (is_locked(fsp,(uint32)req->smbpid,(uint64_t)tcount,
+ (uint64_t)startpos, WRITE_LOCK)) {
reply_doserror(req, ERRDOS, ERRlock);
error_to_writebrawerr(req);
END_PROFILE(SMBwritebraw);
@@ -3655,7 +3655,7 @@ void reply_writeunlock(struct smb_request *req)
return;
}
- fsp = file_fsp(SVAL(req->inbuf,smb_vwv0));
+ fsp = file_fsp(req, SVAL(req->inbuf,smb_vwv0));
if (!check_fsp(conn, req, fsp)) {
END_PROFILE(SMBwriteunlock);
@@ -3673,8 +3673,8 @@ void reply_writeunlock(struct smb_request *req)
data = smb_buf(req->inbuf) + 3;
if (numtowrite
- && is_locked(fsp, (uint32)req->smbpid, (SMB_BIG_UINT)numtowrite,
- (SMB_BIG_UINT)startpos, WRITE_LOCK)) {
+ && is_locked(fsp, (uint32)req->smbpid, (uint64_t)numtowrite,
+ (uint64_t)startpos, WRITE_LOCK)) {
reply_doserror(req, ERRDOS, ERRlock);
END_PROFILE(SMBwriteunlock);
return;
@@ -3708,8 +3708,8 @@ void reply_writeunlock(struct smb_request *req)
status = do_unlock(smbd_messaging_context(),
fsp,
req->smbpid,
- (SMB_BIG_UINT)numtowrite,
- (SMB_BIG_UINT)startpos,
+ (uint64_t)numtowrite,
+ (uint64_t)startpos,
WINDOWS_LOCK);
if (NT_STATUS_V(status)) {
@@ -3762,7 +3762,7 @@ void reply_write(struct smb_request *req)
return;
}
- fsp = file_fsp(SVAL(req->inbuf,smb_vwv0));
+ fsp = file_fsp(req, SVAL(req->inbuf,smb_vwv0));
if (!check_fsp(conn, req, fsp)) {
END_PROFILE(SMBwrite);
@@ -3779,8 +3779,8 @@ void reply_write(struct smb_request *req)
startpos = IVAL_TO_SMB_OFF_T(req->inbuf,smb_vwv2);
data = smb_buf(req->inbuf) + 3;
- if (is_locked(fsp, (uint32)req->smbpid, (SMB_BIG_UINT)numtowrite,
- (SMB_BIG_UINT)startpos, WRITE_LOCK)) {
+ if (is_locked(fsp, (uint32)req->smbpid, (uint64_t)numtowrite,
+ (uint64_t)startpos, WRITE_LOCK)) {
reply_doserror(req, ERRDOS, ERRlock);
END_PROFILE(SMBwrite);
return;
@@ -3992,7 +3992,7 @@ void reply_write_and_X(struct smb_request *req)
return;
}
- fsp = file_fsp(SVAL(req->inbuf,smb_vwv2));
+ fsp = file_fsp(req, SVAL(req->inbuf,smb_vwv2));
startpos = IVAL_TO_SMB_OFF_T(req->inbuf,smb_vwv3);
write_through = BITSETW(req->inbuf+smb_vwv7,0);
@@ -4035,8 +4035,8 @@ void reply_write_and_X(struct smb_request *req)
}
if (is_locked(fsp,(uint32)req->smbpid,
- (SMB_BIG_UINT)numtowrite,
- (SMB_BIG_UINT)startpos, WRITE_LOCK)) {
+ (uint64_t)numtowrite,
+ (uint64_t)startpos, WRITE_LOCK)) {
reply_doserror(req, ERRDOS, ERRlock);
END_PROFILE(SMBwriteX);
return;
@@ -4113,7 +4113,7 @@ void reply_lseek(struct smb_request *req)
return;
}
- fsp = file_fsp(SVAL(req->inbuf,smb_vwv0));
+ fsp = file_fsp(req, SVAL(req->inbuf,smb_vwv0));
if (!check_fsp(conn, req, fsp)) {
return;
@@ -4199,7 +4199,7 @@ void reply_flush(struct smb_request *req)
}
fnum = SVAL(req->inbuf,smb_vwv0);
- fsp = file_fsp(fnum);
+ fsp = file_fsp(req, fnum);
if ((fnum != 0xFFFF) && !check_fsp(conn, req, fsp)) {
return;
@@ -4261,14 +4261,7 @@ void reply_close(struct smb_request *req)
return;
}
- /* If it's an IPC, pass off to the pipe handler. */
- if (IS_IPC(conn)) {
- reply_pipe_close(conn, req);
- END_PROFILE(SMBclose);
- return;
- }
-
- fsp = file_fsp(SVAL(req->inbuf,smb_vwv0));
+ fsp = file_fsp(req, SVAL(req->inbuf,smb_vwv0));
/*
* We can only use check_fsp if we know it's not a directory.
@@ -4285,7 +4278,7 @@ void reply_close(struct smb_request *req)
* Special case - close NT SMB directory handle.
*/
DEBUG(3,("close directory fnum=%d\n", fsp->fnum));
- status = close_file(fsp,NORMAL_CLOSE);
+ status = close_file(req, fsp, NORMAL_CLOSE);
} else {
time_t t;
/*
@@ -4309,7 +4302,7 @@ void reply_close(struct smb_request *req)
* a disk full error. If not then it was probably an I/O error.
*/
- status = close_file(fsp,NORMAL_CLOSE);
+ status = close_file(req, fsp, NORMAL_CLOSE);
}
if (!NT_STATUS_IS_OK(status)) {
@@ -4346,7 +4339,7 @@ void reply_writeclose(struct smb_request *req)
return;
}
- fsp = file_fsp(SVAL(req->inbuf,smb_vwv0));
+ fsp = file_fsp(req, SVAL(req->inbuf,smb_vwv0));
if (!check_fsp(conn, req, fsp)) {
END_PROFILE(SMBwriteclose);
@@ -4365,8 +4358,8 @@ void reply_writeclose(struct smb_request *req)
data = smb_buf(req->inbuf) + 1;
if (numtowrite
- && is_locked(fsp, (uint32)req->smbpid, (SMB_BIG_UINT)numtowrite,
- (SMB_BIG_UINT)startpos, WRITE_LOCK)) {
+ && is_locked(fsp, (uint32)req->smbpid, (uint64_t)numtowrite,
+ (uint64_t)startpos, WRITE_LOCK)) {
reply_doserror(req, ERRDOS,ERRlock);
END_PROFILE(SMBwriteclose);
return;
@@ -4384,7 +4377,7 @@ void reply_writeclose(struct smb_request *req)
if (numtowrite) {
DEBUG(3,("reply_writeclose: zero length write doesn't close file %s\n",
fsp->fsp_name ));
- close_status = close_file(fsp,NORMAL_CLOSE);
+ close_status = close_file(req, fsp, NORMAL_CLOSE);
}
DEBUG(3,("writeclose fnum=%d num=%d wrote=%d (numopen=%d)\n",
@@ -4420,7 +4413,7 @@ void reply_writeclose(struct smb_request *req)
void reply_lock(struct smb_request *req)
{
connection_struct *conn = req->conn;
- SMB_BIG_UINT count,offset;
+ uint64_t count,offset;
NTSTATUS status;
files_struct *fsp;
struct byte_range_lock *br_lck = NULL;
@@ -4433,7 +4426,7 @@ void reply_lock(struct smb_request *req)
return;
}
- fsp = file_fsp(SVAL(req->inbuf,smb_vwv0));
+ fsp = file_fsp(req, SVAL(req->inbuf,smb_vwv0));
if (!check_fsp(conn, req, fsp)) {
END_PROFILE(SMBlock);
@@ -4442,8 +4435,8 @@ void reply_lock(struct smb_request *req)
release_level_2_oplocks_on_change(fsp);
- count = (SMB_BIG_UINT)IVAL(req->inbuf,smb_vwv1);
- offset = (SMB_BIG_UINT)IVAL(req->inbuf,smb_vwv3);
+ count = (uint64_t)IVAL(req->inbuf,smb_vwv1);
+ offset = (uint64_t)IVAL(req->inbuf,smb_vwv3);
DEBUG(3,("lock fd=%d fnum=%d offset=%.0f count=%.0f\n",
fsp->fh->fd, fsp->fnum, (double)offset, (double)count));
@@ -4480,7 +4473,7 @@ void reply_lock(struct smb_request *req)
void reply_unlock(struct smb_request *req)
{
connection_struct *conn = req->conn;
- SMB_BIG_UINT count,offset;
+ uint64_t count,offset;
NTSTATUS status;
files_struct *fsp;
@@ -4492,15 +4485,15 @@ void reply_unlock(struct smb_request *req)
return;
}
- fsp = file_fsp(SVAL(req->inbuf,smb_vwv0));
+ fsp = file_fsp(req, SVAL(req->inbuf,smb_vwv0));
if (!check_fsp(conn, req, fsp)) {
END_PROFILE(SMBunlock);
return;
}
- count = (SMB_BIG_UINT)IVAL(req->inbuf,smb_vwv1);
- offset = (SMB_BIG_UINT)IVAL(req->inbuf,smb_vwv3);
+ count = (uint64_t)IVAL(req->inbuf,smb_vwv1);
+ offset = (uint64_t)IVAL(req->inbuf,smb_vwv3);
status = do_unlock(smbd_messaging_context(),
fsp,
@@ -4638,7 +4631,7 @@ void reply_printopen(struct smb_request *req)
}
/* Open for exclusive use, write only. */
- status = print_fsp_open(conn, NULL, req->vuid, &fsp);
+ status = print_fsp_open(req, conn, NULL, req->vuid, &fsp);
if (!NT_STATUS_IS_OK(status)) {
reply_nterror(req, status);
@@ -4674,7 +4667,7 @@ void reply_printclose(struct smb_request *req)
return;
}
- fsp = file_fsp(SVAL(req->inbuf,smb_vwv0));
+ fsp = file_fsp(req, SVAL(req->inbuf,smb_vwv0));
if (!check_fsp(conn, req, fsp)) {
END_PROFILE(SMBsplclose);
@@ -4690,7 +4683,7 @@ void reply_printclose(struct smb_request *req)
DEBUG(3,("printclose fd=%d fnum=%d\n",
fsp->fh->fd,fsp->fnum));
- status = close_file(fsp,NORMAL_CLOSE);
+ status = close_file(req, fsp, NORMAL_CLOSE);
if(!NT_STATUS_IS_OK(status)) {
reply_nterror(req, status);
@@ -4816,7 +4809,7 @@ void reply_printwrite(struct smb_request *req)
return;
}
- fsp = file_fsp(SVAL(req->inbuf,smb_vwv0));
+ fsp = file_fsp(req, SVAL(req->inbuf,smb_vwv0));
if (!check_fsp(conn, req, fsp)) {
END_PROFILE(SMBsplwr);
@@ -5785,7 +5778,7 @@ NTSTATUS rename_internals(TALLOC_CTX *ctx,
last_component_dest,
attrs, replace_if_exists);
- close_file(fsp, NORMAL_CLOSE);
+ close_file(req, fsp, NORMAL_CLOSE);
DEBUG(3, ("rename_internals: Error %s rename %s -> %s\n",
nt_errstr(status), directory,newname));
@@ -5889,7 +5882,7 @@ NTSTATUS rename_internals(TALLOC_CTX *ctx,
status = rename_internals_fsp(conn, fsp, destname, dname,
attrs, replace_if_exists);
- close_file(fsp, NORMAL_CLOSE);
+ close_file(req, fsp, NORMAL_CLOSE);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(3, ("rename_internals_fsp returned %s for "
@@ -6104,7 +6097,7 @@ NTSTATUS copy_file(TALLOC_CTX *ctx,
TALLOC_FREE(dest);
if (!NT_STATUS_IS_OK(status)) {
- close_file(fsp1,ERROR_CLOSE);
+ close_file(NULL, fsp1, ERROR_CLOSE);
return status;
}
@@ -6123,7 +6116,7 @@ NTSTATUS copy_file(TALLOC_CTX *ctx,
ret = vfs_transfer_file(fsp1, fsp2, src_sbuf.st_size);
}
- close_file(fsp1,NORMAL_CLOSE);
+ close_file(NULL, fsp1, NORMAL_CLOSE);
/* Ensure the modtime is set correctly on the destination file. */
set_close_write_time(fsp2, get_mtimespec(&src_sbuf));
@@ -6134,7 +6127,7 @@ NTSTATUS copy_file(TALLOC_CTX *ctx,
* Thus we don't look at the error return from the
* close of fsp1.
*/
- status = close_file(fsp2,NORMAL_CLOSE);
+ status = close_file(NULL, fsp2, NORMAL_CLOSE);
if (!NT_STATUS_IS_OK(status)) {
return status;
@@ -6498,17 +6491,17 @@ uint32 get_lock_pid( char *data, int data_offset, bool large_file_format)
Get a lock count, dealing with large count requests.
****************************************************************************/
-SMB_BIG_UINT get_lock_count( char *data, int data_offset, bool large_file_format)
+uint64_t get_lock_count( char *data, int data_offset, bool large_file_format)
{
- SMB_BIG_UINT count = 0;
+ uint64_t count = 0;
if(!large_file_format) {
- count = (SMB_BIG_UINT)IVAL(data,SMB_LKLEN_OFFSET(data_offset));
+ count = (uint64_t)IVAL(data,SMB_LKLEN_OFFSET(data_offset));
} else {
#if defined(HAVE_LONGLONG)
- count = (((SMB_BIG_UINT) IVAL(data,SMB_LARGE_LKLEN_OFFSET_HIGH(data_offset))) << 32) |
- ((SMB_BIG_UINT) IVAL(data,SMB_LARGE_LKLEN_OFFSET_LOW(data_offset)));
+ count = (((uint64_t) IVAL(data,SMB_LARGE_LKLEN_OFFSET_HIGH(data_offset))) << 32) |
+ ((uint64_t) IVAL(data,SMB_LARGE_LKLEN_OFFSET_LOW(data_offset)));
#else /* HAVE_LONGLONG */
/*
@@ -6525,7 +6518,7 @@ SMB_BIG_UINT get_lock_count( char *data, int data_offset, bool large_file_format
SIVAL(data,SMB_LARGE_LKLEN_OFFSET_HIGH(data_offset),0);
}
- count = (SMB_BIG_UINT)IVAL(data,SMB_LARGE_LKLEN_OFFSET_LOW(data_offset));
+ count = (uint64_t)IVAL(data,SMB_LARGE_LKLEN_OFFSET_LOW(data_offset));
#endif /* HAVE_LONGLONG */
}
@@ -6570,19 +6563,19 @@ static uint32 map_lock_offset(uint32 high, uint32 low)
Get a lock offset, dealing with large offset requests.
****************************************************************************/
-SMB_BIG_UINT get_lock_offset( char *data, int data_offset, bool large_file_format, bool *err)
+uint64_t get_lock_offset( char *data, int data_offset, bool large_file_format, bool *err)
{
- SMB_BIG_UINT offset = 0;
+ uint64_t offset = 0;
*err = False;
if(!large_file_format) {
- offset = (SMB_BIG_UINT)IVAL(data,SMB_LKOFF_OFFSET(data_offset));
+ offset = (uint64_t)IVAL(data,SMB_LKOFF_OFFSET(data_offset));
} else {
#if defined(HAVE_LONGLONG)
- offset = (((SMB_BIG_UINT) IVAL(data,SMB_LARGE_LKOFF_OFFSET_HIGH(data_offset))) << 32) |
- ((SMB_BIG_UINT) IVAL(data,SMB_LARGE_LKOFF_OFFSET_LOW(data_offset)));
+ offset = (((uint64_t) IVAL(data,SMB_LARGE_LKOFF_OFFSET_HIGH(data_offset))) << 32) |
+ ((uint64_t) IVAL(data,SMB_LARGE_LKOFF_OFFSET_LOW(data_offset)));
#else /* HAVE_LONGLONG */
/*
@@ -6599,7 +6592,7 @@ SMB_BIG_UINT get_lock_offset( char *data, int data_offset, bool large_file_forma
if((new_low = map_lock_offset(high, low)) == 0) {
*err = True;
- return (SMB_BIG_UINT)-1;
+ return (uint64_t)-1;
}
DEBUG(3,("get_lock_offset: truncating lock offset (high)0x%x (low)0x%x to offset 0x%x.\n",
@@ -6608,7 +6601,7 @@ SMB_BIG_UINT get_lock_offset( char *data, int data_offset, bool large_file_forma
SIVAL(data,SMB_LARGE_LKOFF_OFFSET_LOW(data_offset),new_low);
}
- offset = (SMB_BIG_UINT)IVAL(data,SMB_LARGE_LKOFF_OFFSET_LOW(data_offset));
+ offset = (uint64_t)IVAL(data,SMB_LARGE_LKOFF_OFFSET_LOW(data_offset));
#endif /* HAVE_LONGLONG */
}
@@ -6627,7 +6620,7 @@ void reply_lockingX(struct smb_request *req)
unsigned char oplocklevel;
uint16 num_ulocks;
uint16 num_locks;
- SMB_BIG_UINT count = 0, offset = 0;
+ uint64_t count = 0, offset = 0;
uint32 lock_pid;
int32 lock_timeout;
int i;
@@ -6644,7 +6637,7 @@ void reply_lockingX(struct smb_request *req)
return;
}
- fsp = file_fsp(SVAL(req->inbuf,smb_vwv2));
+ fsp = file_fsp(req, SVAL(req->inbuf,smb_vwv2));
locktype = CVAL(req->inbuf,smb_vwv3);
oplocklevel = CVAL(req->inbuf,smb_vwv3+1);
num_ulocks = SVAL(req->inbuf,smb_vwv6);
@@ -7020,7 +7013,7 @@ void reply_setattrE(struct smb_request *req)
return;
}
- fsp = file_fsp(SVAL(req->inbuf,smb_vwv0));
+ fsp = file_fsp(req, SVAL(req->inbuf,smb_vwv0));
if(!fsp || (fsp->conn != conn)) {
reply_doserror(req, ERRDOS, ERRbadfid);
@@ -7131,7 +7124,7 @@ void reply_getattrE(struct smb_request *req)
return;
}
- fsp = file_fsp(SVAL(req->inbuf,smb_vwv0));
+ fsp = file_fsp(req, SVAL(req->inbuf,smb_vwv0));
if(!fsp || (fsp->conn != conn)) {
reply_doserror(req, ERRDOS, ERRbadfid);
diff --git a/source3/smbd/seal.c b/source3/smbd/seal.c
index e9dc46aa3c..3822ee191e 100644
--- a/source3/smbd/seal.c
+++ b/source3/smbd/seal.c
@@ -426,9 +426,14 @@ static NTSTATUS srv_enc_spnego_gss_negotiate(unsigned char **ppdata, size_t *p_d
data_blob_free(&auth_reply);
SAFE_FREE(*ppdata);
- *ppdata = response.data;
+ *ppdata = (unsigned char *)memdup(response.data, response.length);
+ if ((*ppdata) == NULL && response.length > 0) {
+ status = NT_STATUS_NO_MEMORY;
+ }
*p_data_size = response.length;
+ data_blob_free(&response);
+
return status;
}
#endif
@@ -463,8 +468,13 @@ static NTSTATUS srv_enc_ntlm_negotiate(unsigned char **ppdata, size_t *p_data_si
}
SAFE_FREE(*ppdata);
- *ppdata = response.data;
+ *ppdata = (unsigned char *)memdup(response.data, response.length);
+ if ((*ppdata) == NULL && response.length > 0) {
+ status = NT_STATUS_NO_MEMORY;
+ }
*p_data_size = response.length;
+ data_blob_free(&response);
+
return status;
}
@@ -585,8 +595,11 @@ static NTSTATUS srv_enc_spnego_ntlm_auth(connection_struct *conn,
}
SAFE_FREE(*ppdata);
- *ppdata = response.data;
+ *ppdata = (unsigned char *)memdup(response.data, response.length);
+ if ((*ppdata) == NULL && response.length > 0)
+ return NT_STATUS_NO_MEMORY;
*p_data_size = response.length;
+ data_blob_free(&response);
return status;
}
@@ -636,8 +649,11 @@ static NTSTATUS srv_enc_raw_ntlm_auth(connection_struct *conn,
/* Return the raw blob. */
SAFE_FREE(*ppdata);
- *ppdata = response.data;
+ *ppdata = (unsigned char *)memdup(response.data, response.length);
+ if ((*ppdata) == NULL && response.length > 0)
+ return NT_STATUS_NO_MEMORY;
*p_data_size = response.length;
+ data_blob_free(&response);
return status;
}
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 69a483e4fc..4e81263ee4 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -840,7 +840,7 @@ bool reload_services(bool test)
if (lp_loaded()) {
char *fname = lp_configfile();
- if (file_exist(fname, NULL) &&
+ if (file_exist(fname) &&
!strcsequal(fname, get_dyn_CONFIGFILE())) {
set_dyn_CONFIGFILE(fname);
test = False;
@@ -888,7 +888,7 @@ bool reload_services(bool test)
enum server_exit_reason { SERVER_EXIT_NORMAL, SERVER_EXIT_ABNORMAL };
static void exit_server_common(enum server_exit_reason how,
- const char *const reason) NORETURN_ATTRIBUTE;
+ const char *const reason) _NORETURN_;
static void exit_server_common(enum server_exit_reason how,
const char *const reason)
@@ -1319,7 +1319,7 @@ extern void build_options(bool screen);
setpgid( (pid_t)0, (pid_t)0);
#endif
- if (!directory_exist(lp_lockdir(), NULL))
+ if (!directory_exist(lp_lockdir()))
mkdir(lp_lockdir(), 0755);
if (is_daemon)
diff --git a/source3/smbd/service.c b/source3/smbd/service.c
index 0b851f1e48..05197021a3 100644
--- a/source3/smbd/service.c
+++ b/source3/smbd/service.c
@@ -1296,10 +1296,9 @@ connection_struct *make_connection(const char *service_in, DATA_BLOB password,
void close_cnum(connection_struct *conn, uint16 vuid)
{
- if (IS_IPC(conn)) {
- pipe_close_conn(conn);
- } else {
- file_close_conn(conn);
+ file_close_conn(conn);
+
+ if (!IS_IPC(conn)) {
dptr_closecnum(conn);
}
diff --git a/source3/smbd/session.c b/source3/smbd/session.c
index 3b431a19be..8163eb30af 100644
--- a/source3/smbd/session.c
+++ b/source3/smbd/session.c
@@ -113,7 +113,10 @@ bool session_claim(user_struct *vuser)
break;
}
- sess_pid = ((struct sessionid *)rec->value.dptr)->pid;
+ memcpy(&sess_pid,
+ ((char *)rec->value.dptr)
+ + offsetof(struct sessionid, pid),
+ sizeof(sess_pid));
if (!process_exists(sess_pid)) {
DEBUG(5, ("%s has died -- re-using session\n",
diff --git a/source3/smbd/statvfs.c b/source3/smbd/statvfs.c
index 0e9a2c2ebe..ee33e13a48 100644
--- a/source3/smbd/statvfs.c
+++ b/source3/smbd/statvfs.c
@@ -118,7 +118,7 @@ static int darwin_statvfs(const char *path, vfs_statvfs_struct *statbuf)
statbuf->UserBlocksAvail = sbuf.f_bavail;
statbuf->TotalFileNodes = sbuf.f_files;
statbuf->FreeFileNodes = sbuf.f_ffree;
- statbuf->FsIdentifier = *(SMB_BIG_UINT *)(&sbuf.f_fsid); /* Ick. */
+ statbuf->FsIdentifier = *(uint64_t *)(&sbuf.f_fsid); /* Ick. */
statbuf->FsCapabilities = darwin_fs_capabilities(sbuf.f_mntonname);
return 0;
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 1e2095a3ea..1da45a8b58 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -47,9 +47,9 @@ static char *store_file_unix_basic_info2(connection_struct *conn,
Only do this for Windows clients.
********************************************************************/
-SMB_BIG_UINT smb_roundup(connection_struct *conn, SMB_BIG_UINT val)
+uint64_t smb_roundup(connection_struct *conn, uint64_t val)
{
- SMB_BIG_UINT rval = lp_allocation_roundup_size(SNUM(conn));
+ uint64_t rval = lp_allocation_roundup_size(SNUM(conn));
/* Only roundup for Windows clients. */
enum remote_arch_types ra_type = get_remote_arch();
@@ -64,18 +64,18 @@ SMB_BIG_UINT smb_roundup(connection_struct *conn, SMB_BIG_UINT val)
account sparse files.
********************************************************************/
-SMB_BIG_UINT get_allocation_size(connection_struct *conn, files_struct *fsp, const SMB_STRUCT_STAT *sbuf)
+uint64_t get_allocation_size(connection_struct *conn, files_struct *fsp, const SMB_STRUCT_STAT *sbuf)
{
- SMB_BIG_UINT ret;
+ uint64_t ret;
if(S_ISDIR(sbuf->st_mode)) {
return 0;
}
#if defined(HAVE_STAT_ST_BLOCKS) && defined(STAT_ST_BLOCKSIZE)
- ret = (SMB_BIG_UINT)STAT_ST_BLOCKSIZE * (SMB_BIG_UINT)sbuf->st_blocks;
+ ret = (uint64_t)STAT_ST_BLOCKSIZE * (uint64_t)sbuf->st_blocks;
#else
- ret = (SMB_BIG_UINT)get_file_size(*sbuf);
+ ret = (uint64_t)get_file_size(*sbuf);
#endif
if (fsp && fsp->initial_allocation_size)
@@ -1031,7 +1031,7 @@ static void call_trans2open(connection_struct *conn,
mtime = sbuf.st_mtime;
inode = sbuf.st_ino;
if (fattr & aDIR) {
- close_file(fsp,ERROR_CLOSE);
+ close_file(req, fsp, ERROR_CLOSE);
reply_doserror(req, ERRDOS,ERRnoaccess);
return;
}
@@ -1264,7 +1264,7 @@ static bool get_lanman2_dir_entry(TALLOC_CTX *ctx,
long prev_dirpos=0;
uint32 mode=0;
SMB_OFF_T file_size = 0;
- SMB_BIG_UINT allocation_size = 0;
+ uint64_t allocation_size = 0;
uint32 len;
struct timespec mdate_ts, adate_ts, create_date_ts;
time_t mdate = (time_t)0, adate = (time_t)0, create_date = (time_t)0;
@@ -2613,22 +2613,22 @@ static void call_trans2qfsinfo(connection_struct *conn,
switch (info_level) {
case SMB_INFO_ALLOCATION:
{
- SMB_BIG_UINT dfree,dsize,bsize,block_size,sectors_per_unit,bytes_per_sector;
+ uint64_t dfree,dsize,bsize,block_size,sectors_per_unit,bytes_per_sector;
data_len = 18;
- if (get_dfree_info(conn,".",False,&bsize,&dfree,&dsize) == (SMB_BIG_UINT)-1) {
+ if (get_dfree_info(conn,".",False,&bsize,&dfree,&dsize) == (uint64_t)-1) {
reply_unixerror(req, ERRHRD, ERRgeneral);
return;
}
block_size = lp_block_size(snum);
if (bsize < block_size) {
- SMB_BIG_UINT factor = block_size/bsize;
+ uint64_t factor = block_size/bsize;
bsize = block_size;
dsize /= factor;
dfree /= factor;
}
if (bsize > block_size) {
- SMB_BIG_UINT factor = bsize/block_size;
+ uint64_t factor = bsize/block_size;
bsize = block_size;
dsize *= factor;
dfree *= factor;
@@ -2733,21 +2733,21 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)st.st_dev, (unsi
case SMB_QUERY_FS_SIZE_INFO:
case SMB_FS_SIZE_INFORMATION:
{
- SMB_BIG_UINT dfree,dsize,bsize,block_size,sectors_per_unit,bytes_per_sector;
+ uint64_t dfree,dsize,bsize,block_size,sectors_per_unit,bytes_per_sector;
data_len = 24;
- if (get_dfree_info(conn,".",False,&bsize,&dfree,&dsize) == (SMB_BIG_UINT)-1) {
+ if (get_dfree_info(conn,".",False,&bsize,&dfree,&dsize) == (uint64_t)-1) {
reply_unixerror(req, ERRHRD, ERRgeneral);
return;
}
block_size = lp_block_size(snum);
if (bsize < block_size) {
- SMB_BIG_UINT factor = block_size/bsize;
+ uint64_t factor = block_size/bsize;
bsize = block_size;
dsize /= factor;
dfree /= factor;
}
if (bsize > block_size) {
- SMB_BIG_UINT factor = bsize/block_size;
+ uint64_t factor = bsize/block_size;
bsize = block_size;
dsize *= factor;
dfree *= factor;
@@ -2766,21 +2766,21 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)bsize, (unsigned
case SMB_FS_FULL_SIZE_INFORMATION:
{
- SMB_BIG_UINT dfree,dsize,bsize,block_size,sectors_per_unit,bytes_per_sector;
+ uint64_t dfree,dsize,bsize,block_size,sectors_per_unit,bytes_per_sector;
data_len = 32;
- if (get_dfree_info(conn,".",False,&bsize,&dfree,&dsize) == (SMB_BIG_UINT)-1) {
+ if (get_dfree_info(conn,".",False,&bsize,&dfree,&dsize) == (uint64_t)-1) {
reply_unixerror(req, ERRHRD, ERRgeneral);
return;
}
block_size = lp_block_size(snum);
if (bsize < block_size) {
- SMB_BIG_UINT factor = block_size/bsize;
+ uint64_t factor = block_size/bsize;
bsize = block_size;
dsize /= factor;
dfree /= factor;
}
if (bsize > block_size) {
- SMB_BIG_UINT factor = bsize/block_size;
+ uint64_t factor = bsize/block_size;
bsize = block_size;
dsize *= factor;
dfree *= factor;
@@ -2811,8 +2811,8 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)bsize, (unsigned
* what we have to send --metze:
*
* Unknown1: 24 NULL bytes
- * Soft Quota Treshold: 8 bytes seems like SMB_BIG_UINT or so
- * Hard Quota Limit: 8 bytes seems like SMB_BIG_UINT or so
+ * Soft Quota Treshold: 8 bytes seems like uint64_t or so
+ * Hard Quota Limit: 8 bytes seems like uint64_t or so
* Quota Flags: 2 byte :
* Unknown3: 6 NULL bytes
*
@@ -2860,9 +2860,9 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)bsize, (unsigned
DEBUG(10,("SMB_FS_QUOTA_INFORMATION: for service [%s]\n",lp_servicename(SNUM(conn))));
/* Unknown1 24 NULL bytes*/
- SBIG_UINT(pdata,0,(SMB_BIG_UINT)0);
- SBIG_UINT(pdata,8,(SMB_BIG_UINT)0);
- SBIG_UINT(pdata,16,(SMB_BIG_UINT)0);
+ SBIG_UINT(pdata,0,(uint64_t)0);
+ SBIG_UINT(pdata,8,(uint64_t)0);
+ SBIG_UINT(pdata,16,(uint64_t)0);
/* Default Soft Quota 8 bytes */
SBIG_UINT(pdata,24,quotas.softlim);
@@ -2935,7 +2935,7 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)bsize, (unsigned
/* We have POSIX ACLs, pathname, encryption,
* large read/write, and locking capability. */
- SBIG_UINT(pdata,4,((SMB_BIG_UINT)(
+ SBIG_UINT(pdata,4,((uint64_t)(
CIFS_UNIX_POSIX_ACLS_CAP|
CIFS_UNIX_POSIX_PATHNAMES_CAP|
CIFS_UNIX_FCNTL_LOCKS_CAP|
@@ -3037,9 +3037,9 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)bsize, (unsigned
SIVAL(pdata, 0, flags);
SIVAL(pdata, 4, SMB_WHOAMI_MASK);
SBIG_UINT(pdata, 8,
- (SMB_BIG_UINT)conn->server_info->utok.uid);
+ (uint64_t)conn->server_info->utok.uid);
SBIG_UINT(pdata, 16,
- (SMB_BIG_UINT)conn->server_info->utok.gid);
+ (uint64_t)conn->server_info->utok.gid);
if (data_len >= max_data_bytes) {
@@ -3078,7 +3078,7 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)bsize, (unsigned
/* GID list */
for (i = 0; i < conn->server_info->utok.ngroups; ++i) {
SBIG_UINT(pdata, data_len,
- (SMB_BIG_UINT)conn->server_info->utok.groups[i]);
+ (uint64_t)conn->server_info->utok.groups[i]);
data_len += 8;
}
@@ -3298,7 +3298,7 @@ cap_low = 0x%x, cap_high = 0x%x\n",
* but we didn't use the last 6 bytes for now
* --metze
*/
- fsp = file_fsp(SVAL(params,0));
+ fsp = file_fsp(req, SVAL(params,0));
if (!check_fsp_ntquota_handle(conn, req,
fsp)) {
@@ -3319,10 +3319,10 @@ cap_low = 0x%x, cap_high = 0x%x\n",
/* unknown_1 24 NULL bytes in pdata*/
- /* the soft quotas 8 bytes (SMB_BIG_UINT)*/
- quotas.softlim = (SMB_BIG_UINT)IVAL(pdata,24);
+ /* the soft quotas 8 bytes (uint64_t)*/
+ quotas.softlim = (uint64_t)IVAL(pdata,24);
#ifdef LARGE_SMB_OFF_T
- quotas.softlim |= (((SMB_BIG_UINT)IVAL(pdata,28)) << 32);
+ quotas.softlim |= (((uint64_t)IVAL(pdata,28)) << 32);
#else /* LARGE_SMB_OFF_T */
if ((IVAL(pdata,28) != 0)&&
((quotas.softlim != 0xFFFFFFFF)||
@@ -3335,10 +3335,10 @@ cap_low = 0x%x, cap_high = 0x%x\n",
}
#endif /* LARGE_SMB_OFF_T */
- /* the hard quotas 8 bytes (SMB_BIG_UINT)*/
- quotas.hardlim = (SMB_BIG_UINT)IVAL(pdata,32);
+ /* the hard quotas 8 bytes (uint64_t)*/
+ quotas.hardlim = (uint64_t)IVAL(pdata,32);
#ifdef LARGE_SMB_OFF_T
- quotas.hardlim |= (((SMB_BIG_UINT)IVAL(pdata,36)) << 32);
+ quotas.hardlim |= (((uint64_t)IVAL(pdata,36)) << 32);
#else /* LARGE_SMB_OFF_T */
if ((IVAL(pdata,36) != 0)&&
((quotas.hardlim != 0xFFFFFFFF)||
@@ -3754,7 +3754,7 @@ static void call_trans2qpipeinfo(connection_struct *conn,
unsigned int data_size = 0;
unsigned int param_size = 2;
uint16 info_level;
- smb_np_struct *p_pipe = NULL;
+ files_struct *fsp;
if (!params) {
reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
@@ -3766,8 +3766,8 @@ static void call_trans2qpipeinfo(connection_struct *conn,
return;
}
- p_pipe = get_rpc_pipe_p(SVAL(params,0));
- if (p_pipe == NULL) {
+ fsp = file_fsp(req, SVAL(params,0));
+ if (!fsp_is_np(fsp)) {
reply_nterror(req, NT_STATUS_INVALID_HANDLE);
return;
}
@@ -3828,7 +3828,7 @@ static void call_trans2qfilepathinfo(connection_struct *conn,
int mode=0;
int nlink;
SMB_OFF_T file_size=0;
- SMB_BIG_UINT allocation_size=0;
+ uint64_t allocation_size=0;
unsigned int data_size = 0;
unsigned int param_size = 2;
SMB_STRUCT_STAT sbuf;
@@ -3873,7 +3873,7 @@ static void call_trans2qfilepathinfo(connection_struct *conn,
return;
}
- fsp = file_fsp(SVAL(params,0));
+ fsp = file_fsp(req, SVAL(params,0));
info_level = SVAL(params,2);
DEBUG(3,("call_trans2qfilepathinfo: TRANSACT2_QFILEINFO: level = %d\n", info_level));
@@ -4682,8 +4682,8 @@ total_data=%u (should be %u)\n", (unsigned int)total_data, (unsigned int)IVAL(pd
case SMB_QUERY_POSIX_LOCK:
{
NTSTATUS status = NT_STATUS_INVALID_LEVEL;
- SMB_BIG_UINT count;
- SMB_BIG_UINT offset;
+ uint64_t count;
+ uint64_t offset;
uint32 lock_pid;
enum brl_type lock_type;
@@ -4711,13 +4711,13 @@ total_data=%u (should be %u)\n", (unsigned int)total_data, (unsigned int)IVAL(pd
lock_pid = IVAL(pdata, POSIX_LOCK_PID_OFFSET);
#if defined(HAVE_LONGLONG)
- offset = (((SMB_BIG_UINT) IVAL(pdata,(POSIX_LOCK_START_OFFSET+4))) << 32) |
- ((SMB_BIG_UINT) IVAL(pdata,POSIX_LOCK_START_OFFSET));
- count = (((SMB_BIG_UINT) IVAL(pdata,(POSIX_LOCK_LEN_OFFSET+4))) << 32) |
- ((SMB_BIG_UINT) IVAL(pdata,POSIX_LOCK_LEN_OFFSET));
+ offset = (((uint64_t) IVAL(pdata,(POSIX_LOCK_START_OFFSET+4))) << 32) |
+ ((uint64_t) IVAL(pdata,POSIX_LOCK_START_OFFSET));
+ count = (((uint64_t) IVAL(pdata,(POSIX_LOCK_LEN_OFFSET+4))) << 32) |
+ ((uint64_t) IVAL(pdata,POSIX_LOCK_LEN_OFFSET));
#else /* HAVE_LONGLONG */
- offset = (SMB_BIG_UINT)IVAL(pdata,POSIX_LOCK_START_OFFSET);
- count = (SMB_BIG_UINT)IVAL(pdata,POSIX_LOCK_LEN_OFFSET);
+ offset = (uint64_t)IVAL(pdata,POSIX_LOCK_START_OFFSET);
+ count = (uint64_t)IVAL(pdata,POSIX_LOCK_LEN_OFFSET);
#endif /* HAVE_LONGLONG */
status = query_lock(fsp,
@@ -5016,12 +5016,12 @@ static NTSTATUS smb_set_file_size(connection_struct *conn,
if (vfs_set_filelen(new_fsp, size) == -1) {
status = map_nt_error_from_unix(errno);
- close_file(new_fsp,NORMAL_CLOSE);
+ close_file(req, new_fsp,NORMAL_CLOSE);
return status;
}
trigger_write_time_update_immediate(new_fsp);
- close_file(new_fsp,NORMAL_CLOSE);
+ close_file(req, new_fsp,NORMAL_CLOSE);
return NT_STATUS_OK;
}
@@ -5123,7 +5123,7 @@ static NTSTATUS smb_file_position_information(connection_struct *conn,
int total_data,
files_struct *fsp)
{
- SMB_BIG_UINT position_information;
+ uint64_t position_information;
if (total_data < 8) {
return NT_STATUS_INVALID_PARAMETER;
@@ -5134,9 +5134,9 @@ static NTSTATUS smb_file_position_information(connection_struct *conn,
return NT_STATUS_OK;
}
- position_information = (SMB_BIG_UINT)IVAL(pdata,0);
+ position_information = (uint64_t)IVAL(pdata,0);
#ifdef LARGE_SMB_OFF_T
- position_information |= (((SMB_BIG_UINT)IVAL(pdata,4)) << 32);
+ position_information |= (((uint64_t)IVAL(pdata,4)) << 32);
#else /* LARGE_SMB_OFF_T */
if (IVAL(pdata,4) != 0) {
/* more than 32 bits? */
@@ -5475,8 +5475,8 @@ static NTSTATUS smb_set_posix_lock(connection_struct *conn,
int total_data,
files_struct *fsp)
{
- SMB_BIG_UINT count;
- SMB_BIG_UINT offset;
+ uint64_t count;
+ uint64_t offset;
uint32 lock_pid;
bool blocking_lock = False;
enum brl_type lock_type;
@@ -5523,13 +5523,13 @@ static NTSTATUS smb_set_posix_lock(connection_struct *conn,
lock_pid = IVAL(pdata, POSIX_LOCK_PID_OFFSET);
#if defined(HAVE_LONGLONG)
- offset = (((SMB_BIG_UINT) IVAL(pdata,(POSIX_LOCK_START_OFFSET+4))) << 32) |
- ((SMB_BIG_UINT) IVAL(pdata,POSIX_LOCK_START_OFFSET));
- count = (((SMB_BIG_UINT) IVAL(pdata,(POSIX_LOCK_LEN_OFFSET+4))) << 32) |
- ((SMB_BIG_UINT) IVAL(pdata,POSIX_LOCK_LEN_OFFSET));
+ offset = (((uint64_t) IVAL(pdata,(POSIX_LOCK_START_OFFSET+4))) << 32) |
+ ((uint64_t) IVAL(pdata,POSIX_LOCK_START_OFFSET));
+ count = (((uint64_t) IVAL(pdata,(POSIX_LOCK_LEN_OFFSET+4))) << 32) |
+ ((uint64_t) IVAL(pdata,POSIX_LOCK_LEN_OFFSET));
#else /* HAVE_LONGLONG */
- offset = (SMB_BIG_UINT)IVAL(pdata,POSIX_LOCK_START_OFFSET);
- count = (SMB_BIG_UINT)IVAL(pdata,POSIX_LOCK_LEN_OFFSET);
+ offset = (uint64_t)IVAL(pdata,POSIX_LOCK_START_OFFSET);
+ count = (uint64_t)IVAL(pdata,POSIX_LOCK_LEN_OFFSET);
#endif /* HAVE_LONGLONG */
DEBUG(10,("smb_set_posix_lock: file %s, lock_type = %u,"
@@ -5702,7 +5702,7 @@ static NTSTATUS smb_set_file_allocation_info(connection_struct *conn,
const char *fname,
SMB_STRUCT_STAT *psbuf)
{
- SMB_BIG_UINT allocation_size = 0;
+ uint64_t allocation_size = 0;
NTSTATUS status = NT_STATUS_OK;
files_struct *new_fsp = NULL;
@@ -5714,9 +5714,9 @@ static NTSTATUS smb_set_file_allocation_info(connection_struct *conn,
return NT_STATUS_INVALID_PARAMETER;
}
- allocation_size = (SMB_BIG_UINT)IVAL(pdata,0);
+ allocation_size = (uint64_t)IVAL(pdata,0);
#ifdef LARGE_SMB_OFF_T
- allocation_size |= (((SMB_BIG_UINT)IVAL(pdata,4)) << 32);
+ allocation_size |= (((uint64_t)IVAL(pdata,4)) << 32);
#else /* LARGE_SMB_OFF_T */
if (IVAL(pdata,4) != 0) {
/* more than 32 bits? */
@@ -5771,7 +5771,7 @@ static NTSTATUS smb_set_file_allocation_info(connection_struct *conn,
if (allocation_size != get_file_size(*psbuf)) {
if (vfs_allocate_file_space(new_fsp, allocation_size) == -1) {
status = map_nt_error_from_unix(errno);
- close_file(new_fsp,NORMAL_CLOSE);
+ close_file(req, new_fsp, NORMAL_CLOSE);
return status;
}
}
@@ -5783,7 +5783,7 @@ static NTSTATUS smb_set_file_allocation_info(connection_struct *conn,
*/
trigger_write_time_update_immediate(new_fsp);
- close_file(new_fsp,NORMAL_CLOSE);
+ close_file(req, new_fsp, NORMAL_CLOSE);
return NT_STATUS_OK;
}
@@ -6196,7 +6196,7 @@ static NTSTATUS smb_posix_mkdir(connection_struct *conn,
&fsp);
if (NT_STATUS_IS_OK(status)) {
- close_file(fsp, NORMAL_CLOSE);
+ close_file(req, fsp, NORMAL_CLOSE);
}
info_level_return = SVAL(pdata,16);
@@ -6389,7 +6389,7 @@ static NTSTATUS smb_posix_open(connection_struct *conn,
/* Realloc the data size */
*ppdata = (char *)SMB_REALLOC(*ppdata,*pdata_return_size);
if (*ppdata == NULL) {
- close_file(fsp,ERROR_CLOSE);
+ close_file(req, fsp, ERROR_CLOSE);
*pdata_return_size = 0;
return NT_STATUS_NO_MEMORY;
}
@@ -6507,7 +6507,7 @@ static NTSTATUS smb_posix_unlink(connection_struct *conn,
if (lck == NULL) {
DEBUG(0, ("smb_posix_unlink: Could not get share mode "
"lock for file %s\n", fsp->fsp_name));
- close_file(fsp, NORMAL_CLOSE);
+ close_file(req, fsp, NORMAL_CLOSE);
return NT_STATUS_INVALID_PARAMETER;
}
@@ -6523,7 +6523,7 @@ static NTSTATUS smb_posix_unlink(connection_struct *conn,
continue;
}
/* Fail with sharing violation. */
- close_file(fsp, NORMAL_CLOSE);
+ close_file(req, fsp, NORMAL_CLOSE);
TALLOC_FREE(lck);
return NT_STATUS_SHARING_VIOLATION;
}
@@ -6540,12 +6540,12 @@ static NTSTATUS smb_posix_unlink(connection_struct *conn,
psbuf);
if (!NT_STATUS_IS_OK(status)) {
- close_file(fsp, NORMAL_CLOSE);
+ close_file(req, fsp, NORMAL_CLOSE);
TALLOC_FREE(lck);
return status;
}
TALLOC_FREE(lck);
- return close_file(fsp, NORMAL_CLOSE);
+ return close_file(req, fsp, NORMAL_CLOSE);
}
/****************************************************************************
@@ -6582,7 +6582,7 @@ static void call_trans2setfilepathinfo(connection_struct *conn,
return;
}
- fsp = file_fsp(SVAL(params,0));
+ fsp = file_fsp(req, SVAL(params,0));
/* Basic check for non-null fsp. */
if (!check_fsp_open(conn, req, fsp)) {
return;
@@ -7065,10 +7065,11 @@ static void call_trans2mkdir(connection_struct *conn, struct smb_request *req,
reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
return;
}
- } else if (IVAL(pdata,0) != 4) {
- reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
- return;
}
+ /* If total_data == 4 Windows doesn't care what values
+ * are placed in that field, it just ignores them.
+ * The System i QNTC IBM SMB client puts bad values here,
+ * so ignore them. */
status = create_directory(conn, req, directory);
@@ -7250,7 +7251,7 @@ static void call_trans2ioctl(connection_struct *conn,
unsigned int max_data_bytes)
{
char *pdata = *ppdata;
- files_struct *fsp = file_fsp(SVAL(req->inbuf,smb_vwv15));
+ files_struct *fsp = file_fsp(req, SVAL(req->inbuf,smb_vwv15));
/* check for an invalid fid before proceeding */
diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c
index 1e137dd908..011f31dd24 100644
--- a/source3/smbd/vfs.c
+++ b/source3/smbd/vfs.c
@@ -501,13 +501,13 @@ ssize_t vfs_pwrite_data(struct smb_request *req,
Returns 0 on success, -1 on failure.
****************************************************************************/
-int vfs_allocate_file_space(files_struct *fsp, SMB_BIG_UINT len)
+int vfs_allocate_file_space(files_struct *fsp, uint64_t len)
{
int ret;
SMB_STRUCT_STAT st;
connection_struct *conn = fsp->conn;
- SMB_BIG_UINT space_avail;
- SMB_BIG_UINT bsize,dfree,dsize;
+ uint64_t space_avail;
+ uint64_t bsize,dfree,dsize;
release_level_2_oplocks_on_change(fsp);
@@ -527,10 +527,10 @@ int vfs_allocate_file_space(files_struct *fsp, SMB_BIG_UINT len)
if (ret == -1)
return ret;
- if (len == (SMB_BIG_UINT)st.st_size)
+ if (len == (uint64_t)st.st_size)
return 0;
- if (len < (SMB_BIG_UINT)st.st_size) {
+ if (len < (uint64_t)st.st_size) {
/* Shrink - use ftruncate. */
DEBUG(10,("vfs_allocate_file_space: file %s, shrink. Current size %.0f\n",
@@ -551,7 +551,7 @@ int vfs_allocate_file_space(files_struct *fsp, SMB_BIG_UINT len)
len -= st.st_size;
len /= 1024; /* Len is now number of 1k blocks needed. */
space_avail = get_dfree_info(conn,fsp->fsp_name,False,&bsize,&dfree,&dsize);
- if (space_avail == (SMB_BIG_UINT)-1) {
+ if (space_avail == (uint64_t)-1) {
return -1;
}
diff --git a/source3/torture/cmd_vfs.c b/source3/torture/cmd_vfs.c
index dddd5bef29..d984dd661c 100644
--- a/source3/torture/cmd_vfs.c
+++ b/source3/torture/cmd_vfs.c
@@ -105,7 +105,7 @@ static NTSTATUS cmd_disconnect(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int a
static NTSTATUS cmd_disk_free(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, const char **argv)
{
- SMB_BIG_UINT diskfree, bsize, dfree, dsize;
+ uint64_t diskfree, bsize, dfree, dsize;
if (argc != 2) {
printf("Usage: disk_free <path>\n");
return NT_STATUS_OK;
diff --git a/source3/torture/locktest.c b/source3/torture/locktest.c
index 2ba5ab8f06..b58cb3deec 100644
--- a/source3/torture/locktest.c
+++ b/source3/torture/locktest.c
@@ -71,7 +71,7 @@ struct record {
enum lock_op lock_op;
enum brl_type lock_type;
char conn, f;
- SMB_BIG_UINT start, len;
+ uint64_t start, len;
char needed;
};
@@ -303,8 +303,8 @@ static bool test_one(struct cli_state *cli[NSERVERS][NCONNECTIONS],
{
unsigned conn = rec->conn;
unsigned f = rec->f;
- SMB_BIG_UINT start = rec->start;
- SMB_BIG_UINT len = rec->len;
+ uint64_t start = rec->start;
+ uint64_t len = rec->len;
enum brl_type op = rec->lock_type;
int server;
bool ret[NSERVERS];
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index d8942e42b9..904fb5c262 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -294,15 +294,6 @@ static bool torture_open_connection_share(struct cli_state **c,
return True;
}
-void torture_open_connection_free_unclist(char **unc_list)
-{
- if (unc_list!=NULL)
- {
- SAFE_FREE(unc_list[0]);
- SAFE_FREE(unc_list);
- }
-}
-
bool torture_open_connection(struct cli_state **c, int conn_index)
{
char **unc_list = NULL;
@@ -311,7 +302,7 @@ bool torture_open_connection(struct cli_state **c, int conn_index)
if (use_multishare_conn==True) {
char *h, *s;
- unc_list = file_lines_load(multishare_conn_fname, &num_unc_names, 0);
+ unc_list = file_lines_load(multishare_conn_fname, &num_unc_names, 0, NULL);
if (!unc_list || num_unc_names <= 0) {
printf("Failed to load unc names list from '%s'\n", multishare_conn_fname);
exit(1);
@@ -321,14 +312,14 @@ bool torture_open_connection(struct cli_state **c, int conn_index)
NULL, &h, &s)) {
printf("Failed to parse UNC name %s\n",
unc_list[conn_index % num_unc_names]);
- torture_open_connection_free_unclist(unc_list);
+ TALLOC_FREE(unc_list);
exit(1);
}
result = torture_open_connection_share(c, h, s);
/* h, s were copied earlier */
- torture_open_connection_free_unclist(unc_list);
+ TALLOC_FREE(unc_list);
return result;
}
@@ -5075,7 +5066,7 @@ static bool run_local_gencache(int dummy)
return False;
}
- blob = data_blob_string_const("bar");
+ blob = data_blob_string_const_null("bar");
tm = time(NULL);
if (!gencache_set_data_blob("foo", &blob, tm)) {
@@ -5649,7 +5640,7 @@ static void usage(void)
*p = 0;
fstrcpy(share, p+1);
- fstrcpy(myname, get_myname(talloc_tos()));
+ fstrcpy(myname, talloc_get_myname(talloc_tos()));
if (!*myname) {
fprintf(stderr, "Failed to get my hostname.\n");
return 1;
diff --git a/source3/torture/vfstest.c b/source3/torture/vfstest.c
index 56e27eec1d..bb4dc35d2b 100644
--- a/source3/torture/vfstest.c
+++ b/source3/torture/vfstest.c
@@ -433,7 +433,7 @@ bool reload_services(bool test)
if (lp_loaded()) {
const char *fname = lp_configfile();
- if (file_exist(fname, NULL) &&
+ if (file_exist(fname) &&
!strcsequal(fname, get_dyn_CONFIGFILE())) {
set_dyn_CONFIGFILE(fname);
test = False;
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
index 627374cb96..8e8dd7e767 100644
--- a/source3/utils/net_ads.c
+++ b/source3/utils/net_ads.c
@@ -67,7 +67,7 @@ static int net_ads_cldap_netlogon(struct net_context *c, ADS_STRUCT *ads)
break;
}
- d_printf("GUID: %s\n", smb_uuid_string(talloc_tos(), reply.domain_uuid));
+ d_printf("GUID: %s\n", GUID_string(talloc_tos(), &reply.domain_uuid));
d_printf("Flags:\n"
"\tIs a PDC: %s\n"
@@ -182,7 +182,8 @@ static int net_ads_info(struct net_context *c, int argc, const char **argv)
d_printf("Realm: %s\n", ads->config.realm);
d_printf("Bind Path: %s\n", ads->config.bind_path);
d_printf("LDAP port: %d\n", ads->ldap.port);
- d_printf("Server time: %s\n", http_timestring(ads->config.current_time));
+ d_printf("Server time: %s\n",
+ http_timestring(talloc_tos(), ads->config.current_time));
d_printf("KDC server: %s\n", ads->auth.kdc_server );
d_printf("Server time offset: %d\n", ads->auth.time_offset );
diff --git a/source3/utils/net_registry_util.c b/source3/utils/net_registry_util.c
index 278377867a..cd291b5c74 100644
--- a/source3/utils/net_registry_util.c
+++ b/source3/utils/net_registry_util.c
@@ -27,7 +27,7 @@ void print_registry_key(const char *keyname, NTTIME *modtime)
d_printf("Keyname = %s\n", keyname);
d_printf("Modtime = %s\n",
modtime
- ? http_timestring(nt_time_to_unix(*modtime))
+ ? http_timestring(talloc_tos(), nt_time_to_unix(*modtime))
: "None");
d_printf("\n");
}
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index 0e91144d33..5f5a21dfbb 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -504,13 +504,13 @@ NTSTATUS rpc_info_internals(struct net_context *c,
2,
&info);
if (NT_STATUS_IS_OK(result)) {
- d_printf("Domain Name: %s\n", info->info2.domain_name.string);
+ d_printf("Domain Name: %s\n", info->general.domain_name.string);
d_printf("Domain SID: %s\n", sid_str);
d_printf("Sequence number: %llu\n",
- (unsigned long long)info->info2.sequence_num);
- d_printf("Num users: %u\n", info->info2.num_users);
- d_printf("Num domain groups: %u\n", info->info2.num_groups);
- d_printf("Num local groups: %u\n", info->info2.num_aliases);
+ (unsigned long long)info->general.sequence_num);
+ d_printf("Num users: %u\n", info->general.num_users);
+ d_printf("Num domain groups: %u\n", info->general.num_groups);
+ d_printf("Num local groups: %u\n", info->general.num_aliases);
}
done:
@@ -5012,8 +5012,7 @@ NTSTATUS rpc_init_shutdown_internals(struct net_context *c,
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
const char *msg = "This machine will be shutdown shortly";
uint32 timeout = 20;
- struct initshutdown_String msg_string;
- struct initshutdown_String_sub s;
+ struct lsa_StringLarge msg_string;
if (c->opt_comment) {
msg = c->opt_comment;
@@ -5022,8 +5021,7 @@ NTSTATUS rpc_init_shutdown_internals(struct net_context *c,
timeout = c->opt_timeout;
}
- s.name = msg;
- msg_string.name = &s;
+ msg_string.string = msg;
/* create an entry */
result = rpccli_initshutdown_Init(pipe_hnd, mem_ctx, NULL,
@@ -5067,16 +5065,14 @@ NTSTATUS rpc_reg_shutdown_internals(struct net_context *c,
{
const char *msg = "This machine will be shutdown shortly";
uint32 timeout = 20;
- struct initshutdown_String msg_string;
- struct initshutdown_String_sub s;
+ struct lsa_StringLarge msg_string;
NTSTATUS result;
WERROR werr;
if (c->opt_comment) {
msg = c->opt_comment;
}
- s.name = msg;
- msg_string.name = &s;
+ msg_string.string = msg;
if (c->opt_timeout) {
timeout = c->opt_timeout;
diff --git a/source3/utils/net_rpc_join.c b/source3/utils/net_rpc_join.c
index 5bc38f979f..2fe464a000 100644
--- a/source3/utils/net_rpc_join.c
+++ b/source3/utils/net_rpc_join.c
@@ -330,12 +330,8 @@ int net_rpc_join_newstyle(struct net_context *c, int argc, const char **argv)
/* Create a random machine account password */
- {
- char *str;
- str = generate_random_str(DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH);
- clear_trust_password = SMB_STRDUP(str);
- E_md4hash(clear_trust_password, md4_trust_password);
- }
+ clear_trust_password = generate_random_str(talloc_tos(), DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH);
+ E_md4hash(clear_trust_password, md4_trust_password);
/* Set password on machine account */
@@ -468,7 +464,7 @@ done:
cli_shutdown(cli);
- SAFE_FREE(clear_trust_password);
+ TALLOC_FREE(clear_trust_password);
return retval;
}
diff --git a/source3/utils/net_rpc_service.c b/source3/utils/net_rpc_service.c
index d1349a903d..133173116c 100644
--- a/source3/utils/net_rpc_service.c
+++ b/source3/utils/net_rpc_service.c
@@ -264,8 +264,9 @@ static NTSTATUS rpc_service_status_internal(struct net_context *c,
WERROR result = WERR_GENERAL_FAILURE;
NTSTATUS status;
SERVICE_STATUS service_status;
- SERVICE_CONFIG config;
- fstring ascii_string;
+ struct QUERY_SERVICE_CONFIG config;
+ uint32_t buf_size = sizeof(config);
+ uint32_t ret_size = 0;
if (argc != 1 ) {
d_printf("Usage: net rpc service status <service>\n");
@@ -314,8 +315,23 @@ static NTSTATUS rpc_service_status_internal(struct net_context *c,
/* get the config */
- result = rpccli_svcctl_query_config(pipe_hnd, mem_ctx, &hService, &config );
- if ( !W_ERROR_IS_OK(result) ) {
+ status = rpccli_svcctl_QueryServiceConfigW(pipe_hnd, mem_ctx,
+ &hService,
+ &config,
+ buf_size,
+ &ret_size,
+ &result);
+ if (W_ERROR_EQUAL(result, WERR_INSUFFICIENT_BUFFER)) {
+ buf_size = ret_size;
+ status = rpccli_svcctl_QueryServiceConfigW(pipe_hnd, mem_ctx,
+ &hService,
+ &config,
+ buf_size,
+ &ret_size,
+ &result);
+ }
+
+ if (!NT_STATUS_IS_OK(status) || !W_ERROR_IS_OK(result) ) {
d_fprintf(stderr, "Query config request failed. [%s]\n", dos_errstr(result));
goto done;
}
@@ -329,29 +345,24 @@ static NTSTATUS rpc_service_status_internal(struct net_context *c,
d_printf("\tError Control = 0x%x\n", config.error_control);
d_printf("\tTag ID = 0x%x\n", config.tag_id);
- if ( config.executablepath ) {
- rpcstr_pull( ascii_string, config.executablepath->buffer, sizeof(ascii_string), -1, STR_TERMINATE );
- d_printf("\tExecutable Path = %s\n", ascii_string);
+ if (config.executablepath) {
+ d_printf("\tExecutable Path = %s\n", config.executablepath);
}
- if ( config.loadordergroup ) {
- rpcstr_pull( ascii_string, config.loadordergroup->buffer, sizeof(ascii_string), -1, STR_TERMINATE );
- d_printf("\tLoad Order Group = %s\n", ascii_string);
+ if (config.loadordergroup) {
+ d_printf("\tLoad Order Group = %s\n", config.loadordergroup);
}
- if ( config.dependencies ) {
- rpcstr_pull( ascii_string, config.dependencies->buffer, sizeof(ascii_string), -1, STR_TERMINATE );
- d_printf("\tDependencies = %s\n", ascii_string);
+ if (config.dependencies) {
+ d_printf("\tDependencies = %s\n", config.dependencies);
}
- if ( config.startname ) {
- rpcstr_pull( ascii_string, config.startname->buffer, sizeof(ascii_string), -1, STR_TERMINATE );
- d_printf("\tStart Name = %s\n", ascii_string);
+ if (config.startname) {
+ d_printf("\tStart Name = %s\n", config.startname);
}
- if ( config.displayname ) {
- rpcstr_pull( ascii_string, config.displayname->buffer, sizeof(ascii_string), -1, STR_TERMINATE );
- d_printf("\tDisplay Name = %s\n", ascii_string);
+ if (config.displayname) {
+ d_printf("\tDisplay Name = %s\n", config.displayname);
}
done:
diff --git a/source3/utils/net_usershare.c b/source3/utils/net_usershare.c
index 8f263c636c..ce8e82182e 100644
--- a/source3/utils/net_usershare.c
+++ b/source3/utils/net_usershare.c
@@ -371,7 +371,7 @@ static int info_fn(struct file_list *fl, void *priv)
return -1;
}
- lines = fd_lines_load(fd, &numlines, 10240);
+ lines = fd_lines_load(fd, &numlines, 10240, NULL);
close(fd);
if (lines == NULL) {
@@ -385,7 +385,7 @@ static int info_fn(struct file_list *fl, void *priv)
&psd,
&guest_ok);
- file_lines_free(lines);
+ TALLOC_FREE(lines);
if (us_err != USERSHARE_OK) {
d_fprintf(stderr, "info_fn: file %s is not a well formed usershare file.\n",
diff --git a/source3/utils/ntlm_auth.c b/source3/utils/ntlm_auth.c
index 4586086d73..0a76761cb2 100644
--- a/source3/utils/ntlm_auth.c
+++ b/source3/utils/ntlm_auth.c
@@ -1813,7 +1813,7 @@ static void manage_ntlm_server_1_request(struct ntlm_auth_state *state,
if (ntlm_server_1_lm_session_key
&& (memcmp(zeros, lm_key,
sizeof(lm_key)) != 0)) {
- hex_lm_key = hex_encode(NULL,
+ hex_lm_key = hex_encode_talloc(NULL,
(const unsigned char *)lm_key,
sizeof(lm_key));
x_fprintf(x_stdout, "LANMAN-Session-Key: %s\n", hex_lm_key);
@@ -1823,7 +1823,7 @@ static void manage_ntlm_server_1_request(struct ntlm_auth_state *state,
if (ntlm_server_1_user_session_key
&& (memcmp(zeros, user_session_key,
sizeof(user_session_key)) != 0)) {
- hex_user_session_key = hex_encode(NULL,
+ hex_user_session_key = hex_encode_talloc(NULL,
(const unsigned char *)user_session_key,
sizeof(user_session_key));
x_fprintf(x_stdout, "User-Session-Key: %s\n", hex_user_session_key);
@@ -2262,7 +2262,7 @@ static bool check_auth_crap(void)
if (request_lm_key
&& (memcmp(zeros, lm_key,
sizeof(lm_key)) != 0)) {
- hex_lm_key = hex_encode(NULL, (const unsigned char *)lm_key,
+ hex_lm_key = hex_encode_talloc(NULL, (const unsigned char *)lm_key,
sizeof(lm_key));
x_fprintf(x_stdout, "LM_KEY: %s\n", hex_lm_key);
TALLOC_FREE(hex_lm_key);
@@ -2270,7 +2270,7 @@ static bool check_auth_crap(void)
if (request_user_session_key
&& (memcmp(zeros, user_session_key,
sizeof(user_session_key)) != 0)) {
- hex_user_session_key = hex_encode(NULL, (const unsigned char *)user_session_key,
+ hex_user_session_key = hex_encode_talloc(NULL, (const unsigned char *)user_session_key,
sizeof(user_session_key));
x_fprintf(x_stdout, "NT_KEY: %s\n", hex_user_session_key);
TALLOC_FREE(hex_user_session_key);
diff --git a/source3/utils/pdbedit.c b/source3/utils/pdbedit.c
index e1d6709073..6a7189e636 100644
--- a/source3/utils/pdbedit.c
+++ b/source3/utils/pdbedit.c
@@ -235,7 +235,7 @@ static int print_sam_info (struct samu *sam_pwent, bool verbosity, bool smbpwdst
uid_t uid;
time_t tmp;
- /* TODO: chaeck if entry is a user or a workstation */
+ /* TODO: check if entry is a user or a workstation */
if (!sam_pwent) return -1;
if (verbosity) {
@@ -260,25 +260,32 @@ static int print_sam_info (struct samu *sam_pwent, bool verbosity, bool smbpwdst
printf ("Munged dial: %s\n", pdb_get_munged_dial(sam_pwent));
tmp = pdb_get_logon_time(sam_pwent);
- printf ("Logon time: %s\n", tmp ? http_timestring(tmp) : "0");
+ printf ("Logon time: %s\n",
+ tmp ? http_timestring(talloc_tos(), tmp) : "0");
tmp = pdb_get_logoff_time(sam_pwent);
- printf ("Logoff time: %s\n", tmp ? http_timestring(tmp) : "0");
+ printf ("Logoff time: %s\n",
+ tmp ? http_timestring(talloc_tos(), tmp) : "0");
tmp = pdb_get_kickoff_time(sam_pwent);
- printf ("Kickoff time: %s\n", tmp ? http_timestring(tmp) : "0");
+ printf ("Kickoff time: %s\n",
+ tmp ? http_timestring(talloc_tos(), tmp) : "0");
tmp = pdb_get_pass_last_set_time(sam_pwent);
- printf ("Password last set: %s\n", tmp ? http_timestring(tmp) : "0");
+ printf ("Password last set: %s\n",
+ tmp ? http_timestring(talloc_tos(), tmp) : "0");
tmp = pdb_get_pass_can_change_time(sam_pwent);
- printf ("Password can change: %s\n", tmp ? http_timestring(tmp) : "0");
+ printf ("Password can change: %s\n",
+ tmp ? http_timestring(talloc_tos(), tmp) : "0");
tmp = pdb_get_pass_must_change_time(sam_pwent);
- printf ("Password must change: %s\n", tmp ? http_timestring(tmp) : "0");
+ printf ("Password must change: %s\n",
+ tmp ? http_timestring(talloc_tos(), tmp) : "0");
tmp = pdb_get_bad_password_time(sam_pwent);
- printf ("Last bad password : %s\n", tmp ? http_timestring(tmp) : "0");
+ printf ("Last bad password : %s\n",
+ tmp ? http_timestring(talloc_tos(), tmp) : "0");
printf ("Bad password count : %d\n",
pdb_get_bad_password_count(sam_pwent));
diff --git a/source3/utils/smbcacls.c b/source3/utils/smbcacls.c
index eda8732c89..10b55014c2 100644
--- a/source3/utils/smbcacls.c
+++ b/source3/utils/smbcacls.c
@@ -23,13 +23,13 @@
#include "includes.h"
-static int test_args = False;
+static int test_args;
#define CREATE_ACCESS_READ READ_CONTROL_ACCESS
/* numeric is set when the user wants numeric SIDs and ACEs rather
than going via LSA calls to resolve them */
-static int numeric = False;
+static int numeric;
enum acl_mode {SMB_ACL_SET, SMB_ACL_DELETE, SMB_ACL_MODIFY, SMB_ACL_ADD };
enum chown_mode {REQUEST_NONE, REQUEST_CHOWN, REQUEST_CHGRP};
@@ -179,9 +179,12 @@ static void SidToString(struct cli_state *cli, fstring str, const DOM_SID *sid)
return;
}
- slprintf(str, sizeof(fstring) - 1, "%s%s%s",
- domain, lp_winbind_separator(), name);
-
+ if (*domain) {
+ slprintf(str, sizeof(fstring) - 1, "%s%s%s",
+ domain, lp_winbind_separator(), name);
+ } else {
+ fstrcpy(str, name);
+ }
}
/* convert a string to a SID, either numeric or username/group */
@@ -196,6 +199,65 @@ static bool StringToSid(struct cli_state *cli, DOM_SID *sid, const char *str)
return NT_STATUS_IS_OK(cli_lsa_lookup_name(cli, str, &type, sid));
}
+static void print_ace_flags(FILE *f, uint8_t flags)
+{
+ char *str = talloc_strdup(NULL, "");
+
+ if (!str) {
+ goto out;
+ }
+
+ if (flags & SEC_ACE_FLAG_OBJECT_INHERIT) {
+ str = talloc_asprintf(str, "%s%s",
+ str, "OI|");
+ if (!str) {
+ goto out;
+ }
+ }
+ if (flags & SEC_ACE_FLAG_CONTAINER_INHERIT) {
+ str = talloc_asprintf(str, "%s%s",
+ str, "CI|");
+ if (!str) {
+ goto out;
+ }
+ }
+ if (flags & SEC_ACE_FLAG_NO_PROPAGATE_INHERIT) {
+ str = talloc_asprintf(str, "%s%s",
+ str, "NP|");
+ if (!str) {
+ goto out;
+ }
+ }
+ if (flags & SEC_ACE_FLAG_INHERIT_ONLY) {
+ str = talloc_asprintf(str, "%s%s",
+ str, "IO|");
+ if (!str) {
+ goto out;
+ }
+ }
+ if (flags & SEC_ACE_FLAG_INHERITED_ACE) {
+ str = talloc_asprintf(str, "%s%s",
+ str, "I|");
+ if (!str) {
+ goto out;
+ }
+ }
+ /* Ignore define SEC_ACE_FLAG_SUCCESSFUL_ACCESS ( 0x40 )
+ and SEC_ACE_FLAG_FAILED_ACCESS ( 0x80 ) as they're
+ audit ace flags. */
+
+ if (str[strlen(str)-1] == '|') {
+ str[strlen(str)-1] = '\0';
+ fprintf(f, "/%s/", str);
+ } else {
+ fprintf(f, "/0x%x/", flags);
+ }
+ TALLOC_FREE(str);
+ return;
+
+ out:
+ fprintf(f, "/0x%x/", flags);
+}
/* print an ACE on a FILE, using either numeric or ascii representation */
static void print_ace(struct cli_state *cli, FILE *f, SEC_ACE *ace)
@@ -210,7 +272,7 @@ static void print_ace(struct cli_state *cli, FILE *f, SEC_ACE *ace)
fprintf(f, "%s:", sidstr);
if (numeric) {
- fprintf(f, "%d/%d/0x%08x",
+ fprintf(f, "%d/0x%x/0x%08x",
ace->type, ace->flags, ace->access_mask);
return;
}
@@ -225,9 +287,7 @@ static void print_ace(struct cli_state *cli, FILE *f, SEC_ACE *ace)
fprintf(f, "%d", ace->type);
}
- /* Not sure what flags can be set in a file ACL */
-
- fprintf(f, "/%d/", ace->flags);
+ print_ace_flags(f, ace->flags);
/* Standard permissions */
@@ -263,6 +323,37 @@ static void print_ace(struct cli_state *cli, FILE *f, SEC_ACE *ace)
}
}
+static bool parse_ace_flags(const char *str, unsigned int *pflags)
+{
+ const char *p = str;
+ *pflags = 0;
+
+ while (*p) {
+ if (strnequal(p, "OI", 2)) {
+ *pflags |= SEC_ACE_FLAG_OBJECT_INHERIT;
+ p += 2;
+ } else if (strnequal(p, "CI", 2)) {
+ *pflags |= SEC_ACE_FLAG_CONTAINER_INHERIT;
+ p += 2;
+ } else if (strnequal(p, "NP", 2)) {
+ *pflags |= SEC_ACE_FLAG_NO_PROPAGATE_INHERIT;
+ p += 2;
+ } else if (strnequal(p, "IO", 2)) {
+ *pflags |= SEC_ACE_FLAG_INHERIT_ONLY;
+ p += 2;
+ } else if (*p == 'I') {
+ *pflags |= SEC_ACE_FLAG_INHERITED_ACE;
+ p += 1;
+ } else if (*p) {
+ return false;
+ }
+
+ if (*p != '|' && *p != '\0') {
+ return false;
+ }
+ }
+ return true;
+}
/* parse an ACE in the same format as print_ace() */
static bool parse_ace(struct cli_state *cli, SEC_ACE *ace,
@@ -335,15 +426,40 @@ static bool parse_ace(struct cli_state *cli, SEC_ACE *ace,
/* Only numeric form accepted for flags at present */
- if (!(next_token_talloc(frame, &cp, &tok, "/") &&
- sscanf(tok, "%i", &aflags))) {
- printf("ACE '%s': bad integer flags entry at '%s'\n",
+ if (!next_token_talloc(frame, &cp, &tok, "/")) {
+ printf("ACE '%s': bad flags entry at '%s'\n",
orig_str, tok);
SAFE_FREE(str);
TALLOC_FREE(frame);
return False;
}
+ if (tok[0] < '0' || tok[0] > '9') {
+ if (!parse_ace_flags(tok, &aflags)) {
+ printf("ACE '%s': bad named flags entry at '%s'\n",
+ orig_str, tok);
+ SAFE_FREE(str);
+ TALLOC_FREE(frame);
+ return False;
+ }
+ } else if (strnequal(tok, "0x", 2)) {
+ if (!sscanf(tok, "%x", &aflags)) {
+ printf("ACE '%s': bad hex flags entry at '%s'\n",
+ orig_str, tok);
+ SAFE_FREE(str);
+ TALLOC_FREE(frame);
+ return False;
+ }
+ } else {
+ if (!sscanf(tok, "%i", &aflags)) {
+ printf("ACE '%s': bad integer flags entry at '%s'\n",
+ orig_str, tok);
+ SAFE_FREE(str);
+ TALLOC_FREE(frame);
+ return False;
+ }
+ }
+
if (!next_token_talloc(frame, &cp, &tok, "/")) {
printf("ACE '%s': missing / at '%s'\n",
orig_str, tok);
@@ -506,6 +622,7 @@ static void sec_desc_print(struct cli_state *cli, FILE *f, SEC_DESC *sd)
uint32 i;
fprintf(f, "REVISION:%d\n", sd->revision);
+ fprintf(f, "CONTROL:0x%x\n", sd->type);
/* Print owner and group sid */
@@ -626,29 +743,42 @@ static int owner_set(struct cli_state *cli, enum chown_mode change_mode,
}
-/* The MSDN is contradictory over the ordering of ACE entries in an ACL.
- However NT4 gives a "The information may have been modified by a
- computer running Windows NT 5.0" if denied ACEs do not appear before
- allowed ACEs. */
+/* The MSDN is contradictory over the ordering of ACE entries in an
+ ACL. However NT4 gives a "The information may have been modified
+ by a computer running Windows NT 5.0" if denied ACEs do not appear
+ before allowed ACEs. At
+ http://technet.microsoft.com/en-us/library/cc781716.aspx the
+ canonical order is specified as "Explicit Deny, Explicit Allow,
+ Inherited ACEs unchanged" */
static int ace_compare(SEC_ACE *ace1, SEC_ACE *ace2)
{
- if (sec_ace_equal(ace1, ace2))
+ if (sec_ace_equal(ace1, ace2))
return 0;
- if (ace1->type != ace2->type)
+ if ((ace1->flags & SEC_ACE_FLAG_INHERITED_ACE) &&
+ !(ace2->flags & SEC_ACE_FLAG_INHERITED_ACE))
+ return 1;
+ if (!(ace1->flags & SEC_ACE_FLAG_INHERITED_ACE) &&
+ (ace2->flags & SEC_ACE_FLAG_INHERITED_ACE))
+ return -1;
+ if ((ace1->flags & SEC_ACE_FLAG_INHERITED_ACE) &&
+ (ace2->flags & SEC_ACE_FLAG_INHERITED_ACE))
+ return ace1 - ace2;
+
+ if (ace1->type != ace2->type)
return ace2->type - ace1->type;
- if (sid_compare(&ace1->trustee, &ace2->trustee))
+ if (sid_compare(&ace1->trustee, &ace2->trustee))
return sid_compare(&ace1->trustee, &ace2->trustee);
- if (ace1->flags != ace2->flags)
+ if (ace1->flags != ace2->flags)
return ace1->flags - ace2->flags;
- if (ace1->access_mask != ace2->access_mask)
+ if (ace1->access_mask != ace2->access_mask)
return ace1->access_mask - ace2->access_mask;
- if (ace1->size != ace2->size)
+ if (ace1->size != ace2->size)
return ace1->size - ace2->size;
return memcmp(ace1, ace2, sizeof(SEC_ACE));
@@ -677,6 +807,7 @@ static void sort_acl(SEC_ACL *the_acl)
/*****************************************************
set the ACLs on a file given an ascii description
*******************************************************/
+
static int cacl_set(struct cli_state *cli, char *filename,
char *the_acl, enum acl_mode mode)
{
@@ -730,7 +861,7 @@ static int cacl_set(struct cli_state *cli, char *filename,
}
if (!found) {
- printf("ACL for ACE:");
+ printf("ACL for ACE:");
print_ace(cli, stdout, &sd->dacl->aces[i]);
printf(" not found\n");
}
@@ -762,7 +893,7 @@ static int cacl_set(struct cli_state *cli, char *filename,
old->owner_sid = sd->owner_sid;
}
- if (sd->group_sid) {
+ if (sd->group_sid) {
old->group_sid = sd->group_sid;
}
@@ -895,8 +1026,8 @@ static struct cli_state *connect_one(const char *server, const char *share)
{ "set", 'S', POPT_ARG_STRING, NULL, 'S', "Set acls", "ACLS" },
{ "chown", 'C', POPT_ARG_STRING, NULL, 'C', "Change ownership of a file", "USERNAME" },
{ "chgrp", 'G', POPT_ARG_STRING, NULL, 'G', "Change group ownership of a file", "GROUPNAME" },
- { "numeric", 0, POPT_ARG_NONE, &numeric, True, "Don't resolve sids or masks to names" },
- { "test-args", 't', POPT_ARG_NONE, &test_args, True, "Test arguments"},
+ { "numeric", 0, POPT_ARG_NONE, &numeric, 1, "Don't resolve sids or masks to names" },
+ { "test-args", 't', POPT_ARG_NONE, &test_args, 1, "Test arguments"},
POPT_COMMON_SAMBA
POPT_COMMON_CONNECTION
POPT_COMMON_CREDENTIALS
diff --git a/source3/utils/smbcquotas.c b/source3/utils/smbcquotas.c
index 11f8776a0e..b769c2bce0 100644
--- a/source3/utils/smbcquotas.c
+++ b/source3/utils/smbcquotas.c
@@ -180,11 +180,7 @@ static int parse_quota_set(TALLOC_CTX *ctx,
switch (todo) {
case PARSE_LIM:
-#if defined(HAVE_LONGLONG)
- if (sscanf(p,"%llu/%llu",&pqt->softlim,&pqt->hardlim)!=2) {
-#else
- if (sscanf(p,"%lu/%lu",&pqt->softlim,&pqt->hardlim)!=2) {
-#endif
+ if (sscanf(p,"%"PRIu64"/%"PRIu64,&pqt->softlim,&pqt->hardlim)!=2) {
return -1;
}
diff --git a/source3/utils/status_profile.c b/source3/utils/status_profile.c
index 48814fedea..a51537d3da 100644
--- a/source3/utils/status_profile.c
+++ b/source3/utils/status_profile.c
@@ -423,12 +423,12 @@ bool status_profile_dump(bool verbose)
static int print_count_samples(
const struct profile_stats * const current,
const struct profile_stats * const last,
- SMB_BIG_UINT delta_usec)
+ uint64_t delta_usec)
{
int i;
int count = 0;
unsigned step;
- SMB_BIG_UINT spent;
+ uint64_t spent;
int delta_sec;
const char * name;
char buf[40];
@@ -467,13 +467,13 @@ static int print_count_samples(
}
static struct profile_stats sample_data[2];
-static SMB_BIG_UINT sample_time[2];
+static uint64_t sample_time[2];
bool status_profile_rates(bool verbose)
{
- SMB_BIG_UINT remain_usec;
- SMB_BIG_UINT next_usec;
- SMB_BIG_UINT delta_usec;
+ uint64_t remain_usec;
+ uint64_t next_usec;
+ uint64_t delta_usec;
int last = 0;
int current = 1;
diff --git a/source3/utils/testparm.c b/source3/utils/testparm.c
index 4370d49523..da129cf7c0 100644
--- a/source3/utils/testparm.c
+++ b/source3/utils/testparm.c
@@ -56,7 +56,7 @@ cannot be set in the smb.conf file. nmbd will abort with this setting.\n");
ret = 1;
}
- if (!directory_exist(lp_lockdir(), &st)) {
+ if (!directory_exist_stat(lp_lockdir(), &st)) {
fprintf(stderr, "ERROR: lock directory %s does not exist\n",
lp_lockdir());
ret = 1;
@@ -66,7 +66,7 @@ cannot be set in the smb.conf file. nmbd will abort with this setting.\n");
ret = 1;
}
- if (!directory_exist(lp_piddir(), &st)) {
+ if (!directory_exist_stat(lp_piddir(), &st)) {
fprintf(stderr, "ERROR: pid directory %s does not exist\n",
lp_piddir());
ret = 1;
@@ -436,8 +436,8 @@ rameter is ignored when using CUPS libraries.\n",
}
done:
- TALLOC_FREE(frame);
gfree_loadparm();
+ TALLOC_FREE(frame);
return ret;
}
diff --git a/source3/web/cgi.c b/source3/web/cgi.c
index 070e80cf91..ce36bd9310 100644
--- a/source3/web/cgi.c
+++ b/source3/web/cgi.c
@@ -451,7 +451,7 @@ static void cgi_download(char *file)
if (S_ISDIR(st.st_mode))
{
snprintf(buf, sizeof(buf), "%s/index.html", file);
- if (!file_exist(buf, &st) || !S_ISREG(st.st_mode))
+ if (!file_exist_stat(buf, &st) || !S_ISREG(st.st_mode))
{
cgi_setup_error("404 File Not Found","",
"The requested file was not found");
@@ -488,7 +488,8 @@ static void cgi_download(char *file)
printf("Content-Type: text/html\r\n");
}
}
- printf("Expires: %s\r\n", http_timestring(time(NULL)+EXPIRY_TIME));
+ printf("Expires: %s\r\n",
+ http_timestring(talloc_tos(), time(NULL)+EXPIRY_TIME));
lang = lang_tdb_current();
if (lang) {
@@ -604,7 +605,7 @@ void cgi_setup(const char *rootdir, int auth_required)
}
printf("HTTP/1.0 200 OK\r\nConnection: close\r\n");
- printf("Date: %s\r\n", http_timestring(time(NULL)));
+ printf("Date: %s\r\n", http_timestring(talloc_tos(), time(NULL)));
baseurl = "";
pathinfo = url+1;
}
diff --git a/source3/web/swat.c b/source3/web/swat.c
index 1502c5bc2f..27c4b54e2f 100644
--- a/source3/web/swat.c
+++ b/source3/web/swat.c
@@ -384,7 +384,8 @@ static void show_parameters(int snum, int allparameters, unsigned int parm_filte
break;
case P_LIST:
- if (!str_list_compare(*(char ***)ptr, (char **)(parm->def.lvalue))) continue;
+ if (!str_list_equal(*(const char ***)ptr,
+ (const char **)(parm->def.lvalue))) continue;
break;
case P_STRING:
@@ -595,7 +596,7 @@ static void ViewModeBoxes(int mode)
****************************************************************************/
static void welcome_page(void)
{
- if (file_exist("help/welcome.html", NULL)) {
+ if (file_exist("help/welcome.html")) {
include_html("help/welcome.html");
} else {
include_html("help/welcome-no-samba-doc.html");
@@ -1439,7 +1440,7 @@ const char *lang_msg_rotate(TALLOC_CTX *ctx, const char *msgid)
cgi_load_variables();
- if (!file_exist(get_dyn_CONFIGFILE(), NULL)) {
+ if (!file_exist(get_dyn_CONFIGFILE())) {
have_read_access = True;
have_write_access = True;
} else {
diff --git a/source3/winbindd/idmap_tdb.c b/source3/winbindd/idmap_tdb.c
index 9e66eed0c8..f9d3a9fbff 100644
--- a/source3/winbindd/idmap_tdb.c
+++ b/source3/winbindd/idmap_tdb.c
@@ -228,7 +228,7 @@ static NTSTATUS idmap_tdb_open_db(TALLOC_CTX *memctx, TDB_CONTEXT **tdbctx)
goto done;
}
- if (!file_exist(tdbfile, &stbuf)) {
+ if (!file_exist_stat(tdbfile, &stbuf)) {
tdb_is_new = True;
}
diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c
index 44b5415726..5d4f21a820 100644
--- a/source3/winbindd/winbindd.c
+++ b/source3/winbindd/winbindd.c
@@ -66,7 +66,7 @@ static bool reload_services_file(const char *logfile)
if (lp_loaded()) {
const char *fname = lp_configfile();
- if (file_exist(fname,NULL) && !strcsequal(fname,get_dyn_CONFIGFILE())) {
+ if (file_exist(fname) && !strcsequal(fname,get_dyn_CONFIGFILE())) {
set_dyn_CONFIGFILE(fname);
}
}
@@ -1120,7 +1120,7 @@ int main(int argc, char **argv, char **envp)
exit(1);
}
- if (!directory_exist(lp_lockdir(), NULL)) {
+ if (!directory_exist(lp_lockdir())) {
mkdir(lp_lockdir(), 0755);
}
diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c
index aeb52d9b5a..994c94b5be 100644
--- a/source3/winbindd/winbindd_dual.c
+++ b/source3/winbindd/winbindd_dual.c
@@ -905,7 +905,7 @@ static bool calculate_next_machine_pwd_change(const char *domain,
if (time(NULL) < (pass_last_set_time + timeout)) {
next_change = pass_last_set_time + timeout;
DEBUG(10,("machine password still valid until: %s\n",
- http_timestring(next_change)));
+ http_timestring(talloc_tos(), next_change)));
*t = timeval_set(next_change, 0);
return true;
}
diff --git a/source3/winbindd/winbindd_proto.h b/source3/winbindd/winbindd_proto.h
index 3836c46e36..95ccf30cfe 100644
--- a/source3/winbindd/winbindd_proto.h
+++ b/source3/winbindd/winbindd_proto.h
@@ -48,8 +48,6 @@ int count_all_current_connections(void);
bool claim_connection(connection_struct *conn, const char *name,
uint32 msg_flags);
bool register_message_flags(bool doreg, uint32 msg_flags);
-bool store_pipe_opendb( smb_np_struct *p );
-bool delete_pipe_opendb( smb_np_struct *p );
/* The following definitions come from winbindd/winbindd.c */
diff --git a/source3/winbindd/winbindd_rpc.c b/source3/winbindd/winbindd_rpc.c
index 9fbea8e45b..d966e50159 100644
--- a/source3/winbindd/winbindd_rpc.c
+++ b/source3/winbindd/winbindd_rpc.c
@@ -1018,7 +1018,7 @@ static NTSTATUS sequence_number(struct winbindd_domain *domain, uint32 *seq)
&info);
if (NT_STATUS_IS_OK(result)) {
- *seq = info->info2.sequence_num;
+ *seq = info->general.sequence_num;
got_seq_num = True;
}