From 4ea46d69bbb7651b213c5b0674f4f9fb05059acd Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 17 Mar 2009 12:01:29 +0100 Subject: s3-net: temporary disable net_spoolss_setprinterdata. Guenther --- source3/utils/net_rpc_printer.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source3/utils') diff --git a/source3/utils/net_rpc_printer.c b/source3/utils/net_rpc_printer.c index 8a2ebfb01f..14f12e44c1 100644 --- a/source3/utils/net_rpc_printer.c +++ b/source3/utils/net_rpc_printer.c @@ -821,8 +821,11 @@ static bool net_spoolss_setprinterdata(struct rpc_pipe_client *pipe_hnd, { WERROR result; + /* FIXME - GD */ + return true; + /* setprinterdata call */ - result = rpccli_spoolss_setprinterdata(pipe_hnd, mem_ctx, hnd, value); + /* result = rpccli_spoolss_setprinterdata(pipe_hnd, mem_ctx, hnd, value); */ if (!W_ERROR_IS_OK(result)) { printf ("unable to set printerdata: %s\n", win_errstr(result)); -- cgit From 2a8c078357dd7bd191d0f2c55d94834c4774ecfc Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 17 Mar 2009 01:47:40 +0100 Subject: s3-net: use rpccli_spoolss_EnumPrinterData. Guenther --- source3/utils/net_rpc_printer.c | 75 ++++++++++++++++++++++++++++++++--------- 1 file changed, 59 insertions(+), 16 deletions(-) (limited to 'source3/utils') diff --git a/source3/utils/net_rpc_printer.c b/source3/utils/net_rpc_printer.c index 14f12e44c1..695b16c3dc 100644 --- a/source3/utils/net_rpc_printer.c +++ b/source3/utils/net_rpc_printer.c @@ -2128,7 +2128,7 @@ NTSTATUS rpc_printer_migrate_settings_internals(struct net_context *c, WERROR result; NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL; uint32 i = 0, p = 0, j = 0; - uint32 num_printers, val_needed, data_needed; + uint32 num_printers; uint32 level = 2; const char *printername, *sharename; struct rpc_pipe_client *pipe_hnd_dst = NULL; @@ -2177,6 +2177,12 @@ NTSTATUS rpc_printer_migrate_settings_internals(struct net_context *c, /* do something for all printers */ for (i = 0; i < num_printers; i++) { + uint32_t value_offered = 0, value_needed; + uint32_t data_offered = 0, data_needed; + enum winreg_Type type; + uint8_t *buffer = NULL; + const char *value_name = NULL; + /* do some initialization */ printername = info_enum[i].info2.printername; sharename = info_enum[i].info2.sharename; @@ -2269,32 +2275,69 @@ NTSTATUS rpc_printer_migrate_settings_internals(struct net_context *c, */ /* enumerate data on src handle */ - result = rpccli_spoolss_enumprinterdata(pipe_hnd, mem_ctx, &hnd_src, p, 0, 0, - &val_needed, &data_needed, NULL); + nt_status = rpccli_spoolss_EnumPrinterData(pipe_hnd, mem_ctx, + &hnd_src, + p, + value_name, + value_offered, + &value_needed, + &type, + buffer, + data_offered, + &data_needed, + &result); + + data_offered = data_needed; + value_offered = value_needed; + buffer = talloc_zero_array(mem_ctx, uint8_t, data_needed); + value_name = talloc_zero_array(mem_ctx, char, value_needed); /* loop for all printerdata of "PrinterDriverData" */ - while (W_ERROR_IS_OK(result)) { - - REGISTRY_VALUE value; - - result = rpccli_spoolss_enumprinterdata( - pipe_hnd, mem_ctx, &hnd_src, p++, val_needed, - data_needed, 0, 0, &value); - + while (NT_STATUS_IS_OK(nt_status) && W_ERROR_IS_OK(result)) { + + nt_status = rpccli_spoolss_EnumPrinterData(pipe_hnd, mem_ctx, + &hnd_src, + p++, + value_name, + value_offered, + &value_needed, + &type, + buffer, + data_offered, + &data_needed, + &result); /* loop for all reg_keys */ - if (W_ERROR_IS_OK(result)) { + if (NT_STATUS_IS_OK(nt_status) && W_ERROR_IS_OK(result)) { + + REGISTRY_VALUE v; + DATA_BLOB blob; + union spoolss_PrinterData printer_data; /* display_value */ - if (c->opt_verbose) - display_reg_value(SPOOL_PRINTERDATA_KEY, value); + if (c->opt_verbose) { + fstrcpy(v.valuename, value_name); + v.type = type; + v.size = data_offered; + v.data_p = buffer; + display_reg_value(SPOOL_PRINTERDATA_KEY, v); + } + + result = pull_spoolss_PrinterData(mem_ctx, + &blob, + &printer_data, + type); + if (!W_ERROR_IS_OK(result)) { + goto done; + } /* set_value */ if (!net_spoolss_setprinterdata(pipe_hnd_dst, mem_ctx, - &hnd_dst, &value)) + &hnd_dst, value_name, + type, printer_data)) goto done; DEBUGADD(1,("\tSetPrinterData of [%s] succeeded\n", - value.valuename)); + v.valuename)); } } -- cgit From acf523ad7edcde788ee79144928d74d91f0e0754 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 17 Mar 2009 00:34:59 +0100 Subject: s3-net: fix net_spoolss_setprinterdata. Guenther --- source3/utils/net_rpc_printer.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'source3/utils') diff --git a/source3/utils/net_rpc_printer.c b/source3/utils/net_rpc_printer.c index 695b16c3dc..a30b3a1d0e 100644 --- a/source3/utils/net_rpc_printer.c +++ b/source3/utils/net_rpc_printer.c @@ -815,17 +815,23 @@ static bool net_spoolss_setprinter(struct rpc_pipe_client *pipe_hnd, static bool net_spoolss_setprinterdata(struct rpc_pipe_client *pipe_hnd, - TALLOC_CTX *mem_ctx, - POLICY_HND *hnd, - REGISTRY_VALUE *value) + TALLOC_CTX *mem_ctx, + struct policy_handle *hnd, + const char *value_name, + enum winreg_Type type, + union spoolss_PrinterData data) { WERROR result; - - /* FIXME - GD */ - return true; + NTSTATUS status; /* setprinterdata call */ - /* result = rpccli_spoolss_setprinterdata(pipe_hnd, mem_ctx, hnd, value); */ + status = rpccli_spoolss_SetPrinterData(pipe_hnd, mem_ctx, + hnd, + value_name, + type, + data, + 0, /* autocalculated */ + &result); if (!W_ERROR_IS_OK(result)) { printf ("unable to set printerdata: %s\n", win_errstr(result)); -- cgit From 12c6ac6a434325d7e9837bbea6d35482767251ba Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 17 Mar 2009 00:29:13 +0100 Subject: s3-net: fix net_spoolss_setprinterdataex. Guenther --- source3/utils/net_rpc_printer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/utils') diff --git a/source3/utils/net_rpc_printer.c b/source3/utils/net_rpc_printer.c index a30b3a1d0e..43ef412d90 100644 --- a/source3/utils/net_rpc_printer.c +++ b/source3/utils/net_rpc_printer.c @@ -885,7 +885,7 @@ static bool net_spoolss_enumprinterdataex(struct rpc_pipe_client *pipe_hnd, static bool net_spoolss_setprinterdataex(struct rpc_pipe_client *pipe_hnd, TALLOC_CTX *mem_ctx, POLICY_HND *hnd, - char *keyname, + const char *keyname, REGISTRY_VALUE *value) { WERROR result; -- cgit From e0c50aafce59ad4f4275ff91defb14ea44f42a65 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 16 Mar 2009 23:38:05 +0100 Subject: s3-net: use rpccli_spoolss_enumprinterkey wrapper. Guenther --- source3/utils/net_rpc_printer.c | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) (limited to 'source3/utils') diff --git a/source3/utils/net_rpc_printer.c b/source3/utils/net_rpc_printer.c index 43ef412d90..effd23668f 100644 --- a/source3/utils/net_rpc_printer.c +++ b/source3/utils/net_rpc_printer.c @@ -846,12 +846,12 @@ static bool net_spoolss_enumprinterkey(struct rpc_pipe_client *pipe_hnd, TALLOC_CTX *mem_ctx, POLICY_HND *hnd, const char *keyname, - uint16 **keylist) + const char ***keylist) { WERROR result; /* enumprinterkey call */ - result = rpccli_spoolss_enumprinterkey(pipe_hnd, mem_ctx, hnd, keyname, keylist, NULL); + result = rpccli_spoolss_enumprinterkey(pipe_hnd, mem_ctx, hnd, keyname, keylist, 0); if (!W_ERROR_IS_OK(result)) { printf("enumprinterkey failed: %s\n", win_errstr(result)); @@ -2146,8 +2146,7 @@ NTSTATUS rpc_printer_migrate_settings_internals(struct net_context *c, struct cli_state *cli_dst = NULL; char *devicename = NULL, *unc_name = NULL, *url = NULL; const char *longname; - - uint16 *keylist = NULL, *curkey; + const char **keylist = NULL; /* FIXME GD */ ZERO_STRUCT(info_dst_publish); @@ -2367,19 +2366,9 @@ NTSTATUS rpc_printer_migrate_settings_internals(struct net_context *c, if (keylist == NULL) continue; - curkey = keylist; - while (*curkey != 0) { - char *subkey; - rpcstr_pull_talloc(mem_ctx, - &subkey, - curkey, - -1, - STR_TERMINATE); - if (!subkey) { - return NT_STATUS_NO_MEMORY; - } + for (i=0; keylist && keylist[i] != NULL; i++) { - curkey += strlen(subkey) + 1; + const char *subkey = keylist[i]; if ( !(reg_ctr = TALLOC_ZERO_P( mem_ctx, REGVAL_CTR )) ) return NT_STATUS_NO_MEMORY; @@ -2484,7 +2473,7 @@ NTSTATUS rpc_printer_migrate_settings_internals(struct net_context *c, TALLOC_FREE( reg_ctr ); } - SAFE_FREE(keylist); + TALLOC_FREE(keylist); /* close printer handles here */ if (is_valid_policy_hnd(&hnd_src)) { -- cgit From 8dd1faaa2992851f6852ba7ea4498445af5faadd Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 17 Mar 2009 14:53:06 -0700 Subject: Remove the global "struct cm_cred_struct" and associated calls, make callers pass in a struct user_auth_info * instead. This commit causes smbc_set_credentials() to print out a message telling callers to use smbc_set_credentials_with_fallback() instead, as smbc_set_credentials() has a broken API (no SMBCCTX * pointer). No more global variables used in the connection manager API for client dfs calls. Jeremy. --- source3/utils/net_rpc.c | 2 +- source3/utils/smbcacls.c | 7 +------ source3/utils/smbcquotas.c | 7 +------ source3/utils/smbtree.c | 7 +------ 4 files changed, 4 insertions(+), 19 deletions(-) (limited to 'source3/utils') diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c index c54d479413..241924f7de 100644 --- a/source3/utils/net_rpc.c +++ b/source3/utils/net_rpc.c @@ -3299,7 +3299,7 @@ static bool sync_files(struct copy_clistate *cp_clistate, const char *mask) DEBUG(3,("calling cli_list with mask: %s\n", mask)); - if ( !cli_resolve_path(talloc_tos(), "", cp_clistate->cli_share_src, + if ( !cli_resolve_path(talloc_tos(), "", NULL, cp_clistate->cli_share_src, mask, &targetcli, &targetpath ) ) { d_fprintf(stderr, "cli_resolve_path %s failed with error: %s\n", mask, cli_errstr(cp_clistate->cli_share_src)); diff --git a/source3/utils/smbcacls.c b/source3/utils/smbcacls.c index c12778f8c7..85b7baad00 100644 --- a/source3/utils/smbcacls.c +++ b/source3/utils/smbcacls.c @@ -973,12 +973,7 @@ static struct cli_state *connect_one(struct user_auth_info *auth_info, return NULL; } - if (!get_cmdline_auth_info_got_pass(auth_info)) { - char *pass = getpass("Password: "); - if (pass) { - set_cmdline_auth_info_password(auth_info, pass); - } - } + set_cmdline_auth_info_getpass(auth_info); nt_status = cli_full_connection(&c, global_myname(), server, &ss, 0, diff --git a/source3/utils/smbcquotas.c b/source3/utils/smbcquotas.c index a95394b125..bc21dd8ad9 100644 --- a/source3/utils/smbcquotas.c +++ b/source3/utils/smbcquotas.c @@ -385,12 +385,7 @@ static struct cli_state *connect_one(const char *share) } - if (!get_cmdline_auth_info_got_pass(smbcquotas_auth_info)) { - char *pass = getpass("Password: "); - if (pass) { - set_cmdline_auth_info_password(smbcquotas_auth_info, pass); - } - } + set_cmdline_auth_info_getpass(smbcquotas_auth_info); nt_status = cli_full_connection(&c, global_myname(), server, &ss, 0, diff --git a/source3/utils/smbtree.c b/source3/utils/smbtree.c index 6c69300e85..02001f0abb 100644 --- a/source3/utils/smbtree.c +++ b/source3/utils/smbtree.c @@ -315,12 +315,7 @@ static bool print_tree(struct user_auth_info *user_info) return 1; } - if (!get_cmdline_auth_info_got_pass(auth_info)) { - char *pass = getpass("Password: "); - if (pass) { - set_cmdline_auth_info_password(auth_info, pass); - } - } + set_cmdline_auth_info_getpass(auth_info); /* Now do our stuff */ -- cgit From f9712d568ab6331be5a62a34ce60331013ccd253 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 18 Mar 2009 01:06:22 +0100 Subject: s3-net: use rpccli_spoolss_enumprinterdataex. Guenther --- source3/utils/net_rpc_printer.c | 68 ++++++++++++++++++++++++++--------------- 1 file changed, 44 insertions(+), 24 deletions(-) (limited to 'source3/utils') diff --git a/source3/utils/net_rpc_printer.c b/source3/utils/net_rpc_printer.c index effd23668f..6c55487534 100644 --- a/source3/utils/net_rpc_printer.c +++ b/source3/utils/net_rpc_printer.c @@ -866,12 +866,18 @@ static bool net_spoolss_enumprinterdataex(struct rpc_pipe_client *pipe_hnd, uint32 offered, POLICY_HND *hnd, const char *keyname, - REGVAL_CTR *ctr) + uint32_t *count, + struct spoolss_PrinterEnumValues **info) { WERROR result; /* enumprinterdataex call */ - result = rpccli_spoolss_enumprinterdataex(pipe_hnd, mem_ctx, hnd, keyname, ctr); + result = rpccli_spoolss_enumprinterdataex(pipe_hnd, mem_ctx, + hnd, + keyname, + 0, /* offered */ + count, + info); if (!W_ERROR_IS_OK(result)) { printf("enumprinterdataex failed: %s\n", win_errstr(result)); @@ -2142,7 +2148,6 @@ NTSTATUS rpc_printer_migrate_settings_internals(struct net_context *c, union spoolss_PrinterInfo *info_enum; union spoolss_PrinterInfo info_dst_publish; union spoolss_PrinterInfo info_dst; - REGVAL_CTR *reg_ctr; struct cli_state *cli_dst = NULL; char *devicename = NULL, *unc_name = NULL, *url = NULL; const char *longname; @@ -2369,17 +2374,17 @@ NTSTATUS rpc_printer_migrate_settings_internals(struct net_context *c, for (i=0; keylist && keylist[i] != NULL; i++) { const char *subkey = keylist[i]; - - if ( !(reg_ctr = TALLOC_ZERO_P( mem_ctx, REGVAL_CTR )) ) - return NT_STATUS_NO_MEMORY; + uint32_t count; + struct spoolss_PrinterEnumValues *info; /* enumerate all src subkeys */ if (!net_spoolss_enumprinterdataex(pipe_hnd, mem_ctx, 0, &hnd_src, subkey, - reg_ctr)) + &count, &info)) { goto done; + } - for (j=0; j < reg_ctr->num_values; j++) { + for (j=0; j < count; j++) { REGISTRY_VALUE value; UNISTR2 data; @@ -2387,20 +2392,20 @@ NTSTATUS rpc_printer_migrate_settings_internals(struct net_context *c, /* although samba replies with sane data in most cases we should try to avoid writing wrong registry data */ - if (strequal(reg_ctr->values[j]->valuename, SPOOL_REG_PORTNAME) || - strequal(reg_ctr->values[j]->valuename, SPOOL_REG_UNCNAME) || - strequal(reg_ctr->values[j]->valuename, SPOOL_REG_URL) || - strequal(reg_ctr->values[j]->valuename, SPOOL_REG_SHORTSERVERNAME) || - strequal(reg_ctr->values[j]->valuename, SPOOL_REG_SERVERNAME)) { + if (strequal(info[j].value_name, SPOOL_REG_PORTNAME) || + strequal(info[j].value_name, SPOOL_REG_UNCNAME) || + strequal(info[j].value_name, SPOOL_REG_URL) || + strequal(info[j].value_name, SPOOL_REG_SHORTSERVERNAME) || + strequal(info[j].value_name, SPOOL_REG_SERVERNAME)) { - if (strequal(reg_ctr->values[j]->valuename, SPOOL_REG_PORTNAME)) { + if (strequal(info[j].value_name, SPOOL_REG_PORTNAME)) { /* although windows uses a multi-sz, we use a sz */ init_unistr2(&data, SAMBA_PRINTER_PORT_NAME, UNI_STR_TERMINATE); fstrcpy(value.valuename, SPOOL_REG_PORTNAME); } - if (strequal(reg_ctr->values[j]->valuename, SPOOL_REG_UNCNAME)) { + if (strequal(info[j].value_name, SPOOL_REG_UNCNAME)) { if (asprintf(&unc_name, "\\\\%s\\%s", longname, sharename) < 0) { nt_status = NT_STATUS_NO_MEMORY; @@ -2410,7 +2415,7 @@ NTSTATUS rpc_printer_migrate_settings_internals(struct net_context *c, fstrcpy(value.valuename, SPOOL_REG_UNCNAME); } - if (strequal(reg_ctr->values[j]->valuename, SPOOL_REG_URL)) { + if (strequal(info[j].value_name, SPOOL_REG_URL)) { continue; @@ -2425,13 +2430,13 @@ NTSTATUS rpc_printer_migrate_settings_internals(struct net_context *c, #endif } - if (strequal(reg_ctr->values[j]->valuename, SPOOL_REG_SERVERNAME)) { + if (strequal(info[j].value_name, SPOOL_REG_SERVERNAME)) { init_unistr2(&data, longname, UNI_STR_TERMINATE); fstrcpy(value.valuename, SPOOL_REG_SERVERNAME); } - if (strequal(reg_ctr->values[j]->valuename, SPOOL_REG_SHORTSERVERNAME)) { + if (strequal(info[j].value_name, SPOOL_REG_SHORTSERVERNAME)) { init_unistr2(&data, global_myname(), UNI_STR_TERMINATE); fstrcpy(value.valuename, SPOOL_REG_SHORTSERVERNAME); @@ -2455,22 +2460,37 @@ NTSTATUS rpc_printer_migrate_settings_internals(struct net_context *c, } else { - if (c->opt_verbose) - display_reg_value(subkey, *(reg_ctr->values[j])); + REGISTRY_VALUE v; + DATA_BLOB blob; + + result = push_spoolss_PrinterData(mem_ctx, &blob, + info[j].type, + info[j].data); + if (!W_ERROR_IS_OK(result)) { + goto done; + } + + fstrcpy(v.valuename, info[j].value_name); + v.type = info[j].type; + v.data_p = blob.data; + v.size = blob.length; + + if (c->opt_verbose) { + display_reg_value(subkey, v); + } /* here we have to set all subkeys on the dst server */ if (!net_spoolss_setprinterdataex(pipe_hnd_dst, mem_ctx, &hnd_dst, - subkey, reg_ctr->values[j])) + subkey, &v)) { goto done; + } } DEBUGADD(1,("\tSetPrinterDataEx of key [%s\\%s] succeeded\n", - subkey, reg_ctr->values[j]->valuename)); + subkey, info[j].value_name)); } - - TALLOC_FREE( reg_ctr ); } TALLOC_FREE(keylist); -- cgit From 9fdeb7f7b319dca5dbd1fdaf24f01fb19e124fe6 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 18 Mar 2009 13:22:51 +0100 Subject: s3-spoolss: remove custom syntax_spoolss and use the syntax defined in IDL. Guenther --- source3/utils/net_ads.c | 2 +- source3/utils/net_rpc.c | 36 ++++++++++++++++++------------------ source3/utils/net_rpc_printer.c | 10 +++++----- 3 files changed, 24 insertions(+), 24 deletions(-) (limited to 'source3/utils') diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c index 58bbb70ce6..2a66619438 100644 --- a/source3/utils/net_ads.c +++ b/source3/utils/net_ads.c @@ -1662,7 +1662,7 @@ static int net_ads_printer_publish(struct net_context *c, int argc, const char * SAFE_FREE(srv_cn_escaped); SAFE_FREE(printername_escaped); - nt_status = cli_rpc_pipe_open_noauth(cli, &syntax_spoolss, &pipe_hnd); + nt_status = cli_rpc_pipe_open_noauth(cli, &ndr_table_spoolss.syntax_id, &pipe_hnd); if (!NT_STATUS_IS_OK(nt_status)) { d_fprintf(stderr, "Unable to open a connnection to the spoolss pipe on %s\n", servername); diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c index 241924f7de..42756f660e 100644 --- a/source3/utils/net_rpc.c +++ b/source3/utils/net_rpc.c @@ -6421,30 +6421,30 @@ static int rpc_printer_migrate_all(struct net_context *c, int argc, return -1; } - ret = run_rpc_command(c, NULL, &syntax_spoolss, 0, + ret = run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0, rpc_printer_migrate_printers_internals, argc, argv); if (ret) return ret; - ret = run_rpc_command(c, NULL, &syntax_spoolss, 0, + ret = run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0, rpc_printer_migrate_drivers_internals, argc, argv); if (ret) return ret; - ret = run_rpc_command(c, NULL, &syntax_spoolss, 0, + ret = run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0, rpc_printer_migrate_forms_internals, argc, argv); if (ret) return ret; - ret = run_rpc_command(c, NULL, &syntax_spoolss, 0, + ret = run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0, rpc_printer_migrate_settings_internals, argc, argv); if (ret) return ret; - return run_rpc_command(c, NULL, &syntax_spoolss, 0, + return run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0, rpc_printer_migrate_security_internals, argc, argv); @@ -6475,7 +6475,7 @@ static int rpc_printer_migrate_drivers(struct net_context *c, int argc, return -1; } - return run_rpc_command(c, NULL, &syntax_spoolss, 0, + return run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0, rpc_printer_migrate_drivers_internals, argc, argv); } @@ -6505,7 +6505,7 @@ static int rpc_printer_migrate_forms(struct net_context *c, int argc, return -1; } - return run_rpc_command(c, NULL, &syntax_spoolss, 0, + return run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0, rpc_printer_migrate_forms_internals, argc, argv); } @@ -6535,7 +6535,7 @@ static int rpc_printer_migrate_printers(struct net_context *c, int argc, return -1; } - return run_rpc_command(c, NULL, &syntax_spoolss, 0, + return run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0, rpc_printer_migrate_printers_internals, argc, argv); } @@ -6565,7 +6565,7 @@ static int rpc_printer_migrate_security(struct net_context *c, int argc, return -1; } - return run_rpc_command(c, NULL, &syntax_spoolss, 0, + return run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0, rpc_printer_migrate_security_internals, argc, argv); } @@ -6595,7 +6595,7 @@ static int rpc_printer_migrate_settings(struct net_context *c, int argc, return -1; } - return run_rpc_command(c, NULL, &syntax_spoolss, 0, + return run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0, rpc_printer_migrate_settings_internals, argc, argv); } @@ -6691,7 +6691,7 @@ static int rpc_printer_list(struct net_context *c, int argc, const char **argv) return 0; } - return run_rpc_command(c, NULL, &syntax_spoolss, 0, + return run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0, rpc_printer_list_internals, argc, argv); } @@ -6716,7 +6716,7 @@ static int rpc_printer_driver_list(struct net_context *c, int argc, return 0; } - return run_rpc_command(c, NULL, &syntax_spoolss, 0, + return run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0, rpc_printer_driver_list_internals, argc, argv); } @@ -6741,7 +6741,7 @@ static int rpc_printer_publish_publish(struct net_context *c, int argc, return 0; } - return run_rpc_command(c, NULL, &syntax_spoolss, 0, + return run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0, rpc_printer_publish_publish_internals, argc, argv); } @@ -6765,7 +6765,7 @@ static int rpc_printer_publish_update(struct net_context *c, int argc, const cha return 0; } - return run_rpc_command(c, NULL, &syntax_spoolss, 0, + return run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0, rpc_printer_publish_update_internals, argc, argv); } @@ -6790,7 +6790,7 @@ static int rpc_printer_publish_unpublish(struct net_context *c, int argc, return 0; } - return run_rpc_command(c, NULL, &syntax_spoolss, 0, + return run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0, rpc_printer_publish_unpublish_internals, argc, argv); } @@ -6815,7 +6815,7 @@ static int rpc_printer_publish_list(struct net_context *c, int argc, return 0; } - return run_rpc_command(c, NULL, &syntax_spoolss, 0, + return run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0, rpc_printer_publish_list_internals, argc, argv); } @@ -6880,7 +6880,7 @@ static int rpc_printer_publish(struct net_context *c, int argc, net_display_usage_from_functable(func); return 0; } - return run_rpc_command(c, NULL, &syntax_spoolss, 0, + return run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0, rpc_printer_publish_list_internals, argc, argv); } @@ -6983,7 +6983,7 @@ int net_rpc_printer(struct net_context *c, int argc, const char **argv) net_display_usage_from_functable(func); return 0; } - return run_rpc_command(c, NULL, &syntax_spoolss, 0, + return run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0, rpc_printer_list_internals, argc, argv); } diff --git a/source3/utils/net_rpc_printer.c b/source3/utils/net_rpc_printer.c index 6c55487534..41fc50cb13 100644 --- a/source3/utils/net_rpc_printer.c +++ b/source3/utils/net_rpc_printer.c @@ -1479,7 +1479,7 @@ NTSTATUS rpc_printer_migrate_security_internals(struct net_context *c, /* connect destination PI_SPOOLSS */ nt_status = connect_dst_pipe(c, &cli_dst, &pipe_hnd_dst, - &syntax_spoolss); + &ndr_table_spoolss.syntax_id); if (!NT_STATUS_IS_OK(nt_status)) return nt_status; @@ -1627,7 +1627,7 @@ NTSTATUS rpc_printer_migrate_forms_internals(struct net_context *c, /* connect destination PI_SPOOLSS */ nt_status = connect_dst_pipe(c, &cli_dst, &pipe_hnd_dst, - &syntax_spoolss); + &ndr_table_spoolss.syntax_id); if (!NT_STATUS_IS_OK(nt_status)) return nt_status; @@ -1790,7 +1790,7 @@ NTSTATUS rpc_printer_migrate_drivers_internals(struct net_context *c, DEBUG(3,("copying printer-drivers\n")); nt_status = connect_dst_pipe(c, &cli_dst, &pipe_hnd_dst, - &syntax_spoolss); + &ndr_table_spoolss.syntax_id); if (!NT_STATUS_IS_OK(nt_status)) return nt_status; @@ -1997,7 +1997,7 @@ NTSTATUS rpc_printer_migrate_printers_internals(struct net_context *c, /* connect destination PI_SPOOLSS */ nt_status = connect_dst_pipe(c, &cli_dst, &pipe_hnd_dst, - &syntax_spoolss); + &ndr_table_spoolss.syntax_id); if (!NT_STATUS_IS_OK(nt_status)) return nt_status; @@ -2160,7 +2160,7 @@ NTSTATUS rpc_printer_migrate_settings_internals(struct net_context *c, /* connect destination PI_SPOOLSS */ nt_status = connect_dst_pipe(c, &cli_dst, &pipe_hnd_dst, - &syntax_spoolss); + &ndr_table_spoolss.syntax_id); if (!NT_STATUS_IS_OK(nt_status)) return nt_status; -- cgit From 9d1ab9a0013127d08bad01975a5204e8f63b9ddc Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 25 Feb 2009 14:33:59 +0100 Subject: spoolss: add my copyright. Guenther --- source3/utils/net_rpc_printer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/utils') diff --git a/source3/utils/net_rpc_printer.c b/source3/utils/net_rpc_printer.c index 41fc50cb13..8684e4ce74 100644 --- a/source3/utils/net_rpc_printer.c +++ b/source3/utils/net_rpc_printer.c @@ -1,7 +1,7 @@ /* Samba Unix/Linux SMB client library Distributed SMB/CIFS Server Management Utility - Copyright (C) 2004 Guenther Deschner (gd@samba.org) + Copyright (C) 2004,2009 Guenther Deschner (gd@samba.org) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -- cgit From 21391f7fbe6c92ba050462750571cda661f5fb8a Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 18 Mar 2009 17:45:30 +0100 Subject: s3-smbcontrol: use correct PRINTER_NOTIFY flags. Guenther --- source3/utils/smbcontrol.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/utils') diff --git a/source3/utils/smbcontrol.c b/source3/utils/smbcontrol.c index 6ea200bfec..fc7d0aa360 100644 --- a/source3/utils/smbcontrol.c +++ b/source3/utils/smbcontrol.c @@ -669,11 +669,11 @@ static bool do_printnotify(struct messaging_context *msg_ctx, } if (strcmp(argv[3], "comment") == 0) { - attribute = PRINTER_NOTIFY_COMMENT; + attribute = PRINTER_NOTIFY_FIELD_COMMENT; } else if (strcmp(argv[3], "port") == 0) { - attribute = PRINTER_NOTIFY_PORT_NAME; + attribute = PRINTER_NOTIFY_FIELD_PORT_NAME; } else if (strcmp(argv[3], "driver") == 0) { - attribute = PRINTER_NOTIFY_DRIVER_NAME; + attribute = PRINTER_NOTIFY_FIELD_DRIVER_NAME; } else { fprintf(stderr, "Invalid printer command '%s'\n", argv[3]); -- cgit From 531af136f9dd5c6050f78948837294aed02de440 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 18 Mar 2009 22:49:41 +0100 Subject: s3: remove POLICY_HND. Guenther --- source3/utils/net_rpc.c | 74 ++++++++++++++++++++-------------------- source3/utils/net_rpc_audit.c | 8 ++--- source3/utils/net_rpc_join.c | 2 +- source3/utils/net_rpc_printer.c | 32 ++++++++--------- source3/utils/net_rpc_registry.c | 6 ++-- source3/utils/net_rpc_rights.c | 20 +++++------ source3/utils/net_rpc_service.c | 22 ++++++------ source3/utils/net_rpc_sh_acct.c | 2 +- source3/utils/net_util.c | 2 +- source3/utils/netlookup.c | 2 +- source3/utils/smbcquotas.c | 2 +- 11 files changed, 86 insertions(+), 86 deletions(-) (limited to 'source3/utils') diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c index 42756f660e..d83fb44aba 100644 --- a/source3/utils/net_rpc.c +++ b/source3/utils/net_rpc.c @@ -55,7 +55,7 @@ NTSTATUS net_get_remote_domain_sid(struct cli_state *cli, TALLOC_CTX *mem_ctx, const char **domain_name) { struct rpc_pipe_client *lsa_pipe; - POLICY_HND pol; + struct policy_handle pol; NTSTATUS result = NT_STATUS_OK; union lsa_PolicyInformation *info = NULL; @@ -470,7 +470,7 @@ NTSTATUS rpc_info_internals(struct net_context *c, int argc, const char **argv) { - POLICY_HND connect_pol, domain_pol; + struct policy_handle connect_pol, domain_pol; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; union samr_DomainInfo *info = NULL; fstring sid_str; @@ -989,10 +989,10 @@ static NTSTATUS rpc_sh_handle_user(struct net_context *c, TALLOC_CTX *mem_ctx, struct rpc_sh_ctx *ctx, struct rpc_pipe_client *pipe_hnd, - POLICY_HND *user_hnd, + struct policy_handle *user_hnd, int argc, const char **argv)) { - POLICY_HND connect_pol, domain_pol, user_pol; + struct policy_handle connect_pol, domain_pol, user_pol; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; DOM_SID sid; uint32 rid; @@ -1073,7 +1073,7 @@ static NTSTATUS rpc_sh_user_show_internals(struct net_context *c, TALLOC_CTX *mem_ctx, struct rpc_sh_ctx *ctx, struct rpc_pipe_client *pipe_hnd, - POLICY_HND *user_hnd, + struct policy_handle *user_hnd, int argc, const char **argv) { NTSTATUS result; @@ -1124,7 +1124,7 @@ static NTSTATUS rpc_sh_user_str_edit_internals(struct net_context *c, TALLOC_CTX *mem_ctx, struct rpc_sh_ctx *ctx, struct rpc_pipe_client *pipe_hnd, - POLICY_HND *user_hnd, + struct policy_handle *user_hnd, int argc, const char **argv) { NTSTATUS result; @@ -1209,7 +1209,7 @@ static NTSTATUS rpc_sh_user_flag_edit_internals(struct net_context *c, TALLOC_CTX *mem_ctx, struct rpc_sh_ctx *ctx, struct rpc_pipe_client *pipe_hnd, - POLICY_HND *user_hnd, + struct policy_handle *user_hnd, int argc, const char **argv) { NTSTATUS result; @@ -1386,7 +1386,7 @@ static NTSTATUS rpc_group_delete_internals(struct net_context *c, int argc, const char **argv) { - POLICY_HND connect_pol, domain_pol, group_pol, user_pol; + struct policy_handle connect_pol, domain_pol, group_pol, user_pol; bool group_is_primary = false; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; uint32_t group_rid; @@ -1658,7 +1658,7 @@ static NTSTATUS get_sid_from_name(struct cli_state *cli, DOM_SID *sids = NULL; enum lsa_SidType *types = NULL; struct rpc_pipe_client *pipe_hnd; - POLICY_HND lsa_pol; + struct policy_handle lsa_pol; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; result = cli_rpc_pipe_open_noauth(cli, &ndr_table_lsarpc.syntax_id, @@ -1710,10 +1710,10 @@ static NTSTATUS rpc_add_groupmem(struct rpc_pipe_client *pipe_hnd, const DOM_SID *group_sid, const char *member) { - POLICY_HND connect_pol, domain_pol; + struct policy_handle connect_pol, domain_pol; NTSTATUS result; uint32 group_rid; - POLICY_HND group_pol; + struct policy_handle group_pol; struct samr_Ids rids, rid_types; struct lsa_String lsa_acct_name; @@ -1784,10 +1784,10 @@ static NTSTATUS rpc_add_aliasmem(struct rpc_pipe_client *pipe_hnd, const DOM_SID *alias_sid, const char *member) { - POLICY_HND connect_pol, domain_pol; + struct policy_handle connect_pol, domain_pol; NTSTATUS result; uint32 alias_rid; - POLICY_HND alias_pol; + struct policy_handle alias_pol; DOM_SID member_sid; enum lsa_SidType member_type; @@ -1918,10 +1918,10 @@ static NTSTATUS rpc_del_groupmem(struct net_context *c, const DOM_SID *group_sid, const char *member) { - POLICY_HND connect_pol, domain_pol; + struct policy_handle connect_pol, domain_pol; NTSTATUS result; uint32 group_rid; - POLICY_HND group_pol; + struct policy_handle group_pol; struct samr_Ids rids, rid_types; struct lsa_String lsa_acct_name; @@ -1986,10 +1986,10 @@ static NTSTATUS rpc_del_aliasmem(struct rpc_pipe_client *pipe_hnd, const DOM_SID *alias_sid, const char *member) { - POLICY_HND connect_pol, domain_pol; + struct policy_handle connect_pol, domain_pol; NTSTATUS result; uint32 alias_rid; - POLICY_HND alias_pol; + struct policy_handle alias_pol; DOM_SID member_sid; enum lsa_SidType member_type; @@ -2136,7 +2136,7 @@ static NTSTATUS rpc_group_list_internals(struct net_context *c, int argc, const char **argv) { - POLICY_HND connect_pol, domain_pol; + struct policy_handle connect_pol, domain_pol; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; uint32 start_idx=0, max_entries=250, num_entries, i, loop_count = 0; struct samr_SamArray *groups = NULL; @@ -2259,7 +2259,7 @@ static NTSTATUS rpc_group_list_internals(struct net_context *c, if (c->opt_long_list_entries) { - POLICY_HND alias_pol; + struct policy_handle alias_pol; union samr_AliasInfo *info = NULL; if ((NT_STATUS_IS_OK(rpccli_samr_OpenAlias(pipe_hnd, mem_ctx, @@ -2318,7 +2318,7 @@ static NTSTATUS rpc_group_list_internals(struct net_context *c, if (c->opt_long_list_entries) { - POLICY_HND alias_pol; + struct policy_handle alias_pol; union samr_AliasInfo *info = NULL; if ((NT_STATUS_IS_OK(rpccli_samr_OpenAlias(pipe_hnd, mem_ctx, @@ -2362,11 +2362,11 @@ static NTSTATUS rpc_list_group_members(struct net_context *c, TALLOC_CTX *mem_ctx, const char *domain_name, const DOM_SID *domain_sid, - POLICY_HND *domain_pol, + struct policy_handle *domain_pol, uint32 rid) { NTSTATUS result; - POLICY_HND group_pol; + struct policy_handle group_pol; uint32 num_members, *group_rids; int i; struct samr_RidTypeArray *rids = NULL; @@ -2437,12 +2437,12 @@ static NTSTATUS rpc_list_group_members(struct net_context *c, static NTSTATUS rpc_list_alias_members(struct net_context *c, struct rpc_pipe_client *pipe_hnd, TALLOC_CTX *mem_ctx, - POLICY_HND *domain_pol, + struct policy_handle *domain_pol, uint32 rid) { NTSTATUS result; struct rpc_pipe_client *lsa_pipe; - POLICY_HND alias_pol, lsa_pol; + struct policy_handle alias_pol, lsa_pol; uint32 num_members; DOM_SID *alias_sids; char **domains; @@ -2545,7 +2545,7 @@ static NTSTATUS rpc_group_members_internals(struct net_context *c, const char **argv) { NTSTATUS result; - POLICY_HND connect_pol, domain_pol; + struct policy_handle connect_pol, domain_pol; struct samr_Ids rids, rid_types; struct lsa_String lsa_acct_name; @@ -3752,13 +3752,13 @@ static void push_alias(TALLOC_CTX *mem_ctx, struct full_alias *alias) static NTSTATUS rpc_fetch_domain_aliases(struct rpc_pipe_client *pipe_hnd, TALLOC_CTX *mem_ctx, - POLICY_HND *connect_pol, + struct policy_handle *connect_pol, const DOM_SID *domain_sid) { uint32 start_idx, max_entries, num_entries, i; struct samr_SamArray *groups = NULL; NTSTATUS result; - POLICY_HND domain_pol; + struct policy_handle domain_pol; /* Get domain policy handle */ @@ -3782,7 +3782,7 @@ static NTSTATUS rpc_fetch_domain_aliases(struct rpc_pipe_client *pipe_hnd, &num_entries); for (i = 0; i < num_entries; i++) { - POLICY_HND alias_pol; + struct policy_handle alias_pol; struct full_alias alias; struct lsa_SidArray sid_array; int j; @@ -3847,7 +3847,7 @@ static NTSTATUS rpc_aliaslist_dump(struct net_context *c, { int i; NTSTATUS result; - POLICY_HND lsa_pol; + struct policy_handle lsa_pol; result = rpccli_lsa_open_policy(pipe_hnd, mem_ctx, true, SEC_RIGHTS_MAXIMUM_ALLOWED, @@ -3912,7 +3912,7 @@ static NTSTATUS rpc_aliaslist_internals(struct net_context *c, const char **argv) { NTSTATUS result; - POLICY_HND connect_pol; + struct policy_handle connect_pol; result = rpccli_samr_Connect2(pipe_hnd, mem_ctx, pipe_hnd->desthost, @@ -5149,7 +5149,7 @@ static NTSTATUS rpc_trustdom_add_internals(struct net_context *c, int argc, const char **argv) { - POLICY_HND connect_pol, domain_pol, user_pol; + struct policy_handle connect_pol, domain_pol, user_pol; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; char *acct_name; struct lsa_String lsa_acct_name; @@ -5306,7 +5306,7 @@ static NTSTATUS rpc_trustdom_del_internals(struct net_context *c, int argc, const char **argv) { - POLICY_HND connect_pol, domain_pol, user_pol; + struct policy_handle connect_pol, domain_pol, user_pol; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; char *acct_name; DOM_SID trust_acct_sid; @@ -5495,7 +5495,7 @@ static int rpc_trustdom_establish(struct net_context *c, int argc, struct cli_state *cli = NULL; struct sockaddr_storage server_ss; struct rpc_pipe_client *pipe_hnd = NULL; - POLICY_HND connect_hnd; + struct policy_handle connect_hnd; TALLOC_CTX *mem_ctx; NTSTATUS nt_status; DOM_SID *domain_sid; @@ -5731,7 +5731,7 @@ static void print_trusted_domain(DOM_SID *dom_sid, const char *trusted_dom_name) static NTSTATUS vampire_trusted_domain(struct rpc_pipe_client *pipe_hnd, TALLOC_CTX *mem_ctx, - POLICY_HND *pol, + struct policy_handle *pol, DOM_SID dom_sid, const char *trusted_dom_name) { @@ -5797,7 +5797,7 @@ static int rpc_trustdom_vampire(struct net_context *c, int argc, NTSTATUS nt_status; const char *domain_name = NULL; DOM_SID *queried_dom_sid; - POLICY_HND connect_hnd; + struct policy_handle connect_hnd; union lsa_PolicyInformation *info = NULL; /* trusted domains listing variables */ @@ -5950,7 +5950,7 @@ static int rpc_trustdom_list(struct net_context *c, int argc, const char **argv) DOM_SID *queried_dom_sid; fstring padding; int ascii_dom_name_len; - POLICY_HND connect_hnd; + struct policy_handle connect_hnd; union lsa_PolicyInformation *info = NULL; /* trusted domains listing variables */ @@ -5960,7 +5960,7 @@ static int rpc_trustdom_list(struct net_context *c, int argc, const char **argv) fstring pdc_name; /* trusting domains listing variables */ - POLICY_HND domain_hnd; + struct policy_handle domain_hnd; struct samr_SamArray *trusts = NULL; if (c->display_usage) { diff --git a/source3/utils/net_rpc_audit.c b/source3/utils/net_rpc_audit.c index dc4c796c17..aa7fc7c394 100644 --- a/source3/utils/net_rpc_audit.c +++ b/source3/utils/net_rpc_audit.c @@ -70,7 +70,7 @@ static NTSTATUS rpc_audit_get_internal(struct net_context *c, int argc, const char **argv) { - POLICY_HND pol; + struct policy_handle pol; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; union lsa_PolicyInformation *info = NULL; int i; @@ -138,7 +138,7 @@ static NTSTATUS rpc_audit_set_internal(struct net_context *c, int argc, const char **argv) { - POLICY_HND pol; + struct policy_handle pol; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; union lsa_PolicyInformation *info = NULL; uint32_t audit_policy, audit_category; @@ -224,7 +224,7 @@ static NTSTATUS rpc_audit_enable_internal_ext(struct rpc_pipe_client *pipe_hnd, const char **argv, bool enable) { - POLICY_HND pol; + struct policy_handle pol; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; union lsa_PolicyInformation *info = NULL; @@ -308,7 +308,7 @@ static NTSTATUS rpc_audit_list_internal(struct net_context *c, int argc, const char **argv) { - POLICY_HND pol; + struct policy_handle pol; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; union lsa_PolicyInformation *info = NULL; int i; diff --git a/source3/utils/net_rpc_join.c b/source3/utils/net_rpc_join.c index 1c45d0c515..7f3515ce75 100644 --- a/source3/utils/net_rpc_join.c +++ b/source3/utils/net_rpc_join.c @@ -141,7 +141,7 @@ int net_rpc_join_newstyle(struct net_context *c, int argc, const char **argv) /* rpc variables */ - POLICY_HND lsa_pol, sam_pol, domain_pol, user_pol; + struct policy_handle lsa_pol, sam_pol, domain_pol, user_pol; DOM_SID *domain_sid; uint32 user_rid; diff --git a/source3/utils/net_rpc_printer.c b/source3/utils/net_rpc_printer.c index 8684e4ce74..b25c897770 100644 --- a/source3/utils/net_rpc_printer.c +++ b/source3/utils/net_rpc_printer.c @@ -683,7 +683,7 @@ static bool net_spoolss_open_printer_ex(struct rpc_pipe_client *pipe_hnd, const char *printername, uint32 access_required, const char *username, - POLICY_HND *hnd) + struct policy_handle *hnd) { WERROR result; fstring printername2; @@ -722,7 +722,7 @@ static bool net_spoolss_open_printer_ex(struct rpc_pipe_client *pipe_hnd, static bool net_spoolss_getprinter(struct rpc_pipe_client *pipe_hnd, TALLOC_CTX *mem_ctx, - POLICY_HND *hnd, + struct policy_handle *hnd, uint32 level, union spoolss_PrinterInfo *info) { @@ -744,7 +744,7 @@ static bool net_spoolss_getprinter(struct rpc_pipe_client *pipe_hnd, static bool net_spoolss_setprinter(struct rpc_pipe_client *pipe_hnd, TALLOC_CTX *mem_ctx, - POLICY_HND *hnd, + struct policy_handle *hnd, uint32 level, union spoolss_PrinterInfo *info) { @@ -844,7 +844,7 @@ static bool net_spoolss_setprinterdata(struct rpc_pipe_client *pipe_hnd, static bool net_spoolss_enumprinterkey(struct rpc_pipe_client *pipe_hnd, TALLOC_CTX *mem_ctx, - POLICY_HND *hnd, + struct policy_handle *hnd, const char *keyname, const char ***keylist) { @@ -864,7 +864,7 @@ static bool net_spoolss_enumprinterkey(struct rpc_pipe_client *pipe_hnd, static bool net_spoolss_enumprinterdataex(struct rpc_pipe_client *pipe_hnd, TALLOC_CTX *mem_ctx, uint32 offered, - POLICY_HND *hnd, + struct policy_handle *hnd, const char *keyname, uint32_t *count, struct spoolss_PrinterEnumValues **info) @@ -890,7 +890,7 @@ static bool net_spoolss_enumprinterdataex(struct rpc_pipe_client *pipe_hnd, static bool net_spoolss_setprinterdataex(struct rpc_pipe_client *pipe_hnd, TALLOC_CTX *mem_ctx, - POLICY_HND *hnd, + struct policy_handle *hnd, const char *keyname, REGISTRY_VALUE *value) { @@ -917,7 +917,7 @@ static bool net_spoolss_setprinterdataex(struct rpc_pipe_client *pipe_hnd, static bool net_spoolss_enumforms(struct rpc_pipe_client *pipe_hnd, TALLOC_CTX *mem_ctx, - POLICY_HND *hnd, + struct policy_handle *hnd, int level, uint32_t *num_forms, union spoolss_FormInfo **forms) @@ -965,7 +965,7 @@ static bool net_spoolss_enumprinterdrivers (struct rpc_pipe_client *pipe_hnd, static bool net_spoolss_getprinterdriver(struct rpc_pipe_client *pipe_hnd, TALLOC_CTX *mem_ctx, - POLICY_HND *hnd, uint32 level, + struct policy_handle *hnd, uint32 level, const char *env, int version, union spoolss_DriverInfo *info) { @@ -1051,7 +1051,7 @@ static bool get_printer_info(struct rpc_pipe_client *pipe_hnd, uint32 *num_printers, union spoolss_PrinterInfo **info_p) { - POLICY_HND hnd; + struct policy_handle hnd; /* no arguments given, enumerate all printers */ if (argc == 0) { @@ -1236,7 +1236,7 @@ static NTSTATUS rpc_printer_publish_internals_args(struct rpc_pipe_client *pipe_ struct spoolss_SetPrinterInfoCtr info_ctr; struct spoolss_DevmodeContainer devmode_ctr; struct sec_desc_buf secdesc_ctr; - POLICY_HND hnd; + struct policy_handle hnd; WERROR result; const char *action_str; @@ -1378,7 +1378,7 @@ NTSTATUS rpc_printer_publish_list_internals(struct net_context *c, const char *printername, *sharename; union spoolss_PrinterInfo *info_enum; union spoolss_PrinterInfo info; - POLICY_HND hnd; + struct policy_handle hnd; int state; if (!get_printer_info(pipe_hnd, mem_ctx, 2, argc, argv, &num_printers, &info_enum)) @@ -1470,7 +1470,7 @@ NTSTATUS rpc_printer_migrate_security_internals(struct net_context *c, uint32 level = 2; const char *printername, *sharename; struct rpc_pipe_client *pipe_hnd_dst = NULL; - POLICY_HND hnd_src, hnd_dst; + struct policy_handle hnd_src, hnd_dst; union spoolss_PrinterInfo *info_enum; struct cli_state *cli_dst = NULL; union spoolss_PrinterInfo info_src, info_dst; @@ -1616,7 +1616,7 @@ NTSTATUS rpc_printer_migrate_forms_internals(struct net_context *c, uint32 level = 1; const char *printername, *sharename; struct rpc_pipe_client *pipe_hnd_dst = NULL; - POLICY_HND hnd_src, hnd_dst; + struct policy_handle hnd_src, hnd_dst; union spoolss_PrinterInfo *info_enum; union spoolss_PrinterInfo info_dst; uint32_t num_forms; @@ -1778,7 +1778,7 @@ NTSTATUS rpc_printer_migrate_drivers_internals(struct net_context *c, bool got_src_driver_share = false; bool got_dst_driver_share = false; struct rpc_pipe_client *pipe_hnd_dst = NULL; - POLICY_HND hnd_src, hnd_dst; + struct policy_handle hnd_src, hnd_dst; union spoolss_DriverInfo drv_info_src; union spoolss_PrinterInfo *info_enum; union spoolss_PrinterInfo info_dst; @@ -1988,7 +1988,7 @@ NTSTATUS rpc_printer_migrate_printers_internals(struct net_context *c, union spoolss_PrinterInfo info_dst, info_src; union spoolss_PrinterInfo *info_enum; struct cli_state *cli_dst = NULL; - POLICY_HND hnd_dst, hnd_src; + struct policy_handle hnd_dst, hnd_src; const char *printername, *sharename; struct rpc_pipe_client *pipe_hnd_dst = NULL; struct spoolss_SetPrinterInfoCtr info_ctr; @@ -2144,7 +2144,7 @@ NTSTATUS rpc_printer_migrate_settings_internals(struct net_context *c, uint32 level = 2; const char *printername, *sharename; struct rpc_pipe_client *pipe_hnd_dst = NULL; - POLICY_HND hnd_src, hnd_dst; + struct policy_handle hnd_src, hnd_dst; union spoolss_PrinterInfo *info_enum; union spoolss_PrinterInfo info_dst_publish; union spoolss_PrinterInfo info_dst; diff --git a/source3/utils/net_rpc_registry.c b/source3/utils/net_rpc_registry.c index 00c827928e..60274728f3 100644 --- a/source3/utils/net_rpc_registry.c +++ b/source3/utils/net_rpc_registry.c @@ -767,7 +767,7 @@ static NTSTATUS rpc_registry_enumerate_internal(struct net_context *c, int argc, const char **argv ) { - POLICY_HND pol_hive, pol_key; + struct policy_handle pol_hive, pol_key; NTSTATUS status; uint32 num_subkeys = 0; uint32 num_values = 0; @@ -843,7 +843,7 @@ static NTSTATUS rpc_registry_save_internal(struct net_context *c, const char **argv ) { WERROR result = WERR_GENERAL_FAILURE; - POLICY_HND pol_hive, pol_key; + struct policy_handle pol_hive, pol_key; NTSTATUS status = NT_STATUS_UNSUCCESSFUL; struct winreg_String filename; @@ -1139,7 +1139,7 @@ static NTSTATUS rpc_registry_getsd_internal(struct net_context *c, int argc, const char **argv) { - POLICY_HND pol_hive, pol_key; + struct policy_handle pol_hive, pol_key; NTSTATUS status; enum ndr_err_code ndr_err; struct KeySecurityData *sd = NULL; diff --git a/source3/utils/net_rpc_rights.c b/source3/utils/net_rpc_rights.c index ddcfff3685..10166b6d2b 100644 --- a/source3/utils/net_rpc_rights.c +++ b/source3/utils/net_rpc_rights.c @@ -28,7 +28,7 @@ static NTSTATUS sid_to_name(struct rpc_pipe_client *pipe_hnd, DOM_SID *sid, fstring name) { - POLICY_HND pol; + struct policy_handle pol; enum lsa_SidType *sid_types = NULL; NTSTATUS result; char **domains = NULL, **names = NULL; @@ -59,7 +59,7 @@ static NTSTATUS name_to_sid(struct rpc_pipe_client *pipe_hnd, TALLOC_CTX *mem_ctx, DOM_SID *sid, const char *name) { - POLICY_HND pol; + struct policy_handle pol; enum lsa_SidType *sid_types; NTSTATUS result; DOM_SID *sids; @@ -90,7 +90,7 @@ static NTSTATUS name_to_sid(struct rpc_pipe_client *pipe_hnd, static NTSTATUS enum_privileges(struct rpc_pipe_client *pipe_hnd, TALLOC_CTX *ctx, - POLICY_HND *pol ) + struct policy_handle *pol ) { NTSTATUS result; uint32 enum_context = 0; @@ -148,7 +148,7 @@ static NTSTATUS enum_privileges(struct rpc_pipe_client *pipe_hnd, static NTSTATUS check_privilege_for_user(struct rpc_pipe_client *pipe_hnd, TALLOC_CTX *ctx, - POLICY_HND *pol, + struct policy_handle *pol, DOM_SID *sid, const char *right) { @@ -183,7 +183,7 @@ static NTSTATUS check_privilege_for_user(struct rpc_pipe_client *pipe_hnd, static NTSTATUS enum_privileges_for_user(struct rpc_pipe_client *pipe_hnd, TALLOC_CTX *ctx, - POLICY_HND *pol, + struct policy_handle *pol, DOM_SID *sid ) { NTSTATUS result; @@ -214,7 +214,7 @@ static NTSTATUS enum_privileges_for_user(struct rpc_pipe_client *pipe_hnd, static NTSTATUS enum_accounts_for_privilege(struct rpc_pipe_client *pipe_hnd, TALLOC_CTX *ctx, - POLICY_HND *pol, + struct policy_handle *pol, const char *privilege) { NTSTATUS result; @@ -265,7 +265,7 @@ static NTSTATUS enum_accounts_for_privilege(struct rpc_pipe_client *pipe_hnd, static NTSTATUS enum_privileges_for_accounts(struct rpc_pipe_client *pipe_hnd, TALLOC_CTX *ctx, - POLICY_HND *pol) + struct policy_handle *pol) { NTSTATUS result; uint32 enum_context=0; @@ -317,7 +317,7 @@ static NTSTATUS rpc_rights_list_internal(struct net_context *c, int argc, const char **argv ) { - POLICY_HND pol; + struct policy_handle pol; NTSTATUS result; DOM_SID sid; fstring privname; @@ -436,7 +436,7 @@ static NTSTATUS rpc_rights_grant_internal(struct net_context *c, int argc, const char **argv ) { - POLICY_HND dom_pol; + struct policy_handle dom_pol; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; struct lsa_RightSet rights; int i; @@ -506,7 +506,7 @@ static NTSTATUS rpc_rights_revoke_internal(struct net_context *c, int argc, const char **argv ) { - POLICY_HND dom_pol; + struct policy_handle dom_pol; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; struct lsa_RightSet rights; DOM_SID sid; diff --git a/source3/utils/net_rpc_service.c b/source3/utils/net_rpc_service.c index 236414222c..bcb1a00dab 100644 --- a/source3/utils/net_rpc_service.c +++ b/source3/utils/net_rpc_service.c @@ -61,11 +61,11 @@ const char *svc_status_string( uint32 state ) static WERROR query_service_state(struct rpc_pipe_client *pipe_hnd, TALLOC_CTX *mem_ctx, - POLICY_HND *hSCM, + struct policy_handle *hSCM, const char *service, uint32 *state ) { - POLICY_HND hService; + struct policy_handle hService; struct SERVICE_STATUS service_status; WERROR result = WERR_GENERAL_FAILURE; NTSTATUS status; @@ -102,7 +102,7 @@ static WERROR query_service_state(struct rpc_pipe_client *pipe_hnd, static WERROR watch_service_state(struct rpc_pipe_client *pipe_hnd, TALLOC_CTX *mem_ctx, - POLICY_HND *hSCM, + struct policy_handle *hSCM, const char *service, uint32 watch_state, uint32 *final_state ) @@ -137,12 +137,12 @@ static WERROR watch_service_state(struct rpc_pipe_client *pipe_hnd, static WERROR control_service(struct rpc_pipe_client *pipe_hnd, TALLOC_CTX *mem_ctx, - POLICY_HND *hSCM, + struct policy_handle *hSCM, const char *service, uint32 control, uint32 watch_state ) { - POLICY_HND hService; + struct policy_handle hService; WERROR result = WERR_GENERAL_FAILURE; NTSTATUS status; struct SERVICE_STATUS service_status; @@ -199,7 +199,7 @@ static NTSTATUS rpc_service_list_internal(struct net_context *c, int argc, const char **argv ) { - POLICY_HND hSCM; + struct policy_handle hSCM; struct ENUM_SERVICE_STATUSW *services = NULL; WERROR result = WERR_GENERAL_FAILURE; NTSTATUS status; @@ -309,7 +309,7 @@ static NTSTATUS rpc_service_status_internal(struct net_context *c, int argc, const char **argv ) { - POLICY_HND hSCM, hService; + struct policy_handle hSCM, hService; WERROR result = WERR_GENERAL_FAILURE; NTSTATUS status; struct SERVICE_STATUS service_status; @@ -433,7 +433,7 @@ static NTSTATUS rpc_service_stop_internal(struct net_context *c, int argc, const char **argv ) { - POLICY_HND hSCM; + struct policy_handle hSCM; WERROR result = WERR_GENERAL_FAILURE; NTSTATUS status; fstring servicename; @@ -477,7 +477,7 @@ static NTSTATUS rpc_service_pause_internal(struct net_context *c, int argc, const char **argv ) { - POLICY_HND hSCM; + struct policy_handle hSCM; WERROR result = WERR_GENERAL_FAILURE; NTSTATUS status; fstring servicename; @@ -521,7 +521,7 @@ static NTSTATUS rpc_service_resume_internal(struct net_context *c, int argc, const char **argv ) { - POLICY_HND hSCM; + struct policy_handle hSCM; WERROR result = WERR_GENERAL_FAILURE; NTSTATUS status; fstring servicename; @@ -565,7 +565,7 @@ static NTSTATUS rpc_service_start_internal(struct net_context *c, int argc, const char **argv ) { - POLICY_HND hSCM, hService; + struct policy_handle hSCM, hService; WERROR result = WERR_GENERAL_FAILURE; NTSTATUS status; uint32 state = 0; diff --git a/source3/utils/net_rpc_sh_acct.c b/source3/utils/net_rpc_sh_acct.c index 977e1e2a0a..af0b426bbc 100644 --- a/source3/utils/net_rpc_sh_acct.c +++ b/source3/utils/net_rpc_sh_acct.c @@ -38,7 +38,7 @@ static NTSTATUS rpc_sh_acct_do(struct net_context *c, struct samr_DomInfo12 *i12, int argc, const char **argv)) { - POLICY_HND connect_pol, domain_pol; + struct policy_handle connect_pol, domain_pol; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; union samr_DomainInfo *info1 = NULL; union samr_DomainInfo *info3 = NULL; diff --git a/source3/utils/net_util.c b/source3/utils/net_util.c index 7fbfdbab44..c6b6ee9e80 100644 --- a/source3/utils/net_util.c +++ b/source3/utils/net_util.c @@ -29,7 +29,7 @@ NTSTATUS net_rpc_lookup_name(struct net_context *c, enum lsa_SidType *ret_type) { struct rpc_pipe_client *lsa_pipe; - POLICY_HND pol; + struct policy_handle pol; NTSTATUS result = NT_STATUS_OK; const char **dom_names; DOM_SID *sids; diff --git a/source3/utils/netlookup.c b/source3/utils/netlookup.c index 14f2dddebc..dd0efa4142 100644 --- a/source3/utils/netlookup.c +++ b/source3/utils/netlookup.c @@ -31,7 +31,7 @@ struct con_struct { NTSTATUS err; struct cli_state *cli; struct rpc_pipe_client *lsapipe; - POLICY_HND pol; + struct policy_handle pol; }; static struct con_struct *cs; diff --git a/source3/utils/smbcquotas.c b/source3/utils/smbcquotas.c index bc21dd8ad9..78260acf76 100644 --- a/source3/utils/smbcquotas.c +++ b/source3/utils/smbcquotas.c @@ -35,7 +35,7 @@ enum exit_values {EXIT_OK, EXIT_FAILED, EXIT_PARSE_ERROR}; static struct cli_state *cli_ipc; static struct rpc_pipe_client *global_pipe_hnd; -static POLICY_HND pol; +static struct policy_handle pol; static bool got_policy_hnd; static struct user_auth_info *smbcquotas_auth_info; -- cgit From 2c186be0df33664eea980c17720be41f25f91288 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 19 Mar 2009 16:18:29 +0100 Subject: s3-net: Fix Coverity #886 (FORWARD_NULL). Guenther --- source3/utils/net_rpc_printer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/utils') diff --git a/source3/utils/net_rpc_printer.c b/source3/utils/net_rpc_printer.c index b25c897770..81dfbaa5b6 100644 --- a/source3/utils/net_rpc_printer.c +++ b/source3/utils/net_rpc_printer.c @@ -1902,7 +1902,7 @@ NTSTATUS rpc_printer_migrate_drivers_internals(struct net_context *c, } - if (strlen(drivername) == 0) { + if (!drivername || strlen(drivername) == 0) { DEBUGADD(1,("Did not get driver for printer %s\n", printername)); goto done; -- cgit From 045151b767c62ac1343e86cb3886107226e73fda Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 19 Mar 2009 12:53:01 +0100 Subject: s3-spoolss: pure comsetics. sorry, I just need to do that. Guenther --- source3/utils/net_rpc_printer.c | 82 ++++++++++++++++++++--------------------- 1 file changed, 41 insertions(+), 41 deletions(-) (limited to 'source3/utils') diff --git a/source3/utils/net_rpc_printer.c b/source3/utils/net_rpc_printer.c index 81dfbaa5b6..1d0e9a38be 100644 --- a/source3/utils/net_rpc_printer.c +++ b/source3/utils/net_rpc_printer.c @@ -84,7 +84,7 @@ static void display_reg_value(const char *subkey, REGISTRY_VALUE value) switch(value.type) { case REG_DWORD: d_printf("\t[%s:%s]: REG_DWORD: 0x%08x\n", subkey, value.valuename, - *((uint32 *) value.data_p)); + *((uint32_t *) value.data_p)); break; case REG_SZ: @@ -105,7 +105,7 @@ static void display_reg_value(const char *subkey, REGISTRY_VALUE value) break; case REG_MULTI_SZ: { - uint32 i, num_values; + uint32_t i, num_values; char **values; if (!W_ERROR_IS_OK(reg_pull_multi_sz(NULL, value.data_p, @@ -158,7 +158,7 @@ NTSTATUS net_copy_fileattr(struct net_context *c, int fnum_src = 0; int fnum_dst = 0; SEC_DESC *sd = NULL; - uint16 attr; + uint16_t attr; time_t f_atime, f_ctime, f_mtime; @@ -654,9 +654,9 @@ static NTSTATUS copy_print_driver_3(struct net_context *c, static bool net_spoolss_enum_printers(struct rpc_pipe_client *pipe_hnd, TALLOC_CTX *mem_ctx, char *name, - uint32 flags, - uint32 level, - uint32 *num_printers, + uint32_t flags, + uint32_t level, + uint32_t *num_printers, union spoolss_PrinterInfo **info) { WERROR result; @@ -681,7 +681,7 @@ static bool net_spoolss_enum_printers(struct rpc_pipe_client *pipe_hnd, static bool net_spoolss_open_printer_ex(struct rpc_pipe_client *pipe_hnd, TALLOC_CTX *mem_ctx, const char *printername, - uint32 access_required, + uint32_t access_required, const char *username, struct policy_handle *hnd) { @@ -723,7 +723,7 @@ static bool net_spoolss_open_printer_ex(struct rpc_pipe_client *pipe_hnd, static bool net_spoolss_getprinter(struct rpc_pipe_client *pipe_hnd, TALLOC_CTX *mem_ctx, struct policy_handle *hnd, - uint32 level, + uint32_t level, union spoolss_PrinterInfo *info) { WERROR result; @@ -745,7 +745,7 @@ static bool net_spoolss_getprinter(struct rpc_pipe_client *pipe_hnd, static bool net_spoolss_setprinter(struct rpc_pipe_client *pipe_hnd, TALLOC_CTX *mem_ctx, struct policy_handle *hnd, - uint32 level, + uint32_t level, union spoolss_PrinterInfo *info) { WERROR result; @@ -863,7 +863,7 @@ static bool net_spoolss_enumprinterkey(struct rpc_pipe_client *pipe_hnd, static bool net_spoolss_enumprinterdataex(struct rpc_pipe_client *pipe_hnd, TALLOC_CTX *mem_ctx, - uint32 offered, + uint32_t offered, struct policy_handle *hnd, const char *keyname, uint32_t *count, @@ -941,8 +941,8 @@ static bool net_spoolss_enumforms(struct rpc_pipe_client *pipe_hnd, static bool net_spoolss_enumprinterdrivers (struct rpc_pipe_client *pipe_hnd, TALLOC_CTX *mem_ctx, - uint32 level, const char *env, - uint32 *count, + uint32_t level, const char *env, + uint32_t *count, union spoolss_DriverInfo **info) { WERROR result; @@ -965,7 +965,7 @@ static bool net_spoolss_enumprinterdrivers (struct rpc_pipe_client *pipe_hnd, static bool net_spoolss_getprinterdriver(struct rpc_pipe_client *pipe_hnd, TALLOC_CTX *mem_ctx, - struct policy_handle *hnd, uint32 level, + struct policy_handle *hnd, uint32_t level, const char *env, int version, union spoolss_DriverInfo *info) { @@ -999,7 +999,7 @@ static bool net_spoolss_getprinterdriver(struct rpc_pipe_client *pipe_hnd, static bool net_spoolss_addprinterdriver(struct rpc_pipe_client *pipe_hnd, - TALLOC_CTX *mem_ctx, uint32 level, + TALLOC_CTX *mem_ctx, uint32_t level, union spoolss_DriverInfo *info) { WERROR result; @@ -1039,7 +1039,7 @@ static bool net_spoolss_addprinterdriver(struct rpc_pipe_client *pipe_hnd, } /** - * abstraction function to get uint32 num_printers and PRINTER_INFO_CTR ctr + * abstraction function to get uint32_t num_printers and PRINTER_INFO_CTR ctr * for a single printer or for all printers depending on argc/argv **/ @@ -1048,7 +1048,7 @@ static bool get_printer_info(struct rpc_pipe_client *pipe_hnd, int level, int argc, const char **argv, - uint32 *num_printers, + uint32_t *num_printers, union spoolss_PrinterInfo **info_p) { struct policy_handle hnd; @@ -1114,8 +1114,8 @@ NTSTATUS rpc_printer_list_internals(struct net_context *c, const char **argv) { NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL; - uint32 i, num_printers; - uint32 level = 2; + uint32_t i, num_printers; + uint32_t level = 2; const char *printername, *sharename; union spoolss_PrinterInfo *info; @@ -1166,8 +1166,8 @@ NTSTATUS rpc_printer_driver_list_internals(struct net_context *c, const char **argv) { NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL; - uint32 i; - uint32 level = 3; + uint32_t i; + uint32_t level = 3; union spoolss_DriverInfo *info; int d; @@ -1175,7 +1175,7 @@ NTSTATUS rpc_printer_driver_list_internals(struct net_context *c, for (i=0; archi_table[i].long_archi!=NULL; i++) { - uint32 num_drivers; + uint32_t num_drivers; /* enum remote drivers */ if (!net_spoolss_enumprinterdrivers(pipe_hnd, mem_ctx, level, @@ -1225,11 +1225,11 @@ static NTSTATUS rpc_printer_publish_internals_args(struct rpc_pipe_client *pipe_ TALLOC_CTX *mem_ctx, int argc, const char **argv, - uint32 action) + uint32_t action) { NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL; - uint32 i, num_printers; - uint32 level = 7; + uint32_t i, num_printers; + uint32_t level = 7; const char *printername, *sharename; union spoolss_PrinterInfo *info_enum; union spoolss_PrinterInfo info; @@ -1373,8 +1373,8 @@ NTSTATUS rpc_printer_publish_list_internals(struct net_context *c, const char **argv) { NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL; - uint32 i, num_printers; - uint32 level = 7; + uint32_t i, num_printers; + uint32_t level = 7; const char *printername, *sharename; union spoolss_PrinterInfo *info_enum; union spoolss_PrinterInfo info; @@ -1465,9 +1465,9 @@ NTSTATUS rpc_printer_migrate_security_internals(struct net_context *c, convince jerry that we should add clientside setacls level 3 at least */ NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL; - uint32 i = 0; - uint32 num_printers; - uint32 level = 2; + uint32_t i = 0; + uint32_t num_printers; + uint32_t level = 2; const char *printername, *sharename; struct rpc_pipe_client *pipe_hnd_dst = NULL; struct policy_handle hnd_src, hnd_dst; @@ -1611,9 +1611,9 @@ NTSTATUS rpc_printer_migrate_forms_internals(struct net_context *c, { NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL; WERROR result; - uint32 i, f; - uint32 num_printers; - uint32 level = 1; + uint32_t i, f; + uint32_t num_printers; + uint32_t level = 1; const char *printername, *sharename; struct rpc_pipe_client *pipe_hnd_dst = NULL; struct policy_handle hnd_src, hnd_dst; @@ -1771,9 +1771,9 @@ NTSTATUS rpc_printer_migrate_drivers_internals(struct net_context *c, const char **argv) { NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL; - uint32 i, p; - uint32 num_printers; - uint32 level = 3; + uint32_t i, p; + uint32_t num_printers; + uint32_t level = 3; const char *printername, *sharename; bool got_src_driver_share = false; bool got_dst_driver_share = false; @@ -1983,8 +1983,8 @@ NTSTATUS rpc_printer_migrate_printers_internals(struct net_context *c, { WERROR result; NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL; - uint32 i = 0, num_printers; - uint32 level = 2; + uint32_t i = 0, num_printers; + uint32_t level = 2; union spoolss_PrinterInfo info_dst, info_src; union spoolss_PrinterInfo *info_enum; struct cli_state *cli_dst = NULL; @@ -2139,9 +2139,9 @@ NTSTATUS rpc_printer_migrate_settings_internals(struct net_context *c, WERROR result; NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL; - uint32 i = 0, p = 0, j = 0; - uint32 num_printers; - uint32 level = 2; + uint32_t i = 0, p = 0, j = 0; + uint32_t num_printers; + uint32_t level = 2; const char *printername, *sharename; struct rpc_pipe_client *pipe_hnd_dst = NULL; struct policy_handle hnd_src, hnd_dst; @@ -2445,7 +2445,7 @@ NTSTATUS rpc_printer_migrate_settings_internals(struct net_context *c, value.type = REG_SZ; value.size = data.uni_str_len * 2; if (value.size) { - value.data_p = (uint8 *)TALLOC_MEMDUP(mem_ctx, data.buffer, value.size); + value.data_p = (uint8_t *)TALLOC_MEMDUP(mem_ctx, data.buffer, value.size); } else { value.data_p = NULL; } -- cgit From d2fb6d348248cdca7e55360c77aa31b91250f885 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 20 Mar 2009 11:04:59 +0100 Subject: s3-net: Fix Coverity #898 (UNINIT). Guenther --- source3/utils/net_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/utils') diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c index d83fb44aba..8a92c85b9e 100644 --- a/source3/utils/net_rpc.c +++ b/source3/utils/net_rpc.c @@ -1657,7 +1657,7 @@ static NTSTATUS get_sid_from_name(struct cli_state *cli, { DOM_SID *sids = NULL; enum lsa_SidType *types = NULL; - struct rpc_pipe_client *pipe_hnd; + struct rpc_pipe_client *pipe_hnd = NULL; struct policy_handle lsa_pol; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; -- cgit From 73030b107d5722a2c42cd18240d45bcb256335ac Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 20 Mar 2009 11:07:21 +0100 Subject: s3-net: Fix Coverity #861 (UNINIT). Guenther --- source3/utils/net_rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/utils') diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c index 8a92c85b9e..21881ba6a9 100644 --- a/source3/utils/net_rpc.c +++ b/source3/utils/net_rpc.c @@ -54,7 +54,7 @@ NTSTATUS net_get_remote_domain_sid(struct cli_state *cli, TALLOC_CTX *mem_ctx, DOM_SID **domain_sid, const char **domain_name) { - struct rpc_pipe_client *lsa_pipe; + struct rpc_pipe_client *lsa_pipe = NULL; struct policy_handle pol; NTSTATUS result = NT_STATUS_OK; union lsa_PolicyInformation *info = NULL; -- cgit