[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha8-917-g303e49b
Kai Blin
kai at samba.org
Mon Aug 10 11:44:19 MDT 2009
The branch, master has been updated
via 303e49b2f1d3cc437c399fb8d59b8eb60e86f86c (commit)
via e2433b86d24f279fef041ccf60f91dc99aa74344 (commit)
via 0ef723a68204d04e0ad0d315deefaf1af33c1aad (commit)
via ef04e4538c64fd8b4a6473c4780a4a977f2da0cc (commit)
from 8e5beb738c4fd1c195bf198883d747c9888cf8ba (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 303e49b2f1d3cc437c399fb8d59b8eb60e86f86c
Author: Kai Blin <kai at samba.org>
Date: Mon Aug 10 18:52:24 2009 +0200
s3 net: i18n support for net rpc rights
commit e2433b86d24f279fef041ccf60f91dc99aa74344
Author: Kai Blin <kai at samba.org>
Date: Mon Aug 10 18:29:50 2009 +0200
s3 net: i18n support net rpc registry
commit 0ef723a68204d04e0ad0d315deefaf1af33c1aad
Author: Kai Blin <kai at samba.org>
Date: Mon Aug 10 18:24:57 2009 +0200
s3 net: i18n support for net rpc printer
commit ef04e4538c64fd8b4a6473c4780a4a977f2da0cc
Author: Kai Blin <kai at samba.org>
Date: Sun Aug 9 16:57:51 2009 +0200
s3 net: i18n support for net rpc join
-----------------------------------------------------------------------
Summary of changes:
source3/locale/net/genmsg | 3 +-
source3/utils/net_rpc_join.c | 32 ++++---
source3/utils/net_rpc_printer.c | 185 +++++++++++++++++++++----------------
source3/utils/net_rpc_registry.c | 188 ++++++++++++++++++++------------------
source3/utils/net_rpc_rights.c | 96 +++++++++++---------
5 files changed, 275 insertions(+), 229 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/locale/net/genmsg b/source3/locale/net/genmsg
index 2e0769e..fab430e 100755
--- a/source3/locale/net/genmsg
+++ b/source3/locale/net/genmsg
@@ -30,7 +30,8 @@ FILES=`add_basedir_to_filelist ../../utils net.c net_ads.c net_ads_gpo.c \
net_afs.c net_cache.c net_conf.c net_dom.c net_eventlog.c net_file.c \
net_group.c net_groupmap.c net_help.c net_help_common.c net_idmap.c \
net_join.c net_lookup.c net_lua.c net_rap.c net_registry.c \
- net_registry_util.c net_rpc.c net_rpc_audit.c`
+ net_registry_util.c net_rpc.c net_rpc_audit.c net_rpc_join.c \
+ net_rpc_printer.c net_rpc_registry.c net_rpc_rights.c`
LANGS="af ar bg bn bs ca cs cy da de el en_GB en_US es et fi fr gl gu he hi hr
hu id it ja ka km ko lo lt mk mr nb nl pa pl pt_BR pt ro ru si sk sl sr
diff --git a/source3/utils/net_rpc_join.c b/source3/utils/net_rpc_join.c
index ed03113..f55f8f1 100644
--- a/source3/utils/net_rpc_join.c
+++ b/source3/utils/net_rpc_join.c
@@ -285,16 +285,17 @@ int net_rpc_join_newstyle(struct net_context *c, int argc, const char **argv)
&access_granted,
&user_rid);
- if (!NT_STATUS_IS_OK(result) &&
+ if (!NT_STATUS_IS_OK(result) &&
!NT_STATUS_EQUAL(result, NT_STATUS_USER_EXISTS)) {
- d_fprintf(stderr, "Creation of workstation account failed\n");
+ d_fprintf(stderr,_("Creation of workstation account failed\n"));
/* If NT_STATUS_ACCESS_DENIED then we have a valid
username/password combo but the user does not have
administrator access. */
if (NT_STATUS_V(result) == NT_STATUS_V(NT_STATUS_ACCESS_DENIED))
- d_fprintf(stderr, "User specified does not have administrator privileges\n");
+ d_fprintf(stderr, _("User specified does not have "
+ "administrator privileges\n"));
goto done;
}
@@ -399,8 +400,9 @@ int net_rpc_join_newstyle(struct net_context *c, int argc, const char **argv)
if ( NT_STATUS_EQUAL(result, NT_STATUS_ACCESS_DENIED) &&
(sec_channel_type == SEC_CHAN_BDC) ) {
- d_fprintf(stderr, "Please make sure that no computer account\n"
- "named like this machine (%s) exists in the domain\n",
+ d_fprintf(stderr, _("Please make sure that no computer "
+ "account\nnamed like this machine "
+ "(%s) exists in the domain\n"),
global_myname());
}
@@ -426,8 +428,10 @@ int net_rpc_join_newstyle(struct net_context *c, int argc, const char **argv)
if ( NT_STATUS_EQUAL(result, NT_STATUS_ACCESS_DENIED) &&
(sec_channel_type == SEC_CHAN_BDC) ) {
- d_fprintf(stderr, "Please make sure that no computer account\n"
- "named like this machine (%s) exists in the domain\n",
+ d_fprintf(stderr, _("Please make sure that no "
+ "computer account\nnamed "
+ "like this machine (%s) "
+ "exists in the domain\n"),
global_myname());
}
@@ -461,9 +465,9 @@ done:
if (domain) {
if (retval != 0) {
- fprintf(stderr,"Unable to join domain %s.\n",domain);
+ fprintf(stderr,_("Unable to join domain %s.\n"),domain);
} else {
- printf("Joined domain %s.\n",domain);
+ printf(_("Joined domain %s.\n"),domain);
}
}
@@ -485,20 +489,20 @@ int net_rpc_testjoin(struct net_context *c, int argc, const char **argv)
NTSTATUS nt_status;
if (c->display_usage) {
- d_printf("Usage\n"
- "net rpc testjoin\n"
- " Test if a join is OK\n");
+ d_printf(_("Usage\n"
+ "net rpc testjoin\n"
+ " Test if a join is OK\n"));
return 0;
}
/* Display success or failure */
nt_status = net_rpc_join_ok(c, c->opt_target_workgroup, NULL, NULL);
if (!NT_STATUS_IS_OK(nt_status)) {
- fprintf(stderr,"Join to domain '%s' is not valid: %s\n",
+ fprintf(stderr, _("Join to domain '%s' is not valid: %s\n"),
c->opt_target_workgroup, nt_errstr(nt_status));
return -1;
}
- printf("Join to '%s' is OK\n", c->opt_target_workgroup);
+ printf(_("Join to '%s' is OK\n"), c->opt_target_workgroup);
return 0;
}
diff --git a/source3/utils/net_rpc_printer.c b/source3/utils/net_rpc_printer.c
index 3376f56..ea7465e 100644
--- a/source3/utils/net_rpc_printer.c
+++ b/source3/utils/net_rpc_printer.c
@@ -51,23 +51,23 @@ static void display_print_driver3(struct spoolss_DriverInfo3 *r)
return;
}
- printf("Printer Driver Info 3:\n");
- printf("\tVersion: [%x]\n", r->version);
- printf("\tDriver Name: [%s]\n", r->driver_name);
- printf("\tArchitecture: [%s]\n", r->architecture);
- printf("\tDriver Path: [%s]\n", r->driver_path);
- printf("\tDatafile: [%s]\n", r->data_file);
- printf("\tConfigfile: [%s]\n\n", r->config_file);
- printf("\tHelpfile: [%s]\n\n", r->help_file);
+ printf(_("Printer Driver Info 3:\n"));
+ printf(_("\tVersion: [%x]\n"), r->version);
+ printf(_("\tDriver Name: [%s]\n"), r->driver_name);
+ printf(_("\tArchitecture: [%s]\n"), r->architecture);
+ printf(_("\tDriver Path: [%s]\n"), r->driver_path);
+ printf(_("\tDatafile: [%s]\n"), r->data_file);
+ printf(_("\tConfigfile: [%s]\n\n"), r->config_file);
+ printf(_("\tHelpfile: [%s]\n\n"), r->help_file);
for (i=0; r->dependent_files[i] != NULL; i++) {
- printf("\tDependentfiles: [%s]\n", r->dependent_files[i]);
+ printf(_("\tDependentfiles: [%s]\n"), r->dependent_files[i]);
}
printf("\n");
- printf("\tMonitorname: [%s]\n", r->monitor_name);
- printf("\tDefaultdatatype: [%s]\n\n", r->default_datatype);
+ printf(_("\tMonitorname: [%s]\n"), r->monitor_name);
+ printf(_("\tDefaultdatatype: [%s]\n\n"), r->default_datatype);
}
static void display_reg_value(const char *subkey, struct regval_blob value)
@@ -76,8 +76,8 @@ static void display_reg_value(const char *subkey, struct regval_blob value)
switch(value.type) {
case REG_DWORD:
- d_printf("\t[%s:%s]: REG_DWORD: 0x%08x\n", subkey, value.valuename,
- *((uint32_t *) value.data_p));
+ d_printf(_("\t[%s:%s]: REG_DWORD: 0x%08x\n"), subkey,
+ value.valuename, *((uint32_t *) value.data_p));
break;
case REG_SZ:
@@ -89,11 +89,13 @@ static void display_reg_value(const char *subkey, struct regval_blob value)
if (!text) {
break;
}
- d_printf("\t[%s:%s]: REG_SZ: %s\n", subkey, value.valuename, text);
+ d_printf(_("\t[%s:%s]: REG_SZ: %s\n"), subkey, value.valuename,
+ text);
break;
case REG_BINARY:
- d_printf("\t[%s:%s]: REG_BINARY: unknown length value not displayed\n",
+ d_printf(_("\t[%s:%s]: REG_BINARY: unknown length value not "
+ "displayed\n"),
subkey, value.valuename);
break;
@@ -104,7 +106,7 @@ static void display_reg_value(const char *subkey, struct regval_blob value)
if (!W_ERROR_IS_OK(reg_pull_multi_sz(NULL, value.data_p,
value.size, &num_values,
&values))) {
- d_printf("reg_pull_multi_sz failed\n");
+ d_printf(_("reg_pull_multi_sz failed\n"));
break;
}
@@ -116,7 +118,8 @@ static void display_reg_value(const char *subkey, struct regval_blob value)
}
default:
- d_printf("\t%s: unknown type %d\n", value.valuename, value.type);
+ d_printf(_("\t%s: unknown type %d\n"), value.valuename,
+ value.type);
}
}
@@ -248,14 +251,16 @@ NTSTATUS net_copy_fileattr(struct net_context *c,
/* closing files */
if (!NT_STATUS_IS_OK(cli_close(cli_share_src, fnum_src))) {
- d_fprintf(stderr, "could not close %s on originating server: %s\n",
+ d_fprintf(stderr,
+ _("could not close %s on originating server: %s\n"),
is_file?"file":"dir", cli_errstr(cli_share_src));
nt_status = cli_nt_error(cli_share_src);
goto out;
}
if (!NT_STATUS_IS_OK(cli_close(cli_share_dst, fnum_dst))) {
- d_fprintf(stderr, "could not close %s on destination server: %s\n",
+ d_fprintf(stderr,
+ _("could not close %s on destination server: %s\n"),
is_file?"file":"dir", cli_errstr(cli_share_dst));
nt_status = cli_nt_error(cli_share_dst);
goto out;
@@ -348,7 +353,8 @@ NTSTATUS net_copy_file(struct net_context *c,
/* allocate memory */
if (!(data = (char *)SMB_MALLOC(read_size))) {
- d_fprintf(stderr, "malloc fail for size %d\n", read_size);
+ d_fprintf(stderr, _("malloc fail for size %d\n"),
+ read_size);
nt_status = NT_STATUS_NO_MEMORY;
goto out;
}
@@ -358,13 +364,13 @@ NTSTATUS net_copy_file(struct net_context *c,
if (c->opt_verbose) {
- d_printf("copying [\\\\%s\\%s%s] => [\\\\%s\\%s%s] "
- "%s ACLs and %s DOS Attributes %s\n",
+ d_printf(_("copying [\\\\%s\\%s%s] => [\\\\%s\\%s%s] "
+ "%s ACLs and %s DOS Attributes %s\n"),
cli_share_src->desthost, cli_share_src->share, src_name,
cli_share_dst->desthost, cli_share_dst->share, dst_name,
- copy_acls ? "with" : "without",
- copy_attrs ? "with" : "without",
- copy_timestamps ? "(preserving timestamps)" : "" );
+ copy_acls ? _("with") : _("without"),
+ copy_attrs ? _("with") : _("without"),
+ copy_timestamps ? _("(preserving timestamps)") : "" );
}
@@ -382,7 +388,7 @@ NTSTATUS net_copy_file(struct net_context *c,
nread, n);
if (n != ret) {
- d_fprintf(stderr, "Error writing file: %s\n",
+ d_fprintf(stderr, _("Error writing file: %s\n"),
cli_errstr(cli_share_dst));
nt_status = cli_nt_error(cli_share_dst);
goto out;
@@ -405,7 +411,8 @@ NTSTATUS net_copy_file(struct net_context *c,
}
if (!NT_STATUS_IS_OK(cli_chkpath(cli_share_dst, dst_name))) {
- d_fprintf(stderr, "cannot check for directory %s: %s\n",
+ d_fprintf(stderr,
+ _("cannot check for directory %s: %s\n"),
dst_name, cli_errstr(cli_share_dst));
goto out;
}
@@ -414,14 +421,16 @@ NTSTATUS net_copy_file(struct net_context *c,
/* closing files */
if (!NT_STATUS_IS_OK(cli_close(cli_share_src, fnum_src))) {
- d_fprintf(stderr, "could not close file on originating server: %s\n",
+ d_fprintf(stderr,
+ _("could not close file on originating server: %s\n"),
cli_errstr(cli_share_src));
nt_status = cli_nt_error(cli_share_src);
goto out;
}
if (is_file && !NT_STATUS_IS_OK(cli_close(cli_share_dst, fnum_dst))) {
- d_fprintf(stderr, "could not close file on destination server: %s\n",
+ d_fprintf(stderr,
+ _("could not close file on destination server: %s\n"),
cli_errstr(cli_share_dst));
nt_status = cli_nt_error(cli_share_dst);
goto out;
@@ -554,7 +563,7 @@ static NTSTATUS check_arch_dir(struct cli_state *cli_share, const char *short_ar
}
if (!NT_STATUS_IS_OK(cli_chkpath(cli_share, dir))) {
- d_fprintf(stderr, "cannot check %s: %s\n",
+ d_fprintf(stderr, _("cannot check %s: %s\n"),
dir, cli_errstr(cli_share));
goto out;
}
@@ -595,7 +604,8 @@ static NTSTATUS copy_print_driver_3(struct net_context *c,
}
if (c->opt_verbose)
- d_printf("copying driver: [%s], for architecture: [%s], version: [%d]\n",
+ d_printf(_("copying driver: [%s], for architecture: [%s], "
+ "version: [%d]\n"),
r->driver_name, short_archi, r->version);
nt_status = net_copy_driverfile(c, mem_ctx, cli_share_src, cli_share_dst,
@@ -663,7 +673,7 @@ static bool net_spoolss_enum_printers(struct rpc_pipe_client *pipe_hnd,
num_printers,
info);
if (!W_ERROR_IS_OK(result)) {
- printf("cannot enum printers: %s\n", win_errstr(result));
+ printf(_("cannot enum printers: %s\n"), win_errstr(result));
return false;
}
@@ -695,13 +705,15 @@ static bool net_spoolss_open_printer_ex(struct rpc_pipe_client *pipe_hnd,
/* be more verbose */
if (W_ERROR_V(result) == W_ERROR_V(WERR_ACCESS_DENIED)) {
- d_fprintf(stderr, "no access to printer [%s] on [%s] for user [%s] granted\n",
+ d_fprintf(stderr,
+ _("no access to printer [%s] on [%s] for user [%s] "
+ "granted\n"),
printername2, pipe_hnd->srv_name_slash, username);
return false;
}
if (!W_ERROR_IS_OK(result)) {
- d_fprintf(stderr, "cannot open printer %s on server %s: %s\n",
+ d_fprintf(stderr,_("cannot open printer %s on server %s: %s\n"),
printername2, pipe_hnd->srv_name_slash, win_errstr(result));
return false;
}
@@ -727,7 +739,7 @@ static bool net_spoolss_getprinter(struct rpc_pipe_client *pipe_hnd,
0, /* offered */
info);
if (!W_ERROR_IS_OK(result)) {
- printf("cannot get printer-info: %s\n", win_errstr(result));
+ printf(_("cannot get printer-info: %s\n"), win_errstr(result));
return false;
}
@@ -808,7 +820,7 @@ static bool net_spoolss_setprinter(struct rpc_pipe_client *pipe_hnd,
&result);
if (!W_ERROR_IS_OK(result)) {
- printf("cannot set printer-info: %s\n", win_errstr(result));
+ printf(_("cannot set printer-info: %s\n"), win_errstr(result));
return false;
}
@@ -836,7 +848,8 @@ static bool net_spoolss_setprinterdata(struct rpc_pipe_client *pipe_hnd,
&result);
if (!W_ERROR_IS_OK(result)) {
- printf ("unable to set printerdata: %s\n", win_errstr(result));
+ printf (_("unable to set printerdata: %s\n"),
+ win_errstr(result));
return false;
}
@@ -856,7 +869,7 @@ static bool net_spoolss_enumprinterkey(struct rpc_pipe_client *pipe_hnd,
result = rpccli_spoolss_enumprinterkey(pipe_hnd, mem_ctx, hnd, keyname, keylist, 0);
if (!W_ERROR_IS_OK(result)) {
- printf("enumprinterkey failed: %s\n", win_errstr(result));
+ printf(_("enumprinterkey failed: %s\n"), win_errstr(result));
return false;
}
@@ -882,7 +895,7 @@ static bool net_spoolss_enumprinterdataex(struct rpc_pipe_client *pipe_hnd,
info);
if (!W_ERROR_IS_OK(result)) {
- printf("enumprinterdataex failed: %s\n", win_errstr(result));
+ printf(_("enumprinterdataex failed: %s\n"), win_errstr(result));
return false;
}
@@ -910,7 +923,8 @@ static bool net_spoolss_setprinterdataex(struct rpc_pipe_client *pipe_hnd,
&result);
if (!W_ERROR_IS_OK(result)) {
- printf("could not set printerdataex: %s\n", win_errstr(result));
+ printf(_("could not set printerdataex: %s\n"),
+ win_errstr(result));
return false;
}
@@ -934,7 +948,7 @@ static bool net_spoolss_enumforms(struct rpc_pipe_client *pipe_hnd,
num_forms,
forms);
if (!W_ERROR_IS_OK(result)) {
- printf("could not enum forms: %s\n", win_errstr(result));
+ printf(_("could not enum forms: %s\n"), win_errstr(result));
return false;
}
@@ -958,7 +972,7 @@ static bool net_spoolss_enumprinterdrivers (struct rpc_pipe_client *pipe_hnd,
count,
info);
if (!W_ERROR_IS_OK(result)) {
- printf("cannot enum drivers: %s\n", win_errstr(result));
+ printf(_("cannot enum drivers: %s\n"), win_errstr(result));
return false;
}
@@ -991,7 +1005,8 @@ static bool net_spoolss_getprinterdriver(struct rpc_pipe_client *pipe_hnd,
env, win_errstr(result)));
if (W_ERROR_V(result) != W_ERROR_V(WERR_UNKNOWN_PRINTER_DRIVER) &&
W_ERROR_V(result) != W_ERROR_V(WERR_INVALID_ENVIRONMENT)) {
- printf("cannot get driver: %s\n", win_errstr(result));
+ printf(_("cannot get driver: %s\n"),
+ win_errstr(result));
}
return false;
}
@@ -1020,7 +1035,7 @@ static bool net_spoolss_addprinterdriver(struct rpc_pipe_client *pipe_hnd,
(void *)&info->info3;
break;
default:
- printf("unsupported info level: %d\n", level);
+ printf(_("unsupported info level: %d\n"), level);
return false;
}
@@ -1031,11 +1046,11 @@ static bool net_spoolss_addprinterdriver(struct rpc_pipe_client *pipe_hnd,
&result);
/* be more verbose */
if (W_ERROR_V(result) == W_ERROR_V(WERR_ACCESS_DENIED)) {
- printf("You are not allowed to add drivers\n");
+ printf(_("You are not allowed to add drivers\n"));
return false;
}
if (!W_ERROR_IS_OK(result)) {
- printf("cannot add driver: %s\n", win_errstr(result));
+ printf(_("cannot add driver: %s\n"), win_errstr(result));
return false;
}
@@ -1135,7 +1150,7 @@ NTSTATUS rpc_printer_list_internals(struct net_context *c,
sharename = info[i].info2.sharename;
if (printername && sharename) {
- d_printf("printer %d: %s, shared as: %s\n",
+ d_printf(_("printer %d: %s, shared as: %s\n"),
i+1, printername, sharename);
}
}
@@ -1175,7 +1190,7 @@ NTSTATUS rpc_printer_driver_list_internals(struct net_context *c,
union spoolss_DriverInfo *info;
int d;
- printf("listing printer-drivers\n");
+ printf(_("listing printer-drivers\n"));
for (i=0; archi_table[i].long_archi!=NULL; i++) {
@@ -1190,12 +1205,13 @@ NTSTATUS rpc_printer_driver_list_internals(struct net_context *c,
}
if (num_drivers == 0) {
- d_printf ("no drivers found on server for architecture: [%s].\n",
+ d_printf(_("no drivers found on server for "
+ "architecture: [%s].\n"),
archi_table[i].long_archi);
continue;
}
- d_printf("got %d printer-drivers for architecture: [%s]\n",
+ d_printf(_("got %d printer-drivers for architecture: [%s]\n"),
num_drivers, archi_table[i].long_archi);
@@ -1268,17 +1284,17 @@ static NTSTATUS rpc_printer_publish_internals_args(struct rpc_pipe_client *pipe_
/* check action and set string */
switch (action) {
case DSPRINT_PUBLISH:
- action_str = "published";
+ action_str = N_("published");
break;
case DSPRINT_UPDATE:
- action_str = "updated";
+ action_str = N_("updated");
break;
case DSPRINT_UNPUBLISH:
- action_str = "unpublished";
+ action_str = N_("unpublished");
break;
default:
- action_str = "unknown action";
- printf("unkown action: %d\n", action);
+ action_str = N_("unknown action");
+ printf(_("unkown action: %d\n"), action);
break;
}
@@ -1299,11 +1315,13 @@ static NTSTATUS rpc_printer_publish_internals_args(struct rpc_pipe_client *pipe_
&result);
if (!W_ERROR_IS_OK(result) && (W_ERROR_V(result) != W_ERROR_V(WERR_IO_PENDING))) {
- printf("cannot set printer-info: %s\n", win_errstr(result));
+ printf(_("cannot set printer-info: %s\n"),
+ win_errstr(result));
goto done;
}
- printf("successfully %s printer %s in Active Directory\n", action_str, sharename);
+ printf(_("successfully %s printer %s in Active Directory\n"),
+ action_str, sharename);
}
nt_status = NT_STATUS_OK;
@@ -1414,19 +1432,22 @@ NTSTATUS rpc_printer_publish_list_internals(struct net_context *c,
--
Samba Shared Repository
More information about the samba-cvs
mailing list