diff options
author | Andreas Schneider <asn@samba.org> | 2010-06-30 10:25:08 +0200 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2010-07-27 10:27:15 -0400 |
commit | 1be454538b2e4d242be90e43fab9eb09f0b07a57 (patch) | |
tree | bb4128d5dda2bbaf1ba2f6e44684b404609b4169 /source3/rpc_server | |
parent | d8c81423aa52f1810cafeefa186f7dd0590cb0de (diff) | |
download | samba-1be454538b2e4d242be90e43fab9eb09f0b07a57.tar.gz samba-1be454538b2e4d242be90e43fab9eb09f0b07a57.tar.bz2 samba-1be454538b2e4d242be90e43fab9eb09f0b07a57.zip |
s3-spoolss: Remove the program global current_user_info.
Signed-off-by: Jim McDonough <jmcd@samba.org>
Diffstat (limited to 'source3/rpc_server')
-rw-r--r-- | source3/rpc_server/srv_spoolss_nt.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index f93b41aa7f..d44df2a217 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -51,9 +51,6 @@ #define SPOOLSS_BUFFER_OK(val_true,val_false) ((r->in.offered >= *r->out.needed)?val_true:val_false) - -extern userdom_struct current_user_info; - #undef DBGC_CLASS #define DBGC_CLASS DBGC_RPC_SRV @@ -5533,7 +5530,8 @@ static WERROR add_port_hook(TALLOC_CTX *ctx, NT_USER_TOKEN *token, const char *p ****************************************************************************/ bool add_printer_hook(TALLOC_CTX *ctx, NT_USER_TOKEN *token, - struct spoolss_SetPrinterInfo2 *info2) + struct spoolss_SetPrinterInfo2 *info2, + const char *remote_machine) { char *cmd = lp_addprinter_cmd(); char **qlines; @@ -5543,18 +5541,10 @@ bool add_printer_hook(TALLOC_CTX *ctx, NT_USER_TOKEN *token, int fd; SE_PRIV se_printop = SE_PRINT_OPERATOR; bool is_print_op = false; - char *remote_machine = talloc_strdup(ctx, "%m"); if (!remote_machine) { return false; } - remote_machine = talloc_sub_basic(ctx, - current_user_info.smb_name, - current_user_info.domain, - remote_machine); - if (!remote_machine) { - return false; - } command = talloc_asprintf(ctx, "%s \"%s\" \"%s\" \"%s\" \"%s\" \"%s\" \"%s\" \"%s\"", @@ -5589,7 +5579,6 @@ bool add_printer_hook(TALLOC_CTX *ctx, NT_USER_TOKEN *token, DEBUGADD(10,("returned [%d]\n", ret)); TALLOC_FREE(command); - TALLOC_FREE(remote_machine); if ( ret != 0 ) { if (fd != -1) @@ -5958,7 +5947,7 @@ static WERROR update_printer(pipes_struct *p, struct policy_handle *handle, { /* add_printer_hook() will call reload_services() */ if (!add_printer_hook(tmp_ctx, p->server_info->ptok, - printer) ) { + printer, p->client_address) ) { result = WERR_ACCESS_DENIED; goto done; } @@ -7247,7 +7236,7 @@ static WERROR spoolss_addprinterex_level_2(pipes_struct *p, if (*lp_addprinter_cmd() ) { if ( !add_printer_hook(p->mem_ctx, p->server_info->ptok, - info2) ) { + info2, p->client_address) ) { return WERR_ACCESS_DENIED; } } else { |