From 55f2cb18adf4bed0e6770bc33278ef6bf0c64e17 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 6 Feb 2009 10:42:11 +0100 Subject: s3:net conf: remove check for sharename being a usernam in "net conf addshare" This is useless and can be overriden by "net conf setparm" anyways. Michael --- source3/utils/net_conf.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'source3/utils') diff --git a/source3/utils/net_conf.c b/source3/utils/net_conf.c index 31e87ca804..0c2cd24fb2 100644 --- a/source3/utils/net_conf.c +++ b/source3/utils/net_conf.c @@ -576,12 +576,6 @@ static int net_conf_addshare(struct net_context *c, goto done; } - if (getpwnam(sharename)) { - d_fprintf(stderr, "ERROR: share name %s is already a valid " - "system user name.\n", sharename); - goto done; - } - if (strequal(sharename, GLOBAL_NAME)) { d_fprintf(stderr, "ERROR: 'global' is not a valid share name.\n"); -- cgit From 0bd5698dabdf8a408e21c5261a688dd2599af3cf Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 14 Nov 2008 23:58:26 +0100 Subject: s3-spoolss: use rpccli_spoolss_ClosePrinter. Guenther --- source3/utils/net_rpc_printer.c | 50 ++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'source3/utils') diff --git a/source3/utils/net_rpc_printer.c b/source3/utils/net_rpc_printer.c index c750e46b67..60e823e5e0 100644 --- a/source3/utils/net_rpc_printer.c +++ b/source3/utils/net_rpc_printer.c @@ -1006,11 +1006,11 @@ static bool get_printer_info(struct rpc_pipe_client *pipe_hnd, return false; if (!net_spoolss_getprinter(pipe_hnd, mem_ctx, &hnd, level, ctr)) { - rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd); + rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd, NULL); return false; } - rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd); + rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd, NULL); *num_printers = 1; @@ -1242,7 +1242,7 @@ static NTSTATUS rpc_printer_publish_internals_args(struct rpc_pipe_client *pipe_ done: if (got_hnd) - rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd); + rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd, NULL); return nt_status; } @@ -1383,7 +1383,7 @@ NTSTATUS rpc_printer_publish_list_internals(struct net_context *c, done: if (got_hnd) - rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd); + rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd, NULL); return nt_status; } @@ -1522,12 +1522,12 @@ NTSTATUS rpc_printer_migrate_security_internals(struct net_context *c, /* close printer handles here */ if (got_hnd_src) { - rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd_src); + rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd_src, NULL); got_hnd_src = false; } if (got_hnd_dst) { - rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst); + rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL); got_hnd_dst = false; } @@ -1538,11 +1538,11 @@ NTSTATUS rpc_printer_migrate_security_internals(struct net_context *c, done: if (got_hnd_src) { - rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd_src); + rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd_src, NULL); } if (got_hnd_dst) { - rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst); + rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL); } if (cli_dst) { @@ -1711,12 +1711,12 @@ NTSTATUS rpc_printer_migrate_forms_internals(struct net_context *c, /* close printer handles here */ if (got_hnd_src) { - rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd_src); + rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd_src, NULL); got_hnd_src = false; } if (got_hnd_dst) { - rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst); + rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL); got_hnd_dst = false; } } @@ -1726,10 +1726,10 @@ NTSTATUS rpc_printer_migrate_forms_internals(struct net_context *c, done: if (got_hnd_src) - rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd_src); + rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd_src, NULL); if (got_hnd_dst) - rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst); + rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL); if (cli_dst) { cli_shutdown(cli_dst); @@ -1933,13 +1933,13 @@ NTSTATUS rpc_printer_migrate_drivers_internals(struct net_context *c, /* close dst */ if (got_hnd_dst) { - rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst); + rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL); got_hnd_dst = false; } /* close src */ if (got_hnd_src) { - rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd_src); + rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd_src, NULL); got_hnd_src = false; } } @@ -1949,10 +1949,10 @@ NTSTATUS rpc_printer_migrate_drivers_internals(struct net_context *c, done: if (got_hnd_src) - rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd_src); + rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd_src, NULL); if (got_hnd_dst) - rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst); + rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL); if (cli_dst) { cli_shutdown(cli_dst); @@ -2067,7 +2067,7 @@ NTSTATUS rpc_printer_migrate_printers_internals(struct net_context *c, DEBUG(1,("printer already exists: %s\n", sharename)); /* close printer handle here - dst only, not got src yet. */ if (got_hnd_dst) { - rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst); + rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL); got_hnd_dst = false; } continue; @@ -2103,12 +2103,12 @@ NTSTATUS rpc_printer_migrate_printers_internals(struct net_context *c, /* close printer handles here */ if (got_hnd_src) { - rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd_src); + rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd_src, NULL); got_hnd_src = false; } if (got_hnd_dst) { - rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst); + rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL); got_hnd_dst = false; } } @@ -2117,10 +2117,10 @@ NTSTATUS rpc_printer_migrate_printers_internals(struct net_context *c, done: if (got_hnd_src) - rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd_src); + rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd_src, NULL); if (got_hnd_dst) - rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst); + rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL); if (cli_dst) { cli_shutdown(cli_dst); @@ -2486,12 +2486,12 @@ NTSTATUS rpc_printer_migrate_settings_internals(struct net_context *c, /* close printer handles here */ if (got_hnd_src) { - rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd_src); + rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd_src, NULL); got_hnd_src = false; } if (got_hnd_dst) { - rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst); + rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL); got_hnd_dst = false; } @@ -2505,10 +2505,10 @@ done: SAFE_FREE(unc_name); if (got_hnd_src) - rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd_src); + rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd_src, NULL); if (got_hnd_dst) - rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst); + rpccli_spoolss_ClosePrinter(pipe_hnd_dst, mem_ctx, &hnd_dst, NULL); if (cli_dst) { cli_shutdown(cli_dst); -- cgit From 5234f5e433847e6efd29e0c4a7d76a491818a92a Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Sun, 8 Feb 2009 00:03:00 +0100 Subject: s3-spoolss: use rpccli_spoolss_AddForm in net and rpcclient. Guenther --- source3/utils/net_rpc_printer.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'source3/utils') diff --git a/source3/utils/net_rpc_printer.c b/source3/utils/net_rpc_printer.c index 60e823e5e0..ad9be05798 100644 --- a/source3/utils/net_rpc_printer.c +++ b/source3/utils/net_rpc_printer.c @@ -1668,8 +1668,10 @@ NTSTATUS rpc_printer_migrate_forms_internals(struct net_context *c, for (f = 0; f < num_forms; f++) { - FORM form; + union spoolss_AddFormInfo info; + struct spoolss_AddFormInfo1 info1; fstring form_name; + NTSTATUS status; /* only migrate FORM_PRINTER types, according to jerry FORM_BUILTIN-types are hard-coded in samba */ @@ -1685,20 +1687,24 @@ NTSTATUS rpc_printer_migrate_forms_internals(struct net_context *c, f, form_name, forms[f].flag); /* is there a more elegant way to do that ? */ - form.flags = FORM_PRINTER; - form.size_x = forms[f].width; - form.size_y = forms[f].length; - form.left = forms[f].left; - form.top = forms[f].top; - form.right = forms[f].right; - form.bottom = forms[f].bottom; + info1.flags = FORM_PRINTER; + info1.size.width = forms[f].width; + info1.size.height = forms[f].length; + info1.area.left = forms[f].left; + info1.area.top = forms[f].top; + info1.area.right = forms[f].right; + info1.area.bottom = forms[f].bottom; + info1.form_name = form_name; - init_unistr2(&form.name, form_name, UNI_STR_TERMINATE); + info.info1 = &info1; /* FIXME: there might be something wrong with samba's builtin-forms */ - result = rpccli_spoolss_addform(pipe_hnd_dst, mem_ctx, - &hnd_dst, 1, &form); + status = rpccli_spoolss_AddForm(pipe_hnd_dst, mem_ctx, + &hnd_dst, + 1, + info, + &result); if (!W_ERROR_IS_OK(result)) { d_printf("\tAddForm form %d: [%s] refused.\n", f, form_name); -- cgit