Use "double quotes" in messages instead of a combination of the

accent (grave) mark and apostrophe.
This commit is contained in:
Todd C. Miller
2016-11-02 17:10:17 -06:00
parent 75e29f163e
commit 7c56179c7d
8 changed files with 45 additions and 45 deletions

View File

@@ -220,7 +220,7 @@ parse_path(const char *entry, const char *conf_file, unsigned int lineno)
__func__, conf_file, lineno, entry);
debug_return_int(false);
bad:
sudo_warnx(U_("invalid Path value `%s' in %s, line %u"),
sudo_warnx(U_("invalid Path value \"%s\" in %s, line %u"),
entry, conf_file, lineno);
debug_return_int(false);
}
@@ -386,7 +386,7 @@ set_var_disable_coredump(const char *strval, const char *conf_file,
debug_decl(set_var_disable_coredump, SUDO_DEBUG_UTIL)
if (val == -1) {
sudo_warnx(U_("invalid value for %s `%s' in %s, line %u"),
sudo_warnx(U_("invalid value for %s \"%s\" in %s, line %u"),
"disable_coredump", strval, conf_file, lineno);
debug_return_bool(false);
}
@@ -407,7 +407,7 @@ set_var_group_source(const char *strval, const char *conf_file,
} else if (strcasecmp(strval, "dynamic") == 0) {
sudo_conf_data.group_source = GROUP_SOURCE_DYNAMIC;
} else {
sudo_warnx(U_("unsupported group source `%s' in %s, line %u"), strval,
sudo_warnx(U_("unsupported group source \"%s\" in %s, line %u"), strval,
conf_file, lineno);
debug_return_bool(false);
}
@@ -423,7 +423,7 @@ set_var_max_groups(const char *strval, const char *conf_file,
max_groups = strtonum(strval, 1, INT_MAX, NULL);
if (max_groups <= 0) {
sudo_warnx(U_("invalid max groups `%s' in %s, line %u"), strval,
sudo_warnx(U_("invalid max groups \"%s\" in %s, line %u"), strval,
conf_file, lineno);
debug_return_bool(false);
}
@@ -439,7 +439,7 @@ set_var_probe_interfaces(const char *strval, const char *conf_file,
debug_decl(set_var_probe_interfaces, SUDO_DEBUG_UTIL)
if (val == -1) {
sudo_warnx(U_("invalid value for %s `%s' in %s, line %u"),
sudo_warnx(U_("invalid value for %s \"%s\" in %s, line %u"),
"probe_interfaces", strval, conf_file, lineno);
debug_return_bool(false);
}

View File

@@ -129,7 +129,7 @@ alias_add(char *name, int type, struct member *members)
HLTQ_TO_TAILQ(&a->members, members, entries);
switch (rbinsert(aliases, a, NULL)) {
case 1:
snprintf(errbuf, sizeof(errbuf), N_("Alias `%s' already defined"), name);
snprintf(errbuf, sizeof(errbuf), N_("Alias \"%s\" already defined"), name);
alias_free(a);
debug_return_str(errbuf);
case -1:

View File

@@ -207,10 +207,10 @@ set_default_entry(struct sudo_defs_types *def, const char *val, int op,
if (!ISSET(def->type, T_BOOL) || op != false) {
if (!ISSET(flags, FLAG_QUIET)) {
if (lineno > 0) {
sudo_warnx(U_("%s:%d no value specified for `%s'"),
sudo_warnx(U_("%s:%d no value specified for \"%s\""),
file, lineno, def->name);
} else {
sudo_warnx(U_("%s: no value specified for `%s'"),
sudo_warnx(U_("%s: no value specified for \"%s\""),
file, def->name);
}
}
@@ -229,10 +229,10 @@ set_default_entry(struct sudo_defs_types *def, const char *val, int op,
if (ISSET(def->type, T_PATH) && val != NULL && *val != '/') {
if (!ISSET(flags, FLAG_QUIET)) {
if (lineno > 0) {
sudo_warnx(U_("%s:%d values for `%s' must start with a '/'"),
sudo_warnx(U_("%s:%d values for \"%s\" must start with a '/'"),
file, lineno, def->name);
} else {
sudo_warnx(U_("%s: values for `%s' must start with a '/'"),
sudo_warnx(U_("%s: values for \"%s\" must start with a '/'"),
file, def->name);
}
}
@@ -257,10 +257,10 @@ set_default_entry(struct sudo_defs_types *def, const char *val, int op,
if (val != NULL) {
if (!ISSET(flags, FLAG_QUIET)) {
if (lineno > 0) {
sudo_warnx(U_("%s:%d option `%s' does not take a value"),
sudo_warnx(U_("%s:%d option \"%s\" does not take a value"),
file, lineno, def->name);
} else {
sudo_warnx(U_("%s: option `%s' does not take a value"),
sudo_warnx(U_("%s: option \"%s\" does not take a value"),
file, def->name);
}
}
@@ -279,10 +279,10 @@ set_default_entry(struct sudo_defs_types *def, const char *val, int op,
default:
if (!ISSET(flags, FLAG_QUIET)) {
if (lineno > 0) {
sudo_warnx(U_("%s:%d invalid Defaults type 0x%x for option `%s'"),
sudo_warnx(U_("%s:%d invalid Defaults type 0x%x for option \"%s\""),
file, lineno, def->type, def->name);
} else {
sudo_warnx(U_("%s: invalid Defaults type 0x%x for option `%s'"),
sudo_warnx(U_("%s: invalid Defaults type 0x%x for option \"%s\""),
file, def->type, def->name);
}
}
@@ -297,10 +297,10 @@ set_default_entry(struct sudo_defs_types *def, const char *val, int op,
case false:
if (!ISSET(flags, FLAG_QUIET)) {
if (lineno > 0) {
sudo_warnx(U_("%s:%d value `%s' is invalid for option `%s'"),
sudo_warnx(U_("%s:%d value \"%s\" is invalid for option \"%s\""),
file, lineno, val, def->name);
} else {
sudo_warnx(U_("%s: value `%s' is invalid for option `%s'"),
sudo_warnx(U_("%s: value \"%s\" is invalid for option \"%s\""),
file, val, def->name);
}
}
@@ -349,10 +349,10 @@ set_default_int(const char *var, const char *val, int op, const char *file,
if (!cur->name) {
if (!ISSET(flags, FLAG_QUIET)) {
if (lineno > 0) {
sudo_warnx(U_("%s:%d unknown defaults entry `%s'"),
sudo_warnx(U_("%s:%d unknown defaults entry \"%s\""),
file, lineno, var);
} else {
sudo_warnx(U_("%s: unknown defaults entry `%s'"),
sudo_warnx(U_("%s: unknown defaults entry \"%s\""),
file, var);
}
}
@@ -769,10 +769,10 @@ check_default(const char *var, const char *val, int op, const char *file,
if (cur->name == NULL) {
if (!quiet) {
if (lineno > 0) {
sudo_warnx(U_("%s:%d unknown defaults entry `%s'"),
sudo_warnx(U_("%s:%d unknown defaults entry \"%s\""),
file, lineno, var);
} else {
sudo_warnx(U_("%s: unknown defaults entry `%s'"),
sudo_warnx(U_("%s: unknown defaults entry \"%s\""),
file, var);
}
}

View File

@@ -323,7 +323,7 @@ log_failure(int status, int flags)
if (flags == NOT_FOUND)
sudo_warnx(U_("%s: command not found"), user_cmnd);
else if (flags == NOT_FOUND_DOT)
sudo_warnx(U_("ignoring `%s' found in '.'\nUse `sudo ./%s' if this is the `%s' you wish to run."), user_cmnd, user_cmnd, user_cmnd);
sudo_warnx(U_("ignoring \"%s\" found in '.'\nUse \"sudo ./%s\" if this is the \"%s\" you wish to run."), user_cmnd, user_cmnd, user_cmnd);
}
debug_return_bool(ret);

View File

@@ -459,7 +459,7 @@ sudoers_policy_main(int argc, char * const argv[], int pwflag, char *env_add[],
/* Finally tell the user if the command did not exist. */
if (cmnd_status == NOT_FOUND_DOT) {
audit_failure(NewArgc, NewArgv, N_("command in current directory"));
sudo_warnx(U_("ignoring `%s' found in '.'\nUse `sudo ./%s' if this is the `%s' you wish to run."), user_cmnd, user_cmnd, user_cmnd);
sudo_warnx(U_("ignoring \"%s\" found in '.'\nUse \"sudo ./%s\" if this is the \"%s\" you wish to run."), user_cmnd, user_cmnd, user_cmnd);
goto bad;
} else if (cmnd_status == NOT_FOUND) {
if (ISSET(sudo_mode, MODE_CHECK)) {
@@ -645,7 +645,7 @@ done:
}
/*
* Initialize timezone and fill in ``sudo_user'' struct.
* Initialize timezone and fill in sudo_user struct.
*/
static bool
init_vars(char * const envp[])
@@ -956,7 +956,7 @@ set_loginclass(struct passwd *pw)
if (login_class && strcmp(login_class, "-") != 0) {
if (user_uid != 0 && pw->pw_uid != 0) {
sudo_warnx(U_("only root can use `-c %s'"), login_class);
sudo_warnx(U_("only root can use \"-c %s\""), login_class);
ret = false;
goto done;
}

View File

@@ -1109,13 +1109,13 @@ check_alias(char *name, int type, int strict, int quiet)
if (!quiet) {
if (errno == ELOOP) {
sudo_warnx(strict ?
U_("Error: cycle in %s `%s'") :
U_("Warning: cycle in %s `%s'"),
U_("Error: cycle in %s \"%s\"") :
U_("Warning: cycle in %s \"%s\""),
alias_type_to_string(type), name);
} else {
sudo_warnx(strict ?
U_("Error: %s `%s' referenced but not defined") :
U_("Warning: %s `%s' referenced but not defined"),
U_("Error: %s \"%s\" referenced but not defined") :
U_("Warning: %s \"%s\" referenced but not defined"),
alias_type_to_string(type), name);
}
}
@@ -1258,7 +1258,7 @@ print_unused(void *v1, void *v2)
{
struct alias *a = (struct alias *)v1;
sudo_warnx_nodebug(U_("Warning: unused %s `%s'"),
sudo_warnx_nodebug(U_("Warning: unused %s \"%s\""),
alias_type_to_string(a->type), a->name);
return 0;
}

View File

@@ -629,7 +629,7 @@ print_defaults_json(FILE *fp, int indent, bool need_comma)
TAILQ_FOREACH_SAFE(def, &defaults, entries, next) {
type = get_defaults_type(def);
if (type == -1) {
sudo_warnx(U_("unknown defaults entry `%s'"), def->var);
sudo_warnx(U_("unknown defaults entry \"%s\""), def->var);
/* XXX - just pass it through as a string anyway? */
continue;
}
@@ -664,7 +664,7 @@ print_defaults_json(FILE *fp, int indent, bool need_comma)
def = next;
type = get_defaults_type(def);
if (type == -1) {
sudo_warnx(U_("unknown defaults entry `%s'"), def->var);
sudo_warnx(U_("unknown defaults entry \"%s\""), def->var);
/* XXX - just pass it through as a string anyway? */
break;
}

View File

@@ -47,7 +47,7 @@ sudo_stat_plugin(struct plugin_info *info, char *fullpath,
if (info->path[0] == '/') {
if (strlcpy(fullpath, info->path, pathsize) >= pathsize) {
sudo_warnx(U_("error in %s, line %d while loading plugin `%s'"),
sudo_warnx(U_("error in %s, line %d while loading plugin \"%s\""),
_PATH_SUDO_CONF, info->lineno, info->symbol_name);
sudo_warnx(U_("%s: %s"), info->path, strerror(ENAMETOOLONG));
goto done;
@@ -60,7 +60,7 @@ sudo_stat_plugin(struct plugin_info *info, char *fullpath,
/* Check static symbols. */
if (strcmp(info->path, SUDOERS_PLUGIN) == 0) {
if (strlcpy(fullpath, info->path, pathsize) >= pathsize) {
sudo_warnx(U_("error in %s, line %d while loading plugin `%s'"),
sudo_warnx(U_("error in %s, line %d while loading plugin \"%s\""),
_PATH_SUDO_CONF, info->lineno, info->symbol_name);
sudo_warnx(U_("%s: %s"), info->path, strerror(ENAMETOOLONG));
goto done;
@@ -82,7 +82,7 @@ sudo_stat_plugin(struct plugin_info *info, char *fullpath,
len = snprintf(fullpath, pathsize, "%s%s", sudo_conf_plugin_dir_path(),
info->path);
if (len <= 0 || (size_t)len >= pathsize) {
sudo_warnx(U_("error in %s, line %d while loading plugin `%s'"),
sudo_warnx(U_("error in %s, line %d while loading plugin \"%s\""),
_PATH_SUDO_CONF, info->lineno, info->symbol_name);
sudo_warnx(U_("%s%s: %s"), sudo_conf_plugin_dir_path(), info->path,
strerror(ENAMETOOLONG));
@@ -112,7 +112,7 @@ sudo_check_plugin(struct plugin_info *info, char *fullpath, size_t pathsize)
debug_decl(sudo_check_plugin, SUDO_DEBUG_PLUGIN)
if (sudo_stat_plugin(info, fullpath, pathsize, &sb) != 0) {
sudo_warnx(U_("error in %s, line %d while loading plugin `%s'"),
sudo_warnx(U_("error in %s, line %d while loading plugin \"%s\""),
_PATH_SUDO_CONF, info->lineno, info->symbol_name);
sudo_warn("%s%s",
sudo_conf_plugin_dir_path() ? sudo_conf_plugin_dir_path() : "",
@@ -120,13 +120,13 @@ sudo_check_plugin(struct plugin_info *info, char *fullpath, size_t pathsize)
goto done;
}
if (sb.st_uid != ROOT_UID) {
sudo_warnx(U_("error in %s, line %d while loading plugin `%s'"),
sudo_warnx(U_("error in %s, line %d while loading plugin \"%s\""),
_PATH_SUDO_CONF, info->lineno, info->symbol_name);
sudo_warnx(U_("%s must be owned by uid %d"), fullpath, ROOT_UID);
goto done;
}
if ((sb.st_mode & (S_IWGRP|S_IWOTH)) != 0) {
sudo_warnx(U_("error in %s, line %d while loading plugin `%s'"),
sudo_warnx(U_("error in %s, line %d while loading plugin \"%s\""),
_PATH_SUDO_CONF, info->lineno, info->symbol_name);
sudo_warnx(U_("%s must be only be writable by owner"), fullpath);
goto done;
@@ -167,7 +167,7 @@ sudo_load_plugin(struct plugin_container *policy_plugin,
handle = sudo_dso_load(path, SUDO_DSO_LAZY|SUDO_DSO_GLOBAL);
if (!handle) {
const char *errstr = sudo_dso_strerror();
sudo_warnx(U_("error in %s, line %d while loading plugin `%s'"),
sudo_warnx(U_("error in %s, line %d while loading plugin \"%s\""),
_PATH_SUDO_CONF, info->lineno, info->symbol_name);
sudo_warnx(U_("unable to load %s: %s"), path,
errstr ? errstr : "unknown error");
@@ -175,20 +175,20 @@ sudo_load_plugin(struct plugin_container *policy_plugin,
}
plugin = sudo_dso_findsym(handle, info->symbol_name);
if (!plugin) {
sudo_warnx(U_("error in %s, line %d while loading plugin `%s'"),
sudo_warnx(U_("error in %s, line %d while loading plugin \"%s\""),
_PATH_SUDO_CONF, info->lineno, info->symbol_name);
sudo_warnx(U_("unable to find symbol `%s' in %s"), info->symbol_name, path);
sudo_warnx(U_("unable to find symbol \"%s\" in %s"), info->symbol_name, path);
goto bad;
}
if (plugin->type != SUDO_POLICY_PLUGIN && plugin->type != SUDO_IO_PLUGIN) {
sudo_warnx(U_("error in %s, line %d while loading plugin `%s'"),
sudo_warnx(U_("error in %s, line %d while loading plugin \"%s\""),
_PATH_SUDO_CONF, info->lineno, info->symbol_name);
sudo_warnx(U_("unknown policy type %d found in %s"), plugin->type, path);
goto bad;
}
if (SUDO_API_VERSION_GET_MAJOR(plugin->version) != SUDO_API_VERSION_MAJOR) {
sudo_warnx(U_("error in %s, line %d while loading plugin `%s'"),
sudo_warnx(U_("error in %s, line %d while loading plugin \"%s\""),
_PATH_SUDO_CONF, info->lineno, info->symbol_name);
sudo_warnx(U_("incompatible plugin major version %d (expected %d) found in %s"),
SUDO_API_VERSION_GET_MAJOR(plugin->version),
@@ -199,12 +199,12 @@ sudo_load_plugin(struct plugin_container *policy_plugin,
if (policy_plugin->handle != NULL) {
/* Ignore duplicate entries. */
if (strcmp(policy_plugin->name, info->symbol_name) != 0) {
sudo_warnx(U_("ignoring policy plugin `%s' in %s, line %d"),
sudo_warnx(U_("ignoring policy plugin \"%s\" in %s, line %d"),
info->symbol_name, _PATH_SUDO_CONF, info->lineno);
sudo_warnx(U_("only a single policy plugin may be specified"));
goto bad;
}
sudo_warnx(U_("ignoring duplicate policy plugin `%s' in %s, line %d"),
sudo_warnx(U_("ignoring duplicate policy plugin \"%s\" in %s, line %d"),
info->symbol_name, _PATH_SUDO_CONF, info->lineno);
goto bad;
}
@@ -225,7 +225,7 @@ sudo_load_plugin(struct plugin_container *policy_plugin,
/* Check for duplicate entries. */
TAILQ_FOREACH(container, io_plugins, entries) {
if (strcmp(container->name, info->symbol_name) == 0) {
sudo_warnx(U_("ignoring duplicate I/O plugin `%s' in %s, line %d"),
sudo_warnx(U_("ignoring duplicate I/O plugin \"%s\" in %s, line %d"),
info->symbol_name, _PATH_SUDO_CONF, info->lineno);
sudo_dso_unload(handle);
handle = NULL;