const char *get_short_archi(const char *long_archi);
bool add_printer_hook(TALLOC_CTX *ctx, NT_USER_TOKEN *token,
- struct spoolss_SetPrinterInfo2 *info2);
+ struct spoolss_SetPrinterInfo2 *info2,
+ const char *remote_machine);
bool print_access_check(struct auth_serversupplied_info *server_info, int snum,
int access_type);
#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
****************************************************************************/
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;
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\"",
DEBUGADD(10,("returned [%d]\n", ret));
TALLOC_FREE(command);
- TALLOC_FREE(remote_machine);
if ( ret != 0 ) {
if (fd != -1)
{
/* 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;
}
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 {