mirror of
https://github.com/samba-team/samba.git
synced 2024-12-24 21:34:56 +03:00
Enable dynamic loading of RPC modules. See docs/textdocs/RPC_PLUGGIN.txt for instructions.
This commit is contained in:
parent
41a86bb66b
commit
d51e12df78
@ -3,6 +3,7 @@
|
||||
# Copyright Andrew Tridgell 1992-1998
|
||||
# Copyright (C) 2001 by Martin Pool <mbp@samba.org>
|
||||
# Copyright Andrew Barteltt 2002
|
||||
# Copyright (C) 2003 Anthony Liguori <aliguor@us.ibm.com>
|
||||
###########################################################################
|
||||
|
||||
prefix=@prefix@
|
||||
@ -49,6 +50,7 @@ SBINDIR = @sbindir@
|
||||
LIBDIR = @libdir@
|
||||
VFSLIBDIR = $(LIBDIR)/vfs
|
||||
PDBLIBDIR = $(LIBDIR)/pdb
|
||||
RPCLIBDIR = $(LIBDIR)/rpc
|
||||
CONFIGDIR = @configdir@
|
||||
VARDIR = @localstatedir@
|
||||
MANDIR = @mandir@
|
||||
@ -97,7 +99,8 @@ PATH_FLAGS1 = -DCONFIGFILE=\"$(CONFIGFILE)\" -DSBINDIR=\"$(SBINDIR)\"
|
||||
PATH_FLAGS2 = $(PATH_FLAGS1) -DBINDIR=\"$(BINDIR)\" -DDRIVERFILE=\"$(DRIVERFILE)\"
|
||||
PATH_FLAGS3 = $(PATH_FLAGS2) -DLMHOSTSFILE=\"$(LMHOSTSFILE)\"
|
||||
PATH_FLAGS4 = $(PATH_FLAGS3) -DSWATDIR=\"$(SWATDIR)\" -DLOCKDIR=\"$(LOCKDIR)\" -DPIDDIR=\"$(PIDDIR)\"
|
||||
PATH_FLAGS5 = $(PATH_FLAGS4) -DLIBDIR=\"$(LIBDIR)\" -DLOGFILEBASE=\"$(LOGFILEBASE)\"
|
||||
PATH_FLAGS5 = $(PATH_FLAGS4) -DLIBDIR=\"$(LIBDIR)\" \
|
||||
-DLOGFILEBASE=\"$(LOGFILEBASE)\" -DSHLIBEXT=\"@SHLIBEXT@\"
|
||||
PATH_FLAGS6 = $(PATH_FLAGS5) -DCONFIGDIR=\"$(CONFIGDIR)\"
|
||||
PATH_FLAGS = $(PATH_FLAGS6) $(PASSWD_FLAGS)
|
||||
|
||||
@ -201,20 +204,72 @@ LIBMSRPC_OBJ = rpc_client/cli_lsarpc.o rpc_client/cli_samr.o \
|
||||
|
||||
LIBMSRPC_SERVER_OBJ = libsmb/trust_passwd.o
|
||||
|
||||
LIBMSRPC_PICOBJ = $(LIBMSRPC_OBJ:.o=.po)
|
||||
|
||||
REGOBJS_OBJ = registry/reg_objects.o
|
||||
REGISTRY_OBJ = registry/reg_frontend.o registry/reg_cachehook.o registry/reg_printing.o \
|
||||
registry/reg_db.o
|
||||
|
||||
RPC_SERVER_OBJ = rpc_server/srv_lsa.o rpc_server/srv_lsa_nt.o \
|
||||
rpc_server/srv_lsa_hnd.o rpc_server/srv_netlog.o rpc_server/srv_netlog_nt.o \
|
||||
rpc_server/srv_pipe_hnd.o rpc_server/srv_reg.o rpc_server/srv_reg_nt.o \
|
||||
rpc_server/srv_samr.o rpc_server/srv_samr_nt.o rpc_server/srv_samr_util.o \
|
||||
rpc_server/srv_srvsvc.o rpc_server/srv_srvsvc_nt.o \
|
||||
rpc_server/srv_util.o rpc_server/srv_wkssvc.o rpc_server/srv_wkssvc_nt.o \
|
||||
rpc_server/srv_pipe.o rpc_server/srv_dfs.o rpc_server/srv_dfs_nt.o \
|
||||
rpc_server/srv_spoolss.o rpc_server/srv_spoolss_nt.o
|
||||
RPC_LSA_OBJ = rpc_server/srv_lsa.o rpc_server/srv_lsa_nt.o
|
||||
|
||||
RPC_NETLOG_OBJ = rpc_server/srv_netlog.o rpc_server/srv_netlog_nt.o
|
||||
|
||||
RPC_SAMR_OBJ = rpc_server/srv_samr.o rpc_server/srv_samr_nt.o \
|
||||
rpc_server/srv_samr_util.o
|
||||
|
||||
RPC_REG_OBJ = rpc_server/srv_reg.o rpc_server/srv_reg_nt.o
|
||||
|
||||
RPC_SVC_OBJ = rpc_server/srv_srvsvc.o rpc_server/srv_srvsvc_nt.o
|
||||
|
||||
RPC_WKS_OBJ = rpc_server/srv_wkssvc.o rpc_server/srv_wkssvc_nt.o
|
||||
|
||||
RPC_DFS_OBJ = rpc_server/srv_dfs.o rpc_server/srv_dfs_nt.o
|
||||
RPC_SPOOLSS_OBJ = rpc_server/srv_spoolss.o rpc_server/srv_spoolss_nt.o
|
||||
|
||||
RPC_PIPE_OBJ = rpc_server/srv_pipe_hnd.o rpc_server/srv_util.o \
|
||||
rpc_server/srv_pipe.o rpc_server/srv_lsa_hnd.o
|
||||
|
||||
RPC_SERVER_OBJ = $(RPC_PIPE_OBJ)
|
||||
|
||||
ifeq (@LSA_DYNAMIC@,yes)
|
||||
RPC_MODULES := $(RPC_MODULES) bin/librpc_lsarpc.@SHLIBEXT@
|
||||
else
|
||||
RPC_SERVER_OBJ := $(RPC_SERVER_OBJ) $(RPC_LSA_OBJ)
|
||||
endif
|
||||
ifeq (@NETLOG_DYNAMIC@,yes)
|
||||
RPC_MODULES := $(RPC_MODULES) bin/librpc_NETLOGON.@SHLIBEXT@
|
||||
else
|
||||
RPC_SERVER_OBJ := $(RPC_SERVER_OBJ) $(RPC_NETLOG_OBJ)
|
||||
endif
|
||||
ifeq (@SAMR_DYNAMIC@,yes)
|
||||
RPC_MODULES := $(RPC_MODULES) bin/librpc_samr.@SHLIBEXT@
|
||||
else
|
||||
RPC_SERVER_OBJ := $(RPC_SERVER_OBJ) $(RPC_SAMR_OBJ)
|
||||
endif
|
||||
ifeq (@SVC_DYNAMIC@,yes)
|
||||
RPC_MODULES := $(RPC_MODULES) bin/librpc_srvsvc.@SHLIBEXT@
|
||||
else
|
||||
RPC_SERVER_OBJ := $(RPC_SERVER_OBJ) $(RPC_SVC_OBJ)
|
||||
endif
|
||||
ifeq (@WKS_DYNAMIC@,yes)
|
||||
RPC_MODULES := $(RPC_MODULES) bin/librpc_wkssvc.@SHLIBEXT@
|
||||
else
|
||||
RPC_SERVER_OBJ := $(RPC_SERVER_OBJ) $(RPC_WKS_OBJ)
|
||||
endif
|
||||
ifeq (@REG_DYNAMIC@,yes)
|
||||
RPC_MODULES := $(RPC_MODULES) bin/librpc_winreg.@SHLIBEXT@
|
||||
else
|
||||
RPC_SERVER_OBJ := $(RPC_SERVER_OBJ) $(RPC_REG_OBJ)
|
||||
endif
|
||||
ifeq (@SPOOLSS_DYNAMIC@,yes)
|
||||
RPC_MODULES := $(RPC_MODULES) bin/librpc_spoolss.@SHLIBEXT@
|
||||
else
|
||||
RPC_SERVER_OBJ := $(RPC_SERVER_OBJ) $(RPC_SPOOLSS_OBJ)
|
||||
endif
|
||||
ifeq (@DFS_DYNAMIC@,yes)
|
||||
RPC_MODULES := $(RPC_MODULES) bin/librpc_netdfs.@SHLIBEXT@
|
||||
else
|
||||
RPC_SERVER_OBJ := $(RPC_SERVER_OBJ) $(RPC_DFS_OBJ)
|
||||
endif
|
||||
|
||||
|
||||
# this includes only the low level parse code, not stuff
|
||||
# that requires knowledge of security contexts
|
||||
@ -494,12 +549,14 @@ PROTO_OBJ = $(SMBD_OBJ_MAIN) \
|
||||
$(SMBD_OBJ_SRV) $(NMBD_OBJ1) $(SWAT_OBJ1) $(LIB_OBJ) $(LIBSMB_OBJ) \
|
||||
$(SMBW_OBJ1) $(SMBWRAPPER_OBJ1) $(SMBTORTURE_OBJ1) $(RPCCLIENT_OBJ1) \
|
||||
$(LIBMSRPC_OBJ) $(LIBMSRPC_SERVER_OBJ) $(RPC_CLIENT_OBJ) \
|
||||
$(RPC_SERVER_OBJ) $(RPC_PARSE_OBJ) \
|
||||
$(RPC_PIPE_OBJ) $(RPC_PARSE_OBJ) \
|
||||
$(AUTH_OBJ) $(PARAM_OBJ) $(LOCKING_OBJ) $(SECRETS_OBJ) \
|
||||
$(PRINTING_OBJ) $(PRINTBACKEND_OBJ) $(OPLOCK_OBJ) $(NOTIFY_OBJ) \
|
||||
$(QUOTAOBJS) $(PASSDB_OBJ) $(GROUPDB_OBJ) $(MSDFS_OBJ) \
|
||||
$(READLINE_OBJ) $(PROFILE_OBJ) $(LIBADS_OBJ) $(LIBADS_SERVER_OBJ) \
|
||||
$(LIB_SMBD_OBJ) $(SAM_OBJ) $(REGISTRY_OBJ) $(POPT_LIB_OBJ)
|
||||
$(LIB_SMBD_OBJ) $(SAM_OBJ) $(REGISTRY_OBJ) $(POPT_LIB_OBJ) \
|
||||
$(RPC_LSA_OBJ) $(RPC_NETLOG_OBJ) $(RPC_SAMR_OBJ) $(RPC_REG_OBJ) \
|
||||
$(RPC_SVC_OBJ) $(RPC_WKS_OBJ) $(RPC_DFS_OBJ) $(RPC_SPOOLSS_OBJ)
|
||||
|
||||
NSS_OBJ_0 = nsswitch/wins.o $(PARAM_OBJ) $(UBIQX_OBJ) $(LIBSMB_OBJ) \
|
||||
$(LIB_OBJ) $(NSSWINS_OBJ)
|
||||
@ -590,8 +647,8 @@ nsswitch : SHOWFLAGS bin/winbindd@EXEEXT@ bin/wbinfo@EXEEXT@ nsswitch/libnss_win
|
||||
|
||||
wins : SHOWFLAGS nsswitch/libnss_wins.@SHLIBEXT@
|
||||
|
||||
modules: SHOWFLAGS proto_exists $(VFS_MODULES) $(PDB_MODULES) $(MODULES)
|
||||
|
||||
modules: SHOWFLAGS proto_exists $(VFS_MODULES) $(PDB_MODULES) $(MODULES) \
|
||||
$(RPC_MODULES)
|
||||
everything: all libsmbclient debug2html smbfilter talloctort
|
||||
|
||||
.SUFFIXES:
|
||||
@ -837,6 +894,46 @@ bin/libbigballofmud.@SHLIBEXT@: $(LIBBIGBALLOFMUD_PICOBJS)
|
||||
|
||||
libsmbclient: bin/libsmbclient.a bin/libsmbclient.@SHLIBEXT@
|
||||
|
||||
bin/librpc_lsarpc.@SHLIBEXT@: $(RPC_LSA_OBJ)
|
||||
@echo "Linking $@"
|
||||
@$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_LSA_OBJ) -lc \
|
||||
@SONAMEFLAG@`basename $@`
|
||||
|
||||
bin/librpc_samr.@SHLIBEXT@: $(RPC_SAMR_OBJ)
|
||||
@echo "Linking $@"
|
||||
@$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_SAMR_OBJ) -lc \
|
||||
@SONAMEFLAG@`basename $@`
|
||||
|
||||
bin/librpc_srvsvc.@SHLIBEXT@: $(RPC_SVC_OBJ)
|
||||
@echo "Linking $@"
|
||||
@$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_SVC_OBJ) -lc \
|
||||
@SONAMEFLAG@`basename $@`
|
||||
|
||||
bin/librpc_wkssvc.@SHLIBEXT@: $(RPC_WKS_OBJ)
|
||||
@echo "Linking $@"
|
||||
@$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_WKS_OBJ) -lc \
|
||||
@SONAMEFLAG@`basename $@`
|
||||
|
||||
bin/librpc_NETLOGON.@SHLIBEXT@: $(RPC_NETLOG_OBJ)
|
||||
@echo "Linking $@"
|
||||
@$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_NETLOG_OBJ) -lc \
|
||||
@SONAMEFLAG@`basename $@`
|
||||
|
||||
bin/librpc_winreg.@SHLIBEXT@: $(RPC_REG_OBJ)
|
||||
@echo "Linking $@"
|
||||
@$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_REG_OBJ) -lc \
|
||||
@SONAMEFLAG@`basename $@`
|
||||
|
||||
bin/librpc_spoolss.@SHLIBEXT@: $(RPC_SPOOLSS_OBJ)
|
||||
@echo "Linking $@"
|
||||
@$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_SPOOLSS_OBJ) -lc \
|
||||
@SONAMEFLAG@`basename $@`
|
||||
|
||||
bin/librpc_netdfs.@SHLIBEXT@: $(RPC_DFS_OBJ)
|
||||
@echo "Linking $@"
|
||||
@$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_DFS_OBJ) -lc \
|
||||
@SONAMEFLAG@`basename $@`
|
||||
|
||||
nsswitch/libnss_wins.@SHLIBEXT@: $(NSS_OBJ)
|
||||
@echo "Linking $@"
|
||||
@$(SHLD) $(LDSHFLAGS) -o $@ $(NSS_OBJ) -lc \
|
||||
@ -942,6 +1039,7 @@ installbin: all installdirs
|
||||
installmodules: all installdirs
|
||||
@$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(VFSLIBDIR) $(VFS_MODULES)
|
||||
@$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(PDBLIBDIR) $(PDB_MODULES)
|
||||
@$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(RPCLIBDIR) $(RPC_MODULES)
|
||||
|
||||
installscripts: installdirs
|
||||
@$(SHELL) $(srcdir)/script/installscripts.sh $(INSTALLPERMS) $(DESTDIR)$(BINDIR) $(SCRIPTS)
|
||||
|
27573
source/configure
vendored
27573
source/configure
vendored
File diff suppressed because it is too large
Load Diff
@ -149,6 +149,14 @@ AC_SUBST(SMBWRAPPER)
|
||||
AC_SUBST(EXTRA_BIN_PROGS)
|
||||
AC_SUBST(EXTRA_SBIN_PROGS)
|
||||
AC_SUBST(EXTRA_ALL_TARGETS)
|
||||
AC_SUBST(LSA_DYNAMIC)
|
||||
AC_SUBST(NETLOG_DYNAMIC)
|
||||
AC_SUBST(SAMR_DYNAMIC)
|
||||
AC_SUBST(SVC_DYNAMIC)
|
||||
AC_SUBST(WKS_DYNAMIC)
|
||||
AC_SUBST(REG_DYNAMIC)
|
||||
AC_SUBST(SPOOLSS_DYNAMIC)
|
||||
AC_SUBST(DFS_DYNAMIC)
|
||||
|
||||
# compile with optimization and without debugging by default
|
||||
CFLAGS="-O ${CFLAGS}"
|
||||
@ -179,6 +187,52 @@ then
|
||||
LIBS="$LIBS -ldmalloc"
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(dynrpc, [ --enable-dynrpc Enable dynamic RPC modules [default=no]])
|
||||
|
||||
if test x$enable_dynrpc = xyes
|
||||
then
|
||||
enable_dynrpc=lsa,samr,reg,wks,netlog,dfs
|
||||
fi
|
||||
|
||||
if test x$enable_dynrpc != xno
|
||||
then
|
||||
for i in `echo $enable_dynrpc | sed -e's/,/ /g'`
|
||||
do case $i in lsa)
|
||||
LSA_DYNAMIC=yes
|
||||
AC_DEFINE(RPC_LSA_DYNAMIC, 1,
|
||||
[Define to make the LSA pipe dynamic])
|
||||
;; samr)
|
||||
SAMR_DYNAMIC=yes
|
||||
AC_DEFINE(RPC_SAMR_DYNAMIC, 1,
|
||||
[Define to make the SAMR pipe dynamic])
|
||||
;; svc)
|
||||
SVC_DYNAMIC=yes
|
||||
AC_DEFINE(RPC_SVC_DYNAMIC, 1,
|
||||
[Define to make the SRVSVC pipe dynamic])
|
||||
;; wks)
|
||||
WKS_DYNAMIC=yes
|
||||
AC_DEFINE(RPC_WKS_DYNAMIC, 1,
|
||||
[Define to make the WKSSVC pipe dynamic])
|
||||
;; netlog)
|
||||
NETLOG_DYNAMIC=yes
|
||||
AC_DEFINE(RPC_NETLOG_DYNAMIC, 1,
|
||||
[Define to make the NETLOGON pipe dynamic])
|
||||
;; reg)
|
||||
REG_DYNAMIC=yes
|
||||
AC_DEFINE(RPC_REG_DYNAMIC, 1,
|
||||
[Define to make the WINREG pipe dynamic])
|
||||
;; spoolss)
|
||||
SPOOLSS_DYNAMIC=yes
|
||||
AC_DEFINE(RPC_SPOOLSS_DYNAMIC, 1,
|
||||
[Define to make the SPOOLSS pipe dynamic])
|
||||
;; dfs)
|
||||
DFS_DYNAMIC=yes
|
||||
AC_DEFINE(RPC_DFS_DYNAMIC, 1,
|
||||
[Define to make the NETDFS pipe dynamic])
|
||||
;; esac
|
||||
done
|
||||
fi
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_PROG_CC
|
||||
AC_PROG_INSTALL
|
||||
@ -1026,7 +1080,6 @@ if test $ac_cv_shlib_works = no; then
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# this updates our target list if we can build shared libs
|
||||
if test $BLDSHARED = true; then
|
||||
LIBSMBCLIENT_SHARED=bin/libsmbclient.$SHLIBEXT
|
||||
|
@ -1,6 +1,7 @@
|
||||
/*
|
||||
Unix SMB/CIFS implementation.
|
||||
Copyright (C) 2001 by Martin Pool <mbp@samba.org>
|
||||
Copyright (C) 2003 by Anthony Liguori <aliguor@us.ibm.com>
|
||||
|
||||
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
|
||||
@ -56,7 +57,8 @@ pstring dyn_LMHOSTSFILE = LMHOSTSFILE;
|
||||
*
|
||||
* @sa lib_path() to get the path to a file inside the LIBDIR.
|
||||
**/
|
||||
pstring dyn_LIBDIR = LIBDIR;
|
||||
pstring dyn_LIBDIR = LIBDIR;
|
||||
const fstring dyn_SHLIBEXT = SHLIBEXT;
|
||||
|
||||
/**
|
||||
* @brief Directory holding lock files.
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,7 @@
|
||||
/*
|
||||
Unix SMB/CIFS implementation.
|
||||
Copyright (C) 2001 by Martin Pool <mbp@samba.org>
|
||||
Copyright (C) 2003 by Anthony Liguori <aliguor@us.ibm.com>
|
||||
|
||||
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
|
||||
@ -30,6 +31,7 @@ extern char const *dyn_SBINDIR,
|
||||
extern pstring dyn_CONFIGFILE;
|
||||
extern pstring dyn_LOGFILEBASE, dyn_LMHOSTSFILE;
|
||||
extern pstring dyn_LIBDIR;
|
||||
extern const fstring dyn_SHLIBEXT;
|
||||
extern const pstring dyn_LOCKDIR;
|
||||
extern const pstring dyn_PIDDIR;
|
||||
extern const pstring dyn_SMB_PASSWD_FILE;
|
||||
|
@ -4,6 +4,7 @@
|
||||
Copyright (C) Andrew Tridgell 1992-1998
|
||||
Copyright (C) Jeremy Allison 2001-2002
|
||||
Copyright (C) Simo Sorce 2001
|
||||
Copyright (C) Anthony Liguori 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
|
||||
@ -2190,6 +2191,17 @@ char *lib_path(const char *name)
|
||||
return fname;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns the platform specific shared library extension.
|
||||
*
|
||||
* @retval Pointer to a static #fstring containing the extension.
|
||||
**/
|
||||
|
||||
const char *shlib_ext(void)
|
||||
{
|
||||
return dyn_SHLIBEXT;
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
Given a filename - get its directory name
|
||||
NB: Returned in static storage. Caveats:
|
||||
|
@ -3,8 +3,9 @@
|
||||
* RPC Pipe client / server routines for Dfs
|
||||
* Copyright (C) Andrew Tridgell 1992-1997,
|
||||
* Copyright (C) Luke Kenneth Casson Leighton 1996-1997,
|
||||
* Copyright (C) Shirish Kalele 2000.
|
||||
* Copyright (C) Jeremy Allison 2001.
|
||||
* Copyright (C) Shirish Kalele 2000,
|
||||
* Copyright (C) Jeremy Allison 2001,
|
||||
* Copyright (C) Anthony Liguori 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
|
||||
@ -157,21 +158,20 @@ static BOOL api_dfs_enum(pipes_struct *p)
|
||||
\pipe\netdfs commands
|
||||
********************************************************************/
|
||||
|
||||
struct api_struct api_netdfs_cmds[] =
|
||||
#ifdef RPC_DFS_DYNAMIC
|
||||
int rpc_pipe_init(void)
|
||||
#else
|
||||
int rpc_dfs_init(void)
|
||||
#endif
|
||||
{
|
||||
{"DFS_EXIST", DFS_EXIST, api_dfs_exist },
|
||||
{"DFS_ADD", DFS_ADD, api_dfs_add },
|
||||
{"DFS_REMOVE", DFS_REMOVE, api_dfs_remove },
|
||||
{"DFS_GET_INFO", DFS_GET_INFO, api_dfs_get_info },
|
||||
{"DFS_ENUM", DFS_ENUM, api_dfs_enum },
|
||||
{NULL, 0, NULL }
|
||||
};
|
||||
|
||||
/*******************************************************************
|
||||
receives a netdfs pipe and responds.
|
||||
********************************************************************/
|
||||
|
||||
BOOL api_netdfs_rpc(pipes_struct *p)
|
||||
{
|
||||
return api_rpcTNP(p, "api_netdfs_rpc", api_netdfs_cmds);
|
||||
struct api_struct api_netdfs_cmds[] =
|
||||
{
|
||||
{"DFS_EXIST", DFS_EXIST, api_dfs_exist },
|
||||
{"DFS_ADD", DFS_ADD, api_dfs_add },
|
||||
{"DFS_REMOVE", DFS_REMOVE, api_dfs_remove },
|
||||
{"DFS_GET_INFO", DFS_GET_INFO, api_dfs_get_info },
|
||||
{"DFS_ENUM", DFS_ENUM, api_dfs_enum }
|
||||
};
|
||||
return rpc_pipe_register_commands("netdfs", "netdfs", api_netdfs_cmds,
|
||||
sizeof(api_netdfs_cmds) / sizeof(struct api_struct));
|
||||
}
|
||||
|
@ -5,7 +5,8 @@
|
||||
* Copyright (C) Luke Kenneth Casson Leighton 1996-1997,
|
||||
* Copyright (C) Paul Ashton 1997,
|
||||
* Copyright (C) Jeremy Allison 2001,
|
||||
* Copyright (C) Jim McDonough 2002.
|
||||
* Copyright (C) Jim McDonough 2002,
|
||||
* Copyright (C) Anthony Liguori 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
|
||||
@ -645,35 +646,36 @@ static BOOL api_lsa_query_info2(pipes_struct *p)
|
||||
\PIPE\ntlsa commands
|
||||
***************************************************************************/
|
||||
|
||||
static const struct api_struct api_lsa_cmds[] =
|
||||
#ifdef RPC_LSA_DYNAMIC
|
||||
int rpc_pipe_init(void)
|
||||
#else
|
||||
int rpc_lsa_init(void)
|
||||
#endif
|
||||
{
|
||||
{ "LSA_OPENPOLICY2" , LSA_OPENPOLICY2 , api_lsa_open_policy2 },
|
||||
{ "LSA_OPENPOLICY" , LSA_OPENPOLICY , api_lsa_open_policy },
|
||||
{ "LSA_QUERYINFOPOLICY" , LSA_QUERYINFOPOLICY , api_lsa_query_info },
|
||||
{ "LSA_ENUMTRUSTDOM" , LSA_ENUMTRUSTDOM , api_lsa_enum_trust_dom },
|
||||
{ "LSA_CLOSE" , LSA_CLOSE , api_lsa_close },
|
||||
{ "LSA_OPENSECRET" , LSA_OPENSECRET , api_lsa_open_secret },
|
||||
{ "LSA_LOOKUPSIDS" , LSA_LOOKUPSIDS , api_lsa_lookup_sids },
|
||||
{ "LSA_LOOKUPNAMES" , LSA_LOOKUPNAMES , api_lsa_lookup_names },
|
||||
{ "LSA_ENUM_PRIVS" , LSA_ENUM_PRIVS , api_lsa_enum_privs },
|
||||
{ "LSA_PRIV_GET_DISPNAME",LSA_PRIV_GET_DISPNAME,api_lsa_priv_get_dispname},
|
||||
{ "LSA_ENUM_ACCOUNTS" , LSA_ENUM_ACCOUNTS , api_lsa_enum_accounts },
|
||||
{ "LSA_UNK_GET_CONNUSER", LSA_UNK_GET_CONNUSER, api_lsa_unk_get_connuser },
|
||||
{ "LSA_OPENACCOUNT" , LSA_OPENACCOUNT , api_lsa_open_account },
|
||||
{ "LSA_ENUMPRIVSACCOUNT", LSA_ENUMPRIVSACCOUNT, api_lsa_enum_privsaccount},
|
||||
{ "LSA_GETSYSTEMACCOUNT", LSA_GETSYSTEMACCOUNT, api_lsa_getsystemaccount },
|
||||
{ "LSA_SETSYSTEMACCOUNT", LSA_SETSYSTEMACCOUNT, api_lsa_setsystemaccount },
|
||||
{ "LSA_ADDPRIVS" , LSA_ADDPRIVS , api_lsa_addprivs },
|
||||
{ "LSA_REMOVEPRIVS" , LSA_REMOVEPRIVS , api_lsa_removeprivs },
|
||||
{ "LSA_QUERYSECOBJ" , LSA_QUERYSECOBJ , api_lsa_query_secobj },
|
||||
{ "LSA_QUERYINFO2" , LSA_QUERYINFO2 , api_lsa_query_info2 },
|
||||
{ NULL , 0 , NULL }
|
||||
};
|
||||
static const struct api_struct api_lsa_cmds[] =
|
||||
{
|
||||
{ "LSA_OPENPOLICY2" , LSA_OPENPOLICY2 , api_lsa_open_policy2 },
|
||||
{ "LSA_OPENPOLICY" , LSA_OPENPOLICY , api_lsa_open_policy },
|
||||
{ "LSA_QUERYINFOPOLICY" , LSA_QUERYINFOPOLICY , api_lsa_query_info },
|
||||
{ "LSA_ENUMTRUSTDOM" , LSA_ENUMTRUSTDOM , api_lsa_enum_trust_dom },
|
||||
{ "LSA_CLOSE" , LSA_CLOSE , api_lsa_close },
|
||||
{ "LSA_OPENSECRET" , LSA_OPENSECRET , api_lsa_open_secret },
|
||||
{ "LSA_LOOKUPSIDS" , LSA_LOOKUPSIDS , api_lsa_lookup_sids },
|
||||
{ "LSA_LOOKUPNAMES" , LSA_LOOKUPNAMES , api_lsa_lookup_names },
|
||||
{ "LSA_ENUM_PRIVS" , LSA_ENUM_PRIVS , api_lsa_enum_privs },
|
||||
{ "LSA_PRIV_GET_DISPNAME",LSA_PRIV_GET_DISPNAME,api_lsa_priv_get_dispname},
|
||||
{ "LSA_ENUM_ACCOUNTS" , LSA_ENUM_ACCOUNTS , api_lsa_enum_accounts },
|
||||
{ "LSA_UNK_GET_CONNUSER", LSA_UNK_GET_CONNUSER, api_lsa_unk_get_connuser },
|
||||
{ "LSA_OPENACCOUNT" , LSA_OPENACCOUNT , api_lsa_open_account },
|
||||
{ "LSA_ENUMPRIVSACCOUNT", LSA_ENUMPRIVSACCOUNT, api_lsa_enum_privsaccount},
|
||||
{ "LSA_GETSYSTEMACCOUNT", LSA_GETSYSTEMACCOUNT, api_lsa_getsystemaccount },
|
||||
{ "LSA_SETSYSTEMACCOUNT", LSA_SETSYSTEMACCOUNT, api_lsa_setsystemaccount },
|
||||
{ "LSA_ADDPRIVS" , LSA_ADDPRIVS , api_lsa_addprivs },
|
||||
{ "LSA_REMOVEPRIVS" , LSA_REMOVEPRIVS , api_lsa_removeprivs },
|
||||
{ "LSA_QUERYSECOBJ" , LSA_QUERYSECOBJ , api_lsa_query_secobj },
|
||||
{ "LSA_QUERYINFO2" , LSA_QUERYINFO2 , api_lsa_query_info2 }
|
||||
};
|
||||
|
||||
/***************************************************************************
|
||||
api_ntLsarpcTNP
|
||||
***************************************************************************/
|
||||
BOOL api_ntlsa_rpc(pipes_struct *p)
|
||||
{
|
||||
return api_rpcTNP(p, "api_ntlsa_rpc", api_lsa_cmds);
|
||||
return rpc_pipe_register_commands("lsarpc", "lsass", api_lsa_cmds,
|
||||
sizeof(api_lsa_cmds) / sizeof(struct api_struct));
|
||||
}
|
||||
|
@ -3,8 +3,9 @@
|
||||
* RPC Pipe client / server routines
|
||||
* Copyright (C) Andrew Tridgell 1992-1997,
|
||||
* Copyright (C) Luke Kenneth Casson Leighton 1996-1997,
|
||||
* Copyright (C) Paul Ashton 1997.
|
||||
* Copyright (C) Jeremy Allison 1998-2001.
|
||||
* Copyright (C) Paul Ashton 1997,
|
||||
* Copyright (C) Jeremy Allison 1998-2001,
|
||||
* Copyright (C) Anthony Liguori 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
|
||||
@ -319,25 +320,26 @@ static BOOL api_net_logon_ctrl(pipes_struct *p)
|
||||
/*******************************************************************
|
||||
array of \PIPE\NETLOGON operations
|
||||
********************************************************************/
|
||||
static struct api_struct api_net_cmds [] =
|
||||
{
|
||||
{ "NET_REQCHAL" , NET_REQCHAL , api_net_req_chal },
|
||||
{ "NET_AUTH" , NET_AUTH , api_net_auth },
|
||||
{ "NET_AUTH2" , NET_AUTH2 , api_net_auth_2 },
|
||||
{ "NET_SRVPWSET" , NET_SRVPWSET , api_net_srv_pwset },
|
||||
{ "NET_SAMLOGON" , NET_SAMLOGON , api_net_sam_logon },
|
||||
{ "NET_SAMLOGOFF" , NET_SAMLOGOFF , api_net_sam_logoff },
|
||||
{ "NET_LOGON_CTRL2" , NET_LOGON_CTRL2 , api_net_logon_ctrl2 },
|
||||
{ "NET_TRUST_DOM_LIST", NET_TRUST_DOM_LIST, api_net_trust_dom_list },
|
||||
{ "NET_LOGON_CTRL" , NET_LOGON_CTRL , api_net_logon_ctrl },
|
||||
{ NULL , 0 , NULL }
|
||||
};
|
||||
|
||||
/*******************************************************************
|
||||
receives a netlogon pipe and responds.
|
||||
********************************************************************/
|
||||
|
||||
BOOL api_netlog_rpc(pipes_struct *p)
|
||||
#ifdef RPC_NETLOG_DYNAMIC
|
||||
int rpc_pipe_init(void)
|
||||
#else
|
||||
int rpc_net_init(void)
|
||||
#endif
|
||||
{
|
||||
return api_rpcTNP(p, "api_netlog_rpc", api_net_cmds);
|
||||
static struct api_struct api_net_cmds [] =
|
||||
{
|
||||
{ "NET_REQCHAL" , NET_REQCHAL , api_net_req_chal },
|
||||
{ "NET_AUTH" , NET_AUTH , api_net_auth },
|
||||
{ "NET_AUTH2" , NET_AUTH2 , api_net_auth_2 },
|
||||
{ "NET_SRVPWSET" , NET_SRVPWSET , api_net_srv_pwset },
|
||||
{ "NET_SAMLOGON" , NET_SAMLOGON , api_net_sam_logon },
|
||||
{ "NET_SAMLOGOFF" , NET_SAMLOGOFF , api_net_sam_logoff },
|
||||
{ "NET_LOGON_CTRL2" , NET_LOGON_CTRL2 , api_net_logon_ctrl2 },
|
||||
{ "NET_TRUST_DOM_LIST", NET_TRUST_DOM_LIST, api_net_trust_dom_list },
|
||||
{ "NET_LOGON_CTRL" , NET_LOGON_CTRL , api_net_logon_ctrl }
|
||||
};
|
||||
|
||||
return rpc_pipe_register_commands("NETLOGON", "lsass", api_net_cmds,
|
||||
sizeof(api_net_cmds) / sizeof(struct api_struct));
|
||||
}
|
||||
|
@ -3,8 +3,9 @@
|
||||
* RPC Pipe client / server routines
|
||||
* Copyright (C) Andrew Tridgell 1992-1998
|
||||
* Copyright (C) Luke Kenneth Casson Leighton 1996-1998,
|
||||
* Copyright (C) Paul Ashton 1997-1998.
|
||||
* Copyright (C) Jeremy Allison 1999.
|
||||
* Copyright (C) Paul Ashton 1997-1998,
|
||||
* Copyright (C) Jeremy Allison 1999,
|
||||
* Copyright (C) Anthony Liguori 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
|
||||
@ -457,24 +458,53 @@ failed authentication on named pipe %s.\n", domain, user_name, wks, p->name ));
|
||||
|
||||
struct api_cmd
|
||||
{
|
||||
const char * pipe_clnt_name;
|
||||
const char * pipe_srv_name;
|
||||
BOOL (*fn) (pipes_struct *);
|
||||
const char *name;
|
||||
int (*init)(void);
|
||||
};
|
||||
|
||||
static struct api_cmd api_fd_commands[] =
|
||||
{
|
||||
{ "lsarpc", "lsass", api_ntlsa_rpc },
|
||||
{ "samr", "lsass", api_samr_rpc },
|
||||
{ "srvsvc", "ntsvcs", api_srvsvc_rpc },
|
||||
{ "wkssvc", "ntsvcs", api_wkssvc_rpc },
|
||||
{ "NETLOGON", "lsass", api_netlog_rpc },
|
||||
{ "winreg", "winreg", api_reg_rpc },
|
||||
{ "spoolss", "spoolss", api_spoolss_rpc },
|
||||
{ "netdfs", "netdfs" , api_netdfs_rpc },
|
||||
{ NULL, NULL, NULL }
|
||||
#ifndef RPC_LSA_DYNAMIC
|
||||
{ "lsarpc", rpc_lsa_init },
|
||||
#endif
|
||||
#ifndef RPC_SAMR_DYNAMIC
|
||||
{ "samr", rpc_samr_init },
|
||||
#endif
|
||||
#ifndef RPC_SVC_DYNAMIC
|
||||
{ "srvsvc", rpc_srv_init },
|
||||
#endif
|
||||
#ifndef RPC_WKS_DYNAMIC
|
||||
{ "wkssvc", rpc_wks_init },
|
||||
#endif
|
||||
#ifndef RPC_NETLOG_DYNAMIC
|
||||
{ "NETLOGON", rpc_net_init },
|
||||
#endif
|
||||
#ifndef RPC_REG_DYNAMIC
|
||||
{ "winreg", rpc_reg_init },
|
||||
#endif
|
||||
#ifndef RPC_SPOOLSS_DYNAMIC
|
||||
{ "spoolss", rpc_spoolss_init },
|
||||
#endif
|
||||
#ifndef RPC_DFS_DYNAMIC
|
||||
{ "netdfs", rpc_dfs_init },
|
||||
#endif
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
struct rpc_table
|
||||
{
|
||||
struct
|
||||
{
|
||||
const char *clnt;
|
||||
const char *srv;
|
||||
} pipe;
|
||||
struct api_struct *cmds;
|
||||
int n_cmds;
|
||||
};
|
||||
|
||||
static struct rpc_table *rpc_lookup;
|
||||
static int rpc_lookup_size;
|
||||
|
||||
/*******************************************************************
|
||||
This is the client reply to our challenge for an authenticated
|
||||
bind request. The challenge we sent is in p->challenge.
|
||||
@ -681,6 +711,7 @@ BOOL check_bind_req(char* pipe_name, RPC_IFACE* abstract,
|
||||
fstrcpy(pname,"\\PIPE\\");
|
||||
fstrcat(pname,pipe_name);
|
||||
|
||||
DEBUG(3,("check_bind_req for %s\n", pname));
|
||||
|
||||
#ifndef SUPPORT_NEW_LSARPC_UUID
|
||||
|
||||
@ -727,6 +758,82 @@ BOOL check_bind_req(char* pipe_name, RPC_IFACE* abstract,
|
||||
return True;
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
Register commands to an RPC pipe
|
||||
*******************************************************************/
|
||||
int rpc_pipe_register_commands(const char *clnt, const char *srv, const struct api_struct *cmds, int size)
|
||||
{
|
||||
struct rpc_table *rpc_entry;
|
||||
|
||||
|
||||
/* We use a temporary variable because this call can fail and
|
||||
rpc_lookup will still be valid afterwards. It could then succeed if
|
||||
called again later */
|
||||
rpc_entry = realloc(rpc_lookup,
|
||||
++rpc_lookup_size*sizeof(struct rpc_table));
|
||||
if (NULL == rpc_entry) {
|
||||
rpc_lookup_size--;
|
||||
DEBUG(0, ("rpc_pipe_register_commands: memory allocation failed\n"));
|
||||
return 0;
|
||||
} else {
|
||||
rpc_lookup = rpc_entry;
|
||||
}
|
||||
|
||||
rpc_entry = rpc_lookup + (rpc_lookup_size - 1);
|
||||
ZERO_STRUCTP(rpc_entry);
|
||||
rpc_entry->pipe.clnt = strdup(clnt);
|
||||
rpc_entry->pipe.srv = strdup(srv);
|
||||
rpc_entry->cmds = realloc(rpc_entry->cmds,
|
||||
(rpc_entry->n_cmds + size) *
|
||||
sizeof(struct api_struct));
|
||||
memcpy(rpc_entry->cmds + rpc_entry->n_cmds, cmds,
|
||||
size * sizeof(struct api_struct));
|
||||
rpc_entry->n_cmds += size;
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
Register commands to an RPC pipe
|
||||
*******************************************************************/
|
||||
int rpc_load_module(const char *module)
|
||||
{
|
||||
#ifdef HAVE_DLOPEN
|
||||
void *handle;
|
||||
int (*module_init)(void);
|
||||
pstring full_path;
|
||||
char *error;
|
||||
|
||||
pstrcpy(full_path, lib_path("rpc"));
|
||||
pstrcat(full_path, "/librpc_");
|
||||
pstrcat(full_path, module);
|
||||
pstrcat(full_path, ".");
|
||||
pstrcat(full_path, shlib_ext());
|
||||
|
||||
handle = sys_dlopen(full_path, RTLD_LAZY);
|
||||
if (!handle) {
|
||||
DEBUG(0, ("Could not load requested pipe %s as %s\n",
|
||||
module, full_path));
|
||||
DEBUG(0, (" Error: %s\n", dlerror()));
|
||||
return 0;
|
||||
}
|
||||
|
||||
DEBUG(3, ("Module '%s' loaded\n", full_path));
|
||||
|
||||
module_init = sys_dlsym(handle, "rpc_pipe_init");
|
||||
if ((error = sys_dlerror()) != NULL) {
|
||||
DEBUG(0, ("Error trying to resolve symbol 'rpc_pipe_init' in %s: %s\n",
|
||||
full_path, error));
|
||||
return 0;
|
||||
}
|
||||
|
||||
return module_init();
|
||||
#else
|
||||
DEBUG(0,("Attempting to load a dynamic RPC pipe when dlopen isn't available\n"));
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
Respond to a pipe bind request.
|
||||
*******************************************************************/
|
||||
@ -754,23 +861,40 @@ BOOL api_pipe_bind_req(pipes_struct *p, prs_struct *rpc_in_p)
|
||||
* that this is a pipe name we support.
|
||||
*/
|
||||
|
||||
for (i = 0; api_fd_commands[i].pipe_clnt_name; i++) {
|
||||
if (strequal(api_fd_commands[i].pipe_clnt_name, p->name) &&
|
||||
api_fd_commands[i].fn != NULL) {
|
||||
DEBUG(3,("api_pipe_bind_req: \\PIPE\\%s -> \\PIPE\\%s\n",
|
||||
api_fd_commands[i].pipe_clnt_name,
|
||||
api_fd_commands[i].pipe_srv_name));
|
||||
fstrcpy(p->pipe_srv_name, api_fd_commands[i].pipe_srv_name);
|
||||
break;
|
||||
}
|
||||
|
||||
for (i = 0; i < rpc_lookup_size; i++) {
|
||||
if (strequal(rpc_lookup[i].pipe.clnt, p->name)) {
|
||||
DEBUG(0, ("api_pipe_bind_req: \\PIPE\\%s -> \\PIPE\\%s\n",
|
||||
rpc_lookup[i].pipe.clnt, rpc_lookup[i].pipe.srv));
|
||||
fstrcpy(p->pipe_srv_name, rpc_lookup[i].pipe.srv);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (api_fd_commands[i].fn == NULL) {
|
||||
DEBUG(3,("api_pipe_bind_req: Unknown pipe name %s in bind request.\n",
|
||||
p->name ));
|
||||
if(!setup_bind_nak(p))
|
||||
return False;
|
||||
return True;
|
||||
if (i == rpc_lookup_size) {
|
||||
for (i = 0; api_fd_commands[i].name; i++) {
|
||||
if (strequal(api_fd_commands[i].name, p->name)) {
|
||||
api_fd_commands[i].init();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!api_fd_commands[i].name && !rpc_load_module(p->name)) {
|
||||
DEBUG(3,("api_pipe_bind_req: Unknown pipe name %s in bind request.\n",
|
||||
p->name ));
|
||||
if(!setup_bind_nak(p))
|
||||
return False;
|
||||
return True;
|
||||
}
|
||||
|
||||
for (i = 0; i < rpc_lookup_size; i++) {
|
||||
if (strequal(rpc_lookup[i].pipe.clnt, p->name)) {
|
||||
DEBUG(0, ("api_pipe_bind_req: \\PIPE\\%s -> \\PIPE\\%s\n",
|
||||
rpc_lookup[i].pipe.clnt, rpc_lookup[i].pipe.srv));
|
||||
fstrcpy(p->pipe_srv_name, rpc_lookup[i].pipe.srv);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* decode the bind request */
|
||||
@ -1153,14 +1277,46 @@ BOOL api_pipe_request(pipes_struct *p)
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; api_fd_commands[i].pipe_clnt_name; i++) {
|
||||
if (strequal(api_fd_commands[i].pipe_clnt_name, p->name) &&
|
||||
api_fd_commands[i].fn != NULL) {
|
||||
DEBUG(3,("Doing \\PIPE\\%s\n", api_fd_commands[i].pipe_clnt_name));
|
||||
set_current_rpc_talloc(p->mem_ctx);
|
||||
ret = api_fd_commands[i].fn(p);
|
||||
set_current_rpc_talloc(NULL);
|
||||
}
|
||||
DEBUG(5, ("Requested \\PIPE\\%s\n", p->name));
|
||||
|
||||
for (i = 0; i < rpc_lookup_size; i++) {
|
||||
if (strequal(rpc_lookup[i].pipe.clnt, p->name)) {
|
||||
DEBUG(3,("Doing \\PIPE\\%s\n",
|
||||
rpc_lookup[i].pipe.clnt));
|
||||
set_current_rpc_talloc(p->mem_ctx);
|
||||
ret = api_rpcTNP(p, rpc_lookup[i].pipe.clnt,
|
||||
rpc_lookup[i].cmds,
|
||||
rpc_lookup[i].n_cmds);
|
||||
set_current_rpc_talloc(NULL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (i == rpc_lookup_size) {
|
||||
for (i = 0; api_fd_commands[i].name; i++) {
|
||||
if (strequal(api_fd_commands[i].name, p->name)) {
|
||||
api_fd_commands[i].init();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!api_fd_commands[i].name) {
|
||||
rpc_load_module(p->name);
|
||||
}
|
||||
|
||||
for (i = 0; i < rpc_lookup_size; i++) {
|
||||
if (strequal(rpc_lookup[i].pipe.clnt, p->name)) {
|
||||
DEBUG(3,("Doing \\PIPE\\%s\n",
|
||||
rpc_lookup[i].pipe.clnt));
|
||||
set_current_rpc_talloc(p->mem_ctx);
|
||||
ret = api_rpcTNP(p, rpc_lookup[i].pipe.clnt,
|
||||
rpc_lookup[i].cmds,
|
||||
rpc_lookup[i].n_cmds);
|
||||
set_current_rpc_talloc(NULL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(p->ntlmssp_auth_validated)
|
||||
@ -1174,7 +1330,7 @@ BOOL api_pipe_request(pipes_struct *p)
|
||||
********************************************************************/
|
||||
|
||||
BOOL api_rpcTNP(pipes_struct *p, const char *rpc_name,
|
||||
const struct api_struct *api_rpc_cmds)
|
||||
const struct api_struct *api_rpc_cmds, int n_cmds)
|
||||
{
|
||||
int fn_num;
|
||||
fstring name;
|
||||
@ -1186,14 +1342,14 @@ BOOL api_rpcTNP(pipes_struct *p, const char *rpc_name,
|
||||
slprintf(name, sizeof(name)-1, "in_%s", rpc_name);
|
||||
prs_dump(name, p->hdr_req.opnum, &p->in_data.data);
|
||||
|
||||
for (fn_num = 0; api_rpc_cmds[fn_num].name; fn_num++) {
|
||||
for (fn_num = 0; fn_num < n_cmds; fn_num++) {
|
||||
if (api_rpc_cmds[fn_num].opnum == p->hdr_req.opnum && api_rpc_cmds[fn_num].fn != NULL) {
|
||||
DEBUG(3,("api_rpcTNP: rpc command: %s\n", api_rpc_cmds[fn_num].name));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (api_rpc_cmds[fn_num].name == NULL) {
|
||||
if (fn_num == n_cmds) {
|
||||
/*
|
||||
* For an unknown RPC just return a fault PDU but
|
||||
* return True to allow RPC's on the pipe to continue
|
||||
@ -1206,6 +1362,8 @@ BOOL api_rpcTNP(pipes_struct *p, const char *rpc_name,
|
||||
|
||||
offset1 = prs_offset(&p->out_data.rdata);
|
||||
|
||||
fprintf(stderr, "api_rpc_cmds[%d].fn == %p\n",
|
||||
fn_num, api_rpc_cmds[fn_num].fn);
|
||||
/* do the actual command */
|
||||
if(!api_rpc_cmds[fn_num].fn(p)) {
|
||||
DEBUG(0,("api_rpcTNP: %s: %s failed.\n", rpc_name, api_rpc_cmds[fn_num].name));
|
||||
|
@ -3,10 +3,11 @@
|
||||
* RPC Pipe client / server routines
|
||||
* Copyright (C) Andrew Tridgell 1992-1997,
|
||||
* Copyright (C) Luke Kenneth Casson Leighton 1996-1997,
|
||||
* Copyright (C) Paul Ashton 1997.
|
||||
* Copyright (C) Marc Jacobsen 2000.
|
||||
* Copyright (C) Jeremy Allison 2001.
|
||||
* Copyright (C) Gerald Carter 2002.
|
||||
* Copyright (C) Paul Ashton 1997,
|
||||
* Copyright (C) Marc Jacobsen 2000,
|
||||
* Copyright (C) Jeremy Allison 2001,
|
||||
* Copyright (C) Gerald Carter 2002,
|
||||
* Copyright (C) Anthony Liguori 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
|
||||
@ -371,29 +372,29 @@ static BOOL api_reg_save_key(pipes_struct *p)
|
||||
/*******************************************************************
|
||||
array of \PIPE\reg operations
|
||||
********************************************************************/
|
||||
static struct api_struct api_reg_cmds[] =
|
||||
{
|
||||
{ "REG_CLOSE" , REG_CLOSE , api_reg_close },
|
||||
{ "REG_OPEN_ENTRY" , REG_OPEN_ENTRY , api_reg_open_entry },
|
||||
{ "REG_OPEN_HKCR" , REG_OPEN_HKCR , api_reg_open_hkcr },
|
||||
{ "REG_OPEN_HKLM" , REG_OPEN_HKLM , api_reg_open_hklm },
|
||||
{ "REG_OPEN_HKU" , REG_OPEN_HKU , api_reg_open_hku },
|
||||
{ "REG_ENUM_KEY" , REG_ENUM_KEY , api_reg_enum_key },
|
||||
{ "REG_ENUM_VALUE" , REG_ENUM_VALUE , api_reg_enum_value },
|
||||
{ "REG_QUERY_KEY" , REG_QUERY_KEY , api_reg_query_key },
|
||||
{ "REG_INFO" , REG_INFO , api_reg_info },
|
||||
{ "REG_SHUTDOWN" , REG_SHUTDOWN , api_reg_shutdown },
|
||||
{ "REG_ABORT_SHUTDOWN" , REG_ABORT_SHUTDOWN , api_reg_abort_shutdown },
|
||||
{ "REG_UNKNOWN_1A" , REG_UNKNOWN_1A , api_reg_unknown_1a },
|
||||
{ "REG_SAVE_KEY" , REG_SAVE_KEY , api_reg_save_key },
|
||||
{ NULL , 0 , NULL }
|
||||
};
|
||||
|
||||
/*******************************************************************
|
||||
receives a reg pipe and responds.
|
||||
********************************************************************/
|
||||
|
||||
BOOL api_reg_rpc(pipes_struct *p)
|
||||
#ifdef RPC_REG_DYNAMIC
|
||||
int rpc_pipe_init(void)
|
||||
#else
|
||||
int rpc_reg_init(void)
|
||||
#endif
|
||||
{
|
||||
return api_rpcTNP(p, "api_reg_rpc", api_reg_cmds);
|
||||
static struct api_struct api_reg_cmds[] =
|
||||
{
|
||||
{ "REG_CLOSE" , REG_CLOSE , api_reg_close },
|
||||
{ "REG_OPEN_ENTRY" , REG_OPEN_ENTRY , api_reg_open_entry },
|
||||
{ "REG_OPEN_HKCR" , REG_OPEN_HKCR , api_reg_open_hkcr },
|
||||
{ "REG_OPEN_HKLM" , REG_OPEN_HKLM , api_reg_open_hklm },
|
||||
{ "REG_OPEN_HKU" , REG_OPEN_HKU , api_reg_open_hku },
|
||||
{ "REG_ENUM_KEY" , REG_ENUM_KEY , api_reg_enum_key },
|
||||
{ "REG_ENUM_VALUE" , REG_ENUM_VALUE , api_reg_enum_value },
|
||||
{ "REG_QUERY_KEY" , REG_QUERY_KEY , api_reg_query_key },
|
||||
{ "REG_INFO" , REG_INFO , api_reg_info },
|
||||
{ "REG_SHUTDOWN" , REG_SHUTDOWN , api_reg_shutdown },
|
||||
{ "REG_ABORT_SHUTDOWN" , REG_ABORT_SHUTDOWN , api_reg_abort_shutdown },
|
||||
{ "REG_UNKNOWN_1A" , REG_UNKNOWN_1A , api_reg_unknown_1a },
|
||||
{ "REG_SAVE_KEY" , REG_SAVE_KEY , api_reg_save_key }
|
||||
};
|
||||
return rpc_pipe_register_commands("winreg", "winreg", api_reg_cmds,
|
||||
sizeof(api_reg_cmds) / sizeof(struct api_struct));
|
||||
}
|
||||
|
@ -6,7 +6,7 @@
|
||||
* Copyright (C) Paul Ashton 1997,
|
||||
* Copyright (C) Marc Jacobsen 1999,
|
||||
* Copyright (C) Jean François Micouleau 1998-2001,
|
||||
* Copyright (C) Anthony Liguori 2002,
|
||||
* Copyright (C) Anthony Liguori 2002-2003,
|
||||
* Copyright (C) Jim McDonough 2002.
|
||||
*
|
||||
* Split into interface and implementation modules by,
|
||||
@ -1443,68 +1443,68 @@ static BOOL api_samr_set_dom_info(pipes_struct *p)
|
||||
array of \PIPE\samr operations
|
||||
********************************************************************/
|
||||
|
||||
static struct api_struct api_samr_cmds [] =
|
||||
#ifdef RPC_SAMR_DYNAMIC
|
||||
int rpc_pipe_init(void)
|
||||
#else
|
||||
int rpc_samr_init(void)
|
||||
#endif
|
||||
{
|
||||
{"SAMR_CLOSE_HND" , SAMR_CLOSE_HND , api_samr_close_hnd },
|
||||
{"SAMR_CONNECT" , SAMR_CONNECT , api_samr_connect },
|
||||
{"SAMR_CONNECT_ANON" , SAMR_CONNECT_ANON , api_samr_connect_anon },
|
||||
{"SAMR_ENUM_DOMAINS" , SAMR_ENUM_DOMAINS , api_samr_enum_domains },
|
||||
{"SAMR_ENUM_DOM_USERS" , SAMR_ENUM_DOM_USERS , api_samr_enum_dom_users },
|
||||
|
||||
{"SAMR_ENUM_DOM_GROUPS" , SAMR_ENUM_DOM_GROUPS , api_samr_enum_dom_groups },
|
||||
{"SAMR_ENUM_DOM_ALIASES" , SAMR_ENUM_DOM_ALIASES , api_samr_enum_dom_aliases },
|
||||
{"SAMR_QUERY_USERALIASES" , SAMR_QUERY_USERALIASES, api_samr_query_useraliases},
|
||||
{"SAMR_QUERY_ALIASMEM" , SAMR_QUERY_ALIASMEM , api_samr_query_aliasmem },
|
||||
{"SAMR_QUERY_GROUPMEM" , SAMR_QUERY_GROUPMEM , api_samr_query_groupmem },
|
||||
{"SAMR_ADD_ALIASMEM" , SAMR_ADD_ALIASMEM , api_samr_add_aliasmem },
|
||||
{"SAMR_DEL_ALIASMEM" , SAMR_DEL_ALIASMEM , api_samr_del_aliasmem },
|
||||
{"SAMR_ADD_GROUPMEM" , SAMR_ADD_GROUPMEM , api_samr_add_groupmem },
|
||||
{"SAMR_DEL_GROUPMEM" , SAMR_DEL_GROUPMEM , api_samr_del_groupmem },
|
||||
|
||||
{"SAMR_DELETE_DOM_USER" , SAMR_DELETE_DOM_USER , api_samr_delete_dom_user },
|
||||
{"SAMR_DELETE_DOM_GROUP" , SAMR_DELETE_DOM_GROUP , api_samr_delete_dom_group },
|
||||
{"SAMR_DELETE_DOM_ALIAS" , SAMR_DELETE_DOM_ALIAS , api_samr_delete_dom_alias },
|
||||
{"SAMR_CREATE_DOM_GROUP" , SAMR_CREATE_DOM_GROUP , api_samr_create_dom_group },
|
||||
{"SAMR_CREATE_DOM_ALIAS" , SAMR_CREATE_DOM_ALIAS , api_samr_create_dom_alias },
|
||||
{"SAMR_LOOKUP_NAMES" , SAMR_LOOKUP_NAMES , api_samr_lookup_names },
|
||||
{"SAMR_OPEN_USER" , SAMR_OPEN_USER , api_samr_open_user },
|
||||
{"SAMR_QUERY_USERINFO" , SAMR_QUERY_USERINFO , api_samr_query_userinfo },
|
||||
{"SAMR_SET_USERINFO" , SAMR_SET_USERINFO , api_samr_set_userinfo },
|
||||
{"SAMR_SET_USERINFO2" , SAMR_SET_USERINFO2 , api_samr_set_userinfo2 },
|
||||
|
||||
{"SAMR_QUERY_DOMAIN_INFO" , SAMR_QUERY_DOMAIN_INFO, api_samr_query_dom_info },
|
||||
{"SAMR_QUERY_USERGROUPS" , SAMR_QUERY_USERGROUPS , api_samr_query_usergroups },
|
||||
{"SAMR_QUERY_DISPINFO" , SAMR_QUERY_DISPINFO , api_samr_query_dispinfo },
|
||||
{"SAMR_QUERY_DISPINFO3" , SAMR_QUERY_DISPINFO3 , api_samr_query_dispinfo },
|
||||
{"SAMR_QUERY_DISPINFO4" , SAMR_QUERY_DISPINFO4 , api_samr_query_dispinfo },
|
||||
|
||||
{"SAMR_QUERY_ALIASINFO" , SAMR_QUERY_ALIASINFO , api_samr_query_aliasinfo },
|
||||
{"SAMR_QUERY_GROUPINFO" , SAMR_QUERY_GROUPINFO , api_samr_query_groupinfo },
|
||||
{"SAMR_SET_GROUPINFO" , SAMR_SET_GROUPINFO , api_samr_set_groupinfo },
|
||||
{"SAMR_SET_ALIASINFO" , SAMR_SET_ALIASINFO , api_samr_set_aliasinfo },
|
||||
{"SAMR_CREATE_USER" , SAMR_CREATE_USER , api_samr_create_user },
|
||||
{"SAMR_LOOKUP_RIDS" , SAMR_LOOKUP_RIDS , api_samr_lookup_rids },
|
||||
{"SAMR_GET_DOM_PWINFO" , SAMR_GET_DOM_PWINFO , api_samr_get_dom_pwinfo },
|
||||
{"SAMR_CHGPASSWD_USER" , SAMR_CHGPASSWD_USER , api_samr_chgpasswd_user },
|
||||
{"SAMR_OPEN_ALIAS" , SAMR_OPEN_ALIAS , api_samr_open_alias },
|
||||
{"SAMR_OPEN_GROUP" , SAMR_OPEN_GROUP , api_samr_open_group },
|
||||
{"SAMR_OPEN_DOMAIN" , SAMR_OPEN_DOMAIN , api_samr_open_domain },
|
||||
{"SAMR_UNKNOWN_2D" , SAMR_UNKNOWN_2D , api_samr_unknown_2d },
|
||||
{"SAMR_LOOKUP_DOMAIN" , SAMR_LOOKUP_DOMAIN , api_samr_lookup_domain },
|
||||
|
||||
{"SAMR_QUERY_SEC_OBJECT" , SAMR_QUERY_SEC_OBJECT , api_samr_query_sec_obj },
|
||||
{"SAMR_SET_SEC_OBJECT" , SAMR_SET_SEC_OBJECT , api_samr_set_sec_obj },
|
||||
{"SAMR_GET_USRDOM_PWINFO" , SAMR_GET_USRDOM_PWINFO, api_samr_get_usrdom_pwinfo},
|
||||
{"SAMR_UNKNOWN_2E" , SAMR_UNKNOWN_2E , api_samr_unknown_2e },
|
||||
{"SAMR_SET_DOMAIN_INFO" , SAMR_SET_DOMAIN_INFO , api_samr_set_dom_info },
|
||||
{"SAMR_CONNECT4" , SAMR_CONNECT4 , api_samr_connect4 },
|
||||
{NULL , 0 , NULL }
|
||||
};
|
||||
|
||||
/*******************************************************************
|
||||
receives a samr pipe and responds.
|
||||
********************************************************************/
|
||||
BOOL api_samr_rpc(pipes_struct *p)
|
||||
{
|
||||
return api_rpcTNP(p, "api_samr_rpc", api_samr_cmds);
|
||||
static struct api_struct api_samr_cmds [] =
|
||||
{
|
||||
{"SAMR_CLOSE_HND" , SAMR_CLOSE_HND , api_samr_close_hnd },
|
||||
{"SAMR_CONNECT" , SAMR_CONNECT , api_samr_connect },
|
||||
{"SAMR_CONNECT_ANON" , SAMR_CONNECT_ANON , api_samr_connect_anon },
|
||||
{"SAMR_ENUM_DOMAINS" , SAMR_ENUM_DOMAINS , api_samr_enum_domains },
|
||||
{"SAMR_ENUM_DOM_USERS" , SAMR_ENUM_DOM_USERS , api_samr_enum_dom_users },
|
||||
|
||||
{"SAMR_ENUM_DOM_GROUPS" , SAMR_ENUM_DOM_GROUPS , api_samr_enum_dom_groups },
|
||||
{"SAMR_ENUM_DOM_ALIASES" , SAMR_ENUM_DOM_ALIASES , api_samr_enum_dom_aliases },
|
||||
{"SAMR_QUERY_USERALIASES" , SAMR_QUERY_USERALIASES, api_samr_query_useraliases},
|
||||
{"SAMR_QUERY_ALIASMEM" , SAMR_QUERY_ALIASMEM , api_samr_query_aliasmem },
|
||||
{"SAMR_QUERY_GROUPMEM" , SAMR_QUERY_GROUPMEM , api_samr_query_groupmem },
|
||||
{"SAMR_ADD_ALIASMEM" , SAMR_ADD_ALIASMEM , api_samr_add_aliasmem },
|
||||
{"SAMR_DEL_ALIASMEM" , SAMR_DEL_ALIASMEM , api_samr_del_aliasmem },
|
||||
{"SAMR_ADD_GROUPMEM" , SAMR_ADD_GROUPMEM , api_samr_add_groupmem },
|
||||
{"SAMR_DEL_GROUPMEM" , SAMR_DEL_GROUPMEM , api_samr_del_groupmem },
|
||||
|
||||
{"SAMR_DELETE_DOM_USER" , SAMR_DELETE_DOM_USER , api_samr_delete_dom_user },
|
||||
{"SAMR_DELETE_DOM_GROUP" , SAMR_DELETE_DOM_GROUP , api_samr_delete_dom_group },
|
||||
{"SAMR_DELETE_DOM_ALIAS" , SAMR_DELETE_DOM_ALIAS , api_samr_delete_dom_alias },
|
||||
{"SAMR_CREATE_DOM_GROUP" , SAMR_CREATE_DOM_GROUP , api_samr_create_dom_group },
|
||||
{"SAMR_CREATE_DOM_ALIAS" , SAMR_CREATE_DOM_ALIAS , api_samr_create_dom_alias },
|
||||
{"SAMR_LOOKUP_NAMES" , SAMR_LOOKUP_NAMES , api_samr_lookup_names },
|
||||
{"SAMR_OPEN_USER" , SAMR_OPEN_USER , api_samr_open_user },
|
||||
{"SAMR_QUERY_USERINFO" , SAMR_QUERY_USERINFO , api_samr_query_userinfo },
|
||||
{"SAMR_SET_USERINFO" , SAMR_SET_USERINFO , api_samr_set_userinfo },
|
||||
{"SAMR_SET_USERINFO2" , SAMR_SET_USERINFO2 , api_samr_set_userinfo2 },
|
||||
|
||||
{"SAMR_QUERY_DOMAIN_INFO" , SAMR_QUERY_DOMAIN_INFO, api_samr_query_dom_info },
|
||||
{"SAMR_QUERY_USERGROUPS" , SAMR_QUERY_USERGROUPS , api_samr_query_usergroups },
|
||||
{"SAMR_QUERY_DISPINFO" , SAMR_QUERY_DISPINFO , api_samr_query_dispinfo },
|
||||
{"SAMR_QUERY_DISPINFO3" , SAMR_QUERY_DISPINFO3 , api_samr_query_dispinfo },
|
||||
{"SAMR_QUERY_DISPINFO4" , SAMR_QUERY_DISPINFO4 , api_samr_query_dispinfo },
|
||||
|
||||
{"SAMR_QUERY_ALIASINFO" , SAMR_QUERY_ALIASINFO , api_samr_query_aliasinfo },
|
||||
{"SAMR_QUERY_GROUPINFO" , SAMR_QUERY_GROUPINFO , api_samr_query_groupinfo },
|
||||
{"SAMR_SET_GROUPINFO" , SAMR_SET_GROUPINFO , api_samr_set_groupinfo },
|
||||
{"SAMR_SET_ALIASINFO" , SAMR_SET_ALIASINFO , api_samr_set_aliasinfo },
|
||||
{"SAMR_CREATE_USER" , SAMR_CREATE_USER , api_samr_create_user },
|
||||
{"SAMR_LOOKUP_RIDS" , SAMR_LOOKUP_RIDS , api_samr_lookup_rids },
|
||||
{"SAMR_GET_DOM_PWINFO" , SAMR_GET_DOM_PWINFO , api_samr_get_dom_pwinfo },
|
||||
{"SAMR_CHGPASSWD_USER" , SAMR_CHGPASSWD_USER , api_samr_chgpasswd_user },
|
||||
{"SAMR_OPEN_ALIAS" , SAMR_OPEN_ALIAS , api_samr_open_alias },
|
||||
{"SAMR_OPEN_GROUP" , SAMR_OPEN_GROUP , api_samr_open_group },
|
||||
{"SAMR_OPEN_DOMAIN" , SAMR_OPEN_DOMAIN , api_samr_open_domain },
|
||||
{"SAMR_UNKNOWN_2D" , SAMR_UNKNOWN_2D , api_samr_unknown_2d },
|
||||
{"SAMR_LOOKUP_DOMAIN" , SAMR_LOOKUP_DOMAIN , api_samr_lookup_domain },
|
||||
|
||||
{"SAMR_QUERY_SEC_OBJECT" , SAMR_QUERY_SEC_OBJECT , api_samr_query_sec_obj },
|
||||
{"SAMR_SET_SEC_OBJECT" , SAMR_SET_SEC_OBJECT , api_samr_set_sec_obj },
|
||||
{"SAMR_GET_USRDOM_PWINFO" , SAMR_GET_USRDOM_PWINFO, api_samr_get_usrdom_pwinfo},
|
||||
{"SAMR_UNKNOWN_2E" , SAMR_UNKNOWN_2E , api_samr_unknown_2e },
|
||||
{"SAMR_SET_DOMAIN_INFO" , SAMR_SET_DOMAIN_INFO , api_samr_set_dom_info },
|
||||
{"SAMR_CONNECT4" , SAMR_CONNECT4 , api_samr_connect4 }
|
||||
};
|
||||
return rpc_pipe_register_commands("samr", "lsass", api_samr_cmds,
|
||||
sizeof(api_samr_cmds) / sizeof(struct api_struct));
|
||||
}
|
||||
|
@ -3,9 +3,10 @@
|
||||
* RPC Pipe client / server routines
|
||||
* Copyright (C) Andrew Tridgell 1992-2000,
|
||||
* Copyright (C) Luke Kenneth Casson Leighton 1996-2000,
|
||||
* Copyright (C) Jean François Micouleau 1998-2000.
|
||||
* Copyright (C) Jeremy Allison 2001.
|
||||
* Copyright (C) Gerald Carter 2001-2002.
|
||||
* Copyright (C) Jean François Micouleau 1998-2000,
|
||||
* Copyright (C) Jeremy Allison 2001,
|
||||
* Copyright (C) Gerald Carter 2001-2002,
|
||||
* Copyright (C) Anthony Liguori 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
|
||||
@ -1579,8 +1580,14 @@ static BOOL api_spoolss_replycloseprinter(pipes_struct *p)
|
||||
\pipe\spoolss commands
|
||||
********************************************************************/
|
||||
|
||||
struct api_struct api_spoolss_cmds[] =
|
||||
#ifdef RPC_SPOOLSS_DYNAMIC
|
||||
int rpc_pipe_init(void)
|
||||
#else
|
||||
int rpc_spoolss_init(void)
|
||||
#endif
|
||||
{
|
||||
struct api_struct api_spoolss_cmds[] =
|
||||
{
|
||||
{"SPOOLSS_OPENPRINTER", SPOOLSS_OPENPRINTER, api_spoolss_open_printer },
|
||||
{"SPOOLSS_OPENPRINTEREX", SPOOLSS_OPENPRINTEREX, api_spoolss_open_printer_ex },
|
||||
{"SPOOLSS_GETPRINTERDATA", SPOOLSS_GETPRINTERDATA, api_spoolss_getprinterdata },
|
||||
@ -1634,15 +1641,9 @@ struct api_struct api_spoolss_cmds[] =
|
||||
{"SPOOLSS_DELETEPRINTERDRIVEREX", SPOOLSS_DELETEPRINTERDRIVEREX, api_spoolss_deleteprinterdriverex },
|
||||
#if 0
|
||||
{"SPOOLSS_REPLYOPENPRINTER", SPOOLSS_REPLYOPENPRINTER, api_spoolss_replyopenprinter },
|
||||
{"SPOOLSS_REPLYCLOSEPRINTER", SPOOLSS_REPLYCLOSEPRINTER, api_spoolss_replycloseprinter },
|
||||
{"SPOOLSS_REPLYCLOSEPRINTER", SPOOLSS_REPLYCLOSEPRINTER, api_spoolss_replycloseprinter }
|
||||
#endif
|
||||
{ NULL, 0, NULL }
|
||||
};
|
||||
|
||||
/*******************************************************************
|
||||
receives a spoolss pipe and responds.
|
||||
********************************************************************/
|
||||
BOOL api_spoolss_rpc(pipes_struct *p)
|
||||
{
|
||||
return api_rpcTNP(p, "api_spoolss_rpc", api_spoolss_cmds);
|
||||
};
|
||||
return rpc_pipe_register_commands("spoolss", "spoolss", api_spoolss_cmds,
|
||||
sizeof(api_spoolss_cmds) / sizeof(struct api_struct));
|
||||
}
|
||||
|
@ -3,8 +3,9 @@
|
||||
* RPC Pipe client / server routines
|
||||
* Copyright (C) Andrew Tridgell 1992-1997,
|
||||
* Copyright (C) Luke Kenneth Casson Leighton 1996-1997,
|
||||
* Copyright (C) Paul Ashton 1997.
|
||||
* Copyright (C) Jeremy Allison 2001.
|
||||
* Copyright (C) Paul Ashton 1997,
|
||||
* Copyright (C) Jeremy Allison 2001,
|
||||
* Copyright (C) Anthony Liguori 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
|
||||
@ -525,32 +526,32 @@ static BOOL api_srv_net_file_set_secdesc(pipes_struct *p)
|
||||
\PIPE\srvsvc commands
|
||||
********************************************************************/
|
||||
|
||||
static const struct api_struct api_srv_cmds[] =
|
||||
#ifdef RPC_SVC_DYNAMIC
|
||||
int rpc_pipe_init(void)
|
||||
#else
|
||||
int rpc_srv_init(void)
|
||||
#endif
|
||||
{
|
||||
{ "SRV_NET_CONN_ENUM" , SRV_NET_CONN_ENUM , api_srv_net_conn_enum },
|
||||
{ "SRV_NET_SESS_ENUM" , SRV_NET_SESS_ENUM , api_srv_net_sess_enum },
|
||||
{ "SRV_NET_SHARE_ENUM_ALL" , SRV_NET_SHARE_ENUM_ALL , api_srv_net_share_enum_all },
|
||||
{ "SRV_NET_SHARE_ENUM" , SRV_NET_SHARE_ENUM , api_srv_net_share_enum },
|
||||
{ "SRV_NET_SHARE_ADD" , SRV_NET_SHARE_ADD , api_srv_net_share_add },
|
||||
{ "SRV_NET_SHARE_DEL" , SRV_NET_SHARE_DEL , api_srv_net_share_del },
|
||||
{ "SRV_NET_SHARE_DEL_STICKY", SRV_NET_SHARE_DEL_STICKY, api_srv_net_share_del_sticky },
|
||||
{ "SRV_NET_SHARE_GET_INFO", SRV_NET_SHARE_GET_INFO, api_srv_net_share_get_info },
|
||||
{ "SRV_NET_SHARE_SET_INFO", SRV_NET_SHARE_SET_INFO, api_srv_net_share_set_info },
|
||||
{ "SRV_NET_FILE_ENUM" , SRV_NET_FILE_ENUM , api_srv_net_file_enum },
|
||||
{ "SRV_NET_SRV_GET_INFO" , SRV_NET_SRV_GET_INFO , api_srv_net_srv_get_info },
|
||||
{ "SRV_NET_SRV_SET_INFO" , SRV_NET_SRV_SET_INFO , api_srv_net_srv_set_info },
|
||||
{ "SRV_NET_REMOTE_TOD" , SRV_NET_REMOTE_TOD , api_srv_net_remote_tod },
|
||||
{ "SRV_NET_DISK_ENUM" , SRV_NET_DISK_ENUM , api_srv_net_disk_enum },
|
||||
{ "SRV_NET_NAME_VALIDATE" , SRV_NET_NAME_VALIDATE , api_srv_net_name_validate},
|
||||
{ "SRV_NET_FILE_QUERY_SECDESC",SRV_NET_FILE_QUERY_SECDESC, api_srv_net_file_query_secdesc},
|
||||
{ "SRV_NET_FILE_SET_SECDESC" , SRV_NET_FILE_SET_SECDESC , api_srv_net_file_set_secdesc},
|
||||
{ NULL , 0 , NULL }
|
||||
};
|
||||
|
||||
/*******************************************************************
|
||||
receives a srvsvc pipe and responds.
|
||||
********************************************************************/
|
||||
BOOL api_srvsvc_rpc(pipes_struct *p)
|
||||
{
|
||||
return api_rpcTNP(p, "api_srvsvc_rpc", api_srv_cmds);
|
||||
static const struct api_struct api_srv_cmds[] =
|
||||
{
|
||||
{ "SRV_NET_CONN_ENUM" , SRV_NET_CONN_ENUM , api_srv_net_conn_enum },
|
||||
{ "SRV_NET_SESS_ENUM" , SRV_NET_SESS_ENUM , api_srv_net_sess_enum },
|
||||
{ "SRV_NET_SHARE_ENUM_ALL" , SRV_NET_SHARE_ENUM_ALL , api_srv_net_share_enum_all },
|
||||
{ "SRV_NET_SHARE_ENUM" , SRV_NET_SHARE_ENUM , api_srv_net_share_enum },
|
||||
{ "SRV_NET_SHARE_ADD" , SRV_NET_SHARE_ADD , api_srv_net_share_add },
|
||||
{ "SRV_NET_SHARE_DEL" , SRV_NET_SHARE_DEL , api_srv_net_share_del },
|
||||
{ "SRV_NET_SHARE_DEL_STICKY" , SRV_NET_SHARE_DEL_STICKY , api_srv_net_share_del_sticky },
|
||||
{ "SRV_NET_SHARE_GET_INFO" , SRV_NET_SHARE_GET_INFO , api_srv_net_share_get_info },
|
||||
{ "SRV_NET_SHARE_SET_INFO" , SRV_NET_SHARE_SET_INFO , api_srv_net_share_set_info },
|
||||
{ "SRV_NET_FILE_ENUM" , SRV_NET_FILE_ENUM , api_srv_net_file_enum },
|
||||
{ "SRV_NET_SRV_GET_INFO" , SRV_NET_SRV_GET_INFO , api_srv_net_srv_get_info },
|
||||
{ "SRV_NET_SRV_SET_INFO" , SRV_NET_SRV_SET_INFO , api_srv_net_srv_set_info },
|
||||
{ "SRV_NET_REMOTE_TOD" , SRV_NET_REMOTE_TOD , api_srv_net_remote_tod },
|
||||
{ "SRV_NET_DISK_ENUM" , SRV_NET_DISK_ENUM , api_srv_net_disk_enum },
|
||||
{ "SRV_NET_NAME_VALIDATE" , SRV_NET_NAME_VALIDATE , api_srv_net_name_validate },
|
||||
{ "SRV_NET_FILE_QUERY_SECDESC", SRV_NET_FILE_QUERY_SECDESC, api_srv_net_file_query_secdesc },
|
||||
{ "SRV_NET_FILE_SET_SECDESC" , SRV_NET_FILE_SET_SECDESC , api_srv_net_file_set_secdesc }
|
||||
};
|
||||
return rpc_pipe_register_commands("srvsvc", "ntsvcs", api_srv_cmds,
|
||||
sizeof(api_srv_cmds) / sizeof(struct api_struct));
|
||||
}
|
||||
|
@ -3,7 +3,8 @@
|
||||
* RPC Pipe client / server routines
|
||||
* Copyright (C) Andrew Tridgell 1992-1997,
|
||||
* Copyright (C) Luke Kenneth Casson Leighton 1996-1997,
|
||||
* Copyright (C) Paul Ashton 1997.
|
||||
* Copyright (C) Paul Ashton 1997,
|
||||
* Copyright (C) Anthony Liguori 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
|
||||
@ -58,16 +59,17 @@ static BOOL api_wks_query_info(pipes_struct *p)
|
||||
/*******************************************************************
|
||||
\PIPE\wkssvc commands
|
||||
********************************************************************/
|
||||
static struct api_struct api_wks_cmds[] =
|
||||
{
|
||||
{ "WKS_Q_QUERY_INFO", WKS_QUERY_INFO, api_wks_query_info },
|
||||
{ NULL , 0 , NULL }
|
||||
};
|
||||
|
||||
/*******************************************************************
|
||||
receives a wkssvc pipe and responds.
|
||||
********************************************************************/
|
||||
BOOL api_wkssvc_rpc(pipes_struct *p)
|
||||
#ifdef RPC_WKS_DYNAMIC
|
||||
int rpc_pipe_init(void)
|
||||
#else
|
||||
int rpc_wks_init(void)
|
||||
#endif
|
||||
{
|
||||
return api_rpcTNP(p, "api_wkssvc_rpc", api_wks_cmds);
|
||||
static struct api_struct api_wks_cmds[] =
|
||||
{
|
||||
{ "WKS_Q_QUERY_INFO", WKS_QUERY_INFO, api_wks_query_info }
|
||||
};
|
||||
return rpc_pipe_register_commands("wkssvc", "ntsvcs", api_wks_cmds,
|
||||
sizeof(api_wks_cmds) / sizeof(struct api_struct));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user