2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 06:15:37 +00:00

Display warning/error messages in the user's locale.

This commit is contained in:
Todd C. Miller
2012-11-08 15:37:44 -05:00
parent f454a852cb
commit 595d3b2651
31 changed files with 331 additions and 300 deletions

View File

@@ -88,7 +88,7 @@ group_plugin_load(char *plugin_info)
(*plugin_info != '/') ? _PATH_SUDO_PLUGIN_DIR : "", plugin_info);
}
if (len <= 0 || len >= sizeof(path)) {
warningx(_("%s%s: %s"),
warningx(N_("%s%s: %s"),
(*plugin_info != '/') ? _PATH_SUDO_PLUGIN_DIR : "", plugin_info,
strerror(ENAMETOOLONG));
goto done;
@@ -100,28 +100,28 @@ group_plugin_load(char *plugin_info)
goto done;
}
if (sb.st_uid != ROOT_UID) {
warningx(_("%s must be owned by uid %d"), path, ROOT_UID);
warningx(N_("%s must be owned by uid %d"), path, ROOT_UID);
goto done;
}
if ((sb.st_mode & (S_IWGRP|S_IWOTH)) != 0) {
warningx(_("%s must only be writable by owner"), path);
warningx(N_("%s must only be writable by owner"), path);
goto done;
}
/* Open plugin and map in symbol. */
group_handle = dlopen(path, RTLD_LAZY|RTLD_GLOBAL);
if (!group_handle) {
warningx(_("unable to dlopen %s: %s"), path, dlerror());
warningx(N_("unable to dlopen %s: %s"), path, dlerror());
goto done;
}
group_plugin = dlsym(group_handle, "group_plugin");
if (group_plugin == NULL) {
warningx(_("unable to find symbol \"group_plugin\" in %s"), path);
warningx(N_("unable to find symbol \"group_plugin\" in %s"), path);
goto done;
}
if (GROUP_API_VERSION_GET_MAJOR(group_plugin->version) != GROUP_API_VERSION_MAJOR) {
warningx(_("%s: incompatible group plugin major version %d, expected %d"),
warningx(N_("%s: incompatible group plugin major version %d, expected %d"),
path, GROUP_API_VERSION_GET_MAJOR(group_plugin->version),
GROUP_API_VERSION_MAJOR);
goto done;