Change some _() into U_() since they are used for warn/fatal.

We always want to issue warnings in the user's locale.
This commit is contained in:
Todd C. Miller
2017-12-11 08:07:01 -07:00
parent b68554b7cf
commit bbc43b5e30
2 changed files with 9 additions and 9 deletions

View File

@@ -312,7 +312,7 @@ parse_args(int argc, char **argv, int *nargc, char ***nargv,
break; break;
case 'C': case 'C':
if (strtonum(optarg, 3, INT_MAX, NULL) == 0) { if (strtonum(optarg, 3, INT_MAX, NULL) == 0) {
sudo_warnx(_("the argument to -C must be a number greater than or equal to 3")); sudo_warnx(U_("the argument to -C must be a number greater than or equal to 3"));
usage(1); usage(1);
} }
sudo_settings[ARG_CLOSEFROM].value = optarg; sudo_settings[ARG_CLOSEFROM].value = optarg;

View File

@@ -175,7 +175,7 @@ sudo_openat(int dfd, const char *path, int flags, mode_t mode)
/* Restore cwd */ /* Restore cwd */
if (fchdir(odfd) == -1) if (fchdir(odfd) == -1)
sudo_fatal(_("unable to restore current working directory")); sudo_fatal(U_("unable to restore current working directory"));
close(odfd); close(odfd);
debug_return_int(fd); debug_return_int(fd);
@@ -264,7 +264,7 @@ done:
/* Restore cwd */ /* Restore cwd */
if (odfd != -1) { if (odfd != -1) {
if (fchdir(odfd) == -1) if (fchdir(odfd) == -1)
sudo_fatal(_("unable to restore current working directory")); sudo_fatal(U_("unable to restore current working directory"));
close(odfd); close(odfd);
} }
@@ -812,11 +812,11 @@ selinux_edit_create_tfiles(struct command_details *command_details,
case SESH_SUCCESS: case SESH_SUCCESS:
break; break;
case SESH_ERR_BAD_PATHS: case SESH_ERR_BAD_PATHS:
sudo_fatalx(_("sesh: internal error: odd number of paths")); sudo_fatalx(U_("sesh: internal error: odd number of paths"));
case SESH_ERR_NO_FILES: case SESH_ERR_NO_FILES:
sudo_fatalx(_("sesh: unable to create temporary files")); sudo_fatalx(U_("sesh: unable to create temporary files"));
default: default:
sudo_fatalx(_("sesh: unknown error %d"), rc); sudo_fatalx(U_("sesh: unknown error %d"), rc);
} }
/* Restore saved command_details. */ /* Restore saved command_details. */
@@ -906,15 +906,15 @@ selinux_edit_copy_tfiles(struct command_details *command_details,
ret = 0; ret = 0;
break; break;
case SESH_ERR_NO_FILES: case SESH_ERR_NO_FILES:
sudo_warnx(_("unable to copy temporary files back to their original location")); sudo_warnx(U_("unable to copy temporary files back to their original location"));
sudo_warnx(U_("contents of edit session left in %s"), edit_tmpdir); sudo_warnx(U_("contents of edit session left in %s"), edit_tmpdir);
break; break;
case SESH_ERR_SOME_FILES: case SESH_ERR_SOME_FILES:
sudo_warnx(_("unable to copy some of the temporary files back to their original location")); sudo_warnx(U_("unable to copy some of the temporary files back to their original location"));
sudo_warnx(U_("contents of edit session left in %s"), edit_tmpdir); sudo_warnx(U_("contents of edit session left in %s"), edit_tmpdir);
break; break;
default: default:
sudo_warnx(_("sesh: unknown error %d"), rc); sudo_warnx(U_("sesh: unknown error %d"), rc);
break; break;
} }
} }