diff options
Diffstat (limited to 'source4/librpc')
-rw-r--r-- | source4/librpc/config.mk | 479 | ||||
-rwxr-xr-x | source4/librpc/idl-deps.pl | 22 | ||||
-rw-r--r-- | source4/librpc/idl/dcerpc.idl | 1 | ||||
-rw-r--r-- | source4/librpc/idl/drsuapi.idl | 2 | ||||
-rw-r--r-- | source4/librpc/idl/nbt.idl | 342 | ||||
-rw-r--r-- | source4/librpc/idl/policyagent.idl | 2 | ||||
-rw-r--r-- | source4/librpc/idl/security.idl | 3 | ||||
-rw-r--r-- | source4/librpc/idl/xattr.idl | 12 | ||||
-rw-r--r-- | source4/librpc/ndr/libndr.h | 4 | ||||
-rw-r--r-- | source4/librpc/ndr/ndr_basic.c | 4 | ||||
-rw-r--r-- | source4/librpc/ndr/ndr_sec_helper.c | 51 | ||||
-rw-r--r-- | source4/librpc/rpc/dcerpc.c | 15 | ||||
-rw-r--r-- | source4/librpc/rpc/dcerpc.py | 4 | ||||
-rw-r--r-- | source4/librpc/rpc/dcerpc_connect.c | 15 | ||||
-rw-r--r-- | source4/librpc/rpc/dcerpc_smb2.c | 16 | ||||
-rw-r--r-- | source4/librpc/rpc/dcerpc_util.c | 15 | ||||
-rw-r--r-- | source4/librpc/rpc/dcerpc_wrap.c | 65 | ||||
-rwxr-xr-x | source4/librpc/scripts/build_idl.sh | 38 |
18 files changed, 532 insertions, 558 deletions
diff --git a/source4/librpc/config.mk b/source4/librpc/config.mk index 11a320a583..c7cbf27667 100644 --- a/source4/librpc/config.mk +++ b/source4/librpc/config.mk @@ -1,20 +1,25 @@ +ndrsrcdir = $(librpcsrcdir)/ndr +gen_ndrsrcdir = $(librpcsrcdir)/gen_ndr +dcerpcsrcdir = $(librpcsrcdir)/rpc + ################################################ # Start SUBSYSTEM LIBNDR [LIBRARY::LIBNDR] -PRIVATE_PROTO_HEADER = ndr/libndr_proto.h PUBLIC_DEPENDENCIES = LIBSAMBA-ERRORS LIBTALLOC LIBSAMBA-UTIL CHARSET \ LIBSAMBA-HOSTCONFIG -LIBNDR_OBJ_FILES = $(addprefix librpc/ndr/, ndr.o ndr_basic.o ndr_string.o uuid.o) +LIBNDR_OBJ_FILES = $(addprefix $(ndrsrcdir)/, ndr.o ndr_basic.o ndr_string.o uuid.o) + +$(eval $(call proto_header_template,$(ndrsrcdir)/libndr_proto.h,$(LIBNDR_OBJ_FILES:.o=.c))) -PC_FILES += librpc/ndr.pc +PC_FILES += $(librpcsrcdir)/ndr.pc LIBNDR_VERSION = 0.0.1 LIBNDR_SOVERSION = 0 # End SUBSYSTEM LIBNDR ################################################ -PUBLIC_HEADERS += librpc/ndr/libndr.h +PUBLIC_HEADERS += $(ndrsrcdir)/libndr.h ################################# # Start BINARY ndrdump @@ -31,332 +36,333 @@ PRIVATE_DEPENDENCIES = \ # End BINARY ndrdump ################################# -ndrdump_OBJ_FILES = librpc/tools/ndrdump.o +ndrdump_OBJ_FILES = $(librpcsrcdir)/tools/ndrdump.o -MANPAGES += librpc/tools/ndrdump.1 +MANPAGES += $(librpcsrcdir)/tools/ndrdump.1 ################################################ # Start SUBSYSTEM NDR_COMPRESSION [SUBSYSTEM::NDR_COMPRESSION] -PRIVATE_PROTO_HEADER = ndr/ndr_compression.h PUBLIC_DEPENDENCIES = LIBCOMPRESSION LIBSAMBA-ERRORS LIBNDR # End SUBSYSTEM NDR_COMPRESSION ################################################ -NDR_COMPRESSION_OBJ_FILES = librpc/ndr/ndr_compression.o +NDR_COMPRESSION_OBJ_FILES = $(ndrsrcdir)/ndr_compression.o + +$(eval $(call proto_header_template,$(ndrsrcdir)/ndr_compression.h,$(NDR_COMPRESSION_OBJ_FILES:.o=.c))) [SUBSYSTEM::NDR_SECURITY] PUBLIC_DEPENDENCIES = NDR_MISC LIBSECURITY -NDR_SECURITY_OBJ_FILES = librpc/gen_ndr/ndr_security.o librpc/ndr/ndr_sec_helper.o +NDR_SECURITY_OBJ_FILES = $(gen_ndrsrcdir)/ndr_security.o $(ndrsrcdir)/ndr_sec_helper.o -PUBLIC_HEADERS += librpc/gen_ndr/security.h +PUBLIC_HEADERS += $(gen_ndrsrcdir)/security.h [SUBSYSTEM::NDR_AUDIOSRV] PUBLIC_DEPENDENCIES = LIBNDR -NDR_AUDIOSRV_OBJ_FILES = librpc/gen_ndr/ndr_audiosrv.o +NDR_AUDIOSRV_OBJ_FILES = $(gen_ndrsrcdir)/ndr_audiosrv.o [SUBSYSTEM::NDR_DNSSERVER] PUBLIC_DEPENDENCIES = LIBNDR -NDR_DNSSERVER_OBJ_FILES = librpc/gen_ndr/ndr_dnsserver.o +NDR_DNSSERVER_OBJ_FILES = $(gen_ndrsrcdir)/ndr_dnsserver.o [SUBSYSTEM::NDR_WINSTATION] PUBLIC_DEPENDENCIES = LIBNDR -NDR_WINSTATION_OBJ_FILES = librpc/gen_ndr/ndr_winstation.o +NDR_WINSTATION_OBJ_FILES = $(gen_ndrsrcdir)/ndr_winstation.o [SUBSYSTEM::NDR_ECHO] PUBLIC_DEPENDENCIES = LIBNDR -NDR_ECHO_OBJ_FILES = librpc/gen_ndr/ndr_echo.o +NDR_ECHO_OBJ_FILES = $(gen_ndrsrcdir)/ndr_echo.o [SUBSYSTEM::NDR_IRPC] PUBLIC_DEPENDENCIES = LIBNDR NDR_SECURITY NDR_NBT -NDR_IRPC_OBJ_FILES = librpc/gen_ndr/ndr_irpc.o +NDR_IRPC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_irpc.o [SUBSYSTEM::NDR_DSBACKUP] PUBLIC_DEPENDENCIES = LIBNDR -NDR_DSBACKUP_OBJ_FILES = librpc/gen_ndr/ndr_dsbackup.o +NDR_DSBACKUP_OBJ_FILES = $(gen_ndrsrcdir)/ndr_dsbackup.o [SUBSYSTEM::NDR_EFS] PUBLIC_DEPENDENCIES = LIBNDR NDR_SECURITY -NDR_EFS_OBJ_FILES = librpc/gen_ndr/ndr_efs.o +NDR_EFS_OBJ_FILES = $(gen_ndrsrcdir)/ndr_efs.o [SUBSYSTEM::NDR_MISC] PUBLIC_DEPENDENCIES = LIBNDR -NDR_MISC_OBJ_FILES = librpc/gen_ndr/ndr_misc.o librpc/ndr/ndr_misc.o +NDR_MISC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_misc.o $(ndrsrcdir)/ndr_misc.o -PUBLIC_HEADERS += librpc/gen_ndr/misc.h librpc/gen_ndr/ndr_misc.h +PUBLIC_HEADERS += $(gen_ndrsrcdir)/misc.h $(gen_ndrsrcdir)/ndr_misc.h [SUBSYSTEM::NDR_ROT] PUBLIC_DEPENDENCIES = LIBNDR NDR_ORPC -NDR_ROT_OBJ_FILES = librpc/gen_ndr/ndr_rot.o +NDR_ROT_OBJ_FILES = $(gen_ndrsrcdir)/ndr_rot.o [SUBSYSTEM::NDR_LSA] PUBLIC_DEPENDENCIES = LIBNDR NDR_SECURITY -NDR_LSA_OBJ_FILES = librpc/gen_ndr/ndr_lsa.o +NDR_LSA_OBJ_FILES = $(gen_ndrsrcdir)/ndr_lsa.o -PUBLIC_HEADERS += librpc/gen_ndr/lsa.h +PUBLIC_HEADERS += $(gen_ndrsrcdir)/lsa.h [SUBSYSTEM::NDR_DFS] PUBLIC_DEPENDENCIES = LIBNDR NDR_MISC -NDR_DFS_OBJ_FILES = librpc/gen_ndr/ndr_dfs.o +NDR_DFS_OBJ_FILES = $(gen_ndrsrcdir)/ndr_dfs.o [SUBSYSTEM::NDR_FRSRPC] PUBLIC_DEPENDENCIES = LIBNDR -NDR_FRSRPC_OBJ_FILES = librpc/gen_ndr/ndr_frsrpc.o +NDR_FRSRPC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_frsrpc.o [SUBSYSTEM::NDR_FRSAPI] PUBLIC_DEPENDENCIES = LIBNDR -NDR_FRSAPI_OBJ_FILES = librpc/gen_ndr/ndr_frsapi.o +NDR_FRSAPI_OBJ_FILES = $(gen_ndrsrcdir)/ndr_frsapi.o [SUBSYSTEM::NDR_DRSUAPI] PUBLIC_DEPENDENCIES = LIBNDR NDR_COMPRESSION NDR_SECURITY NDR_SAMR ASN1_UTIL -NDR_DRSUAPI_OBJ_FILES = librpc/gen_ndr/ndr_drsuapi.o librpc/ndr/ndr_drsuapi.o +NDR_DRSUAPI_OBJ_FILES = $(gen_ndrsrcdir)/ndr_drsuapi.o $(ndrsrcdir)/ndr_drsuapi.o [SUBSYSTEM::NDR_DRSBLOBS] PUBLIC_DEPENDENCIES = LIBNDR NDR_MISC NDR_DRSUAPI -NDR_DRSBLOBS_OBJ_FILES = librpc/gen_ndr/ndr_drsblobs.o +NDR_DRSBLOBS_OBJ_FILES = $(gen_ndrsrcdir)/ndr_drsblobs.o [SUBSYSTEM::NDR_SASL_HELPERS] PUBLIC_DEPENDENCIES = LIBNDR -NDR_SASL_HELPERS_OBJ_FILES = librpc/gen_ndr/ndr_sasl_helpers.o +NDR_SASL_HELPERS_OBJ_FILES = $(gen_ndrsrcdir)/ndr_sasl_helpers.o [SUBSYSTEM::NDR_POLICYAGENT] PUBLIC_DEPENDENCIES = LIBNDR -NDR_POLICYAGENT_OBJ_FILES = librpc/gen_ndr/ndr_policyagent.o +NDR_POLICYAGENT_OBJ_FILES = $(gen_ndrsrcdir)/ndr_policyagent.o [SUBSYSTEM::NDR_UNIXINFO] PUBLIC_DEPENDENCIES = LIBNDR NDR_SECURITY -NDR_UNIXINFO_OBJ_FILES = librpc/gen_ndr/ndr_unixinfo.o +NDR_UNIXINFO_OBJ_FILES = $(gen_ndrsrcdir)/ndr_unixinfo.o [SUBSYSTEM::NDR_SAMR] PUBLIC_DEPENDENCIES = LIBNDR NDR_MISC NDR_LSA NDR_SECURITY -NDR_SAMR_OBJ_FILES = librpc/gen_ndr/ndr_samr.o +NDR_SAMR_OBJ_FILES = $(gen_ndrsrcdir)/ndr_samr.o -PUBLIC_HEADERS += $(addprefix librpc/, gen_ndr/samr.h gen_ndr/ndr_samr.h gen_ndr/ndr_samr_c.h) +PUBLIC_HEADERS += $(addprefix $(librpcsrcdir)/, gen_ndr/samr.h gen_ndr/ndr_samr.h gen_ndr/ndr_samr_c.h) [SUBSYSTEM::NDR_NFS4ACL] PUBLIC_DEPENDENCIES = LIBNDR NDR_MISC NDR_SECURITY -NDR_NFS4ACL_OBJ_FILES = librpc/gen_ndr/ndr_nfs4acl.o +NDR_NFS4ACL_OBJ_FILES = $(gen_ndrsrcdir)/ndr_nfs4acl.o [SUBSYSTEM::NDR_SPOOLSS] PUBLIC_DEPENDENCIES = LIBNDR NDR_SPOOLSS_BUF NDR_SECURITY -NDR_SPOOLSS_OBJ_FILES = librpc/gen_ndr/ndr_spoolss.o +NDR_SPOOLSS_OBJ_FILES = $(gen_ndrsrcdir)/ndr_spoolss.o [SUBSYSTEM::NDR_SPOOLSS_BUF] -PRIVATE_PROTO_HEADER = ndr/ndr_spoolss_buf.h -NDR_SPOOLSS_BUF_OBJ_FILES = librpc/ndr/ndr_spoolss_buf.o +NDR_SPOOLSS_BUF_OBJ_FILES = $(ndrsrcdir)/ndr_spoolss_buf.o + +$(eval $(call proto_header_template,$(ndrsrcdir)/ndr_spoolss_buf.h,$(NDR_SPOOLSS_BUF_OBJ_FILES:.o=.c))) [SUBSYSTEM::NDR_WKSSVC] PUBLIC_DEPENDENCIES = LIBNDR NDR_SRVSVC NDR_MISC NDR_SECURITY -NDR_WKSSVC_OBJ_FILES = librpc/gen_ndr/ndr_wkssvc.o +NDR_WKSSVC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_wkssvc.o [SUBSYSTEM::NDR_SRVSVC] PUBLIC_DEPENDENCIES = LIBNDR NDR_SVCCTL NDR_SECURITY -NDR_SRVSVC_OBJ_FILES = librpc/gen_ndr/ndr_srvsvc.o +NDR_SRVSVC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_srvsvc.o [SUBSYSTEM::NDR_SVCCTL] PUBLIC_DEPENDENCIES = LIBNDR NDR_MISC -NDR_SVCCTL_OBJ_FILES = librpc/gen_ndr/ndr_svcctl.o +NDR_SVCCTL_OBJ_FILES = $(gen_ndrsrcdir)/ndr_svcctl.o -PUBLIC_HEADERS += $(addprefix librpc/, gen_ndr/ndr_svcctl.h gen_ndr/svcctl.h) +PUBLIC_HEADERS += $(addprefix $(librpcsrcdir)/, gen_ndr/ndr_svcctl.h gen_ndr/svcctl.h) [SUBSYSTEM::NDR_ATSVC] PUBLIC_DEPENDENCIES = LIBNDR -NDR_ATSVC_OBJ_FILES = librpc/gen_ndr/ndr_atsvc.o +NDR_ATSVC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_atsvc.o -PUBLIC_HEADERS += $(addprefix librpc/, gen_ndr/atsvc.h gen_ndr/ndr_atsvc.h) +PUBLIC_HEADERS += $(addprefix $(librpcsrcdir)/, gen_ndr/atsvc.h gen_ndr/ndr_atsvc.h) [SUBSYSTEM::NDR_EVENTLOG] PUBLIC_DEPENDENCIES = LIBNDR NDR_LSA -NDR_EVENTLOG_OBJ_FILES = librpc/gen_ndr/ndr_eventlog.o +NDR_EVENTLOG_OBJ_FILES = $(gen_ndrsrcdir)/ndr_eventlog.o [SUBSYSTEM::NDR_EPMAPPER] PUBLIC_DEPENDENCIES = LIBNDR NDR_MISC -NDR_EPMAPPER_OBJ_FILES = librpc/gen_ndr/ndr_epmapper.o +NDR_EPMAPPER_OBJ_FILES = $(gen_ndrsrcdir)/ndr_epmapper.o [SUBSYSTEM::NDR_DBGIDL] PUBLIC_DEPENDENCIES = LIBNDR -NDR_DBGIDL_OBJ_FILES = librpc/gen_ndr/ndr_dbgidl.o +NDR_DBGIDL_OBJ_FILES = $(gen_ndrsrcdir)/ndr_dbgidl.o [SUBSYSTEM::NDR_DSSETUP] PUBLIC_DEPENDENCIES = LIBNDR NDR_MISC -NDR_DSSETUP_OBJ_FILES = librpc/gen_ndr/ndr_dssetup.o +NDR_DSSETUP_OBJ_FILES = $(gen_ndrsrcdir)/ndr_dssetup.o [SUBSYSTEM::NDR_MSGSVC] PUBLIC_DEPENDENCIES = LIBNDR -NDR_MSGSVC_OBJ_FILES = librpc/gen_ndr/ndr_msgsvc.o +NDR_MSGSVC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_msgsvc.o [SUBSYSTEM::NDR_WINS] PUBLIC_DEPENDENCIES = LIBNDR -NDR_WINS_OBJ_FILES = librpc/gen_ndr/ndr_wins.o +NDR_WINS_OBJ_FILES = $(gen_ndrsrcdir)/ndr_wins.o [SUBSYSTEM::NDR_WINREG] PUBLIC_DEPENDENCIES = LIBNDR NDR_INITSHUTDOWN NDR_SECURITY NDR_MISC -NDR_WINREG_OBJ_FILES = librpc/gen_ndr/ndr_winreg.o +NDR_WINREG_OBJ_FILES = $(gen_ndrsrcdir)/ndr_winreg.o [SUBSYSTEM::NDR_INITSHUTDOWN] PUBLIC_DEPENDENCIES = LIBNDR -NDR_INITSHUTDOWN_OBJ_FILES = librpc/gen_ndr/ndr_initshutdown.o +NDR_INITSHUTDOWN_OBJ_FILES = $(gen_ndrsrcdir)/ndr_initshutdown.o [SUBSYSTEM::NDR_MGMT] PUBLIC_DEPENDENCIES = LIBNDR -NDR_MGMT_OBJ_FILES = librpc/gen_ndr/ndr_mgmt.o +NDR_MGMT_OBJ_FILES = $(gen_ndrsrcdir)/ndr_mgmt.o [SUBSYSTEM::NDR_PROTECTED_STORAGE] PUBLIC_DEPENDENCIES = LIBNDR -NDR_PROTECTED_STORAGE_OBJ_FILES = librpc/gen_ndr/ndr_protected_storage.o +NDR_PROTECTED_STORAGE_OBJ_FILES = $(gen_ndrsrcdir)/ndr_protected_storage.o [SUBSYSTEM::NDR_ORPC] PUBLIC_DEPENDENCIES = LIBNDR -NDR_ORPC_OBJ_FILES = librpc/gen_ndr/ndr_orpc.o librpc/ndr/ndr_orpc.o +NDR_ORPC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_orpc.o $(ndrsrcdir)/ndr_orpc.o [SUBSYSTEM::NDR_OXIDRESOLVER] PUBLIC_DEPENDENCIES = LIBNDR NDR_ORPC NDR_MISC -NDR_OXIDRESOLVER_OBJ_FILES = librpc/gen_ndr/ndr_oxidresolver.o +NDR_OXIDRESOLVER_OBJ_FILES = $(gen_ndrsrcdir)/ndr_oxidresolver.o [SUBSYSTEM::NDR_REMACT] PUBLIC_DEPENDENCIES = LIBNDR NDR_ORPC NDR_MISC -NDR_REMACT_OBJ_FILES = librpc/gen_ndr/ndr_remact.o +NDR_REMACT_OBJ_FILES = $(gen_ndrsrcdir)/ndr_remact.o [SUBSYSTEM::NDR_WZCSVC] PUBLIC_DEPENDENCIES = LIBNDR -NDR_WZCSVC_OBJ_FILES = librpc/gen_ndr/ndr_wzcsvc.o +NDR_WZCSVC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_wzcsvc.o [SUBSYSTEM::NDR_BROWSER] PUBLIC_DEPENDENCIES = LIBNDR -NDR_BROWSER_OBJ_FILES = librpc/gen_ndr/ndr_browser.o +NDR_BROWSER_OBJ_FILES = $(gen_ndrsrcdir)/ndr_browser.o [SUBSYSTEM::NDR_W32TIME] PUBLIC_DEPENDENCIES = LIBNDR -NDR_W32TIME_OBJ_FILES = librpc/gen_ndr/ndr_w32time.o +NDR_W32TIME_OBJ_FILES = $(gen_ndrsrcdir)/ndr_w32time.o [SUBSYSTEM::NDR_SCERPC] PUBLIC_DEPENDENCIES = LIBNDR -NDR_SCERPC_OBJ_FILES = librpc/gen_ndr/ndr_scerpc.o +NDR_SCERPC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_scerpc.o [SUBSYSTEM::NDR_NTSVCS] PUBLIC_DEPENDENCIES = LIBNDR -NDR_NTSVCS_OBJ_FILES = librpc/gen_ndr/ndr_ntsvcs.o +NDR_NTSVCS_OBJ_FILES = $(gen_ndrsrcdir)/ndr_ntsvcs.o [SUBSYSTEM::NDR_NETLOGON] PUBLIC_DEPENDENCIES = LIBNDR NDR_SAMR NDR_LSA NDR_SECURITY -NDR_NETLOGON_OBJ_FILES = librpc/gen_ndr/ndr_netlogon.o +NDR_NETLOGON_OBJ_FILES = $(gen_ndrsrcdir)/ndr_netlogon.o -PUBLIC_HEADERS += $(addprefix librpc/, gen_ndr/netlogon.h) +PUBLIC_HEADERS += $(addprefix $(librpcsrcdir)/, gen_ndr/netlogon.h) [SUBSYSTEM::NDR_TRKWKS] PUBLIC_DEPENDENCIES = LIBNDR -NDR_TRKWKS_OBJ_FILES = librpc/gen_ndr/ndr_trkwks.o +NDR_TRKWKS_OBJ_FILES = $(gen_ndrsrcdir)/ndr_trkwks.o [SUBSYSTEM::NDR_KEYSVC] PUBLIC_DEPENDENCIES = LIBNDR -NDR_KEYSVC_OBJ_FILES = librpc/gen_ndr/ndr_keysvc.o +NDR_KEYSVC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_keysvc.o [SUBSYSTEM::NDR_KRB5PAC] PUBLIC_DEPENDENCIES = LIBNDR NDR_NETLOGON NDR_SECURITY -NDR_KRB5PAC_OBJ_FILES = librpc/gen_ndr/ndr_krb5pac.o librpc/ndr/ndr_krb5pac.o +NDR_KRB5PAC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_krb5pac.o $(ndrsrcdir)/ndr_krb5pac.o [SUBSYSTEM::NDR_XATTR] PUBLIC_DEPENDENCIES = LIBNDR NDR_SECURITY -NDR_XATTR_OBJ_FILES = librpc/gen_ndr/ndr_xattr.o +NDR_XATTR_OBJ_FILES = $(gen_ndrsrcdir)/ndr_xattr.o [SUBSYSTEM::NDR_OPENDB] PUBLIC_DEPENDENCIES = LIBNDR -NDR_OPENDB_OBJ_FILES = librpc/gen_ndr/ndr_opendb.o +NDR_OPENDB_OBJ_FILES = $(gen_ndrsrcdir)/ndr_opendb.o [SUBSYSTEM::NDR_NOTIFY] PUBLIC_DEPENDENCIES = LIBNDR -NDR_NOTIFY_OBJ_FILES = librpc/gen_ndr/ndr_notify.o +NDR_NOTIFY_OBJ_FILES = $(gen_ndrsrcdir)/ndr_notify.o [SUBSYSTEM::NDR_SCHANNEL] PUBLIC_DEPENDENCIES = LIBNDR NDR_NBT -NDR_SCHANNEL_OBJ_FILES = librpc/gen_ndr/ndr_schannel.o +NDR_SCHANNEL_OBJ_FILES = $(gen_ndrsrcdir)/ndr_schannel.o [SUBSYSTEM::NDR_NBT] -PUBLIC_DEPENDENCIES = LIBNDR NDR_MISC NDR_NBT_BUF NDR_SVCCTL NDR_SECURITY +PUBLIC_DEPENDENCIES = LIBNDR NDR_MISC NDR_NBT_BUF NDR_SVCCTL NDR_SECURITY NDR_SAMR LIBCLI_NDR_NETLOGON -NDR_NBT_OBJ_FILES = librpc/gen_ndr/ndr_nbt.o +NDR_NBT_OBJ_FILES = $(gen_ndrsrcdir)/ndr_nbt.o -PUBLIC_HEADERS += librpc/gen_ndr/nbt.h +PUBLIC_HEADERS += $(gen_ndrsrcdir)/nbt.h [SUBSYSTEM::NDR_WINSREPL] PUBLIC_DEPENDENCIES = LIBNDR NDR_NBT -NDR_WINSREPL_OBJ_FILES = librpc/gen_ndr/ndr_winsrepl.o +NDR_WINSREPL_OBJ_FILES = $(gen_ndrsrcdir)/ndr_winsrepl.o [SUBSYSTEM::NDR_WINBIND] PUBLIC_DEPENDENCIES = LIBNDR NDR_NETLOGON -NDR_WINBIND_OBJ_FILES = librpc/gen_ndr/ndr_winbind.o -PUBLIC_HEADERS += librpc/gen_ndr/winbind.h +NDR_WINBIND_OBJ_FILES = $(gen_ndrsrcdir)/ndr_winbind.o +#PUBLIC_HEADERS += $(gen_ndrsrcdir)/winbind.h -librpc/idl-deps: - ./librpc/idl-deps.pl librpc/idl/*.idl >$@ +$(librpcsrcdir)/idl-deps: + ./$(librpcsrcdir)/idl-deps.pl $(librpcsrcdir)/idl/*.idl >$@ clean:: - rm -f librpc/idl-deps + rm -f $(librpcsrcdir)/idl-deps -include librpc/idl-deps +include $(librpcsrcdir)/idl-deps -librpc/gen_ndr/tables.c: $(IDL_NDR_PARSE_H_FILES) +$(gen_ndrsrcdir)/tables.c: $(IDL_NDR_PARSE_H_FILES) @echo Generating $@ - @$(PERL) $(srcdir)/librpc/tables.pl --output=$@ $^ > librpc/gen_ndr/tables.x - @mv librpc/gen_ndr/tables.x $@ + @$(PERL) $(librpcsrcdir)/tables.pl --output=$@ $^ > $(gen_ndrsrcdir)/tables.x + @mv $(gen_ndrsrcdir)/tables.x $@ [SUBSYSTEM::NDR_TABLE] -PRIVATE_PROTO_HEADER = ndr/ndr_table.h PUBLIC_DEPENDENCIES = \ NDR_AUDIOSRV NDR_ECHO NDR_DCERPC \ NDR_DSBACKUP NDR_EFS NDR_MISC NDR_LSA NDR_DFS NDR_DRSUAPI \ @@ -369,93 +375,95 @@ PUBLIC_DEPENDENCIES = \ NDR_INITSHUTDOWN NDR_DNSSERVER NDR_WINSTATION NDR_IRPC NDR_OPENDB \ NDR_SASL_HELPERS NDR_NOTIFY NDR_WINBIND NDR_FRSRPC NDR_FRSAPI NDR_NFS4ACL -NDR_TABLE_OBJ_FILES = librpc/ndr/ndr_table.o librpc/gen_ndr/tables.o +NDR_TABLE_OBJ_FILES = $(ndrsrcdir)/ndr_table.o $(gen_ndrsrcdir)/tables.o + +$(eval $(call proto_header_template,$(ndrsrcdir)/ndr_table.h,$(NDR_TABLE_OBJ_FILES:.o=.c))) [SUBSYSTEM::RPC_NDR_ROT] PUBLIC_DEPENDENCIES = NDR_ROT dcerpc -RPC_NDR_ROT_OBJ_FILES = librpc/gen_ndr/ndr_rot_c.o +RPC_NDR_ROT_OBJ_FILES = $(gen_ndrsrcdir)/ndr_rot_c.o [SUBSYSTEM::RPC_NDR_AUDIOSRV] PUBLIC_DEPENDENCIES = NDR_AUDIOSRV dcerpc -RPC_NDR_AUDIOSRV_OBJ_FILES = librpc/gen_ndr/ndr_audiosrv_c.o +RPC_NDR_AUDIOSRV_OBJ_FILES = $(gen_ndrsrcdir)/ndr_audiosrv_c.o [SUBSYSTEM::RPC_NDR_ECHO] PUBLIC_DEPENDENCIES = dcerpc NDR_ECHO -RPC_NDR_ECHO_OBJ_FILES = librpc/gen_ndr/ndr_echo_c.o +RPC_NDR_ECHO_OBJ_FILES = $(gen_ndrsrcdir)/ndr_echo_c.o [SUBSYSTEM::RPC_NDR_DSBACKUP] PUBLIC_DEPENDENCIES = dcerpc NDR_DSBACKUP -RPC_NDR_DSBACKUP_OBJ_FILES = librpc/gen_ndr/ndr_dsbackup_c.o +RPC_NDR_DSBACKUP_OBJ_FILES = $(gen_ndrsrcdir)/ndr_dsbackup_c.o [SUBSYSTEM::RPC_NDR_EFS] PUBLIC_DEPENDENCIES = dcerpc NDR_EFS -RPC_NDR_EFS_OBJ_FILES = librpc/gen_ndr/ndr_efs_c.o +RPC_NDR_EFS_OBJ_FILES = $(gen_ndrsrcdir)/ndr_efs_c.o [SUBSYSTEM::RPC_NDR_LSA] PUBLIC_DEPENDENCIES = dcerpc NDR_LSA -RPC_NDR_LSA_OBJ_FILES = librpc/gen_ndr/ndr_lsa_c.o +RPC_NDR_LSA_OBJ_FILES = $(gen_ndrsrcdir)/ndr_lsa_c.o [SUBSYSTEM::RPC_NDR_DFS] PUBLIC_DEPENDENCIES = dcerpc NDR_DFS -RPC_NDR_DFS_OBJ_FILES = librpc/gen_ndr/ndr_dfs_c.o +RPC_NDR_DFS_OBJ_FILES = $(gen_ndrsrcdir)/ndr_dfs_c.o [SUBSYSTEM::RPC_NDR_FRSAPI] PUBLIC_DEPENDENCIES = dcerpc NDR_FRSAPI -RPC_NDR_FRSAPI_OBJ_FILES = librpc/gen_ndr/ndr_frsapi_c.o +RPC_NDR_FRSAPI_OBJ_FILES = $(gen_ndrsrcdir)/ndr_frsapi_c.o [SUBSYSTEM::RPC_NDR_DRSUAPI] PUBLIC_DEPENDENCIES = dcerpc NDR_DRSUAPI -RPC_NDR_DRSUAPI_OBJ_FILES = librpc/gen_ndr/ndr_drsuapi_c.o +RPC_NDR_DRSUAPI_OBJ_FILES = $(gen_ndrsrcdir)/ndr_drsuapi_c.o [SUBSYSTEM::RPC_NDR_POLICYAGENT] PUBLIC_DEPENDENCIES = dcerpc NDR_POLICYAGENT -RPC_NDR_POLICYAGENT_OBJ_FILES = librpc/gen_ndr/ndr_policyagent_c.o +RPC_NDR_POLICYAGENT_OBJ_FILES = $(gen_ndrsrcdir)/ndr_policyagent_c.o [SUBSYSTEM::RPC_NDR_UNIXINFO] PUBLIC_DEPENDENCIES = dcerpc NDR_UNIXINFO -RPC_NDR_UNIXINFO_OBJ_FILES = librpc/gen_ndr/ndr_unixinfo_c.o +RPC_NDR_UNIXINFO_OBJ_FILES = $(gen_ndrsrcdir)/ndr_unixinfo_c.o [LIBRARY::dcerpc_samr] PUBLIC_DEPENDENCIES = dcerpc NDR_SAMR -PC_FILES += librpc/dcerpc_samr.pc +PC_FILES += $(librpcsrcdir)/dcerpc_samr.pc dcerpc_samr_VERSION = 0.0.1 dcerpc_samr_SOVERSION = 0 -dcerpc_samr_OBJ_FILES = librpc/gen_ndr/ndr_samr_c.o +dcerpc_samr_OBJ_FILES = $(gen_ndrsrcdir)/ndr_samr_c.o [SUBSYSTEM::RPC_NDR_SPOOLSS] PUBLIC_DEPENDENCIES = dcerpc NDR_SPOOLSS -RPC_NDR_SPOOLSS_OBJ_FILES = librpc/gen_ndr/ndr_spoolss_c.o +RPC_NDR_SPOOLSS_OBJ_FILES = $(gen_ndrsrcdir)/ndr_spoolss_c.o [SUBSYSTEM::RPC_NDR_WKSSVC] PUBLIC_DEPENDENCIES = dcerpc NDR_WKSSVC -RPC_NDR_WKSSVC_OBJ_FILES = librpc/gen_ndr/ndr_wkssvc_c.o +RPC_NDR_WKSSVC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_wkssvc_c.o [SUBSYSTEM::RPC_NDR_SRVSVC] PUBLIC_DEPENDENCIES = dcerpc NDR_SRVSVC -RPC_NDR_SRVSVC_OBJ_FILES = librpc/gen_ndr/ndr_srvsvc_c.o +RPC_NDR_SRVSVC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_srvsvc_c.o [SUBSYSTEM::RPC_NDR_SVCCTL] PUBLIC_DEPENDENCIES = dcerpc NDR_SVCCTL -RPC_NDR_SVCCTL_OBJ_FILES = librpc/gen_ndr/ndr_svcctl_c.o +RPC_NDR_SVCCTL_OBJ_FILES = $(gen_ndrsrcdir)/ndr_svcctl_c.o -PUBLIC_HEADERS += librpc/gen_ndr/ndr_svcctl_c.h +PUBLIC_HEADERS += $(gen_ndrsrcdir)/ndr_svcctl_c.h [LIBRARY::dcerpc_atsvc] PUBLIC_DEPENDENCIES = dcerpc NDR_ATSVC @@ -463,117 +471,116 @@ PUBLIC_DEPENDENCIES = dcerpc NDR_ATSVC dcerpc_atsvc_VERSION = 0.0.1 dcerpc_atsvc_SOVERSION = 0 -dcerpc_atsvc_OBJ_FILES = librpc/gen_ndr/ndr_atsvc_c.o -PC_FILES += librpc/dcerpc_atsvc.pc +dcerpc_atsvc_OBJ_FILES = $(gen_ndrsrcdir)/ndr_atsvc_c.o +PC_FILES += $(librpcsrcdir)/dcerpc_atsvc.pc -PUBLIC_HEADERS += librpc/gen_ndr/ndr_atsvc_c.h +PUBLIC_HEADERS += $(gen_ndrsrcdir)/ndr_atsvc_c.h [SUBSYSTEM::RPC_NDR_EVENTLOG] PUBLIC_DEPENDENCIES = dcerpc NDR_EVENTLOG -RPC_NDR_EVENTLOG_OBJ_FILES = librpc/gen_ndr/ndr_eventlog_c.o +RPC_NDR_EVENTLOG_OBJ_FILES = $(gen_ndrsrcdir)/ndr_eventlog_c.o [SUBSYSTEM::RPC_NDR_EPMAPPER] PUBLIC_DEPENDENCIES = NDR_EPMAPPER -RPC_NDR_EPMAPPER_OBJ_FILES = librpc/gen_ndr/ndr_epmapper_c.o +RPC_NDR_EPMAPPER_OBJ_FILES = $(gen_ndrsrcdir)/ndr_epmapper_c.o [SUBSYSTEM::RPC_NDR_DBGIDL] PUBLIC_DEPENDENCIES = dcerpc NDR_DBGIDL -RPC_NDR_DBGIDL_OBJ_FILES = librpc/gen_ndr/ndr_dbgidl_c.o +RPC_NDR_DBGIDL_OBJ_FILES = $(gen_ndrsrcdir)/ndr_dbgidl_c.o [SUBSYSTEM::RPC_NDR_DSSETUP] PUBLIC_DEPENDENCIES = dcerpc NDR_DSSETUP -RPC_NDR_DSSETUP_OBJ_FILES = librpc/gen_ndr/ndr_dssetup_c.o +RPC_NDR_DSSETUP_OBJ_FILES = $(gen_ndrsrcdir)/ndr_dssetup_c.o [SUBSYSTEM::RPC_NDR_MSGSVC] PUBLIC_DEPENDENCIES = dcerpc NDR_MSGSVC -RPC_NDR_MSGSVC_OBJ_FILES = librpc/gen_ndr/ndr_msgsvc_c.o +RPC_NDR_MSGSVC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_msgsvc_c.o [SUBSYSTEM::RPC_NDR_WINS] PUBLIC_DEPENDENCIES = dcerpc NDR_WINS -RPC_NDR_WINS_OBJ_FILES = librpc/gen_ndr/ndr_wins_c.o +RPC_NDR_WINS_OBJ_FILES = $(gen_ndrsrcdir)/ndr_wins_c.o [SUBSYSTEM::RPC_NDR_WINREG] PUBLIC_DEPENDENCIES = dcerpc NDR_WINREG -RPC_NDR_WINREG_OBJ_FILES = librpc/gen_ndr/ndr_winreg_c.o +RPC_NDR_WINREG_OBJ_FILES = $(gen_ndrsrcdir)/ndr_winreg_c.o [SUBSYSTEM::RPC_NDR_INITSHUTDOWN] PUBLIC_DEPENDENCIES = dcerpc NDR_INITSHUTDOWN -RPC_NDR_INITSHUTDOWN_OBJ_FILES = librpc/gen_ndr/ndr_initshutdown_c.o +RPC_NDR_INITSHUTDOWN_OBJ_FILES = $(gen_ndrsrcdir)/ndr_initshutdown_c.o [SUBSYSTEM::RPC_NDR_MGMT] PRIVATE_DEPENDENCIES = NDR_MGMT -RPC_NDR_MGMT_OBJ_FILES = librpc/gen_ndr/ndr_mgmt_c.o +RPC_NDR_MGMT_OBJ_FILES = $(gen_ndrsrcdir)/ndr_mgmt_c.o [SUBSYSTEM::RPC_NDR_PROTECTED_STORAGE] PUBLIC_DEPENDENCIES = dcerpc NDR_PROTECTED_STORAGE -RPC_NDR_PROTECTED_STORAGE_OBJ_FILES = librpc/gen_ndr/ndr_protected_storage_c.o +RPC_NDR_PROTECTED_STORAGE_OBJ_FILES = $(gen_ndrsrcdir)/ndr_protected_storage_c.o [SUBSYSTEM::RPC_NDR_OXIDRESOLVER] PUBLIC_DEPENDENCIES = dcerpc NDR_OXIDRESOLVER -RPC_NDR_OXIDRESOLVER_OBJ_FILES = librpc/gen_ndr/ndr_oxidresolver_c.o +RPC_NDR_OXIDRESOLVER_OBJ_FILES = $(gen_ndrsrcdir)/ndr_oxidresolver_c.o [SUBSYSTEM::RPC_NDR_REMACT] PUBLIC_DEPENDENCIES = dcerpc NDR_REMACT -RPC_NDR_REMACT_OBJ_FILES = librpc/gen_ndr/ndr_remact_c.o +RPC_NDR_REMACT_OBJ_FILES = $(gen_ndrsrcdir)/ndr_remact_c.o [SUBSYSTEM::RPC_NDR_WZCSVC] PUBLIC_DEPENDENCIES = dcerpc NDR_WZCSVC -RPC_NDR_WZCSVC_OBJ_FILES = librpc/gen_ndr/ndr_wzcsvc_c.o +RPC_NDR_WZCSVC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_wzcsvc_c.o [SUBSYSTEM::RPC_NDR_W32TIME] PUBLIC_DEPENDENCIES = dcerpc NDR_W32TIME -RPC_NDR_W32TIME_OBJ_FILES = librpc/gen_ndr/ndr_w32time_c.o +RPC_NDR_W32TIME_OBJ_FILES = $(gen_ndrsrcdir)/ndr_w32time_c.o [SUBSYSTEM::RPC_NDR_SCERPC] PUBLIC_DEPENDENCIES = dcerpc NDR_SCERPC -RPC_NDR_SCERPC_OBJ_FILES = librpc/gen_ndr/ndr_scerpc_c.o +RPC_NDR_SCERPC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_scerpc_c.o [SUBSYSTEM::RPC_NDR_NTSVCS] PUBLIC_DEPENDENCIES = dcerpc NDR_NTSVCS -RPC_NDR_NTSVCS_OBJ_FILES = librpc/gen_ndr/ndr_ntsvcs_c.o +RPC_NDR_NTSVCS_OBJ_FILES = $(gen_ndrsrcdir)/ndr_ntsvcs_c.o [SUBSYSTEM::RPC_NDR_NETLOGON] PUBLIC_DEPENDENCIES = NDR_NETLOGON -RPC_NDR_NETLOGON_OBJ_FILES = librpc/gen_ndr/ndr_netlogon_c.o +RPC_NDR_NETLOGON_OBJ_FILES = $(gen_ndrsrcdir)/ndr_netlogon_c.o [SUBSYSTEM::RPC_NDR_TRKWKS] PUBLIC_DEPENDENCIES = dcerpc NDR_TRKWKS -RPC_NDR_TRKWKS_OBJ_FILES = librpc/gen_ndr/ndr_trkwks_c.o +RPC_NDR_TRKWKS_OBJ_FILES = $(gen_ndrsrcdir)/ndr_trkwks_c.o [SUBSYSTEM::RPC_NDR_KEYSVC] PUBLIC_DEPENDENCIES = dcerpc NDR_KEYSVC -RPC_NDR_KEYSVC_OBJ_FILES = librpc/gen_ndr/ndr_keysvc_c.o +RPC_NDR_KEYSVC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_keysvc_c.o [SUBSYSTEM::NDR_DCERPC] PUBLIC_DEPENDENCIES = LIBNDR NDR_MISC -NDR_DCERPC_OBJ_FILES = librpc/gen_ndr/ndr_dcerpc.o +NDR_DCERPC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_dcerpc.o -PUBLIC_HEADERS += $(addprefix librpc/, gen_ndr/dcerpc.h gen_ndr/ndr_dcerpc.h) +PUBLIC_HEADERS += $(addprefix $(librpcsrcdir)/, gen_ndr/dcerpc.h gen_ndr/ndr_dcerpc.h) ################################################ # Start SUBSYSTEM dcerpc [LIBRARY::dcerpc] -PRIVATE_PROTO_HEADER = rpc/dcerpc_proto.h PRIVATE_DEPENDENCIES = \ samba-socket LIBCLI_RESOLVE LIBCLI_SMB LIBCLI_SMB2 \ LIBNDR NDR_DCERPC RPC_NDR_EPMAPPER \ @@ -585,211 +592,131 @@ PUBLIC_DEPENDENCIES = CREDENTIALS # End SUBSYSTEM dcerpc ################################################ -PC_FILES += librpc/dcerpc.pc +PC_FILES += $(librpcsrcdir)/dcerpc.pc dcerpc_VERSION = 0.0.1 dcerpc_SOVERSION = 0 -dcerpc_OBJ_FILES = $(addprefix librpc/rpc/, dcerpc.o dcerpc_auth.o dcerpc_schannel.o dcerpc_util.o \ - binding.o \ +dcerpc_OBJ_FILES = $(addprefix $(dcerpcsrcdir)/, dcerpc.o dcerpc_auth.o dcerpc_schannel.o dcerpc_util.o binding.o \ dcerpc_error.o dcerpc_smb.o dcerpc_smb2.o dcerpc_sock.o dcerpc_connect.o dcerpc_secondary.o) +$(eval $(call proto_header_template,$(dcerpcsrcdir)/dcerpc_proto.h,$(dcerpc_OBJ_FILES:.o=.c))) + -PUBLIC_HEADERS += $(addprefix librpc/, rpc/dcerpc.h \ +PUBLIC_HEADERS += $(addprefix $(librpcsrcdir)/, rpc/dcerpc.h \ gen_ndr/mgmt.h gen_ndr/ndr_mgmt.h gen_ndr/ndr_mgmt_c.h \ gen_ndr/epmapper.h gen_ndr/ndr_epmapper.h gen_ndr/ndr_epmapper_c.h) -[MODULE::RPC_EJS_ECHO] -INIT_FUNCTION = ejs_init_rpcecho -SUBSYSTEM = smbcalls -PRIVATE_DEPENDENCIES = dcerpc NDR_ECHO EJSRPC - -RPC_EJS_ECHO_OBJ_FILES = librpc/gen_ndr/ndr_echo_ejs.o - -[MODULE::RPC_EJS_MISC] -INIT_FUNCTION = ejs_init_misc -SUBSYSTEM = smbcalls -PRIVATE_DEPENDENCIES = dcerpc NDR_MISC EJSRPC - -RPC_EJS_MISC_OBJ_FILES = librpc/gen_ndr/ndr_misc_ejs.o - -[MODULE::RPC_EJS_SAMR] -INIT_FUNCTION = ejs_init_samr -SUBSYSTEM = smbcalls -PRIVATE_DEPENDENCIES = dcerpc NDR_SAMR EJSRPC RPC_EJS_LSA RPC_EJS_SECURITY RPC_EJS_MISC - -RPC_EJS_SAMR_OBJ_FILES = librpc/gen_ndr/ndr_samr_ejs.o - -[MODULE::RPC_EJS_SECURITY] -INIT_FUNCTION = ejs_init_security -SUBSYSTEM = smbcalls -PRIVATE_DEPENDENCIES = dcerpc NDR_SECURITY EJSRPC - -RPC_EJS_SECURITY_OBJ_FILES = librpc/gen_ndr/ndr_security_ejs.o - -[MODULE::RPC_EJS_LSA] -INIT_FUNCTION = ejs_init_lsarpc -SUBSYSTEM = smbcalls -PRIVATE_DEPENDENCIES = dcerpc NDR_LSA EJSRPC RPC_EJS_SECURITY RPC_EJS_MISC - -RPC_EJS_LSA_OBJ_FILES = librpc/gen_ndr/ndr_lsa_ejs.o - -[MODULE::RPC_EJS_DFS] -INIT_FUNCTION = ejs_init_netdfs -SUBSYSTEM = smbcalls -PRIVATE_DEPENDENCIES = dcerpc NDR_DFS EJSRPC - -RPC_EJS_DFS_OBJ_FILES = librpc/gen_ndr/ndr_dfs_ejs.o - -[MODULE::RPC_EJS_DRSUAPI] -INIT_FUNCTION = ejs_init_drsuapi -SUBSYSTEM = smbcalls -PRIVATE_DEPENDENCIES = dcerpc NDR_DRSUAPI EJSRPC RPC_EJS_MISC RPC_EJS_SAMR - -RPC_EJS_DRSUAPI_OBJ_FILES = librpc/gen_ndr/ndr_drsuapi_ejs.o - -[MODULE::RPC_EJS_SPOOLSS] -INIT_FUNCTION = ejs_init_spoolss -SUBSYSTEM = smbcalls -ENABLE = NO -PRIVATE_DEPENDENCIES = dcerpc NDR_SPOOLSS EJSRPC - -RPC_EJS_SPOOLSS_OBJ_FILES = librpc/gen_ndr/ndr_spoolss_ejs.o - -[MODULE::RPC_EJS_WKSSVC] -INIT_FUNCTION = ejs_init_wkssvc -SUBSYSTEM = smbcalls -PRIVATE_DEPENDENCIES = dcerpc NDR_WKSSVC EJSRPC RPC_EJS_SRVSVC RPC_EJS_MISC - -RPC_EJS_WKSSVC_OBJ_FILES = librpc/gen_ndr/ndr_wkssvc_ejs.o - -[MODULE::RPC_EJS_SRVSVC] -INIT_FUNCTION = ejs_init_srvsvc -SUBSYSTEM = smbcalls -PRIVATE_DEPENDENCIES = dcerpc NDR_SRVSVC EJSRPC RPC_EJS_MISC RPC_EJS_SVCCTL RPC_EJS_SECURITY - -RPC_EJS_SRVSVC_OBJ_FILES = librpc/gen_ndr/ndr_srvsvc_ejs.o - -[MODULE::RPC_EJS_EVENTLOG] -INIT_FUNCTION = ejs_init_eventlog -SUBSYSTEM = smbcalls -PRIVATE_DEPENDENCIES = dcerpc NDR_EVENTLOG EJSRPC RPC_EJS_MISC - -RPC_EJS_EVENTLOG_OBJ_FILES = librpc/gen_ndr/ndr_eventlog_ejs.o - -[MODULE::RPC_EJS_WINREG] -INIT_FUNCTION = ejs_init_winreg -SUBSYSTEM = smbcalls -PRIVATE_DEPENDENCIES = dcerpc NDR_WINREG EJSRPC RPC_EJS_INITSHUTDOWN \ - RPC_EJS_MISC RPC_EJS_SECURITY - -RPC_EJS_WINREG_OBJ_FILES = librpc/gen_ndr/ndr_winreg_ejs.o - -[MODULE::RPC_EJS_INITSHUTDOWN] -INIT_FUNCTION = ejs_init_initshutdown -SUBSYSTEM = smbcalls -PRIVATE_DEPENDENCIES = dcerpc NDR_INITSHUTDOWN EJSRPC - -RPC_EJS_INITSHUTDOWN_OBJ_FILES = librpc/gen_ndr/ndr_initshutdown_ejs.o - -[MODULE::RPC_EJS_NETLOGON] -INIT_FUNCTION = ejs_init_netlogon -SUBSYSTEM = smbcalls -PRIVATE_DEPENDENCIES = dcerpc NDR_NETLOGON EJSRPC RPC_EJS_SAMR RPC_EJS_SECURITY RPC_EJS_MISC - -RPC_EJS_NETLOGON_OBJ_FILES = librpc/gen_ndr/ndr_netlogon_ejs.o - -[MODULE::RPC_EJS_SVCCTL] -INIT_FUNCTION = ejs_init_svcctl -SUBSYSTEM = smbcalls -PRIVATE_DEPENDENCIES = dcerpc NDR_SVCCTL EJSRPC RPC_EJS_MISC - -RPC_EJS_SVCCTL_OBJ_FILES = librpc/gen_ndr/ndr_svcctl_ejs.o - -[MODULE::RPC_EJS_IRPC] -INIT_FUNCTION = ejs_init_irpc -SUBSYSTEM = smbcalls -PRIVATE_DEPENDENCIES = dcerpc NDR_IRPC EJSRPC - -RPC_EJS_IRPC_OBJ_FILES = librpc/gen_ndr/ndr_irpc_ejs.o - [PYTHON::swig_dcerpc] -SWIG_FILE = rpc/dcerpc.i +LIBRARY_REALNAME = samba/dcerpc/_dcerpc.$(SHLIBEXT) PUBLIC_DEPENDENCIES = LIBCLI_SMB NDR_MISC LIBSAMBA-UTIL LIBSAMBA-HOSTCONFIG dcerpc_samr RPC_NDR_LSA DYNCONFIG -swig_dcerpc_OBJ_FILES = librpc/rpc/dcerpc_wrap.o +swig_dcerpc_OBJ_FILES = $(dcerpcsrcdir)/dcerpc_wrap.o + +$(eval $(call python_py_module_template,samba/dcerpc/__init__.py,$(dcerpcsrcdir)/dcerpc.py)) + +$(swig_dcerpc_OBJ_FILES): CFLAGS+=$(CFLAG_NO_UNUSED_MACROS) $(CFLAG_NO_CAST_QUAL) [PYTHON::python_echo] -PRIVATE_DEPENDENCIES = RPC_NDR_ECHO PYTALLOC +LIBRARY_REALNAME = samba/dcerpc/echo.$(SHLIBEXT) +PRIVATE_DEPENDENCIES = RPC_NDR_ECHO PYTALLOC param swig_credentials -python_echo_OBJ_FILES = librpc/gen_ndr/py_echo.o +python_echo_OBJ_FILES = $(gen_ndrsrcdir)/py_echo.o [PYTHON::python_winreg] -PRIVATE_DEPENDENCIES = RPC_NDR_WINREG python_misc PYTALLOC +LIBRARY_REALNAME = samba/dcerpc/winreg.$(SHLIBEXT) +PRIVATE_DEPENDENCIES = RPC_NDR_WINREG python_misc PYTALLOC param swig_credentials python_dcerpc_misc python_lsa -python_winreg_OBJ_FILES = librpc/gen_ndr/py_winreg.o +python_winreg_OBJ_FILES = $(gen_ndrsrcdir)/py_winreg.o [PYTHON::python_dcerpc_misc] +LIBRARY_REALNAME = samba/dcerpc/misc.$(SHLIBEXT) PRIVATE_DEPENDENCIES = PYTALLOC -python_dcerpc_misc_OBJ_FILES = librpc/gen_ndr/py_misc.o +python_dcerpc_misc_OBJ_FILES = $(gen_ndrsrcdir)/py_misc.o [PYTHON::python_initshutdown] -PRIVATE_DEPENDENCIES = RPC_NDR_INITSHUTDOWN PYTALLOC +LIBRARY_REALNAME = samba/dcerpc/initshutdown.$(SHLIBEXT) +PRIVATE_DEPENDENCIES = RPC_NDR_INITSHUTDOWN PYTALLOC param swig_credentials python_lsa python_dcerpc_security -python_initshutdown_OBJ_FILES = librpc/gen_ndr/py_initshutdown.o +python_initshutdown_OBJ_FILES = $(gen_ndrsrcdir)/py_initshutdown.o [PYTHON::python_epmapper] -PRIVATE_DEPENDENCIES = PYTALLOC +LIBRARY_REALNAME = samba/dcerpc/epmapper.$(SHLIBEXT) +PRIVATE_DEPENDENCIES = dcerpc PYTALLOC param swig_credentials python_dcerpc_misc -python_epmapper_OBJ_FILES = librpc/gen_ndr/py_epmapper.o +python_epmapper_OBJ_FILES = $(gen_ndrsrcdir)/py_epmapper.o [PYTHON::python_mgmt] -PRIVATE_DEPENDENCIES = dcerpc_mgmt PYTALLOC +LIBRARY_REALNAME = samba/dcerpc/mgmt.$(SHLIBEXT) +PRIVATE_DEPENDENCIES = PYTALLOC param swig_credentials dcerpc python_dcerpc_misc -python_mgmt_OBJ_FILES = librpc/gen_ndr/py_mgmt.o +python_mgmt_OBJ_FILES = $(gen_ndrsrcdir)/py_mgmt.o [PYTHON::python_atsvc] -PRIVATE_DEPENDENCIES = dcerpc_atsvc PYTALLOC +LIBRARY_REALNAME = samba/dcerpc/atsvc.$(SHLIBEXT) +PRIVATE_DEPENDENCIES = dcerpc_atsvc PYTALLOC param swig_credentials -python_atsvc_OBJ_FILES = librpc/gen_ndr/py_atsvc.o +python_atsvc_OBJ_FILES = $(gen_ndrsrcdir)/py_atsvc.o [PYTHON::python_samr] -PRIVATE_DEPENDENCIES = dcerpc_samr PYTALLOC +LIBRARY_REALNAME = samba/dcerpc/samr.$(SHLIBEXT) +PRIVATE_DEPENDENCIES = dcerpc_samr PYTALLOC python_dcerpc_security python_lsa python_dcerpc_misc swig_credentials param -python_samr_OBJ_FILES = librpc/gen_ndr/py_samr.o +python_samr_OBJ_FILES = $(gen_ndrsrcdir)/py_samr.o [PYTHON::python_svcctl] -PRIVATE_DEPENDENCIES = RPC_NDR_SVCCTL PYTALLOC +LIBRARY_REALNAME = samba/dcerpc/svcctl.$(SHLIBEXT) +PRIVATE_DEPENDENCIES = RPC_NDR_SVCCTL PYTALLOC param swig_credentials python_dcerpc_misc -python_svcctl_OBJ_FILES = librpc/gen_ndr/py_svcctl.o +python_svcctl_OBJ_FILES = $(gen_ndrsrcdir)/py_svcctl.o [PYTHON::python_lsa] -PRIVATE_DEPENDENCIES = RPC_NDR_LSA PYTALLOC +LIBRARY_REALNAME = samba/dcerpc/lsa.$(SHLIBEXT) +PRIVATE_DEPENDENCIES = RPC_NDR_LSA PYTALLOC param swig_credentials python_dcerpc_security -python_lsa_OBJ_FILES = librpc/gen_ndr/py_lsa.o +python_lsa_OBJ_FILES = $(gen_ndrsrcdir)/py_lsa.o [PYTHON::python_wkssvc] -PRIVATE_DEPENDENCIES = RPC_NDR_WKSSVC PYTALLOC +LIBRARY_REALNAME = samba/dcerpc/wkssvc.$(SHLIBEXT) +PRIVATE_DEPENDENCIES = RPC_NDR_WKSSVC PYTALLOC param swig_credentials python_lsa python_dcerpc_security -python_wkssvc_OBJ_FILES = librpc/gen_ndr/py_wkssvc.o +python_wkssvc_OBJ_FILES = $(gen_ndrsrcdir)/py_wkssvc.o [PYTHON::python_dfs] -PRIVATE_DEPENDENCIES = RPC_NDR_DFS PYTALLOC +LIBRARY_REALNAME = samba/dcerpc/dfs.$(SHLIBEXT) +PRIVATE_DEPENDENCIES = RPC_NDR_DFS PYTALLOC param swig_credentials python_dcerpc_misc -python_dfs_OBJ_FILES = librpc/gen_ndr/py_dfs.o +python_dfs_OBJ_FILES = $(gen_ndrsrcdir)/py_dfs.o [PYTHON::python_unixinfo] -PRIVATE_DEPENDENCIES = RPC_NDR_UNIXINFO PYTALLOC +LIBRARY_REALNAME = samba/dcerpc/unixinfo.$(SHLIBEXT) +PRIVATE_DEPENDENCIES = RPC_NDR_UNIXINFO PYTALLOC param swig_credentials python_dcerpc_security python_dcerpc_misc -python_unixinfo_OBJ_FILES = librpc/gen_ndr/py_unixinfo.o +python_unixinfo_OBJ_FILES = $(gen_ndrsrcdir)/py_unixinfo.o [PYTHON::python_drsuapi] -PRIVATE_DEPENDENCIES = RPC_NDR_DRSUAPI PYTALLOC +LIBRARY_REALNAME = samba/dcerpc/drsuapi.$(SHLIBEXT) +PRIVATE_DEPENDENCIES = RPC_NDR_DRSUAPI PYTALLOC param swig_credentials python_dcerpc_misc python_dcerpc_security -python_drsuapi_OBJ_FILES = librpc/gen_ndr/py_drsuapi.o +python_drsuapi_OBJ_FILES = $(gen_ndrsrcdir)/py_drsuapi.o [PYTHON::python_dcerpc_security] -PRIVATE_DEPENDENCIES = PYTALLOC +LIBRARY_REALNAME = samba/dcerpc/security.$(SHLIBEXT) +PRIVATE_DEPENDENCIES = PYTALLOC python_dcerpc_misc + +python_dcerpc_security_OBJ_FILES = $(gen_ndrsrcdir)/py_security.o + +$(IDL_HEADER_FILES) $(IDL_NDR_PARSE_H_FILES) $(IDL_NDR_PARSE_C_FILES) \ + $(IDL_NDR_CLIENT_C_FILES) $(IDL_NDR_CLIENT_H_FILES) \ + $(IDL_NDR_SERVER_C_FILES) $(IDL_SWIG_FILES) \ + $(IDL_NDR_EJS_C_FILES) $(IDL_NDR_EJS_H_FILES) \ + $(IDL_NDR_PY_C_FILES) $(IDL_NDR_PY_H_FILES): idl + +idl_full:: $(pidldir)/lib/Parse/Pidl/IDL.pm $(pidldir)/lib/Parse/Pidl/Expr.pm + @CPP="$(CPP)" PIDL="$(PIDL)" $(librpcsrcdir)/scripts/build_idl.sh FULL $(librpcsrcdir)/idl $(librpcsrcdir)/gen_ndr + +idl:: $(pidldir)/lib/Parse/Pidl/IDL.pm $(pidldir)/lib/Parse/Pidl/Expr.pm + @CPP="$(CPP)" PIDL="$(PIDL)" $(librpcsrcdir)/scripts/build_idl.sh PARTIAL $(librpcsrcdir)/idl $(librpcsrcdir)/gen_ndr + -python_dcerpc_security_OBJ_FILES = librpc/gen_ndr/py_security.o diff --git a/source4/librpc/idl-deps.pl b/source4/librpc/idl-deps.pl index d5bfe0b2ec..e630ee4f61 100755 --- a/source4/librpc/idl-deps.pl +++ b/source4/librpc/idl-deps.pl @@ -6,17 +6,17 @@ my %vars = (); foreach(@ARGV) { push (@{$vars{IDL_FILES}}, $_); my $b = $_; $b =~ s/.*\/(.*?).idl$/$1/; - push (@{$vars{IDL_HEADER_FILES}}, "librpc/gen_ndr/$b.h"); - push (@{$vars{IDL_NDR_PARSE_H_FILES}}, "librpc/gen_ndr/ndr_$b.h"); - push (@{$vars{IDL_NDR_PARSE_C_FILES}}, "librpc/gen_ndr/ndr_$b.c"); - push (@{$vars{IDL_NDR_CLIENT_C_FILES}}, "librpc/gen_ndr/ndr_$b\_c.c"); - push (@{$vars{IDL_NDR_CLIENT_H_FILES}}, "librpc/gen_ndr/ndr_$b\_c.h"); - push (@{$vars{IDL_SWIG_FILES}}, "librpc/gen_ndr/$b.i"); - push (@{$vars{IDL_NDR_SERVER_C_FILES}}, "librpc/gen_ndr/ndr_$b\_s.c"); - push (@{$vars{IDL_NDR_EJS_C_FILES}}, "librpc/gen_ndr/ndr_$b\_ejs.c"); - push (@{$vars{IDL_NDR_EJS_H_FILES}}, "librpc/gen_ndr/ndr_$b\_ejs.h"); - push (@{$vars{IDL_NDR_PY_C_FILES}}, "librpc/gen_ndr/py_$b.c"); - push (@{$vars{IDL_NDR_PY_H_FILES}}, "librpc/gen_ndr/py_$b.h"); + push (@{$vars{IDL_HEADER_FILES}}, "\$(librpcsrcdir)/gen_ndr/$b.h"); + push (@{$vars{IDL_NDR_PARSE_H_FILES}}, "\$(librpcsrcdir)/gen_ndr/ndr_$b.h"); + push (@{$vars{IDL_NDR_PARSE_C_FILES}}, "\$(librpcsrcdir)/gen_ndr/ndr_$b.c"); + push (@{$vars{IDL_NDR_CLIENT_C_FILES}}, "\$(librpcsrcdir)/gen_ndr/ndr_$b\_c.c"); + push (@{$vars{IDL_NDR_CLIENT_H_FILES}}, "\$(librpcsrcdir)/gen_ndr/ndr_$b\_c.h"); + push (@{$vars{IDL_SWIG_FILES}}, "\$(librpcsrcdir)/gen_ndr/$b.i"); + push (@{$vars{IDL_NDR_SERVER_C_FILES}}, "\$(librpcsrcdir)/gen_ndr/ndr_$b\_s.c"); + push (@{$vars{IDL_NDR_EJS_C_FILES}}, "\$(librpcsrcdir)/gen_ndr/ndr_$b\_ejs.c"); + push (@{$vars{IDL_NDR_EJS_H_FILES}}, "\$(librpcsrcdir)/gen_ndr/ndr_$b\_ejs.h"); + push (@{$vars{IDL_NDR_PY_C_FILES}}, "\$(librpcsrcdir)/gen_ndr/py_$b.c"); + push (@{$vars{IDL_NDR_PY_H_FILES}}, "\$(librpcsrcdir)/gen_ndr/py_$b.h"); } foreach (keys %vars) { diff --git a/source4/librpc/idl/dcerpc.idl b/source4/librpc/idl/dcerpc.idl index b2c67542f5..e228d85c46 100644 --- a/source4/librpc/idl/dcerpc.idl +++ b/source4/librpc/idl/dcerpc.idl @@ -116,6 +116,7 @@ interface dcerpc uint16 context_id; uint8 cancel_count; uint32 status; + [flag(NDR_REMAINING)] DATA_BLOB _pad; } dcerpc_fault; /* the auth types we know about */ diff --git a/source4/librpc/idl/drsuapi.idl b/source4/librpc/idl/drsuapi.idl index 9652571668..2f48287233 100644 --- a/source4/librpc/idl/drsuapi.idl +++ b/source4/librpc/idl/drsuapi.idl @@ -849,7 +849,7 @@ interface drsuapi [case(1)] drsuapi_DsNameCtr1 *ctr1; } drsuapi_DsNameCtr; - [todo] WERROR drsuapi_DsCrackNames( + WERROR drsuapi_DsCrackNames( [in] policy_handle *bind_handle, [in, out] int32 level, [in,switch_is(level)] drsuapi_DsNameRequest req, diff --git a/source4/librpc/idl/nbt.idl b/source4/librpc/idl/nbt.idl index aa88360882..783f04eb42 100644 --- a/source4/librpc/idl/nbt.idl +++ b/source4/librpc/idl/nbt.idl @@ -8,9 +8,9 @@ encoding if it doesn't work out */ -import "misc.idl", "security.idl", "svcctl.idl"; +import "misc.idl", "security.idl", "svcctl.idl", "samr.idl"; [ -helper("libcli/nbt/libnbt.h") + helper("libcli/netlogon.h", "libcli/nbt/libnbt.h") ] interface nbt { @@ -338,52 +338,19 @@ interface nbt } nbt_dgram_packet; - /*******************************************/ - /* \MAILSLOT\NET\NETLOGON mailslot requests */ - typedef enum { - NETLOGON_QUERY_FOR_PDC = 0x7, - NETLOGON_ANNOUNCE_UAS = 0xa, - NETLOGON_RESPONSE_FROM_PDC = 0xc, - NETLOGON_QUERY_FOR_PDC2 = 0x12, - NETLOGON_RESPONSE_FROM_PDC2 = 0x17, - NETLOGON_RESPONSE_FROM_PDC_USER = 0x19 - } nbt_netlogon_command; - - /* query for pdc request */ - typedef struct { - astring computer_name; - astring mailslot_name; - [flag(NDR_ALIGN2)] DATA_BLOB _pad; - nstring unicode_name; - uint32 nt_version; - uint16 lmnt_token; - uint16 lm20_token; - } nbt_netlogon_query_for_pdc; - - /* query for pdc request - new style */ - typedef struct { - uint16 request_count; - nstring computer_name; - nstring user_name; - astring mailslot_name; - uint32 unknown[2]; - uint32 nt_version; - uint16 lmnt_token; - uint16 lm20_token; - } nbt_netlogon_query_for_pdc2; + /****************************************** + * \MAILSLOT\NET\NETLOGON mailslot requests + * and + * \MAILSLOT\NET\NTLOGON mailslot requests + */ - /* response from pdc */ - typedef struct { - astring pdc_name; - [flag(NDR_ALIGN2)] DATA_BLOB _pad; - nstring unicode_pdc_name; - nstring domain_name; - uint32 nt_version; - uint16 lmnt_token; - uint16 lm20_token; - } nbt_netlogon_response_from_pdc; + typedef [public,gensize] struct { + uint32 sa_family; + [flag(NDR_BIG_ENDIAN)] ipv4address pdc_ip; + [flag(NDR_REMAINING)] DATA_BLOB remaining; + } nbt_sockaddr; - typedef [bitmap32bit] bitmap { + typedef [bitmap32bit,public] bitmap { NBT_SERVER_PDC = 0x00000001, NBT_SERVER_GC = 0x00000004, NBT_SERVER_LDAP = 0x00000008, @@ -395,108 +362,90 @@ interface nbt NBT_SERVER_GOOD_TIMESERV = 0x00000200 } nbt_server_type; - /* response from pdc - type2 */ - typedef struct { - [flag(NDR_ALIGN4)] DATA_BLOB _pad; - 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; - uint8 unknown; - uint32 unknown2; - [flag(NDR_BIG_ENDIAN)] - ipv4address pdc_ip; - uint32 unknown3[2]; - uint32 nt_version; + 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; - } nbt_netlogon_response_from_pdc2; - - typedef enum netr_SamDatabaseID netr_SamDatabaseID; - - /* announce change to UAS or SAM */ - typedef struct { - netr_SamDatabaseID db_index; - hyper serial; - NTTIME timestamp; - } nbt_db_change; - - /* used to announce SAM changes */ - 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 dbchange[db_count]; - [value(ndr_size_dom_sid(&sid, ndr->flags))] uint32 sid_size; - [flag(NDR_ALIGN4)] DATA_BLOB _pad2; - dom_sid sid; - uint32 nt_version; - uint16 lmnt_token; - uint16 lm20_token; - } nbt_netlogon_announce_uas; - - typedef [nodiscriminant] union { - [case(NETLOGON_QUERY_FOR_PDC)] nbt_netlogon_query_for_pdc pdc; - [case(NETLOGON_QUERY_FOR_PDC2)] nbt_netlogon_query_for_pdc2 pdc2; - [case(NETLOGON_ANNOUNCE_UAS)] nbt_netlogon_announce_uas uas; - [case(NETLOGON_RESPONSE_FROM_PDC)] nbt_netlogon_response_from_pdc response; - [case(NETLOGON_RESPONSE_FROM_PDC2)] nbt_netlogon_response_from_pdc2 response2; - [case(NETLOGON_RESPONSE_FROM_PDC_USER)] nbt_netlogon_response_from_pdc2 response2; - } nbt_netlogon_request; + } NETLOGON_SAM_LOGON_REQUEST; typedef [flag(NDR_NOALIGN),public] struct { - nbt_netlogon_command command; - [switch_is(command)] nbt_netlogon_request req; - } nbt_netlogon_packet; - - /*******************************************/ - /* CLDAP netlogon response */ - - /* note that these structures are very similar to, but not - quite identical to, the netlogon structures above */ - - typedef struct { - uint16 type; - nstring pdc_name; + netlogon_command command; + nstring server; nstring user_name; - nstring domain_name; - [value(1)] uint32 nt_version; + nstring domain; + netlogon_nt_version_flags nt_version; uint16 lmnt_token; - uint16 lm20_token; - } nbt_cldap_netlogon_1; + uint16 lm20_token; + } NETLOGON_SAM_LOGON_RESPONSE_NT40; - typedef struct { - uint16 type; + typedef [flag(NDR_NOALIGN),public] struct { + netlogon_command command; nstring pdc_name; nstring user_name; nstring domain_name; GUID domain_uuid; - GUID unknown_uuid; + GUID zero_uuid; nbt_string forest; nbt_string dns_domain; nbt_string pdc_dns_name; ipv4address pdc_ip; nbt_server_type server_type; - [value(3)] uint32 nt_version; + netlogon_nt_version_flags nt_version; uint16 lmnt_token; uint16 lm20_token; - } nbt_cldap_netlogon_3; + } NETLOGON_SAM_LOGON_RESPONSE; - typedef struct { - uint32 type; + /* 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; @@ -507,86 +456,91 @@ interface nbt nbt_string user_name; nbt_string server_site; nbt_string client_site; - [value(5)] uint32 nt_version; - uint16 lmnt_token; - uint16 lm20_token; - } nbt_cldap_netlogon_5; - typedef struct { - uint32 type; - 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; - uint8 unknown; - uint32 unknown2; - [flag(NDR_BIG_ENDIAN)] - ipv4address pdc_ip; - uint32 unknown3[2]; - [value(13)] uint32 nt_version; + /* 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; - } nbt_cldap_netlogon_13; - - typedef [flag(NDR_NOALIGN),public,nodiscriminant] union { - [case(0)] nbt_cldap_netlogon_1 logon1; - [case(1)] nbt_cldap_netlogon_1 logon1; - [case(2)] nbt_cldap_netlogon_3 logon3; - [case(3)] nbt_cldap_netlogon_3 logon3; - [case(4)] nbt_cldap_netlogon_5 logon5; - [case(5)] nbt_cldap_netlogon_5 logon5; - [case(6)] nbt_cldap_netlogon_5 logon5; - [case(7)] nbt_cldap_netlogon_5 logon5; - [default] nbt_cldap_netlogon_13 logon13; - } nbt_cldap_netlogon; - - /*******************************************/ - /* \MAILSLOT\NET\NTLOGON mailslot requests */ - typedef enum { - NTLOGON_SAM_LOGON = 0x12, - NTLOGON_SAM_LOGON_REPLY = 0x13, - NTLOGON_SAM_LOGON_REPLY15 = 0x15 - } nbt_ntlogon_command; + } NETLOGON_SAM_LOGON_RESPONSE_EX; + /* query for pdc request */ typedef struct { - uint16 request_count; - nstring computer_name; - nstring user_name; + astring computer_name; astring mailslot_name; - uint32 acct_control; - [value(ndr_size_dom_sid(&sid, ndr->flags))] uint32 sid_size; - [flag(NDR_ALIGN4)] DATA_BLOB _pad; - dom_sid sid; - uint32 nt_version; + [flag(NDR_ALIGN2)] DATA_BLOB _pad; + nstring unicode_name; + netlogon_nt_version_flags nt_version; uint16 lmnt_token; uint16 lm20_token; - } nbt_ntlogon_sam_logon; + } nbt_netlogon_query_for_pdc; - typedef struct { - nstring server; - nstring user_name; - nstring domain; - uint32 nt_version; + /* 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_ntlogon_sam_logon_reply; + } 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(NTLOGON_SAM_LOGON)] nbt_ntlogon_sam_logon logon; - [case(NTLOGON_SAM_LOGON_REPLY)] nbt_ntlogon_sam_logon_reply reply; - [case(NTLOGON_SAM_LOGON_REPLY15)] nbt_ntlogon_sam_logon_reply reply; - } nbt_ntlogon_request; + [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 { - nbt_ntlogon_command command; - [switch_is(command)] nbt_ntlogon_request req; - } nbt_ntlogon_packet; + netlogon_command command; + [switch_is(command)] nbt_netlogon_request req; + } nbt_netlogon_packet; /********************************************************/ /* \MAILSLOT\BROWSE mailslot requests */ diff --git a/source4/librpc/idl/policyagent.idl b/source4/librpc/idl/policyagent.idl index 295b70a2a1..ab137faf27 100644 --- a/source4/librpc/idl/policyagent.idl +++ b/source4/librpc/idl/policyagent.idl @@ -9,5 +9,5 @@ { /*****************/ /* Function 0x00 */ - WERROR policyagent_Dummy(); + [todo] WERROR policyagent_Dummy(); } diff --git a/source4/librpc/idl/security.idl b/source4/librpc/idl/security.idl index 753fad85cf..314846c53f 100644 --- a/source4/librpc/idl/security.idl +++ b/source4/librpc/idl/security.idl @@ -22,6 +22,9 @@ 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) ] diff --git a/source4/librpc/idl/xattr.idl b/source4/librpc/idl/xattr.idl index 7e73baee7d..2010d51ce1 100644 --- a/source4/librpc/idl/xattr.idl +++ b/source4/librpc/idl/xattr.idl @@ -31,8 +31,14 @@ interface xattr NTTIME change_time; } xattr_DosInfo1; - const int XATTR_ATTRIB_FLAG_STICKY_WRITE_TIME = 0x1; +/* + We use xattrDosInfo1 again when we store values. + Because the sticky write time is now stored in the opendb + and xattr_DosInfo2Old is only present to parse existing + values from disk. + const int XATTR_ATTRIB_FLAG_STICKY_WRITE_TIME = 0x1; +*/ typedef struct { uint32 flags; uint32 attrib; @@ -43,11 +49,11 @@ interface xattr NTTIME change_time; NTTIME write_time; /* only used when sticky write time is set */ utf8string name; - } xattr_DosInfo2; + } xattr_DosInfo2Old; typedef [switch_type(uint16)] union { [case(1)] xattr_DosInfo1 info1; - [case(2)] xattr_DosInfo2 info2; + [case(2)] xattr_DosInfo2Old oldinfo2; } xattr_DosInfo; typedef [public] struct { diff --git a/source4/librpc/ndr/libndr.h b/source4/librpc/ndr/libndr.h index 2439c386db..b719be2bab 100644 --- a/source4/librpc/ndr/libndr.h +++ b/source4/librpc/ndr/libndr.h @@ -336,6 +336,10 @@ enum ndr_err_code ndr_push_dom_sid28(struct ndr_push *ndr, int ndr_flags, const enum ndr_err_code ndr_pull_dom_sid28(struct ndr_pull *ndr, int ndr_flags, struct dom_sid *sid); 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); +enum ndr_err_code ndr_push_dom_sid0(struct ndr_push *ndr, int ndr_flags, const struct dom_sid *sid); +enum ndr_err_code ndr_pull_dom_sid0(struct ndr_pull *ndr, int ndr_flags, struct dom_sid *sid); +void ndr_print_dom_sid0(struct ndr_print *ndr, const char *name, const struct dom_sid *sid); +size_t ndr_size_dom_sid0(const struct dom_sid *sid, int flags); void ndr_print_ipv4_addr(struct ndr_print *ndr, const char *name, const struct in_addr *_ip); void ndr_print_GUID(struct ndr_print *ndr, const char *name, const struct GUID *guid); 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); diff --git a/source4/librpc/ndr/ndr_basic.c b/source4/librpc/ndr/ndr_basic.c index 93a177f94e..1d2b47c850 100644 --- a/source4/librpc/ndr/ndr_basic.c +++ b/source4/librpc/ndr/ndr_basic.c @@ -196,7 +196,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_hyper(struct ndr_pull *ndr, int ndr_flags, u */ _PUBLIC_ enum ndr_err_code ndr_pull_pointer(struct ndr_pull *ndr, int ndr_flags, void* *v) { - intptr_t h; + uintptr_t h; NDR_PULL_ALIGN(ndr, sizeof(h)); NDR_PULL_NEED_BYTES(ndr, sizeof(h)); memcpy(&h, ndr->data+ndr->offset, sizeof(h)); @@ -393,7 +393,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_hyper(struct ndr_push *ndr, int ndr_flags, u */ _PUBLIC_ enum ndr_err_code ndr_push_pointer(struct ndr_push *ndr, int ndr_flags, void* v) { - intptr_t h = (intptr_t)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)); diff --git a/source4/librpc/ndr/ndr_sec_helper.c b/source4/librpc/ndr/ndr_sec_helper.c index 5a0178bd25..1256d7dd2d 100644 --- a/source4/librpc/ndr/ndr_sec_helper.c +++ b/source4/librpc/ndr/ndr_sec_helper.c @@ -48,6 +48,11 @@ size_t ndr_size_dom_sid28(const struct dom_sid *sid, int flags) return 8 + 4*sid->num_auths; } +size_t ndr_size_dom_sid0(const struct dom_sid *sid, int flags) +{ + return ndr_size_dom_sid28(sid, flags); +} + /* return the wire size of a security_ace */ @@ -128,6 +133,11 @@ void ndr_print_dom_sid28(struct ndr_print *ndr, const char *name, const struct d ndr_print_dom_sid(ndr, name, sid); } +void ndr_print_dom_sid0(struct ndr_print *ndr, const char *name, const struct dom_sid *sid) +{ + ndr_print_dom_sid(ndr, name, sid); +} + /* parse a dom_sid2 - this is a dom_sid but with an extra copy of the num_auths field @@ -225,3 +235,44 @@ enum ndr_err_code ndr_push_dom_sid28(struct ndr_push *ndr, int ndr_flags, const return NDR_ERR_SUCCESS; } +/* + parse a dom_sid0 - this is a dom_sid in a variable byte buffer, which is maybe empty +*/ +enum ndr_err_code ndr_pull_dom_sid0(struct ndr_pull *ndr, int ndr_flags, struct dom_sid *sid) +{ + if (!(ndr_flags & NDR_SCALARS)) { + return NDR_ERR_SUCCESS; + } + + if (ndr->data_size == ndr->offset) { + ZERO_STRUCTP(sid); + return NDR_ERR_SUCCESS; + } + + return ndr_pull_dom_sid(ndr, ndr_flags, sid); +} + +/* + push a dom_sid0 - this is a dom_sid in a variable byte buffer, which is maybe empty +*/ +enum ndr_err_code ndr_push_dom_sid0(struct ndr_push *ndr, int ndr_flags, const struct dom_sid *sid) +{ + struct dom_sid zero_sid; + + if (!(ndr_flags & NDR_SCALARS)) { + return NDR_ERR_SUCCESS; + } + + if (!sid) { + return NDR_ERR_SUCCESS; + } + + ZERO_STRUCT(zero_sid); + + if (memcmp(&zero_sid, sid, sizeof(zero_sid)) == 0) { + return NDR_ERR_SUCCESS; + } + + return ndr_push_dom_sid(ndr, ndr_flags, sid); +} + diff --git a/source4/librpc/rpc/dcerpc.c b/source4/librpc/rpc/dcerpc.c index 5e32f6f5bf..4758189d3b 100644 --- a/source4/librpc/rpc/dcerpc.c +++ b/source4/librpc/rpc/dcerpc.c @@ -67,22 +67,15 @@ static struct dcerpc_connection *dcerpc_connection_init(TALLOC_CTX *mem_ctx, return NULL; } - if (ev == NULL) { - ev = event_context_init(c); - if (ev == NULL) { - talloc_free(c); - return NULL; - } - } - c->iconv_convenience = talloc_reference(c, ic); - c->event_ctx = ev; - - if (!talloc_reference(c, ev)) { + c->event_ctx = talloc_reference(c, ev); + + if (c->event_ctx == NULL) { talloc_free(c); return NULL; } + c->call_id = 1; c->security_state.auth_info = NULL; c->security_state.session_key = dcerpc_generic_session_key; diff --git a/source4/librpc/rpc/dcerpc.py b/source4/librpc/rpc/dcerpc.py index 7e4d82d7c4..db5b95cee8 100644 --- a/source4/librpc/rpc/dcerpc.py +++ b/source4/librpc/rpc/dcerpc.py @@ -1,5 +1,5 @@ # This file was automatically generated by SWIG (http://www.swig.org). -# Version 1.3.33 +# Version 1.3.35 # # Don't modify this file, modify the SWIG interface instead. @@ -57,8 +57,6 @@ def _swig_setattr_nondynamic_method(set): return set_attr -import credentials -import param pipe_connect = _dcerpc.pipe_connect dcerpc_server_name = _dcerpc.dcerpc_server_name diff --git a/source4/librpc/rpc/dcerpc_connect.c b/source4/librpc/rpc/dcerpc_connect.c index cc7f2ddbaa..a22cad9a4a 100644 --- a/source4/librpc/rpc/dcerpc_connect.c +++ b/source4/librpc/rpc/dcerpc_connect.c @@ -717,12 +717,6 @@ _PUBLIC_ struct composite_context* dcerpc_pipe_connect_b_send(TALLOC_CTX *parent struct pipe_connect_state *s; struct event_context *new_ev = NULL; - if (ev == NULL) { - new_ev = event_context_init(parent_ctx); - if (new_ev == NULL) return NULL; - ev = new_ev; - } - /* composite context allocation and setup */ c = composite_create(parent_ctx, ev); if (c == NULL) { @@ -844,21 +838,12 @@ _PUBLIC_ struct composite_context* dcerpc_pipe_connect_send(TALLOC_CTX *parent_c struct pipe_conn_state *s; struct dcerpc_binding *b; struct composite_context *pipe_conn_req; - struct event_context *new_ev = NULL; - - if (ev == NULL) { - new_ev = event_context_init(parent_ctx); - if (new_ev == NULL) return NULL; - ev = new_ev; - } /* composite context allocation and setup */ c = composite_create(parent_ctx, ev); if (c == NULL) { - talloc_free(new_ev); return NULL; } - talloc_steal(c, new_ev); s = talloc_zero(c, struct pipe_conn_state); if (composite_nomem(s, c)) return c; diff --git a/source4/librpc/rpc/dcerpc_smb2.c b/source4/librpc/rpc/dcerpc_smb2.c index 8adca4caba..4767165fba 100644 --- a/source4/librpc/rpc/dcerpc_smb2.c +++ b/source4/librpc/rpc/dcerpc_smb2.c @@ -83,7 +83,7 @@ static void smb2_read_callback(struct smb2_request *req) uint16_t frag_length; NTSTATUS status; - state = talloc_get_type(req->async.private, struct smb2_read_state); + state = talloc_get_type(req->async.private_data, struct smb2_read_state); smb = talloc_get_type(state->c->transport.private_data, struct smb2_private); status = smb2_read_recv(req, state, &io); @@ -136,7 +136,7 @@ static void smb2_read_callback(struct smb2_request *req) } req->async.fn = smb2_read_callback; - req->async.private = state; + req->async.private_data = state; } @@ -180,7 +180,7 @@ static NTSTATUS send_read_request_continue(struct dcerpc_connection *c, DATA_BLO } req->async.fn = smb2_read_callback; - req->async.private = state; + req->async.private_data = state; return NT_STATUS_OK; } @@ -212,7 +212,7 @@ struct smb2_trans_state { */ static void smb2_trans_callback(struct smb2_request *req) { - struct smb2_trans_state *state = talloc_get_type(req->async.private, + struct smb2_trans_state *state = talloc_get_type(req->async.private_data, struct smb2_trans_state); struct dcerpc_connection *c = state->c; NTSTATUS status; @@ -269,7 +269,7 @@ static NTSTATUS smb2_send_trans_request(struct dcerpc_connection *c, DATA_BLOB * } req->async.fn = smb2_trans_callback; - req->async.private = state; + req->async.private_data = state; talloc_steal(state, req); @@ -281,7 +281,7 @@ static NTSTATUS smb2_send_trans_request(struct dcerpc_connection *c, DATA_BLOB * */ static void smb2_write_callback(struct smb2_request *req) { - struct dcerpc_connection *c = (struct dcerpc_connection *)req->async.private; + struct dcerpc_connection *c = (struct dcerpc_connection *)req->async.private_data; if (!NT_STATUS_IS_OK(req->status)) { DEBUG(0,("dcerpc_smb2: write callback error\n")); @@ -319,7 +319,7 @@ static NTSTATUS smb2_send_request(struct dcerpc_connection *c, DATA_BLOB *blob, } req->async.fn = smb2_write_callback; - req->async.private = c; + req->async.private_data = c; return NT_STATUS_OK; } @@ -444,7 +444,7 @@ struct composite_context *dcerpc_pipe_open_smb2_send(struct dcerpc_pipe *p, static void pipe_open_recv(struct smb2_request *req) { struct pipe_open_smb2_state *state = - talloc_get_type(req->async.private, + talloc_get_type(req->async.private_data, struct pipe_open_smb2_state); struct composite_context *ctx = state->ctx; struct dcerpc_connection *c = state->c; diff --git a/source4/librpc/rpc/dcerpc_util.c b/source4/librpc/rpc/dcerpc_util.c index 469c83788c..71c6d5f2cc 100644 --- a/source4/librpc/rpc/dcerpc_util.c +++ b/source4/librpc/rpc/dcerpc_util.c @@ -209,32 +209,20 @@ struct composite_context *dcerpc_epm_map_binding_send(TALLOC_CTX *mem_ctx, 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; - } + return NULL; } /* 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; @@ -245,7 +233,6 @@ struct composite_context *dcerpc_epm_map_binding_send(TALLOC_CTX *mem_ctx, /* 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); /* diff --git a/source4/librpc/rpc/dcerpc_wrap.c b/source4/librpc/rpc/dcerpc_wrap.c index bae41c2c22..ff5cdbd390 100644 --- a/source4/librpc/rpc/dcerpc_wrap.c +++ b/source4/librpc/rpc/dcerpc_wrap.c @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 1.3.33 + * Version 1.3.35 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make @@ -126,7 +126,7 @@ /* This should only be incremented when either the layout of swig_type_info changes, or for whatever reason, the runtime changes incompatibly */ -#define SWIG_RUNTIME_VERSION "3" +#define SWIG_RUNTIME_VERSION "4" /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ #ifdef SWIG_TYPE_TABLE @@ -161,6 +161,7 @@ /* Flags for pointer conversions */ #define SWIG_POINTER_DISOWN 0x1 +#define SWIG_CAST_NEW_MEMORY 0x2 /* Flags for new pointer objects */ #define SWIG_POINTER_OWN 0x1 @@ -301,10 +302,10 @@ SWIGINTERNINLINE int SWIG_CheckState(int r) { extern "C" { #endif -typedef void *(*swig_converter_func)(void *); +typedef void *(*swig_converter_func)(void *, int *); typedef struct swig_type_info *(*swig_dycast_func)(void **); -/* Structure to store inforomation on one type */ +/* Structure to store information on one type */ typedef struct swig_type_info { const char *name; /* mangled name of this type */ const char *str; /* human readable name of this type */ @@ -431,8 +432,8 @@ SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) { Cast a pointer up an inheritance hierarchy */ SWIGRUNTIMEINLINE void * -SWIG_TypeCast(swig_cast_info *ty, void *ptr) { - return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr); +SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) { + return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory); } /* @@ -856,7 +857,7 @@ SWIG_Python_AddErrorMsg(const char* mesg) Py_DECREF(old_str); Py_DECREF(value); } else { - PyErr_Format(PyExc_RuntimeError, mesg); + PyErr_SetString(PyExc_RuntimeError, mesg); } } @@ -1416,7 +1417,7 @@ PySwigObject_dealloc(PyObject *v) { PySwigObject *sobj = (PySwigObject *) v; PyObject *next = sobj->next; - if (sobj->own) { + if (sobj->own == SWIG_POINTER_OWN) { swig_type_info *ty = sobj->ty; PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0; PyObject *destroy = data ? data->destroy : 0; @@ -1434,12 +1435,13 @@ PySwigObject_dealloc(PyObject *v) res = ((*meth)(mself, v)); } Py_XDECREF(res); - } else { - const char *name = SWIG_TypePrettyName(ty); + } #if !defined(SWIG_PYTHON_SILENT_MEMLEAK) - printf("swig/python detected a memory leak of type '%s', no destructor found.\n", name); -#endif + else { + const char *name = SWIG_TypePrettyName(ty); + printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown")); } +#endif } Py_XDECREF(next); PyObject_DEL(v); @@ -1944,7 +1946,7 @@ SWIG_Python_GetSwigThis(PyObject *pyobj) SWIGRUNTIME int SWIG_Python_AcquirePtr(PyObject *obj, int own) { - if (own) { + if (own == SWIG_POINTER_OWN) { PySwigObject *sobj = SWIG_Python_GetSwigThis(obj); if (sobj) { int oldown = sobj->own; @@ -1965,6 +1967,8 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int return SWIG_OK; } else { PySwigObject *sobj = SWIG_Python_GetSwigThis(obj); + if (own) + *own = 0; while (sobj) { void *vptr = sobj->ptr; if (ty) { @@ -1978,7 +1982,15 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int if (!tc) { sobj = (PySwigObject *)sobj->next; } else { - if (ptr) *ptr = SWIG_TypeCast(tc,vptr); + if (ptr) { + int newmemory = 0; + *ptr = SWIG_TypeCast(tc,vptr,&newmemory); + if (newmemory == SWIG_CAST_NEW_MEMORY) { + assert(own); + if (own) + *own = *own | SWIG_CAST_NEW_MEMORY; + } + } break; } } @@ -1988,7 +2000,8 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int } } if (sobj) { - if (own) *own = sobj->own; + if (own) + *own = *own | sobj->own; if (flags & SWIG_POINTER_DISOWN) { sobj->own = 0; } @@ -2053,8 +2066,13 @@ SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) { } if (ty) { swig_cast_info *tc = SWIG_TypeCheck(desc,ty); - if (!tc) return SWIG_ERROR; - *ptr = SWIG_TypeCast(tc,vptr); + if (tc) { + int newmemory = 0; + *ptr = SWIG_TypeCast(tc,vptr,&newmemory); + assert(!newmemory); /* newmemory handling not yet implemented */ + } else { + return SWIG_ERROR; + } } else { *ptr = vptr; } @@ -2510,7 +2528,7 @@ static swig_module_info swig_module = {swig_types, 21, 0, 0, 0, 0}; #define SWIG_name "_dcerpc" -#define SWIGVERSION 0x010333 +#define SWIGVERSION 0x010335 #define SWIG_VERSION SWIGVERSION @@ -2912,7 +2930,7 @@ SWIGRUNTIME void SWIG_InitializeModule(void *clientdata) { size_t i; swig_module_info *module_head, *iter; - int found; + int found, init; clientdata = clientdata; @@ -2922,6 +2940,9 @@ SWIG_InitializeModule(void *clientdata) { swig_module.type_initial = swig_type_initial; swig_module.cast_initial = swig_cast_initial; swig_module.next = &swig_module; + init = 1; + } else { + init = 0; } /* Try and load any already created modules */ @@ -2950,6 +2971,12 @@ SWIG_InitializeModule(void *clientdata) { module_head->next = &swig_module; } + /* When multiple interpeters are used, a module could have already been initialized in + a different interpreter, but not yet have a pointer in this interpreter. + In this case, we do not want to continue adding types... everything should be + set up already */ + if (init == 0) return; + /* Now work on filling in swig_module.types */ #ifdef SWIGRUNTIME_DEBUG printf("SWIG_InitializeModule: size %d\n", swig_module.size); diff --git a/source4/librpc/scripts/build_idl.sh b/source4/librpc/scripts/build_idl.sh new file mode 100755 index 0000000000..3f13b64a2e --- /dev/null +++ b/source4/librpc/scripts/build_idl.sh @@ -0,0 +1,38 @@ +#!/bin/sh + +FULLBUILD=$1 +IDLDIR=$2 +OUTDIR=$3 +shift 3 +PIDL_EXTRA_ARGS="$*" + +[ -d $OUTDIR ] || mkdir -p $OUTDIR || exit 1 + +PIDL="$PIDL --outputdir $OUTDIR --header --ndr-parser --server --client --swig --python $PIDL_EXTRA_ARGS" + +if [ x$FULLBUILD = xFULL ]; then + echo Rebuilding all idl files in $IDLDIR + $PIDL $IDLDIR/*.idl || exit 1 + exit 0 +fi + +list="" + +for f in $IDLDIR/*.idl ; do + basename=`basename $f .idl` + ndr="$OUTDIR/ndr_$basename.c" + # blergh - most shells don't have the -nt function + if [ -f $ndr ]; then + if [ x`find $f -newer $ndr -print` = x$f ]; then + list="$list $f" + fi + else + list="$list $f" + fi +done + +if [ "x$list" != x ]; then + $PIDL $list || exit 1 +fi + +exit 0 |