summaryrefslogtreecommitdiff
path: root/source3/utils/net_rpc.c
diff options
context:
space:
mode:
authorKai Blin <kai@samba.org>2010-01-19 11:43:54 +0100
committerKai Blin <kai@samba.org>2010-01-19 14:48:34 +0100
commit66de52c4f4527ef43cfaf11c55616ec7602cce85 (patch)
treec0195d1bb09fb5e8a8d87e3a32f2cc1d06756502 /source3/utils/net_rpc.c
parent7d04c0fcfdd6cd52ce99d94cbe42fb698b7a0674 (diff)
downloadsamba-66de52c4f4527ef43cfaf11c55616ec7602cce85.tar.gz
samba-66de52c4f4527ef43cfaf11c55616ec7602cce85.tar.bz2
samba-66de52c4f4527ef43cfaf11c55616ec7602cce85.zip
s3 net: Fix compile warnings
Diffstat (limited to 'source3/utils/net_rpc.c')
-rw-r--r--source3/utils/net_rpc.c262
1 files changed, 169 insertions, 93 deletions
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index 654b7af97b..cae435b6c9 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -78,8 +78,9 @@ NTSTATUS net_get_remote_domain_sid(struct cli_state *cli, TALLOC_CTX *mem_ctx,
SEC_FLAG_MAXIMUM_ALLOWED,
&pol);
if (!NT_STATUS_IS_OK(result)) {
- d_fprintf(stderr, "open_policy ",_("failed"),": %s\n"),
- nt_errstr(result);
+ d_fprintf(stderr, "open_policy %s: %s\n",
+ _("failed"),
+ nt_errstr(result));
return result;
}
@@ -88,8 +89,9 @@ NTSTATUS net_get_remote_domain_sid(struct cli_state *cli, TALLOC_CTX *mem_ctx,
LSA_POLICY_INFO_ACCOUNT_DOMAIN,
&info);
if (!NT_STATUS_IS_OK(result)) {
- d_fprintf(stderr, "lsaquery ",_("failed"),": %s\n"),
- nt_errstr(result);
+ d_fprintf(stderr, "lsaquery %s: %s\n",
+ _("failed"),
+ nt_errstr(result));
return result;
}
@@ -272,9 +274,11 @@ static NTSTATUS rpc_changetrustpw_internals(struct net_context *c,
int net_rpc_changetrustpw(struct net_context *c, int argc, const char **argv)
{
if (c->display_usage) {
- d_printf(_("Usage:\n"),
+ d_printf( "%s\n"
"net rpc changetrustpw\n"
- " ",_("Change the machine trust password\n"));
+ " %s\n",
+ _("Usage:"),
+ _("Change the machine trust password"));
return 0;
}
@@ -403,9 +407,11 @@ static int net_rpc_oldjoin(struct net_context *c, int argc, const char **argv)
int rc = -1;
if (c->display_usage) {
- d_printf(_("Usage:\n"),
+ d_printf( "%s\n"
"net rpc oldjoin\n"
- " ",_("Join a domain the old way\n"));
+ " %s\n",
+ _("Usage:"),
+ _("Join a domain the old way"));
return 0;
}
@@ -433,8 +439,9 @@ static int net_rpc_oldjoin(struct net_context *c, int argc, const char **argv)
int net_rpc_join(struct net_context *c, int argc, const char **argv)
{
if (c->display_usage) {
- d_printf(_("Usage:\n"),
- _("net rpc join -U <username>[%%password] <type>\n"
+ d_printf("%s\n%s",
+ _("Usage:"),
+ _("net rpc join -U <username>[%%password] <type>\n"
" Join a domain\n"
" username\tName of the admin user"
" password\tPassword of the admin user, will "
@@ -548,9 +555,11 @@ NTSTATUS rpc_info_internals(struct net_context *c,
int net_rpc_info(struct net_context *c, int argc, const char **argv)
{
if (c->display_usage) {
- d_printf(_("Usage:\n"),
+ d_printf( "%s\n"
"net rpc info\n"
- " ",_("Display information about the domain\n"));
+ " %s\n",
+ _("Usage:"),
+ _("Display information about the domain"));
return 0;
}
@@ -614,9 +623,11 @@ int net_rpc_getsid(struct net_context *c, int argc, const char **argv)
}
if (c->display_usage) {
- d_printf(_("Usage:\n"),
+ d_printf( "%s\n"
"net rpc getsid\n"
- " ",_("Fetch domain SID into local secrets.tdb\n"));
+ " %s\n",
+ _("Usage:"),
+ _("Fetch domain SID into local secrets.tdb"));
return 0;
}
@@ -982,9 +993,11 @@ int net_rpc_user(struct net_context *c, int argc, const char **argv)
if (argc == 0) {
if (c->display_usage) {
- d_printf(_("Usage:\n"),
+ d_printf( "%s\n"
"net rpc user\n"
- " ",_("List all users\n"));
+ " %s\n",
+ _("Usage:"),
+ _("List all users"));
net_display_usage_from_functable(func);
return 0;
}
@@ -1033,7 +1046,8 @@ static NTSTATUS rpc_sh_handle_user(struct net_context *c,
enum lsa_SidType type;
if (argc == 0) {
- d_fprintf(stderr, _("Usage:")," %s <username>\n"), ctx->whoami;
+ d_fprintf(stderr, "%s %s <username>\n", _("Usage:"),
+ ctx->whoami);
return NT_STATUS_INVALID_PARAMETER;
}
@@ -1114,7 +1128,8 @@ static NTSTATUS rpc_sh_user_show_internals(struct net_context *c,
union samr_UserInfo *info = NULL;
if (argc != 0) {
- d_fprintf(stderr, _("Usage:")," %s show <username>\n"),ctx->whoami;
+ d_fprintf(stderr, "%s %s show <username>\n", _("Usage:"),
+ ctx->whoami);
return NT_STATUS_INVALID_PARAMETER;
}
@@ -1167,8 +1182,8 @@ static NTSTATUS rpc_sh_user_str_edit_internals(struct net_context *c,
union samr_UserInfo *info = NULL;
if (argc > 1) {
- d_fprintf(stderr, _("Usage:")," %s <username> [new value|NULL]\n",
- ctx->whoami);
+ d_fprintf(stderr, "%s %s <username> [new value|NULL]\n",
+ _("Usage:"), ctx->whoami);
return NT_STATUS_INVALID_PARAMETER;
}
@@ -1571,7 +1586,7 @@ static NTSTATUS rpc_group_delete_internals(struct net_context *c,
d_printf(_("ok\n"));
} else {
if (c->opt_verbose)
- d_printf(_("failed"),"\n");
+ d_printf("%s\n", _("failed"));
goto done;
}
}
@@ -1914,8 +1929,9 @@ static NTSTATUS rpc_group_addmem_internals(struct net_context *c,
enum lsa_SidType group_type;
if (argc != 2 || c->display_usage) {
- d_printf(_("Usage:\n"),
- _("net rpc group addmem <group> <member>\n"
+ d_printf("%s\n%s",
+ _("Usage:"),
+ _("net rpc group addmem <group> <member>\n"
" Add a member to a group\n"
" group\tGroup to add member to\n"
" member\tMember to add to group\n"));
@@ -2116,8 +2132,9 @@ static NTSTATUS rpc_group_delmem_internals(struct net_context *c,
enum lsa_SidType group_type;
if (argc != 2 || c->display_usage) {
- d_printf(_("Usage:\n"),
- _("net rpc group delmem <group> <member>\n"
+ d_printf("%s\n%s",
+ _("Usage:"),
+ _("net rpc group delmem <group> <member>\n"
" Delete a member from a group\n"
" group\tGroup to delete member from\n"
" member\tMember to delete from group\n"));
@@ -2200,8 +2217,9 @@ static NTSTATUS rpc_group_list_internals(struct net_context *c,
bool builtin = false;
if (c->display_usage) {
- d_printf(_("Usage:\n"),
- _("net rpc group list [global] [local] [builtin]\n"
+ d_printf("%s\n%s",
+ _("Usage:"),
+ _("net rpc group list [global] [local] [builtin]\n"
" List groups on RPC server\n"
" global\tList global groups\n"
" local\tList local groups\n"
@@ -2709,7 +2727,8 @@ static int rpc_group_rename_internals(struct net_context *c, int argc, const cha
uint32_t parm_err;
if (argc != 2) {
- d_printf(_("Usage:\n"), "net rpc group rename group newname\n");
+ d_printf(_("Usage:\n"));
+ d_printf("net rpc group rename group newname\n");
return -1;
}
@@ -3047,9 +3066,11 @@ static int rpc_share_list(struct net_context *c, int argc, const char **argv)
uint32_t i, level = 1;
if (c->display_usage) {
- d_printf(_("Usage:\n"),
+ d_printf( "%s\n"
"net rpc share list\n"
- " ",_("List shares on remote server\n"));
+ " %s\n",
+ _("Usage:"),
+ _("List shares on remote server"));
return 0;
}
@@ -3231,9 +3252,11 @@ static int rpc_share_migrate_shares(struct net_context *c, int argc,
const char **argv)
{
if (c->display_usage) {
- d_printf(_("Usage:\n"),
+ d_printf( "%s\n"
"net rpc share migrate shares\n"
- " ",_("Migrate shares to local server\n"));
+ " %s\n",
+ _("Usage:"),
+ _("Migrate shares to local server"));
return 0;
}
@@ -3564,9 +3587,11 @@ done:
static int rpc_share_migrate_files(struct net_context *c, int argc, const char **argv)
{
if (c->display_usage) {
- d_printf(_("Usage:\n"),
+ d_printf( "%s\n"
"net share migrate files\n"
- " ",_("Migrate files to local server\n"));
+ " %s\n",
+ _("Usage:"),
+ _("Migrate files to local server"));
return 0;
}
@@ -3689,9 +3714,11 @@ static int rpc_share_migrate_security(struct net_context *c, int argc,
const char **argv)
{
if (c->display_usage) {
- d_printf(_("Usage:\n"),
+ d_printf( "%s\n"
"net rpc share migrate security\n"
- " ",_("Migrate share-acls to local server\n"));
+ " %s\n",
+ _("Usage:"),
+ _("Migrate share-acls to local server"));
return 0;
}
@@ -3722,9 +3749,11 @@ static int rpc_share_migrate_all(struct net_context *c, int argc,
int ret;
if (c->display_usage) {
- d_printf(_("Usage:\n"),
+ d_printf( "%s\n"
"net rpc share migrate all\n"
- " ",_("Migrates shares including all share settings\n"));
+ " %s\n",
+ _("Usage:"),
+ _("Migrates shares including all share settings"));
return 0;
}
@@ -4019,7 +4048,7 @@ static void init_user_token(NT_USER_TOKEN *token, DOM_SID *user_sid)
token->num_sids = 4;
if (!(token->user_sids = SMB_MALLOC_ARRAY(DOM_SID, 4))) {
- d_fprintf(stderr, "malloc ",_("failed"),"\n");
+ d_fprintf(stderr, "malloc %s\n",_("failed"));
token->num_sids = 0;
return;
}
@@ -4525,9 +4554,11 @@ static int rpc_share_allowedusers(struct net_context *c, int argc,
int result;
if (c->display_usage) {
- d_printf(_("Usage:\n"),
+ d_printf( "%s\n"
"net rpc share allowedusers\n"
- " ",_("List allowed users\n"));
+ " %s\n",
+ _("Usage:"),
+ _("List allowed users"));
return 0;
}
@@ -4651,8 +4682,9 @@ int net_rpc_share(struct net_context *c, int argc, const char **argv)
if (argc == 0) {
if (c->display_usage) {
- d_printf(_("Usage:\n"),
- _("net rpc share\n"
+ d_printf("%s\n%s",
+ _("Usage:"),
+ _("net rpc share\n"
" List shares\n"
" Alias for net rpc share list\n"));
net_display_usage_from_functable(func);
@@ -4715,7 +4747,7 @@ static NTSTATUS rpc_sh_share_delete(struct net_context *c,
int argc, const char **argv)
{
if (argc != 1) {
- d_fprintf(stderr, _("Usage:")," %s <share>\n", ctx->whoami);
+ d_fprintf(stderr, "%s %s <share>\n", _("Usage:"), ctx->whoami);
return NT_STATUS_INVALID_PARAMETER;
}
@@ -4733,7 +4765,7 @@ static NTSTATUS rpc_sh_share_info(struct net_context *c,
NTSTATUS status;
if (argc != 1) {
- d_fprintf(stderr, _("Usage: %s <share>\n"), ctx->whoami);
+ d_fprintf(stderr, "%s %s <share>\n", _("Usage:"), ctx->whoami);
return NT_STATUS_INVALID_PARAMETER;
}
@@ -5033,9 +5065,11 @@ static int rpc_shutdown_abort(struct net_context *c, int argc,
int rc = -1;
if (c->display_usage) {
- d_printf(_("Usage:\n"),
+ d_printf( "%s\n"
"net rpc abortshutdown\n"
- " ",_("Abort a scheduled shutdown\n"));
+ " %s\n",
+ _("Usage:"),
+ _("Abort a scheduled shutdown"));
return 0;
}
@@ -5180,9 +5214,11 @@ static int rpc_shutdown(struct net_context *c, int argc, const char **argv)
int rc = -1;
if (c->display_usage) {
- d_printf(_("Usage:\n"),
+ d_printf( "%s\n"
"net rpc shutdown\n"
- " ",_("Shut down a remote RPC server\n"));
+ " %s\n",
+ _("Usage:"),
+ _("Shut down a remote RPC server"));
return 0;
}
@@ -5239,12 +5275,14 @@ static NTSTATUS rpc_trustdom_add_internals(struct net_context *c,
unsigned int orig_timeout;
if (argc != 2) {
- d_printf(_("Usage:"),_(" net rpc trustdom add <domain_name> "
+ d_printf("%s\n%s",
+ _("Usage:"),
+ _(" net rpc trustdom add <domain_name> "
"<trust password>\n"));
return NT_STATUS_INVALID_PARAMETER;
}
- /*
+ /*
* Make valid trusting domain account (ie. uppercased and with '$' appended)
*/
@@ -5352,8 +5390,9 @@ static int rpc_trustdom_add(struct net_context *c, int argc, const char **argv)
return run_rpc_command(c, NULL, &ndr_table_samr.syntax_id, 0,
rpc_trustdom_add_internals, argc, argv);
} else {
- d_printf(_("Usage:\n"),
- _("net rpc trustdom add <domain_name> <trust "
+ d_printf("%s\n%s",
+ _("Usage:"),
+ _("net rpc trustdom add <domain_name> <trust "
"password>\n"));
return -1;
}
@@ -5393,7 +5432,9 @@ static NTSTATUS rpc_trustdom_del_internals(struct net_context *c,
struct lsa_String lsa_acct_name;
if (argc != 1) {
- d_printf(_("Usage:"),_(" net rpc trustdom del <domain_name>\n"));
+ d_printf("%s\n%s",
+ _("Usage:"),
+ _(" net rpc trustdom del <domain_name>\n"));
return NT_STATUS_INVALID_PARAMETER;
}
@@ -5509,8 +5550,9 @@ static int rpc_trustdom_del(struct net_context *c, int argc, const char **argv)
return run_rpc_command(c, NULL, &ndr_table_samr.syntax_id, 0,
rpc_trustdom_del_internals, argc, argv);
} else {
- d_printf(_("Usage:\n"),
- _("net rpc trustdom del <domain>\n"));
+ d_printf("%s\n%s",
+ _("Usage:"),
+ _("net rpc trustdom del <domain>\n"));
return -1;
}
}
@@ -5592,8 +5634,9 @@ static int rpc_trustdom_establish(struct net_context *c, int argc,
*/
if (argc != 1 || c->display_usage) {
- d_printf(_("Usage:\n"),
- _("net rpc trustdom establish <domain_name>\n"));
+ d_printf("%s\n%s",
+ _("Usage:"),
+ _("net rpc trustdom establish <domain_name>\n"));
return -1;
}
@@ -5756,8 +5799,9 @@ static int rpc_trustdom_revoke(struct net_context *c, int argc,
int rc = -1;
if (argc < 1 || c->display_usage) {
- d_printf(_("Usage:\n"),
- _("net rpc trustdom revoke <domain_name>\n"
+ d_printf("%s\n%s",
+ _("Usage:"),
+ _("net rpc trustdom revoke <domain_name>\n"
" Revoke trust relationship\n"
" domain_name\tName of domain to revoke trust\n"));
return -1;
@@ -5887,9 +5931,11 @@ static int rpc_trustdom_vampire(struct net_context *c, int argc,
fstring pdc_name;
if (c->display_usage) {
- d_printf(_("Usage:\n"),
+ d_printf( "%s\n"
"net rpc trustdom vampire\n"
- " ",_("Vampire trust relationship from remote server\n"));
+ " %s\n",
+ _("Usage:"),
+ _("Vampire trust relationship from remote server"));
return 0;
}
@@ -6044,9 +6090,11 @@ static int rpc_trustdom_list(struct net_context *c, int argc, const char **argv)
struct samr_SamArray *trusts = NULL;
if (c->display_usage) {
- d_printf(_("Usage:\n"),
+ d_printf( "%s\n"
"net rpc trustdom list\n"
- " ",_("List in- and outgoing trust relationships\n"));
+ " %s\n",
+ _("Usage:"),
+ _("List incoming and outgoing trust relationships"));
return 0;
}
@@ -6417,9 +6465,11 @@ bool net_rpc_check(struct net_context *c, unsigned flags)
/* dump sam database via samsync rpc calls */
static int rpc_samdump(struct net_context *c, int argc, const char **argv) {
if (c->display_usage) {
- d_printf(_("Usage:\n"),
+ d_printf( "%s\n"
"net rpc samdump\n"
- " ",_("Dump remote SAM database\n"));
+ " %s\n",
+ _("Usage:"),
+ _("Dump remote SAM database"));
return 0;
}
@@ -6464,9 +6514,11 @@ static int rpc_vampire(struct net_context *c, int argc, const char **argv)
if (argc == 0) {
if (c->display_usage) {
- d_printf(_("Usage:\n"),
+ d_printf( "%s\n"
"net rpc vampire\n"
- " ",_("Vampire remote SAM database\n"));
+ " %s\n",
+ _("Usage:"),
+ _("Vampire remote SAM database"));
return 0;
}
@@ -6500,9 +6552,11 @@ static int rpc_printer_migrate_all(struct net_context *c, int argc,
int ret;
if (c->display_usage) {
- d_printf(_("Usage:\n"),
+ d_printf( "%s\n"
"net rpc printer migrate all\n"
- " ",_("Migrate everything from a print server\n"));
+ " %s\n",
+ _("Usage:"),
+ _("Migrate everything from a print server"));
return 0;
}
@@ -6554,9 +6608,11 @@ static int rpc_printer_migrate_drivers(struct net_context *c, int argc,
const char **argv)
{
if (c->display_usage) {
- d_printf(_("Usage:\n"),
+ d_printf( "%s\n"
"net rpc printer migrate drivers\n"
- " ",_("Migrate print-drivers from a print-server\n"));
+ " %s\n",
+ _("Usage:"),
+ _("Migrate print-drivers from a print-server"));
return 0;
}
@@ -6584,9 +6640,11 @@ static int rpc_printer_migrate_forms(struct net_context *c, int argc,
const char **argv)
{
if (c->display_usage) {
- d_printf(_("Usage:\n"),
+ d_printf( "%s\n"
"net rpc printer migrate forms\n"
- " ",_("Migrate print-forms from a print-server\n"));
+ " %s\n",
+ _("Usage:"),
+ _("Migrate print-forms from a print-server"));
return 0;
}
@@ -6614,9 +6672,11 @@ static int rpc_printer_migrate_printers(struct net_context *c, int argc,
const char **argv)
{
if (c->display_usage) {
- d_printf(_("Usage:\n"),
+ d_printf( "%s\n"
"net rpc printer migrate printers\n"
- " ",_("Migrate printers from a print-server\n"));
+ " %s\n",
+ _("Usage:"),
+ _("Migrate printers from a print-server"));
return 0;
}
@@ -6644,9 +6704,11 @@ static int rpc_printer_migrate_security(struct net_context *c, int argc,
const char **argv)
{
if (c->display_usage) {
- d_printf(_("Usage:\n"),
+ d_printf( "%s\n"
"net rpc printer migrate security\n"
- " ",_("Migrate printer-ACLs from a print-server\n"));
+ " %s\n",
+ _("Usage:"),
+ _("Migrate printer-ACLs from a print-server"));
return 0;
}
@@ -6674,10 +6736,12 @@ static int rpc_printer_migrate_settings(struct net_context *c, int argc,
const char **argv)
{
if (c->display_usage) {
- d_printf(_("Usage:\n"),
+ d_printf( "%s\n"
"net rpc printer migrate settings\n"
- " ",_("Migrate printer-settings from a "
- "print-server\n"));
+ " %s\n",
+ _("Usage:"),
+ _("Migrate printer-settings from a "
+ "print-server"));
return 0;
}
@@ -6776,9 +6840,11 @@ int rpc_printer_migrate(struct net_context *c, int argc, const char **argv)
static int rpc_printer_list(struct net_context *c, int argc, const char **argv)
{
if (c->display_usage) {
- d_printf(_("Usage:\n"),
+ d_printf( "%s\n"
"net rpc printer list\n"
- " ",_("List printers on a remote RPC server\n"));
+ " %s\n",
+ _("Usage:"),
+ _("List printers on a remote RPC server"));
return 0;
}
@@ -6801,9 +6867,11 @@ static int rpc_printer_driver_list(struct net_context *c, int argc,
const char **argv)
{
if (c->display_usage) {
- d_printf(_("Usage:\n"),
+ d_printf( "%s\n"
"net rpc printer driver\n"
- " ",_("List printer-drivers on a remote RPC server\n"));
+ " %s\n",
+ _("Usage:"),
+ _("List printer-drivers on a remote RPC server"));
return 0;
}
@@ -6826,9 +6894,11 @@ static int rpc_printer_publish_publish(struct net_context *c, int argc,
const char **argv)
{
if (c->display_usage) {
- d_printf(_("Usage:\n"),
+ d_printf( "%s\n"
"net rpc printer publish publish\n"
- " ",_("Publish printer in ADS via MSRPC\n"));
+ " %s\n",
+ _("Usage:"),
+ _("Publish printer in ADS via MSRPC"));
return 0;
}
@@ -6850,9 +6920,11 @@ static int rpc_printer_publish_publish(struct net_context *c, int argc,
static int rpc_printer_publish_update(struct net_context *c, int argc, const char **argv)
{
if (c->display_usage) {
- d_printf(_("Usage:\n"),
+ d_printf( "%s\n"
"net rpc printer publish update\n"
- " ",_("Update printer in ADS via MSRPC\n"));
+ " %s\n",
+ _("Usage:"),
+ _("Update printer in ADS via MSRPC"));
return 0;
}
@@ -6875,9 +6947,11 @@ static int rpc_printer_publish_unpublish(struct net_context *c, int argc,
const char **argv)
{
if (c->display_usage) {
- d_printf(_("Usage:\n"),
+ d_printf( "%s\n"
"net rpc printer publish unpublish\n"
- " ",_("UnPublish printer in ADS via MSRPC\n"));
+ " %s\n",
+ _("Usage:\n"),
+ _("UnPublish printer in ADS via MSRPC"));
return 0;
}
@@ -6900,9 +6974,11 @@ static int rpc_printer_publish_list(struct net_context *c, int argc,
const char **argv)
{
if (c->display_usage) {
- d_printf(_("Usage:\n"),
+ d_printf( "%s\n"
"net rpc printer publish list\n"
- " ",_("List published printers via MSRPC\n"));
+ " %s\n",
+ _("Usage:"),
+ _("List published printers via MSRPC"));
return 0;
}