mirror of
https://github.com/samba-team/samba.git
synced 2024-12-24 21:34:56 +03:00
s3-spoolss: prepare to use generated spoolss.
Guenther
This commit is contained in:
parent
1bb22b5527
commit
e11fa4cc33
@ -308,7 +308,8 @@ LIBNDR_GEN_OBJ = ../librpc/gen_ndr/ndr_wkssvc.o \
|
||||
../librpc/gen_ndr/ndr_xattr.o \
|
||||
../librpc/gen_ndr/ndr_epmapper.o \
|
||||
../librpc/gen_ndr/ndr_named_pipe_auth.o \
|
||||
../librpc/gen_ndr/ndr_ntsvcs.o
|
||||
../librpc/gen_ndr/ndr_ntsvcs.o \
|
||||
$(LIBNDR_GEN_OBJ2)
|
||||
|
||||
RPC_PARSE_OBJ0 = rpc_parse/parse_prs.o rpc_parse/parse_misc.o
|
||||
|
||||
@ -481,6 +482,7 @@ LIBMSRPC_GEN_OBJ = ../librpc/gen_ndr/cli_lsa.o \
|
||||
../librpc/gen_ndr/cli_ntsvcs.o \
|
||||
../librpc/gen_ndr/cli_epmapper.o \
|
||||
../librpc/gen_ndr/cli_drsuapi.o \
|
||||
../librpc/gen_ndr/cli_spoolss.o \
|
||||
$(LIBNDR_GEN_OBJ) \
|
||||
$(RPCCLIENT_NDR_OBJ)
|
||||
|
||||
@ -567,7 +569,8 @@ RPC_NTSVCS_OBJ = rpc_server/srv_ntsvcs_nt.o \
|
||||
|
||||
RPC_DFS_OBJ = ../librpc/gen_ndr/srv_dfs.o rpc_server/srv_dfs_nt.o
|
||||
|
||||
RPC_SPOOLSS_OBJ = rpc_server/srv_spoolss.o rpc_server/srv_spoolss_nt.o
|
||||
RPC_SPOOLSS_OBJ = rpc_server/srv_spoolss.o rpc_server/srv_spoolss_nt.o \
|
||||
../librpc/gen_ndr/srv_spoolss.o
|
||||
|
||||
RPC_EVENTLOG_OBJ = rpc_server/srv_eventlog_nt.o \
|
||||
$(LIB_EVENTLOG_OBJ) ../librpc/gen_ndr/srv_eventlog.o
|
||||
@ -2253,7 +2256,7 @@ bin/librpc_dssetup.@SHLIBEXT@: $(BINARY_PREREQS) $(RPC_DSSETUP_OBJ)
|
||||
@echo "Linking $@"
|
||||
@$(SHLD_MODULE) $(RPC_DSSETUP_OBJ)
|
||||
|
||||
bin/librpc_spoolss.@SHLIBEXT@: $(BINARY_PREREQS) $(RPC_SPOOLSS_OBJ)
|
||||
bin/librpc_spoolss2.@SHLIBEXT@: $(BINARY_PREREQS) $(RPC_SPOOLSS_OBJ)
|
||||
@echo "Linking $@"
|
||||
@$(SHLD_MODULE) $(RPC_SPOOLSS_OBJ)
|
||||
|
||||
|
@ -414,7 +414,7 @@ AC_SUBST(DYNEXP)
|
||||
|
||||
dnl Add modules that have to be built by default here
|
||||
dnl These have to be built static:
|
||||
default_static_modules="pdb_smbpasswd pdb_tdbsam rpc_lsarpc rpc_samr rpc_winreg rpc_initshutdown rpc_dssetup rpc_wkssvc rpc_svcctl rpc_ntsvcs rpc_netlogon rpc_netdfs rpc_srvsvc rpc_spoolss rpc_eventlog auth_sam auth_unix auth_winbind auth_server auth_domain auth_builtin auth_netlogond vfs_default nss_info_template"
|
||||
default_static_modules="pdb_smbpasswd pdb_tdbsam rpc_lsarpc rpc_samr rpc_winreg rpc_initshutdown rpc_dssetup rpc_wkssvc rpc_svcctl rpc_ntsvcs rpc_netlogon rpc_netdfs rpc_srvsvc rpc_spoolss2 rpc_eventlog auth_sam auth_unix auth_winbind auth_server auth_domain auth_builtin auth_netlogond vfs_default nss_info_template"
|
||||
|
||||
dnl These are preferably build shared, and static if dlopen() is not available
|
||||
default_shared_modules="vfs_recycle vfs_audit vfs_extd_audit vfs_full_audit vfs_netatalk vfs_fake_perms vfs_default_quota vfs_readonly vfs_cap vfs_expand_msdfs vfs_shadow_copy vfs_shadow_copy2 charset_CP850 charset_CP437 auth_script vfs_readahead vfs_xattr_tdb vfs_streams_xattr vfs_streams_depot vfs_acl_xattr vfs_acl_tdb vfs_smb_traffic_analyzer"
|
||||
@ -6296,7 +6296,7 @@ do
|
||||
done
|
||||
|
||||
dnl Always build these modules static
|
||||
MODULE_rpc_spoolss=STATIC
|
||||
MODULE_rpc_spoolss2=STATIC
|
||||
MODULE_rpc_srvsvc=STATIC
|
||||
MODULE_idmap_tdb=STATIC
|
||||
MODULE_idmap_passdb=STATIC
|
||||
@ -6339,7 +6339,7 @@ SMB_MODULE(rpc_ntsvcs, \$(RPC_NTSVCS_OBJ), "bin/librpc_ntsvcs.$SHLIBEXT", RPC)
|
||||
SMB_MODULE(rpc_netlogon, \$(RPC_NETLOG_OBJ), "bin/librpc_NETLOGON.$SHLIBEXT", RPC)
|
||||
SMB_MODULE(rpc_netdfs, \$(RPC_DFS_OBJ), "bin/librpc_netdfs.$SHLIBEXT", RPC)
|
||||
SMB_MODULE(rpc_srvsvc, \$(RPC_SVC_OBJ), "bin/librpc_svcsvc.$SHLIBEXT", RPC)
|
||||
SMB_MODULE(rpc_spoolss, \$(RPC_SPOOLSS_OBJ), "bin/librpc_spoolss.$SHLIBEXT", RPC)
|
||||
SMB_MODULE(rpc_spoolss2, \$(RPC_SPOOLSS_OBJ), "bin/librpc_spoolss2.$SHLIBEXT", RPC)
|
||||
SMB_MODULE(rpc_eventlog, \$(RPC_EVENTLOG_OBJ), "bin/librpc_eventlog.$SHLIBEXT", RPC)
|
||||
SMB_MODULE(rpc_samr, \$(RPC_SAMR_OBJ), "bin/librpc_samr.$SHLIBEXT", RPC)
|
||||
SMB_MODULE(rpc_rpcecho, \$(RPC_ECHO_OBJ), "bin/librpc_rpcecho.$SHLIBEXT", RPC)
|
||||
|
@ -2267,6 +2267,7 @@ ADS_STATUS gp_get_machine_token(ADS_STRUCT *ads,
|
||||
#include "librpc/gen_ndr/srv_svcctl.h"
|
||||
#include "librpc/gen_ndr/srv_winreg.h"
|
||||
#include "librpc/gen_ndr/srv_wkssvc.h"
|
||||
#include "librpc/gen_ndr/srv_spoolss.h"
|
||||
|
||||
#include "librpc/ndr/libndr.h"
|
||||
|
||||
@ -6277,8 +6278,8 @@ void copy_id25_to_sam_passwd(struct samu *to,
|
||||
|
||||
/* The following definitions come from rpc_server/srv_spoolss.c */
|
||||
|
||||
void spoolss_get_pipe_fns( struct api_struct **fns, int *n_fns );
|
||||
NTSTATUS rpc_spoolss_init(void);
|
||||
void spoolss2_get_pipe_fns( struct api_struct **fns, int *n_fns );
|
||||
NTSTATUS rpc_spoolss2_init(void);
|
||||
|
||||
/* The following definitions come from rpc_server/srv_spoolss_nt.c */
|
||||
|
||||
|
@ -37,6 +37,7 @@
|
||||
#include "librpc/gen_ndr/cli_ntsvcs.h"
|
||||
#include "librpc/gen_ndr/cli_epmapper.h"
|
||||
#include "librpc/gen_ndr/cli_drsuapi.h"
|
||||
#include "librpc/gen_ndr/cli_spoolss.h"
|
||||
|
||||
#define prs_init_empty( _ps_, _ctx_, _io_ ) (void) prs_init((_ps_), 0, (_ctx_), (_io_))
|
||||
|
||||
|
@ -257,6 +257,7 @@ struct id_map {
|
||||
#include "librpc/gen_ndr/nbt.h"
|
||||
#include "librpc/gen_ndr/drsuapi.h"
|
||||
#include "librpc/gen_ndr/drsblobs.h"
|
||||
#include "librpc/gen_ndr/spoolss.h"
|
||||
|
||||
struct lsa_dom_info {
|
||||
bool valid;
|
||||
|
@ -27,6 +27,27 @@
|
||||
#undef DBGC_CLASS
|
||||
#define DBGC_CLASS DBGC_RPC_SRV
|
||||
|
||||
/*******************************************************************
|
||||
********************************************************************/
|
||||
|
||||
static bool proxy_spoolss_call(pipes_struct *p, uint8_t opnum)
|
||||
{
|
||||
struct api_struct *fns;
|
||||
int n_fns;
|
||||
|
||||
spoolss2_get_pipe_fns(&fns, &n_fns);
|
||||
|
||||
if (opnum >= n_fns) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (fns[opnum].opnum != opnum) {
|
||||
smb_panic("SPOOLSS function table not sorted");
|
||||
}
|
||||
|
||||
return fns[opnum].fn(p);
|
||||
}
|
||||
|
||||
/********************************************************************
|
||||
* api_spoolss_open_printer_ex (rarely seen - older call)
|
||||
********************************************************************/
|
||||
@ -1624,35 +1645,13 @@ static bool api_spoolss_xcvdataport(pipes_struct *p)
|
||||
{"SPOOLSS_XCVDATAPORT", SPOOLSS_XCVDATAPORT, api_spoolss_xcvdataport },
|
||||
};
|
||||
|
||||
void spoolss_get_pipe_fns( struct api_struct **fns, int *n_fns )
|
||||
void spoolss2_get_pipe_fns( struct api_struct **fns, int *n_fns )
|
||||
{
|
||||
*fns = api_spoolss_cmds;
|
||||
*n_fns = sizeof(api_spoolss_cmds) / sizeof(struct api_struct);
|
||||
}
|
||||
|
||||
static const char * const spoolss_endpoint_strings[] = {
|
||||
"ncacn_np:[\\pipe\\spoolss]",
|
||||
};
|
||||
|
||||
static const struct ndr_interface_string_array spoolss_endpoints = {
|
||||
.count = 1,
|
||||
.names = spoolss_endpoint_strings
|
||||
};
|
||||
|
||||
const struct ndr_interface_table ndr_table_spoolss = {
|
||||
.name = "spoolss",
|
||||
.syntax_id = {
|
||||
{ 0x12345678, 0x1234, 0xabcd, { 0xef, 0x00 },
|
||||
{ 0x01, 0x23, 0x45, 0x67, 0x89, 0xab } }, 0x01
|
||||
},
|
||||
.helpstring = "Spooler SubSystem",
|
||||
.num_calls = 0x60,
|
||||
.calls = NULL, /* unused in s3 so far */
|
||||
.endpoints = &spoolss_endpoints,
|
||||
.authservices = NULL /* unused in s3 so far */
|
||||
};
|
||||
|
||||
NTSTATUS rpc_spoolss_init(void)
|
||||
NTSTATUS rpc_spoolss2_init(void)
|
||||
{
|
||||
return rpc_srv_register(
|
||||
SMB_RPC_INTERFACE_VERSION, "spoolss", "spoolss",
|
||||
|
Loading…
Reference in New Issue
Block a user