diff options
Diffstat (limited to 'source3/utils')
-rw-r--r-- | source3/utils/net.c | 11 | ||||
-rw-r--r-- | source3/utils/net_ads.c | 125 | ||||
-rw-r--r-- | source3/utils/net_ads_gpo.c | 41 | ||||
-rw-r--r-- | source3/utils/net_cache.c | 37 | ||||
-rw-r--r-- | source3/utils/net_conf.c | 46 | ||||
-rw-r--r-- | source3/utils/net_dom.c | 12 | ||||
-rw-r--r-- | source3/utils/net_eventlog.c | 9 | ||||
-rw-r--r-- | source3/utils/net_groupmap.c | 44 | ||||
-rw-r--r-- | source3/utils/net_idmap.c | 23 | ||||
-rw-r--r-- | source3/utils/net_lookup.c | 19 | ||||
-rw-r--r-- | source3/utils/net_rap.c | 10 | ||||
-rw-r--r-- | source3/utils/net_registry.c | 58 | ||||
-rw-r--r-- | source3/utils/net_rpc.c | 262 | ||||
-rw-r--r-- | source3/utils/net_rpc_audit.c | 30 | ||||
-rw-r--r-- | source3/utils/net_rpc_registry.c | 62 | ||||
-rw-r--r-- | source3/utils/net_rpc_rights.c | 29 | ||||
-rw-r--r-- | source3/utils/net_rpc_samsync.c | 19 | ||||
-rw-r--r-- | source3/utils/net_rpc_service.c | 66 | ||||
-rw-r--r-- | source3/utils/net_rpc_sh_acct.c | 4 | ||||
-rw-r--r-- | source3/utils/net_rpc_shell.c | 3 | ||||
-rw-r--r-- | source3/utils/net_sam.c | 104 | ||||
-rw-r--r-- | source3/utils/net_status.c | 16 | ||||
-rw-r--r-- | source3/utils/net_time.c | 22 | ||||
-rw-r--r-- | source3/utils/net_util.c | 4 |
24 files changed, 676 insertions, 380 deletions
diff --git a/source3/utils/net.c b/source3/utils/net.c index 7f20a258a7..7154abf1f1 100644 --- a/source3/utils/net.c +++ b/source3/utils/net.c @@ -277,7 +277,8 @@ static int net_setlocalsid(struct net_context *c, int argc, const char **argv) || (strncmp(argv[0], "S-1-5-21-", strlen("S-1-5-21-")) != 0) || (!string_to_sid(&sid, argv[0])) || (sid.num_auths != 4)) { - d_printf(_("Usage:")," net setlocalsid S-1-5-21-x-y-z\n"); + d_printf(_("Usage:")); + d_printf(" net setlocalsid S-1-5-21-x-y-z\n"); return 1; } @@ -297,7 +298,8 @@ static int net_setdomainsid(struct net_context *c, int argc, const char **argv) || (strncmp(argv[0], "S-1-5-21-", strlen("S-1-5-21-")) != 0) || (!string_to_sid(&sid, argv[0])) || (sid.num_auths != 4)) { - d_printf(_("Usage:")," net setdomainsid S-1-5-21-x-y-z\n"); + d_printf(_("Usage:")); + d_printf(" net setdomainsid S-1-5-21-x-y-z\n"); return 1; } @@ -315,7 +317,8 @@ static int net_getdomainsid(struct net_context *c, int argc, const char **argv) fstring sid_str; if (argc > 0) { - d_printf(_("Usage:")," net getdomainsid\n"); + d_printf(_("Usage:")); + d_printf(" net getdomainsid\n"); return 1; } @@ -399,7 +402,7 @@ static int net_maxrid(struct net_context *c, int argc, const char **argv) uint32 rid; if (argc != 0) { - d_fprintf(stderr, _("Usage:")," net maxrid\n"); + d_fprintf(stderr, "%s net maxrid\n", _("Usage:")); return 1; } diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c index 8e9f412d6c..eff664fcb4 100644 --- a/source3/utils/net_ads.c +++ b/source3/utils/net_ads.c @@ -128,9 +128,11 @@ static int net_ads_lookup(struct net_context *c, int argc, const char **argv) int ret; if (c->display_usage) { - d_printf(_("Usage:\n"), - "net ads lookup\n" - " ",_("Find the ADS DC using CLDAP lookup.\n")); + d_printf("%s\n" + "net ads lookup\n" + " %s", + _("Usage:"), + _("Find the ADS DC using CLDAP lookup.\n")); return 0; } @@ -158,10 +160,11 @@ static int net_ads_info(struct net_context *c, int argc, const char **argv) char addr[INET6_ADDRSTRLEN]; if (c->display_usage) { - d_printf(_("Usage:\n"), - "net ads info\n", - " ", - _("Display information about an Active Directory " + d_printf("%s\n" + "net ads info\n" + " %s", + _("Usage:"), + _("Display information about an Active Directory " "server.\n")); return 0; } @@ -373,9 +376,11 @@ static int net_ads_workgroup(struct net_context *c, int argc, const char **argv) struct NETLOGON_SAM_LOGON_RESPONSE_EX reply; if (c->display_usage) { - d_printf(_("Usage:\n"), + d_printf ("%s\n" "net ads workgroup\n" - " ",_("Print the workgroup name\n")); + " %s\n", + _("Usage:"), + _("Print the workgroup name")); return 0; } @@ -698,9 +703,11 @@ int net_ads_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 ads user\n" - " ",_("List AD users\n")); + " %s\n", + _("Usage:"), + _("List AD users")); net_display_usage_from_functable(func); return 0; } @@ -849,9 +856,11 @@ int net_ads_group(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 ads group\n" - " ", _("List AD groups\n")); + " %s\n", + _("Usage:"), + _("List AD groups")); net_display_usage_from_functable(func); return 0; } @@ -883,9 +892,11 @@ static int net_ads_status(struct net_context *c, int argc, const char **argv) LDAPMessage *res; if (c->display_usage) { - d_printf(_("Usage:\n"), + d_printf( "%s\n" "net ads status\n" - " ",_("Display machine account details\n")); + " %s\n", + _("Usage:"), + _("Display machine account details")); return 0; } @@ -925,9 +936,11 @@ static int net_ads_leave(struct net_context *c, int argc, const char **argv) WERROR werr; if (c->display_usage) { - d_printf(_("Usage:\n"), + d_printf( "%s\n" "net ads leave\n" - " ", _("Leave an AD domain\n")); + " %s\n", + _("Usage:"), + _("Leave an AD domain")); return 0; } @@ -1038,9 +1051,11 @@ int net_ads_testjoin(struct net_context *c, int argc, const char **argv) use_in_memory_ccache(); if (c->display_usage) { - d_printf(_("Usage:\n"), + d_printf( "%s\n" "net ads testjoin\n" - " ", _("Test if the existing join is ok\n")); + " %s\n", + _("Usage:"), + _("Test if the existing join is ok")); return 0; } @@ -1539,9 +1554,11 @@ static int net_ads_printer_search(struct net_context *c, int argc, const char ** LDAPMessage *res = NULL; if (c->display_usage) { - d_printf(_("Usage:\n"), + d_printf( "%s\n" "net ads printer search\n" - " ", _("List printers in the AD\n")); + " %s\n", + _("Usage:"), + _("List printers in the AD")); return 0; } @@ -1579,8 +1596,9 @@ static int net_ads_printer_info(struct net_context *c, int argc, const char **ar LDAPMessage *res = NULL; if (c->display_usage) { - d_printf(_("Usage:\n"), - _("net ads printer info [printername [servername]]\n" + d_printf("%s\n%s", + _("Usage:"), + _("net ads printer info [printername [servername]]\n" " Display printer info from AD\n" " printername\tPrinter name or wildcard\n" " servername\tName of the print server\n")); @@ -1643,8 +1661,9 @@ static int net_ads_printer_publish(struct net_context *c, int argc, const char * LDAPMessage *res = NULL; if (argc < 1 || c->display_usage) { - d_printf(_("Usage:\n"), - _("net ads printer publish <printername> [servername]\n" + d_printf("%s\n%s", + _("Usage:"), + _("net ads printer publish <printername> [servername]\n" " Publish printer in AD\n" " printername\tName of the printer\n" " servername\tName of the print server\n")); @@ -1769,8 +1788,9 @@ static int net_ads_printer_remove(struct net_context *c, int argc, const char ** LDAPMessage *res = NULL; if (argc < 1 || c->display_usage) { - d_printf(_("Usage:\n"), - _("net ads printer remove <printername> [servername]\n" + d_printf("%s\n%s", + _("Usage:"), + _("net ads printer remove <printername> [servername]\n" " Remove a printer from the AD\n" " printername\tName of the printer\n" " servername\tName of the print server\n")); @@ -1872,8 +1892,9 @@ static int net_ads_password(struct net_context *c, int argc, const char **argv) ADS_STATUS ret; if (c->display_usage) { - d_printf(_("Usage:\n"), - _("net ads password <username>\n" + d_printf("%s\n%s", + _("Usage:"), + _("net ads password <username>\n" " Change password for user\n" " username\tName of user to change password for\n")); return 0; @@ -1955,9 +1976,11 @@ int net_ads_changetrustpw(struct net_context *c, int argc, const char **argv) ADS_STATUS ret; if (c->display_usage) { - d_printf(_("Usage:\n"), + d_printf( "%s\n" "net ads changetrustpw\n" - " ", _("Change the machine account's trust password\n")); + " %s\n", + _("Usage:"), + _("Change the machine account's trust password")); return 0; } @@ -2196,9 +2219,11 @@ static int net_ads_keytab_flush(struct net_context *c, int argc, const char **ar ADS_STRUCT *ads; if (c->display_usage) { - d_printf(_("Usage:\n"), + d_printf( "%s\n" "net ads keytab flush\n" - " ", _("Delete the whole keytab\n")); + " %s\n", + _("Usage:"), + _("Delete the whole keytab")); return 0; } @@ -2217,8 +2242,9 @@ static int net_ads_keytab_add(struct net_context *c, int argc, const char **argv ADS_STRUCT *ads; if (c->display_usage) { - d_printf(_("Usage:\n"), - _("net ads keytab add <principal> [principal ...]\n" + d_printf("%s\n%s", + _("Usage:"), + _("net ads keytab add <principal> [principal ...]\n" " Add principals to local keytab\n" " principal\tKerberos principal to add to " "keytab\n")); @@ -2242,9 +2268,11 @@ static int net_ads_keytab_create(struct net_context *c, int argc, const char **a int ret; if (c->display_usage) { - d_printf(_("Usage:\n"), + d_printf( "%s\n" "net ads keytab create\n" - " ", _("Create new default keytab\n")); + " %s\n", + _("Usage:"), + _("Create new default keytab")); return 0; } @@ -2261,8 +2289,9 @@ static int net_ads_keytab_list(struct net_context *c, int argc, const char **arg const char *keytab = NULL; if (c->display_usage) { - d_printf(_("Usage:\n"), - _("net ads keytab list [keytab]\n" + d_printf("%s\n%s", + _("Usage:"), + _("net ads keytab list [keytab]\n" " List a local keytab\n" " keytab\tKeytab to list\n")); return 0; @@ -2327,9 +2356,11 @@ static int net_ads_kerberos_renew(struct net_context *c, int argc, const char ** int ret = -1; if (c->display_usage) { - d_printf(_("Usage:\n"), + d_printf( "%s\n" "net ads kerberos renew\n" - " ", _("Renew TGT from existing credential cache\n")); + " %s\n", + _("Usage:"), + _("Renew TGT from existing credential cache")); return 0; } @@ -2351,9 +2382,11 @@ static int net_ads_kerberos_pac(struct net_context *c, int argc, const char **ar const char *impersonate_princ_s = NULL; if (c->display_usage) { - d_printf(_("Usage:\n"), + d_printf( "%s\n" "net ads kerberos pac\n" - " ", _("Dump the Kerberos PAC\n")); + " %s\n", + _("Usage:"), + _("Dump the Kerberos PAC")); return 0; } @@ -2406,9 +2439,11 @@ static int net_ads_kerberos_kinit(struct net_context *c, int argc, const char ** NTSTATUS status; if (c->display_usage) { - d_printf(_("Usage:\n"), + d_printf( "%s\n" "net ads kerberos kinit\n" - " ", _("Get Ticket Granting Ticket (TGT) for the user\n")); + " %s\n", + _("Usage:"), + _("Get Ticket Granting Ticket (TGT) for the user")); return 0; } diff --git a/source3/utils/net_ads_gpo.c b/source3/utils/net_ads_gpo.c index 2203f362e9..14bc378633 100644 --- a/source3/utils/net_ads_gpo.c +++ b/source3/utils/net_ads_gpo.c @@ -37,9 +37,10 @@ static int net_ads_gpo_refresh(struct net_context *c, int argc, const char **arg struct nt_user_token *token = NULL; if (argc < 1 || c->display_usage) { - d_printf(_("Usage:\n"), - _("net ads gpo refresh <username|machinename>\n"), - _(" Lists all GPOs assigned to an account and " + d_printf("%s\n%s\n%s", + _("Usage:"), + _("net ads gpo refresh <username|machinename>"), + _(" Lists all GPOs assigned to an account and " "downloads them\n" " username\tUser to refresh GPOs for\n" " machinename\tMachine to refresh GPOs for\n")); @@ -223,9 +224,11 @@ static int net_ads_gpo_list_all(struct net_context *c, int argc, const char **ar }; if (c->display_usage) { - d_printf(_("Usage:\n"), + d_printf( "%s\n" "net ads gpo listall\n" - " ", _("List all GPOs on the DC\n")); + " %s\n", + _("Usage:"), + _("List all GPOs on the DC")); return 0; } @@ -297,9 +300,10 @@ static int net_ads_gpo_list(struct net_context *c, int argc, const char **argv) struct nt_user_token *token = NULL; if (argc < 1 || c->display_usage) { - d_printf(_("Usage:\n"), - _("net ads gpo list <username|machinename>\n"), - _(" Lists all GPOs for machine/user\n" + d_printf("%s\n%s\n%s", + _("Usage:"), + _("net ads gpo list <username|machinename>"), + _(" Lists all GPOs for machine/user\n" " username\tUser to list GPOs for\n" " machinename\tMachine to list GPOs for\n")); return -1; @@ -448,9 +452,10 @@ static int net_ads_gpo_link_get(struct net_context *c, int argc, const char **ar struct GP_LINK gp_link; if (argc < 1 || c->display_usage) { - d_printf(_("Usage:\n"), - _("net ads gpo linkget <container>\n"), - _(" Lists gPLink of a containter\n" + d_printf("%s\n%s\n%s", + _("Usage:"), + _("net ads gpo linkget <container>"), + _(" Lists gPLink of a containter\n" " container\tContainer to get link for\n")); return -1; } @@ -489,9 +494,10 @@ static int net_ads_gpo_link_add(struct net_context *c, int argc, const char **ar TALLOC_CTX *mem_ctx; if (argc < 2 || c->display_usage) { - d_printf(_("Usage:\n"), - _("net ads gpo linkadd <linkdn> <gpodn> [options]\n"), - _(" Link a container to a GPO\n" + d_printf("%s\n%s\n%s", + _("Usage:"), + _("net ads gpo linkadd <linkdn> <gpodn> [options]"), + _(" Link a container to a GPO\n" " linkdn\tContainer to link to a GPO\n" " gpodn\tGPO to link container to\n")); d_printf(_("note: DNs must be provided properly escaped.\n" @@ -576,9 +582,10 @@ static int net_ads_gpo_get_gpo(struct net_context *c, int argc, const char **arg struct GROUP_POLICY_OBJECT gpo; if (argc < 1 || c->display_usage) { - d_printf(_("Usage:\n"), - _("net ads gpo getgpo <gpo>\n"), - _(" List speciefied GPO\n" + d_printf("%s\n%s\n%s", + _("Usage:"), + _("net ads gpo getgpo <gpo>"), + _(" List speciefied GPO\n" " gpo\t\tGPO to list\n")); return -1; } diff --git a/source3/utils/net_cache.c b/source3/utils/net_cache.c index 41bf7ef1c7..fef269d77d 100644 --- a/source3/utils/net_cache.c +++ b/source3/utils/net_cache.c @@ -155,8 +155,9 @@ static int net_cache_add(struct net_context *c, int argc, const char **argv) time_t timeout; if (argc < 3 || c->display_usage) { - d_printf("\n",_("Usage:\n"), - _("net cache add <key string> <data string> " + d_printf("%s\n%s", + _("Usage:"), + _("net cache add <key string> <data string> " "<timeout>\n")); return -1; } @@ -193,7 +194,9 @@ static int net_cache_del(struct net_context *c, int argc, const char **argv) const char *keystr = argv[0]; if (argc < 1 || c->display_usage) { - d_printf("\n",_("Usage:"), _(" net cache del <key string>\n")); + d_printf("%s\n%s", + _("Usage:"), + _(" net cache del <key string>\n")); return -1; } @@ -221,7 +224,9 @@ static int net_cache_get(struct net_context *c, int argc, const char **argv) time_t timeout; if (argc < 1 || c->display_usage) { - d_printf("\n", _("Usage:"), _(" net cache get <key>\n")); + d_printf("%s\n%s", + _("Usage:"), + _(" net cache get <key>\n")); return -1; } @@ -248,7 +253,9 @@ static int net_cache_search(struct net_context *c, int argc, const char **argv) const char* pattern; if (argc < 1 || c->display_usage) { - d_printf(_("Usage:"), _(" net cache search <pattern>\n")); + d_printf("%s\n%s", + _("Usage:"), + _(" net cache search <pattern>\n")); return -1; } @@ -270,9 +277,11 @@ static int net_cache_list(struct net_context *c, int argc, const char **argv) const char* pattern = "*"; if (c->display_usage) { - d_printf(_("Usage:\n"), + d_printf( "%s\n" "net cache list\n" - " ", _("List all cache entries.\n")); + " %s\n", + _("Usage:"), + _("List all cache entries.")); return 0; } gencache_iterate(print_cache_entry, NULL, pattern); @@ -291,9 +300,11 @@ static int net_cache_flush(struct net_context *c, int argc, const char **argv) { const char* pattern = "*"; if (c->display_usage) { - d_printf(_("Usage:\n"), + d_printf( "%s\n" "net cache flush\n" - " ", _("Delete all cache entries.\n")); + " %s", + _("Usage:"), + _("Delete all cache entries.")); return 0; } gencache_iterate(delete_cache_entry, NULL, pattern); @@ -304,9 +315,11 @@ static int net_cache_stabilize(struct net_context *c, int argc, const char **argv) { if (c->display_usage) { - d_printf(_("Usage:\n"), - "net cache flush\n" - " ", _("Delete all cache entries.\n")); + d_printf( "%s\n" + "net cache stabilize\n" + " %s\n", + _("Usage:"), + _("Move transient cache content to stable storage")); return 0; } diff --git a/source3/utils/net_conf.c b/source3/utils/net_conf.c index 74c72a5292..e6e8e52581 100644 --- a/source3/utils/net_conf.c +++ b/source3/utils/net_conf.c @@ -39,14 +39,16 @@ static int net_conf_list_usage(struct net_context *c, int argc, const char **argv) { - d_printf(_("Usage:"), " net conf list\n"); + d_printf("%s net conf list\n", _("Usage:")); return -1; } static int net_conf_import_usage(struct net_context *c, int argc, const char**argv) { - d_printf(_("Usage:"), _(" net conf import [--test|-T] <filename> " + d_printf("%s\n%s", + _("Usage:"), + _(" net conf import [--test|-T] <filename> " "[<servicename>]\n" "\t[--test|-T] testmode - do not act, just print " "what would be done\n" @@ -58,28 +60,32 @@ static int net_conf_import_usage(struct net_context *c, int argc, static int net_conf_listshares_usage(struct net_context *c, int argc, const char **argv) { - d_printf(_("Usage:"), " net conf listshares\n"); + d_printf("%s\nnet conf listshares\n", _("Usage:")); return -1; } static int net_conf_drop_usage(struct net_context *c, int argc, const char **argv) { - d_printf(_("Usage:"), " net conf drop\n"); + d_printf("%s\nnet conf drop\n", _("Usage:")); return -1; } static int net_conf_showshare_usage(struct net_context *c, int argc, const char **argv) { - d_printf(_("Usage:"), _(" net conf showshare <sharename>\n")); + d_printf("%s\n%s", + _("Usage:"), + _("net conf showshare <sharename>\n")); return -1; } static int net_conf_addshare_usage(struct net_context *c, int argc, const char **argv) { - d_printf(_("Usage:"), _(" net conf addshare <sharename> <path> " + d_printf("%s\n%s", + _("Usage:"), + _(" net conf addshare <sharename> <path> " "[writeable={y|N} [guest_ok={y|N} [<comment>]]\n" "\t<sharename> the new share name.\n" "\t<path> the path on the filesystem to export.\n" @@ -94,49 +100,63 @@ static int net_conf_addshare_usage(struct net_context *c, int argc, static int net_conf_delshare_usage(struct net_context *c, int argc, const char **argv) { - d_printf(_("Usage:"), _(" net conf delshare <sharename>\n")); + d_printf("%s\n%s", + _("Usage:"), + _("net conf delshare <sharename>\n")); return -1; } static int net_conf_setparm_usage(struct net_context *c, int argc, const char **argv) { - d_printf(_("Usage:"), _(" net conf setparm <section> <param> <value>\n")); + d_printf("%s\n%s", + _("Usage:"), + _(" net conf setparm <section> <param> <value>\n")); return -1; } static int net_conf_getparm_usage(struct net_context *c, int argc, const char **argv) { - d_printf(_("Usage:"), _(" net conf getparm <section> <param>\n")); + d_printf("%s\n%s", + _("Usage:"), + _(" net conf getparm <section> <param>\n")); return -1; } static int net_conf_delparm_usage(struct net_context *c, int argc, const char **argv) { - d_printf(_("Usage:"), _(" net conf delparm <section> <param>\n")); + d_printf("%s\n%s", + _("Usage:"), + _(" net conf delparm <section> <param>\n")); return -1; } static int net_conf_getincludes_usage(struct net_context *c, int argc, const char **argv) { - d_printf(_("Usage:"), _(" net conf getincludes <section>\n")); + d_printf("%s\n%s", + _("Usage:"), + _(" net conf getincludes <section>\n")); return -1; } static int net_conf_setincludes_usage(struct net_context *c, int argc, const char **argv) { - d_printf(_("Usage:"), _(" net conf setincludes <section> [<filename>]*\n")); + d_printf("%s\n%s", + _("Usage:"), + _(" net conf setincludes <section> [<filename>]*\n")); return -1; } static int net_conf_delincludes_usage(struct net_context *c, int argc, const char **argv) { - d_printf(_("Usage:"), _(" net conf delincludes <section>\n")); + d_printf("%s\n%s", + _("Usage:"), + _(" net conf delincludes <section>\n")); return -1; } diff --git a/source3/utils/net_dom.c b/source3/utils/net_dom.c index e139ef4e03..c05a42465a 100644 --- a/source3/utils/net_dom.c +++ b/source3/utils/net_dom.c @@ -23,13 +23,19 @@ int net_dom_usage(struct net_context *c, int argc, const char **argv) { - d_printf(_("Usage:"), _(" net dom join " + d_printf("%s\n%s", + _("Usage:"), + _("net dom join " "<domain=DOMAIN> <ou=OU> <account=ACCOUNT> " "<password=PASSWORD> <reboot>\n Join a remote machine\n")); - d_printf(_("Usage:"), _(" net dom unjoin " + d_printf("%s\n%s", + _("Usage:"), + _("net dom unjoin " "<account=ACCOUNT> <password=PASSWORD> <reboot>\n" " Unjoin a remote machine\n")); - d_printf(_("Usage:"), _(" net dom renamecomputer " + d_printf("%s\n%s", + _("Usage:"), + _("net dom renamecomputer " "<newname=NEWNAME> " "<account=ACCOUNT> <password=PASSWORD> <reboot>\n" " Rename joined computer\n")); diff --git a/source3/utils/net_eventlog.c b/source3/utils/net_eventlog.c index 99ecd43c2a..c889efbf95 100644 --- a/source3/utils/net_eventlog.c +++ b/source3/utils/net_eventlog.c @@ -43,7 +43,8 @@ static int net_eventlog_dump(struct net_context *c, int argc, char *s; if (argc < 1 || c->display_usage) { - d_fprintf(stderr, _("Usage:")," net eventlog dump <file.evt>\n"); + d_fprintf(stderr, "%s\nnet eventlog dump <file.evt>\n", + _("Usage:")); goto done; } @@ -99,7 +100,8 @@ static int net_eventlog_import(struct net_context *c, int argc, if (argc < 2 || c->display_usage) { d_fprintf(stderr, - _("Usage:")," net eventlog import <file> <eventlog>\n"); + "%s\nnet eventlog import <file> <eventlog>\n", + _("Usage:")); goto done; } @@ -194,7 +196,8 @@ static int net_eventlog_export(struct net_context *c, int argc, if (argc < 2 || c->display_usage) { d_fprintf(stderr, - _("Usage:")," net eventlog export <file> <eventlog>\n"); + "%s\nnet eventlog export <file> <eventlog>\n", + _("Usage:")); goto done; } diff --git a/source3/utils/net_groupmap.c b/source3/utils/net_groupmap.c index d17dab150d..94576d362d 100644 --- a/source3/utils/net_groupmap.c +++ b/source3/utils/net_groupmap.c @@ -88,7 +88,7 @@ static int net_groupmap_list(struct net_context *c, int argc, const char **argv) " sid\tSID of group to list"); if (c->display_usage) { - d_printf(_("Usage:\n"),"%s\n", list_usage_str); + d_printf("%s\n%s\n", _("Usage: "), list_usage_str); return 0; } @@ -116,7 +116,7 @@ static int net_groupmap_list(struct net_context *c, int argc, const char **argv) } else { d_fprintf(stderr, _("Bad option: %s\n"), argv[i]); - d_printf(_("Usage:\n"),"%s\n", list_usage_str); + d_printf("%s\n%s\n", _("Usage:"), list_usage_str); return -1; } } @@ -192,7 +192,7 @@ static int net_groupmap_add(struct net_context *c, int argc, const char **argv) name_type = "domain group"; if (c->display_usage) { - d_printf(_("Usage:\n"),"%s\n", add_usage_str); + d_printf("%s\n%s\n", _("Usage:\n"), add_usage_str); return 0; } @@ -268,7 +268,7 @@ static int net_groupmap_add(struct net_context *c, int argc, const char **argv) } if ( !unixgrp[0] ) { - d_printf(_("Usage:\n"),"%s\n", add_usage_str); + d_printf("%s\n%s\n", _("Usage:\n"), add_usage_str); return -1; } @@ -352,7 +352,7 @@ static int net_groupmap_modify(struct net_context *c, int argc, const char **arg "[type=<domain|local>]"); if (c->display_usage) { - d_printf(_("Usage:\n"),"%s\n", modify_usage_str); + d_printf("%s\n%s\n", _("Usage:\n"), modify_usage_str); return 0; } @@ -408,7 +408,7 @@ static int net_groupmap_modify(struct net_context *c, int argc, const char **arg } if ( !ntgroup[0] && !sid_string[0] ) { - d_printf(_("Usage:\n"),"%s\n", modify_usage_str); + d_printf("%s\n%s\n", _("Usage:\n"), modify_usage_str); return -1; } @@ -491,7 +491,7 @@ static int net_groupmap_delete(struct net_context *c, int argc, const char **arg "{ntgroup=<string>|sid=<SID>}"); if (c->display_usage) { - d_printf(_("Usage:\n"),"%s\n", delete_usage_str); + d_printf("%s\n%s\n", _("Usage:\n"), delete_usage_str); return 0; } @@ -518,7 +518,7 @@ static int net_groupmap_delete(struct net_context *c, int argc, const char **arg } if ( !ntgroup[0] && !sid_string[0]) { - d_printf(_("Usage:\n"),"%s\n", delete_usage_str); + d_printf("%s\n%s\n", _("Usage:\n"), delete_usage_str); return -1; } @@ -553,8 +553,10 @@ static int net_groupmap_set(struct net_context *c, int argc, const char **argv) bool have_map = false; if ((argc < 1) || (argc > 2) || c->display_usage) { - d_printf(_("Usage:"), _(" net groupmap set \"NT Group\" " - "[\"unix group\"] [-C \"comment\"] [-L] [-D]\n")); + d_printf("%s\n%s", + _("Usage:"), + _(" net groupmap set \"NT Group\" " + "[\"unix group\"] [-C \"comment\"] [-L] [-D]\n")); return -1; } @@ -669,9 +671,11 @@ static int net_groupmap_cleanup(struct net_context *c, int argc, const char **ar size_t i, entries; if (c->display_usage) { - d_printf(_("Usage:\n"), + d_printf( "%s\n" "net groupmap cleanup\n" - " ",_("Delete all group mappings\n")); + " %s\n", + _("Usage:"), + _("Delete all group mappings")); return 0; } @@ -707,7 +711,9 @@ static int net_groupmap_addmem(struct net_context *c, int argc, const char **arg c->display_usage || !string_to_sid(&alias, argv[0]) || !string_to_sid(&member, argv[1]) ) { - d_printf(_("Usage:"), _("net groupmap addmem alias-sid member-sid\n")); + d_printf("%s\n%s", + _("Usage:"), + _("net groupmap addmem alias-sid member-sid\n")); return -1; } @@ -728,7 +734,9 @@ static int net_groupmap_delmem(struct net_context *c, int argc, const char **arg c->display_usage || !string_to_sid(&alias, argv[0]) || !string_to_sid(&member, argv[1]) ) { - d_printf(_("Usage:"), _(" net groupmap delmem alias-sid member-sid\n")); + d_printf("%s\n%s", + _("Usage:"), + _("net groupmap delmem alias-sid member-sid\n")); return -1; } @@ -750,7 +758,9 @@ static int net_groupmap_listmem(struct net_context *c, int argc, const char **ar if ( (argc != 1) || c->display_usage || !string_to_sid(&alias, argv[0]) ) { - d_printf(_("Usage:"), _(" net groupmap listmem alias-sid\n")); + d_printf("%s\n%s", + _("Usage:"), + _("net groupmap listmem alias-sid\n")); return -1; } @@ -808,7 +818,9 @@ static int net_groupmap_memberships(struct net_context *c, int argc, const char if ( (argc != 1) || c->display_usage || !string_to_sid(&member, argv[0]) ) { - d_printf(_("Usage:"), _(" net groupmap memberof sid\n")); + d_printf("%s\n%s", + _("Usage:"), + _("net groupmap memberof sid\n")); return -1; } diff --git a/source3/utils/net_idmap.c b/source3/utils/net_idmap.c index d1400db553..32680e0dee 100644 --- a/source3/utils/net_idmap.c +++ b/source3/utils/net_idmap.c @@ -61,8 +61,9 @@ static int net_idmap_dump(struct net_context *c, int argc, const char **argv) TDB_CONTEXT *idmap_tdb; if ( argc != 1 || c->display_usage) { - d_printf(_("Usage:\n"), - _("net idmap dump <inputfile>\n" + d_printf("%s\n%s", + _("Usage:"), + _("net idmap dump <inputfile>\n" " Dump current ID mapping.\n" " inputfile\tTDB file to read mappings from.\n")); return c->display_usage?0:-1; @@ -92,8 +93,9 @@ static int net_idmap_restore(struct net_context *c, int argc, const char **argv) FILE *input; if (c->display_usage) { - d_printf(_("Usage:\n"), - _("net idmap restore [inputfile]\n" + d_printf("%s\n%s", + _("Usage:"), + _("net idmap restore [inputfile]\n" " Restore ID mappings from file\n" " inputfile\tFile to load ID mappings from. If " "not given, load data from stdin.\n")); @@ -194,13 +196,13 @@ static int net_idmap_restore(struct net_context *c, int argc, const char **argv) **********************************************************/ static int net_idmap_delete(struct net_context *c, int argc, const char **argv) { - d_printf(_("Not implemented yet"),"\n"); + d_printf("%s\n", _("Not implemented yet")); return -1; } static int net_idmap_set(struct net_context *c, int argc, const char **argv) { - d_printf(_("Not implemented yet"),"\n"); + d_printf("%s\n", _("Not implemented yet")); return -1; } bool idmap_store_secret(const char *backend, bool alloc, @@ -238,8 +240,9 @@ static int net_idmap_secret(struct net_context *c, int argc, const char **argv) bool ret; if (argc != 2 || c->display_usage) { - d_printf(_("Usage:\n"), - _("net idmap secret {<DOMAIN>|alloc} <secret>\n" + d_printf("%s\n%s", + _("Usage:"), + _("net idmap secret {<DOMAIN>|alloc} <secret>\n" " Set the secret for the specified domain " "(or alloc module)\n" " DOMAIN\tDomain to set secret for.\n" @@ -337,8 +340,8 @@ static int net_idmap_aclmapset(struct net_context *c, int argc, const char **arg NTSTATUS status; if (argc != 3 || c->display_usage) { - d_fprintf(stderr, _("Usage:")," net idmap aclmapset <tdb> " - "<src-sid> <dst-sid>\n"); + d_fprintf(stderr, "%s net idmap aclmapset <tdb> " + "<src-sid> <dst-sid>\n", _("Usage:")); return -1; } diff --git a/source3/utils/net_lookup.c b/source3/utils/net_lookup.c index b303abde56..658e904f59 100644 --- a/source3/utils/net_lookup.c +++ b/source3/utils/net_lookup.c @@ -109,7 +109,8 @@ static int net_lookup_ldap(struct net_context *c, int argc, const char **argv) sitename = sitename_fetch(domain); if ( (ctx = talloc_init("net_lookup_ldap")) == NULL ) { - d_fprintf(stderr,"net_lookup_ldap: talloc_init() ",_("failed"),"!\n"); + d_fprintf(stderr,"net_lookup_ldap: talloc_init() %s!\n", + _("failed")); SAFE_FREE(sitename); return -1; } @@ -305,12 +306,12 @@ static int net_lookup_kdc(struct net_context *c, int argc, const char **argv) return -1; } for (i=0;i<num_kdcs;i++) - if (addrs[i].sin_family == AF_INET) + if (addrs[i].sin_family == AF_INET) d_printf("%s:%hd\n", inet_ntoa(addrs[i].sin_addr), ntohs(addrs[i].sin_port)); return 0; -#endif +#endif DEBUG(1, ("No kerberos support\n")); return -1; } @@ -322,7 +323,9 @@ static int net_lookup_name(struct net_context *c, int argc, const char **argv) enum lsa_SidType type; if (argc != 1) { - d_printf(_("Usage:"), _(" net lookup name <name>\n")); + d_printf("%s\n%s", + _("Usage:"), + _(" net lookup name <name>\n")); return -1; } @@ -344,7 +347,9 @@ static int net_lookup_sid(struct net_context *c, int argc, const char **argv) enum lsa_SidType type; if (argc != 1) { - d_printf(_("Usage:"), _(" net lookup sid <sid>\n")); + d_printf("%s\n%s", + _("Usage:"), + _(" net lookup sid <sid>\n")); return -1; } @@ -375,7 +380,9 @@ static int net_lookup_dsgetdcname(struct net_context *c, int argc, const char ** char *s = NULL; if (argc < 1 || argc > 3) { - d_printf(_("Usage:"), _(" net lookup dsgetdcname " + d_printf("%s\n%s", + _("Usage:"), + _(" net lookup dsgetdcname " "<name> <flags> <sitename>\n")); return -1; } diff --git a/source3/utils/net_rap.c b/source3/utils/net_rap.c index b613b266b0..078c7febc9 100644 --- a/source3/utils/net_rap.c +++ b/source3/utils/net_rap.c @@ -503,8 +503,9 @@ static int net_rap_server_name(struct net_context *c, int argc, const char *argv char *name; if (c->display_usage) { - d_printf(_("Usage:\n"), - _("net rap server name\n" + d_printf("%s\n%s", + _("Usage:"), + _("net rap server name\n" " Get the name of the server\n")); return 0; } @@ -532,8 +533,9 @@ static int net_rap_server_domain(struct net_context *c, int argc, int ret; if (c->display_usage) { - d_printf(_("Usage:\n"), - _("net rap server domain\n" + d_printf("%s\n%s", + _("Usage:"), + _("net rap server domain\n" " Enumerate servers in this domain/workgroup\n")); return 0; } diff --git a/source3/utils/net_registry.c b/source3/utils/net_registry.c index 3958d2165d..c118b73310 100644 --- a/source3/utils/net_registry.c +++ b/source3/utils/net_registry.c @@ -130,9 +130,12 @@ static int net_registry_enumerate(struct net_context *c, int argc, int ret = -1; if (argc != 1 || c->display_usage) { - d_printf(_("Usage:"),_(" net registry enumerate <path>\n")); - d_printf(_("Example:"), _(" net registry enumerate " - "'HKLM\\Software\\Samba'\n")); + d_printf("%s\n%s", + _("Usage:"), + _("net registry enumerate <path>\n")); + d_printf("%s\n%s", + _("Example:"), + _("net registry enumerate 'HKLM\\Software\\Samba'\n")); goto done; } @@ -182,9 +185,13 @@ static int net_registry_createkey(struct net_context *c, int argc, int ret = -1; if (argc != 1 || c->display_usage) { - d_printf(_("Usage:"),_(" net registry createkey <path>\n")); - d_printf(_("Example:"), _(" net registry createkey " - "'HKLM\\Software\\Samba\\smbconf.127.0.0.1'\n")); + d_printf("%s\n%s", + _("Usage:"), + _("net registry createkey <path>\n")); + d_printf("%s\n%s", + _("Example:"), + _("net registry createkey " + "'HKLM\\Software\\Samba\\smbconf.127.0.0.1'\n")); goto done; } if (strlen(argv[0]) == 0) { @@ -235,8 +242,12 @@ static int net_registry_deletekey(struct net_context *c, int argc, int ret = -1; if (argc != 1 || c->display_usage) { - d_printf(_("Usage:"),_(" net registry deletekey <path>\n")); - d_printf(_("Example:"),_(" net registry deletekey " + d_printf("%s\n%s", + _("Usage:"), + _("net registry deletekey <path>\n")); + d_printf("%s\n%s", + _("Example:"), + _("net registry deletekey " "'HKLM\\Software\\Samba\\smbconf.127.0.0.1'\n")); goto done; } @@ -247,14 +258,14 @@ static int net_registry_deletekey(struct net_context *c, int argc, werr = open_hive(ctx, argv[0], REG_KEY_WRITE, &hivekey, &subkeyname); if (!W_ERROR_IS_OK(werr)) { - d_fprintf(stderr, "open_hive ", _("failed"), - ": %s\n", win_errstr(werr)); + d_fprintf(stderr, "open_hive %s: %s\n", _("failed"), + win_errstr(werr)); goto done; } werr = reg_deletekey(hivekey, subkeyname); if (!W_ERROR_IS_OK(werr)) { - d_fprintf(stderr, "reg_deletekey ", _("failed"), ": %s\n", + d_fprintf(stderr, "reg_deletekey %s: %s\n", _("failed"), win_errstr(werr)); goto done; } @@ -276,8 +287,9 @@ static int net_registry_getvalue_internal(struct net_context *c, int argc, TALLOC_CTX *ctx = talloc_stackframe(); if (argc != 2 || c->display_usage) { - d_fprintf(stderr, _("Usage:"),_(" net rpc registry getvalue <key> " - "<valuename>\n")); + d_fprintf(stderr, "%s\n%s", + _("Usage:"), + _("net rpc registry getvalue <key> <valuename>\n")); goto done; } @@ -325,8 +337,10 @@ static int net_registry_setvalue(struct net_context *c, int argc, TALLOC_CTX *ctx = talloc_stackframe(); if (argc < 4 || c->display_usage) { - d_fprintf(stderr, _("Usage:"),_(" net rpc registry setvalue <key> " - "<valuename> <type> [<val>]+\n")); + d_fprintf(stderr, "%s\n%s", + _("Usage:"), + _("net rpc registry setvalue <key> <valuename> " + "<type> [<val>]+\n")); goto done; } @@ -380,8 +394,9 @@ static int net_registry_deletevalue(struct net_context *c, int argc, int ret = -1; if (argc != 2 || c->display_usage) { - d_fprintf(stderr, _("Usage:"),_(" net rpc registry deletevalue <key> " - "<valuename>\n")); + d_fprintf(stderr, "%s\n%s", + _("Usage:"), + _("net rpc registry deletevalue <key> <valuename>\n")); goto done; } @@ -424,9 +439,12 @@ static int net_registry_getsd(struct net_context *c, int argc, access_mask = REG_KEY_READ; if (argc != 1 || c->display_usage) { - d_printf(_("Usage:"),_(" net registry getsd <path>\n")); - d_printf(_("Example:"),_(" net registry getsd " - "'HKLM\\Software\\Samba'\n")); + d_printf("%s\n%s", + _("Usage:"), + _("net registry getsd <path>\n")); + d_printf("%s\n%s", + _("Example:"), + _("net registry getsd 'HKLM\\Software\\Samba'\n")); goto done; } if (strlen(argv[0]) == 0) { 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; } diff --git a/source3/utils/net_rpc_audit.c b/source3/utils/net_rpc_audit.c index ed461cafb0..ceea9f6970 100644 --- a/source3/utils/net_rpc_audit.c +++ b/source3/utils/net_rpc_audit.c @@ -364,9 +364,11 @@ static NTSTATUS rpc_audit_list_internal(struct net_context *c, static int rpc_audit_get(struct net_context *c, int argc, const char **argv) { if (c->display_usage) { - d_printf(_("Usage:\n"), + d_printf( "%s\n" "net rpc audit get\n" - " ",_("View configured audit setting\n")); + " %s\n", + _("Usage:"), + _("View configured audit setting")); return 0; } @@ -380,9 +382,11 @@ static int rpc_audit_get(struct net_context *c, int argc, const char **argv) static int rpc_audit_set(struct net_context *c, int argc, const char **argv) { if (c->display_usage) { - d_printf(_("Usage:\n"), + d_printf( "%s\n" "net rpc audit set\n" - " ",_("Set audit policies\n")); + " %s\n", + _("Usage:"), + _("Set audit policies")); return 0; } @@ -396,9 +400,11 @@ static int rpc_audit_set(struct net_context *c, int argc, const char **argv) static int rpc_audit_enable(struct net_context *c, int argc, const char **argv) { if (c->display_usage) { - d_printf(_("Usage:\n"), + d_printf( "%s\n" "net rpc audit enable\n" - " ",_("Enable auditing\n")); + " %s\n", + _("Usage:"), + _("Enable auditing")); return 0; } @@ -412,9 +418,11 @@ static int rpc_audit_enable(struct net_context *c, int argc, const char **argv) static int rpc_audit_disable(struct net_context *c, int argc, const char **argv) { if (c->display_usage) { - d_printf(_("Usage:\n"), + d_printf( "%s\n" "net rpc audit disable\n" - " ",_("Disable auditing\n")); + " %s\n", + _("Usage:"), + _("Disable auditing")); return 0; } @@ -428,9 +436,11 @@ static int rpc_audit_disable(struct net_context *c, int argc, const char **argv) static int rpc_audit_list(struct net_context *c, int argc, const char **argv) { if (c->display_usage) { - d_printf(_("Usage:\n"), + d_printf( "%s\n" "net rpc audit list\n" - " ",_("List auditing settings\n")); + " %s\n", + _("Usage:"), + _("List auditing settings")); return 0; } diff --git a/source3/utils/net_rpc_registry.c b/source3/utils/net_rpc_registry.c index 8fc22fbcfa..fb9d80b876 100644 --- a/source3/utils/net_rpc_registry.c +++ b/source3/utils/net_rpc_registry.c @@ -471,8 +471,10 @@ static int rpc_registry_setvalue(struct net_context *c, int argc, const char **argv ) { if (argc < 4 || c->display_usage) { - d_fprintf(stderr, _("Usage:"),_(" net rpc registry setvalue <key> " - "<valuename> <type> [<val>]+\n")); + d_fprintf(stderr, "%s\n%s", + _("Usage:"), + _("net rpc registry setvalue <key> <valuename> " + "<type> [<val>]+\n")); return -1; } @@ -524,8 +526,9 @@ static int rpc_registry_deletevalue(struct net_context *c, int argc, const char **argv ) { if (argc != 2 || c->display_usage) { - d_fprintf(stderr, _("Usage:"),_(" net rpc registry deletevalue <key> " - "<valuename>\n")); + d_fprintf(stderr, "%s\n%s", + _("Usage:"), + _("net rpc registry deletevalue <key> <valuename>\n")); return -1; } @@ -639,8 +642,9 @@ static int rpc_registry_getvalue(struct net_context *c, int argc, const char **argv) { if (argc != 2 || c->display_usage) { - d_fprintf(stderr, _("Usage:"),_(" net rpc registry getvalue <key> " - "<valuename>\n")); + d_fprintf(stderr, "%s\n%s", + _("Usage:"), + _("net rpc registry getvalue <key> <valuename>\n")); return -1; } @@ -666,8 +670,9 @@ static int rpc_registry_getvalueraw(struct net_context *c, int argc, const char **argv) { if (argc != 2 || c->display_usage) { - d_fprintf(stderr, _("Usage:"),_(" net rpc registry getvalue <key> " - "<valuename>\n")); + d_fprintf(stderr, "%s\n%s", + _("Usage:"), + _("net rpc registry getvalue <key> <valuename>\n")); return -1; } @@ -739,8 +744,9 @@ static int rpc_registry_createkey(struct net_context *c, int argc, const char **argv ) { if (argc != 1 || c->display_usage) { - d_fprintf(stderr, - _("Usage:"),_(" net rpc registry createkey <key>\n")); + d_fprintf(stderr, "%s\n%s", + _("Usage:"), + _("net rpc registry createkey <key>\n")); return -1; } @@ -789,8 +795,9 @@ static NTSTATUS rpc_registry_deletekey_internal(struct net_context *c, static int rpc_registry_deletekey(struct net_context *c, int argc, const char **argv ) { if (argc != 1 || c->display_usage) { - d_fprintf(stderr, - _("Usage:"),_(" net rpc registry deletekey <key>\n")); + d_fprintf(stderr, "%s\n%s", + _("Usage:"), + _("net rpc registry deletekey <key>\n")); return -1; } @@ -820,9 +827,11 @@ static NTSTATUS rpc_registry_enumerate_internal(struct net_context *c, struct registry_value **values = NULL; if (argc != 1 || c->display_usage) { - d_printf(_("Usage:"),_(" net rpc registry enumerate <path>\n")); - d_printf(_("Example:")," net rpc registry enumerate " - "'HKLM\\Software\\Samba'\n"); + d_printf("%s\n%s", + _("Usage:"), + _("net rpc registry enumerate <path>\n")); + d_printf("%s net rpc registry enumerate " + "'HKLM\\Software\\Samba'\n", _("Example:")); return NT_STATUS_INVALID_PARAMETER; } @@ -892,8 +901,9 @@ static NTSTATUS rpc_registry_save_internal(struct net_context *c, struct winreg_String filename; if (argc != 2 || c->display_usage) { - d_printf(_("Usage:"),_(" net rpc registry backup <path> " - "<file> \n")); + d_printf("%s\n%s", + _("Usage:"), + _("net rpc registry backup <path> <file> \n")); return NT_STATUS_INVALID_PARAMETER; } @@ -1080,7 +1090,9 @@ static int rpc_registry_dump(struct net_context *c, int argc, const char **argv) REGF_NK_REC *nk; if (argc != 1 || c->display_usage) { - d_printf(_("Usage:"),_(" net rpc registry dump <file> \n")); + d_printf("%s\n%s", + _("Usage:"), + _("net rpc registry dump <file> \n")); return -1; } @@ -1124,8 +1136,9 @@ static int rpc_registry_copy(struct net_context *c, int argc, const char **argv int result = 1; if (argc != 2 || c->display_usage) { - d_printf(_("Usage:"),_(" net rpc registry copy <srcfile> " - "<newfile>\n")); + d_printf("%s\n%s", + _("Usage:"), + _("net rpc registry copy <srcfile> <newfile>\n")); return -1; } @@ -1196,10 +1209,11 @@ static NTSTATUS rpc_registry_getsd_internal(struct net_context *c, SEC_FLAG_SYSTEM_SECURITY; if (argc <1 || argc > 2 || c->display_usage) { - d_printf(_("Usage:"),_(" net rpc registry getsd <path> " - "<secinfo>\n")); - d_printf(_("Example:")," net rpc registry getsd " - "'HKLM\\Software\\Samba'\n"); + d_printf("%s\n%s", + _("Usage:"), + _("net rpc registry getsd <path> <secinfo>\n")); + d_printf("%s net rpc registry getsd " + "'HKLM\\Software\\Samba'\n", _("Example:")); return NT_STATUS_INVALID_PARAMETER; } diff --git a/source3/utils/net_rpc_rights.c b/source3/utils/net_rpc_rights.c index 355a226198..8555154471 100644 --- a/source3/utils/net_rpc_rights.c +++ b/source3/utils/net_rpc_rights.c @@ -413,8 +413,8 @@ static NTSTATUS rpc_rights_list_internal(struct net_context *c, /* backward comaptibility: if no keyword provided, treat the key as an account name */ if (argc > 1) { - d_printf(_("Usage:")," net rpc rights list [[accounts|privileges] " - "[name|SID]]\n"); + d_printf("%s net rpc rights list [[accounts|privileges] " + "[name|SID]]\n", _("Usage:")); result = NT_STATUS_OK; goto done; } @@ -451,8 +451,9 @@ static NTSTATUS rpc_rights_grant_internal(struct net_context *c, DOM_SID sid; if (argc < 2 ) { - d_printf(_("Usage:"),_(" net rpc rights grant <name|SID> " - "<rights...>\n")); + d_printf("%s\n%s", + _("Usage:"), + _(" net rpc rights grant <name|SID> <rights...>\n")); return NT_STATUS_OK; } @@ -521,8 +522,9 @@ static NTSTATUS rpc_rights_revoke_internal(struct net_context *c, int i; if (argc < 2 ) { - d_printf(_("Usage:"),_(" net rpc rights revoke <name|SID> " - "<rights...>\n")); + d_printf("%s\n%s", + _("Usage:"), + _(" net rpc rights revoke <name|SID> <rights...>\n")); return NT_STATUS_OK; } @@ -577,8 +579,9 @@ done: static int rpc_rights_list(struct net_context *c, int argc, const char **argv ) { if (c->display_usage) { - d_printf(_("Usage:\n"), - _("net rpc rights list [{accounts|privileges} " + d_printf("%s\n%s", + _("Usage:"), + _("net rpc rights list [{accounts|privileges} " "[name|SID]]\n" " View available/assigned privileges\n")); return 0; @@ -594,8 +597,9 @@ static int rpc_rights_list(struct net_context *c, int argc, const char **argv ) static int rpc_rights_grant(struct net_context *c, int argc, const char **argv ) { if (c->display_usage) { - d_printf(_("Usage:\n"), - _("net rpc rights grant <name|SID> <right>\n" + d_printf("%s\n%s", + _("Usage:"), + _("net rpc rights grant <name|SID> <right>\n" " Assign privilege[s]\n")); d_printf(_("For example:\n" " net rpc rights grant 'VALE\\biddle' " @@ -615,8 +619,9 @@ static int rpc_rights_grant(struct net_context *c, int argc, const char **argv ) static int rpc_rights_revoke(struct net_context *c, int argc, const char **argv) { if (c->display_usage) { - d_printf(_("Usage:\n"), - _("net rpc rights revoke <name|SID> <right>\n" + d_printf("%s\n%s", + _("Usage:"), + _("net rpc rights revoke <name|SID> <right>\n" " Revoke privilege[s]\n")); d_printf(_("For example:\n" " net rpc rights revoke 'VALE\\biddle' " diff --git a/source3/utils/net_rpc_samsync.c b/source3/utils/net_rpc_samsync.c index b6b5b21542..739818ddb5 100644 --- a/source3/utils/net_rpc_samsync.c +++ b/source3/utils/net_rpc_samsync.c @@ -252,9 +252,11 @@ NTSTATUS rpc_vampire_internals(struct net_context *c, int rpc_vampire_passdb(struct net_context *c, int argc, const char **argv) { if (c->display_usage) { - d_printf(_("Usage:\n"), + d_printf( "%s\n" "net rpc vampire passdb\n" - " ",_("Dump remote SAM database to passdb\n")); + " %s\n", + _("Usage:"), + _("Dump remote SAM database to passdb")); return 0; } @@ -333,10 +335,12 @@ NTSTATUS rpc_vampire_ldif_internals(struct net_context *c, int rpc_vampire_ldif(struct net_context *c, int argc, const char **argv) { if (c->display_usage) { - d_printf(_("Usage:\n"), + d_printf( "%s\n" "net rpc vampire ldif\n" - " ",_("Dump remote SAM database to LDIF file or " - "stdout\n")); + " %s\n", + _("Usage:"), + _("Dump remote SAM database to LDIF file or " + "stdout")); return 0; } @@ -477,8 +481,9 @@ int rpc_vampire_keytab(struct net_context *c, int argc, const char **argv) struct net_dc_info dc_info; if (c->display_usage || (argc < 1)) { - d_printf(_("Usage:\n"), - _("net rpc vampire keytab <keytabfile>\n" + d_printf("%s\n%s", + _("Usage:"), + _("net rpc vampire keytab <keytabfile>\n" " Dump remote SAM database to Kerberos keytab " "file\n")); return 0; diff --git a/source3/utils/net_rpc_service.c b/source3/utils/net_rpc_service.c index 55bd40dec8..3aacfd1d1d 100644 --- a/source3/utils/net_rpc_service.c +++ b/source3/utils/net_rpc_service.c @@ -215,7 +215,7 @@ static NTSTATUS rpc_service_list_internal(struct net_context *c, uint32_t resume_handle = 0; if (argc != 0 ) { - d_printf(_("Usage:")," net rpc service list\n"); + d_printf("%s net rpc service list\n", _("Usage:")); return NT_STATUS_OK; } @@ -324,7 +324,7 @@ static NTSTATUS rpc_service_status_internal(struct net_context *c, uint32_t ret_size = 0; if (argc != 1 ) { - d_printf(_("Usage:")," net rpc service status <service>\n"); + d_printf("%s net rpc service status <service>\n", _("Usage:")); return NT_STATUS_OK; } @@ -456,7 +456,7 @@ static NTSTATUS rpc_service_stop_internal(struct net_context *c, fstring servicename; if (argc != 1 ) { - d_printf(_("Usage:")," net rpc service status <service>\n"); + d_printf("%s net rpc service status <service>\n", _("Usage:")); return NT_STATUS_OK; } @@ -502,7 +502,7 @@ static NTSTATUS rpc_service_pause_internal(struct net_context *c, fstring servicename; if (argc != 1 ) { - d_printf(_("Usage:")," net rpc service status <service>\n"); + d_printf("%s net rpc service status <service>\n", _("Usage:")); return NT_STATUS_OK; } @@ -548,7 +548,7 @@ static NTSTATUS rpc_service_resume_internal(struct net_context *c, fstring servicename; if (argc != 1 ) { - d_printf(_("Usage:")," net rpc service status <service>\n"); + d_printf("%s net rpc service status <service>\n", _("Usage:")); return NT_STATUS_OK; } @@ -594,7 +594,7 @@ static NTSTATUS rpc_service_start_internal(struct net_context *c, uint32 state = 0; if (argc != 1 ) { - d_printf(_("Usage:")," net rpc service status <service>\n"); + d_printf("%s net rpc service status <service>\n", _("Usage:")); return NT_STATUS_OK; } @@ -674,7 +674,7 @@ static NTSTATUS rpc_service_delete_internal(struct net_context *c, NTSTATUS status; if (argc != 1 ) { - d_printf(_("Usage:")," net rpc service delete <service>\n"); + d_printf("%s net rpc service delete <service>\n", _("Usage:")); return NT_STATUS_OK; } @@ -752,8 +752,8 @@ static NTSTATUS rpc_service_create_internal(struct net_context *c, const char *binary_path; if (argc != 3) { - d_printf(_("Usage:")," net rpc service create <service> " - "<displayname> <binarypath>\n"); + d_printf("%s net rpc service create <service> " + "<displayname> <binarypath>\n", _("Usage:")); return NT_STATUS_OK; } @@ -821,9 +821,11 @@ static NTSTATUS rpc_service_create_internal(struct net_context *c, static int rpc_service_list(struct net_context *c, int argc, const char **argv ) { if (c->display_usage) { - d_printf(_("Usage:\n"), + d_printf( "%s\n" "net rpc service list\n" - " ",_("View configured Win32 services\n")); + " %s\n", + _("Usage:"), + _("View configured Win32 services")); return 0; } @@ -837,9 +839,11 @@ static int rpc_service_list(struct net_context *c, int argc, const char **argv ) static int rpc_service_start(struct net_context *c, int argc, const char **argv ) { if (c->display_usage) { - d_printf(_("Usage:\n"), + d_printf( "%s\n" "net rpc service start <service>\n" - " ",_("Start a Win32 service\n")); + " %s\n", + _("Usage:"), + _("Start a Win32 service")); return 0; } @@ -853,9 +857,11 @@ static int rpc_service_start(struct net_context *c, int argc, const char **argv static int rpc_service_stop(struct net_context *c, int argc, const char **argv ) { if (c->display_usage) { - d_printf(_("Usage:\n"), + d_printf( "%s\n" "net rpc service stop <service>\n" - " ",_("Stop a Win32 service\n")); + " %s\n", + _("Usage:"), + _("Stop a Win32 service")); return 0; } @@ -869,9 +875,11 @@ static int rpc_service_stop(struct net_context *c, int argc, const char **argv ) static int rpc_service_resume(struct net_context *c, int argc, const char **argv ) { if (c->display_usage) { - d_printf(_("Usage:\n"), + d_printf( "%s\n" "net rpc service resume <service>\n" - " ",_("Resume a Win32 service\n")); + " %s\n", + _("Usage:"), + _("Resume a Win32 service")); return 0; } @@ -885,9 +893,11 @@ static int rpc_service_resume(struct net_context *c, int argc, const char **argv static int rpc_service_pause(struct net_context *c, int argc, const char **argv ) { if (c->display_usage) { - d_printf(_("Usage:\n"), + d_printf( "%s\n" "net rpc service pause <service>\n" - " ",_("Pause a Win32 service\n")); + " %s\n", + _("Usage:"), + _("Pause a Win32 service")); return 0; } @@ -901,9 +911,11 @@ static int rpc_service_pause(struct net_context *c, int argc, const char **argv static int rpc_service_status(struct net_context *c, int argc, const char **argv ) { if (c->display_usage) { - d_printf(_("Usage:\n"), + d_printf( "%s\n" "net rpc service status <service>\n" - " ",_("Show the current status of a service\n")); + " %s\n", + _("Usage:"), + _("Show the current status of a service")); return 0; } @@ -917,9 +929,11 @@ static int rpc_service_status(struct net_context *c, int argc, const char **argv static int rpc_service_delete(struct net_context *c, int argc, const char **argv) { if (c->display_usage) { - d_printf(_("Usage:\n"), + d_printf( "%s\n" "net rpc service delete <service>\n" - " ",_("Delete a Win32 service\n")); + " %s\n", + _("Usage:"), + _("Delete a Win32 service")); return 0; } @@ -933,9 +947,11 @@ static int rpc_service_delete(struct net_context *c, int argc, const char **argv static int rpc_service_create(struct net_context *c, int argc, const char **argv) { if (c->display_usage) { - d_printf(_("Usage:\n"), + d_printf( "%s\n" "net rpc service create <service>\n" - " ",_("Create a Win32 service\n")); + " %s\n", + _("Usage:"), + _("Create a Win32 service")); return 0; } diff --git a/source3/utils/net_rpc_sh_acct.c b/source3/utils/net_rpc_sh_acct.c index 4289c27183..3e93fc503c 100644 --- a/source3/utils/net_rpc_sh_acct.c +++ b/source3/utils/net_rpc_sh_acct.c @@ -155,7 +155,7 @@ static int account_show(struct net_context *c, int argc, const char **argv) { if (argc != 0) { - d_fprintf(stderr, _("Usage:")," %s\n"), ctx->whoami; + d_fprintf(stderr, "%s %s\n", _("Usage:"), ctx->whoami); return -1; } @@ -226,7 +226,7 @@ static int account_set_badpw(struct net_context *c, int argc, const char **argv) { if (argc != 1) { - d_fprintf(stderr, _("Usage:")," %s <count>\n"), ctx->whoami; + d_fprintf(stderr, "%s %s <count>\n", _("Usage:"), ctx->whoami); return -1; } diff --git a/source3/utils/net_rpc_shell.c b/source3/utils/net_rpc_shell.c index fdfb2f3beb..11facf933b 100644 --- a/source3/utils/net_rpc_shell.c +++ b/source3/utils/net_rpc_shell.c @@ -214,8 +214,7 @@ int net_rpc_shell(struct net_context *c, int argc, const char **argv) struct rpc_sh_ctx *ctx; if (argc != 0 || c->display_usage) { - d_printf(_("Usage:\n"), - "net rpc shell\n"); + d_printf("%s\nnet rpc shell\n", _("Usage:")); return -1; } diff --git a/source3/utils/net_sam.c b/source3/utils/net_sam.c index 006d01e422..6e3ccfefaf 100644 --- a/source3/utils/net_sam.c +++ b/source3/utils/net_sam.c @@ -37,7 +37,8 @@ static int net_sam_userset(struct net_context *c, int argc, const char **argv, NTSTATUS status; if (argc != 2 || c->display_usage) { - d_fprintf(stderr, _("Usage:"),_(" net sam set %s <user> <value>\n"), + d_fprintf(stderr, "%s\n", _("Usage:")); + d_fprintf(stderr, _("net sam set %s <user> <value>\n"), field); return -1; } @@ -142,7 +143,8 @@ static int net_sam_set_userflag(struct net_context *c, int argc, if ((argc != 2) || c->display_usage || (!strequal(argv[1], "yes") && !strequal(argv[1], "no"))) { - d_fprintf(stderr, _("Usage:"),_(" net sam set %s <user> [yes|no]\n"), + d_fprintf(stderr, "%s\n", _("Usage:")); + d_fprintf(stderr, _("net sam set %s <user> [yes|no]\n"), field); return -1; } @@ -233,9 +235,9 @@ static int net_sam_set_pwdmustchangenow(struct net_context *c, int argc, if ((argc != 2) || c->display_usage || (!strequal(argv[1], "yes") && !strequal(argv[1], "no"))) { - d_fprintf(stderr, - _("Usage:"),_(" net sam set pwdmustchangenow <user> " - "[yes|no]\n")); + d_fprintf(stderr, "%s\n%s", + _("Usage:"), + _("net sam set pwdmustchangenow <user> [yes|no]\n")); return -1; } @@ -297,8 +299,9 @@ static int net_sam_set_comment(struct net_context *c, int argc, NTSTATUS status; if (argc != 2 || c->display_usage) { - d_fprintf(stderr, _("Usage:"),_(" net sam set comment <name> " - "<comment>\n")); + d_fprintf(stderr, "%s\n%s", + _("Usage:"), + _("net sam set comment <name> <comment>\n")); return -1; } @@ -461,8 +464,9 @@ static int net_sam_policy_set(struct net_context *c, int argc, const char **argv char *endptr; if (argc != 2 || c->display_usage) { - d_fprintf(stderr, _("Usage:"),_(" net sam policy set " - "\"<account policy>\" <value> \n")); + d_fprintf(stderr, "%s\n%s", + _("Usage:"), + _("net sam policy set \"<account policy>\" <value>\n")); return -1; } @@ -527,8 +531,9 @@ static int net_sam_policy_show(struct net_context *c, int argc, const char **arg enum pdb_policy_type field; if (argc != 1 || c->display_usage) { - d_fprintf(stderr, _("Usage:"),_(" net sam policy show" - " \"<account policy>\" \n")); + d_fprintf(stderr, "%s\n%s", + _("Usage:"), + _("net sam policy show \"<account policy>\"\n")); return -1; } @@ -572,9 +577,11 @@ static int net_sam_policy_list(struct net_context *c, int argc, const char **arg int i; if (c->display_usage) { - d_printf(_("Usage:\n"), + d_printf( "%s\n" "net sam policy list\n" - " ",_("List account policies\n")); + " %s\n", + _("Usage:"), + _("List account policies")); return 0; } @@ -631,8 +638,9 @@ static int net_sam_rights_list(struct net_context *c, int argc, SE_PRIV mask; if (argc > 1 || c->display_usage) { - d_fprintf(stderr, _("Usage:"), - _(" net sam rights list [privilege name]\n")); + d_fprintf(stderr, "%s\n%s", + _("Usage:"), + _("net sam rights list [privilege name]\n")); return -1; } @@ -687,8 +695,9 @@ static int net_sam_rights_grant(struct net_context *c, int argc, int i; if (argc < 2 || c->display_usage) { - d_fprintf(stderr, _("Usage:"),_(" net sam rights grant <name> " - "<rights> ...\n")); + d_fprintf(stderr, "%s\n%s", + _("Usage:"), + _("net sam rights grant <name> <rights> ...\n")); return -1; } @@ -725,8 +734,9 @@ static int net_sam_rights_revoke(struct net_context *c, int argc, int i; if (argc < 2 || c->display_usage) { - d_fprintf(stderr, _("Usage:"),_(" net sam rights revoke <name> " - "<rights>\n")); + d_fprintf(stderr, "%s\n%s", + _("Usage:"), + _("net sam rights revoke <name> <rights>\n")); return -1; } @@ -852,7 +862,9 @@ static int net_sam_mapunixgroup(struct net_context *c, int argc, const char **ar struct group *grp; if (argc != 1 || c->display_usage) { - d_fprintf(stderr, _("Usage:"),_(" net sam mapunixgroup <name>\n")); + d_fprintf(stderr, "%s\n%s", + _("Usage:"), + _("net sam mapunixgroup <name>\n")); return -1; } @@ -914,7 +926,9 @@ static int net_sam_unmapunixgroup(struct net_context *c, int argc, const char ** struct group *grp; if (argc != 1 || c->display_usage) { - d_fprintf(stderr, _("Usage:"),_(" net sam unmapunixgroup <name>\n")); + d_fprintf(stderr, "%s\n%s", + _("Usage:"), + _("net sam unmapunixgroup <name>\n")); return -1; } @@ -949,8 +963,9 @@ static int net_sam_createdomaingroup(struct net_context *c, int argc, uint32 rid; if (argc != 1 || c->display_usage) { - d_fprintf(stderr, - _("Usage:"),_(" net sam createdomaingroup <name>\n")); + d_fprintf(stderr, "%s\n%s", + _("Usage:"), + _("net sam createdomaingroup <name>\n")); return -1; } @@ -981,7 +996,9 @@ static int net_sam_deletedomaingroup(struct net_context *c, int argc, NTSTATUS status; if (argc != 1 || c->display_usage) { - d_fprintf(stderr,_("Usage:"),_(" net sam deletelocalgroup <name>\n")); + d_fprintf(stderr, "%s\n%s", + _("Usage:"), + _("net sam deletelocalgroup <name>\n")); return -1; } @@ -1022,7 +1039,9 @@ static int net_sam_createlocalgroup(struct net_context *c, int argc, const char uint32 rid; if (argc != 1 || c->display_usage) { - d_fprintf(stderr,_("Usage:"),_(" net sam createlocalgroup <name>\n")); + d_fprintf(stderr, "%s\n%s", + _("Usage:"), + _("net sam createlocalgroup <name>\n")); return -1; } @@ -1057,7 +1076,9 @@ static int net_sam_deletelocalgroup(struct net_context *c, int argc, const char NTSTATUS status; if (argc != 1 || c->display_usage) { - d_fprintf(stderr,_("Usage:"),_(" net sam deletelocalgroup <name>\n")); + d_fprintf(stderr, "%s\n%s", + _("Usage:"), + _("net sam deletelocalgroup <name>\n")); return -1; } @@ -1099,8 +1120,9 @@ static int net_sam_createbuiltingroup(struct net_context *c, int argc, const cha DOM_SID sid; if (argc != 1 || c->display_usage) { - d_fprintf(stderr, - _("Usage:"),_(" net sam createbuiltingroup <name>\n")); + d_fprintf(stderr, "%s\n%s", + _("Usage:"), + _("net sam createbuiltingroup <name>\n")); return -1; } @@ -1152,7 +1174,9 @@ static int net_sam_addmem(struct net_context *c, int argc, const char **argv) NTSTATUS status; if (argc != 2 || c->display_usage) { - d_fprintf(stderr,_("Usage:"),_(" net sam addmem <group> <member>\n")); + d_fprintf(stderr, "%s\n%s", + _("Usage:"), + _("net sam addmem <group> <member>\n")); return -1; } @@ -1239,7 +1263,9 @@ static int net_sam_delmem(struct net_context *c, int argc, const char **argv) NTSTATUS status; if (argc != 2 || c->display_usage) { - d_fprintf(stderr,_("Usage:"),_(" net sam delmem <group> <member>\n")); + d_fprintf(stderr,"%s\n%s", + _("Usage:"), + _("net sam delmem <group> <member>\n")); return -1; } @@ -1311,7 +1337,9 @@ static int net_sam_listmem(struct net_context *c, int argc, const char **argv) NTSTATUS status; if (argc != 1 || c->display_usage) { - d_fprintf(stderr, _("Usage:"),_(" net sam listmem <group>\n")); + d_fprintf(stderr, "%s\n%s", + _("Usage:"), + _("net sam listmem <group>\n")); return -1; } @@ -1385,7 +1413,8 @@ static int net_sam_do_list(struct net_context *c, int argc, const char **argv, if ((argc > 1) || c->display_usage || ((argc == 1) && !strequal(argv[0], "verbose"))) { - d_fprintf(stderr,_("Usage:"),_(" net sam list %s [verbose]\n"), what); + d_fprintf(stderr, "%s\n", _("Usage:")); + d_fprintf(stderr, _("net sam list %s [verbose]\n"), what); return -1; } @@ -1518,7 +1547,9 @@ static int net_sam_show(struct net_context *c, int argc, const char **argv) const char *dom, *name; if (argc != 1 || c->display_usage) { - d_fprintf(stderr, _("Usage:"),_(" net sam show <name>\n")); + d_fprintf(stderr, "%s\n%s", + _("Usage:"), + _("net sam show <name>\n")); return -1; } @@ -1556,10 +1587,11 @@ static int net_sam_provision(struct net_context *c, int argc, const char **argv) struct passwd *pwd; if (c->display_usage) { - d_printf(_("Usage:\n"), + d_printf( "%s\n" "net sam provision\n" - " ",_("Init an LDAP tree with default " - "users/groups\n")); + " %s\n", + _("Usage:"), + _("Init an LDAP tree with default users/groups")); return 0; } diff --git a/source3/utils/net_status.c b/source3/utils/net_status.c index d49470a187..ce7dbcaf20 100644 --- a/source3/utils/net_status.c +++ b/source3/utils/net_status.c @@ -63,11 +63,13 @@ static int net_status_sessions(struct net_context *c, int argc, const char **arg bool parseable; if (c->display_usage) { - d_printf(_("Usage:\n"), + d_printf( "%s\n" "net status sessions [parseable]\n" - " ",_("Display open user sessions.\n" + " %s\n", + _("Usage:"), + _("Display open user sessions.\n" " If parseable is specified, output is machine-" - "readable.\n")); + "readable.")); return 0; } @@ -213,11 +215,13 @@ static int net_status_shares_parseable(struct net_context *c, int argc, const ch static int net_status_shares(struct net_context *c, int argc, const char **argv) { if (c->display_usage) { - d_printf(_("Usage:\n"), + d_printf( "%s\n" "net status shares [parseable]\n" - " ",_("Display open user shares.\n" + " %s\n", + _("Usage:"), + _("Display open user shares.\n" " If parseable is specified, output is machine-" - "readable.\n")); + "readable.")); return 0; } diff --git a/source3/utils/net_time.c b/source3/utils/net_time.c index 1ed36238da..d9b6f27551 100644 --- a/source3/utils/net_time.c +++ b/source3/utils/net_time.c @@ -133,10 +133,12 @@ static int net_time_system(struct net_context *c, int argc, const char **argv) time_t t; if (c->display_usage) { - d_printf(_("Usage:\n"), + d_printf( "%s\n" "net time system\n" - " ",_("Output remote time server time in a format " - "ready for /bin/date\n")); + " %s\n", + _("Usage:"), + _("Output remote time server time in a format " + "ready for /bin/date")); return 0; } @@ -157,10 +159,12 @@ static int net_time_zone(struct net_context *c, int argc, const char **argv) time_t t; if (c->display_usage) { - d_printf(_("Usage:\n"), + d_printf( "%s\n" "net time zone\n" - " ",_("Display the remote time server's offset to " - "UTC\n")); + " %s\n", + _("Usage:"), + _("Display the remote time server's offset to " + "UTC")); return 0; } @@ -217,9 +221,11 @@ int net_time(struct net_context *c, int argc, const char **argv) } if (c->display_usage) { - d_printf(_("Usage:\n"), + d_printf( "%s\n" "net time\n" - " ",_("Display the remote time server's time\n")); + " %s\n", + _("Usage:"), + _("Display the remote time server's time")); net_display_usage_from_functable(func); return 0; } diff --git a/source3/utils/net_util.c b/source3/utils/net_util.c index 3560a9bd3b..5f66cfa01f 100644 --- a/source3/utils/net_util.c +++ b/source3/utils/net_util.c @@ -50,8 +50,8 @@ NTSTATUS net_rpc_lookup_name(struct net_context *c, 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; } |