TALLOC_CTX *mem_ctx,
const char *printername,
uint32_t access_required,
- const char *username,
struct policy_handle *hnd)
{
+ struct cli_credentials *creds = gensec_get_credentials(pipe_hnd->auth->auth_ctx);
+ const char *username = cli_credentials_get_username(creds);
WERROR result;
fstring printername2;
{
struct dcerpc_binding_handle *b = pipe_hnd->binding_handle;
struct policy_handle hnd;
- struct cli_credentials *creds = gensec_get_credentials(pipe_hnd->auth->auth_ctx);
WERROR werr;
/* no arguments given, enumerate all printers */
/* argument given, get a single printer by name */
if (!net_spoolss_open_printer_ex(pipe_hnd, mem_ctx, argv[0],
MAXIMUM_ALLOWED_ACCESS,
- cli_credentials_get_username(creds),
&hnd))
return false;
struct policy_handle hnd = { 0, };
WERROR result;
const char *action_str;
- struct cli_credentials *creds = gensec_get_credentials(pipe_hnd->auth->auth_ctx);
- const char *username = cli_credentials_get_username(creds);
if (!get_printer_info(pipe_hnd, mem_ctx, 2, argc, argv, &num_printers, &info_enum))
return nt_status;
/* open printer handle */
if (!net_spoolss_open_printer_ex(pipe_hnd, mem_ctx, sharename,
- PRINTER_ALL_ACCESS, username, &hnd))
+ PRINTER_ALL_ACCESS, &hnd))
goto done;
/* check for existing dst printer */
/* open printer handle */
if (!net_spoolss_open_printer_ex(pipe_hnd, mem_ctx, sharename,
- PRINTER_ALL_ACCESS, cli->user_name, &hnd))
+ PRINTER_ALL_ACCESS, &hnd))
goto done;
/* check for existing dst printer */
/* open src printer handle */
if (!net_spoolss_open_printer_ex(pipe_hnd, mem_ctx, sharename,
- MAXIMUM_ALLOWED_ACCESS, cli->user_name, &hnd_src))
+ MAXIMUM_ALLOWED_ACCESS, &hnd_src))
goto done;
/* open dst printer handle */
if (!net_spoolss_open_printer_ex(pipe_hnd_dst, mem_ctx, sharename,
- PRINTER_ALL_ACCESS, cli_dst->user_name, &hnd_dst))
+ PRINTER_ALL_ACCESS, &hnd_dst))
goto done;
/* check for existing dst printer */
/* open src printer handle */
if (!net_spoolss_open_printer_ex(pipe_hnd, mem_ctx, sharename,
- MAXIMUM_ALLOWED_ACCESS, cli->user_name, &hnd_src))
+ MAXIMUM_ALLOWED_ACCESS, &hnd_src))
goto done;
/* open dst printer handle */
if (!net_spoolss_open_printer_ex(pipe_hnd_dst, mem_ctx, sharename,
- PRINTER_ALL_ACCESS, cli->user_name, &hnd_dst))
+ PRINTER_ALL_ACCESS, &hnd_dst))
goto done;
/* check for existing dst printer */
struct cli_state *cli_share_src = NULL;
struct cli_state *cli_share_dst = NULL;
const char *drivername = NULL;
- struct cli_credentials *creds = gensec_get_credentials(pipe_hnd->auth->auth_ctx);
- const char *username = cli_credentials_get_username(creds);
WERROR werr;
DEBUG(3,("copying printer-drivers\n"));
/* open dst printer handle */
if (!net_spoolss_open_printer_ex(pipe_hnd_dst, mem_ctx, sharename,
- PRINTER_ALL_ACCESS, cli->user_name, &hnd_dst))
+ PRINTER_ALL_ACCESS, &hnd_dst))
goto done;
/* check for existing dst printer */
/* open src printer handle */
if (!net_spoolss_open_printer_ex(pipe_hnd, mem_ctx, sharename,
MAXIMUM_ALLOWED_ACCESS,
- username,
&hnd_src))
goto done;
/* open dst printer handle */
if (!net_spoolss_open_printer_ex(pipe_hnd_dst, mem_ctx, sharename,
- PRINTER_ALL_ACCESS, cli->user_name, &hnd_dst)) {
+ PRINTER_ALL_ACCESS, &hnd_dst)) {
DEBUG(1,("could not open printer: %s\n", sharename));
}
/* open src printer handle */
if (!net_spoolss_open_printer_ex(pipe_hnd, mem_ctx, sharename,
- MAXIMUM_ALLOWED_ACCESS, cli->user_name, &hnd_src))
+ MAXIMUM_ALLOWED_ACCESS, &hnd_src))
goto done;
/* getprinter on the src server */
/* open src printer handle */
if (!net_spoolss_open_printer_ex(pipe_hnd, mem_ctx, sharename,
- MAXIMUM_ALLOWED_ACCESS, cli->user_name, &hnd_src))
+ MAXIMUM_ALLOWED_ACCESS, &hnd_src))
goto done;
/* open dst printer handle */
if (!net_spoolss_open_printer_ex(pipe_hnd_dst, mem_ctx, sharename,
- PRINTER_ALL_ACCESS, cli_dst->user_name, &hnd_dst))
+ PRINTER_ALL_ACCESS, &hnd_dst))
goto done;
/* check for existing dst printer */