Prepare sudo front end messages for translation.
This commit is contained in:
@@ -105,7 +105,7 @@ sudo_edit(struct command_details *command_details)
|
||||
* We will change the euid as needed below.
|
||||
*/
|
||||
if (setuid(ROOT_UID) != 0) {
|
||||
warning("unable to change to uid to root (%u)", ROOT_UID);
|
||||
warning(_("unable to change to uid to root (%u)"), ROOT_UID);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@ sudo_edit(struct command_details *command_details)
|
||||
editor_argc++;
|
||||
}
|
||||
if (nfiles == 0) {
|
||||
warningx("plugin error: missing file list for sudoedit");
|
||||
warningx(_("plugin error: missing file list for sudoedit"));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ sudo_edit(struct command_details *command_details)
|
||||
if (rc)
|
||||
warning("%s", files[i]);
|
||||
else
|
||||
warningx("%s: not a regular file", files[i]);
|
||||
warningx(_("%s: not a regular file"), files[i]);
|
||||
if (ofd != -1)
|
||||
close(ofd);
|
||||
continue;
|
||||
@@ -203,7 +203,7 @@ sudo_edit(struct command_details *command_details)
|
||||
if (nwritten == -1)
|
||||
warning("%s", tf[j].tfile);
|
||||
else
|
||||
warningx("%s: short write", tf[j].tfile);
|
||||
warningx(_("%s: short write"), tf[j].tfile);
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
@@ -277,8 +277,8 @@ sudo_edit(struct command_details *command_details)
|
||||
if (rc)
|
||||
warning("%s", tf[i].tfile);
|
||||
else
|
||||
warningx("%s: not a regular file", tf[i].tfile);
|
||||
warningx("%s left unmodified", tf[i].ofile);
|
||||
warningx(_("%s: not a regular file"), tf[i].tfile);
|
||||
warningx(_("%s left unmodified"), tf[i].ofile);
|
||||
if (tfd != -1)
|
||||
close(tfd);
|
||||
continue;
|
||||
@@ -291,7 +291,7 @@ sudo_edit(struct command_details *command_details)
|
||||
*/
|
||||
timevalsub(&tv1, &tv2);
|
||||
if (timevalisset(&tv2)) {
|
||||
warningx("%s unchanged", tf[i].ofile);
|
||||
warningx(_("%s unchanged"), tf[i].ofile);
|
||||
unlink(tf[i].tfile);
|
||||
close(tfd);
|
||||
continue;
|
||||
@@ -303,8 +303,8 @@ sudo_edit(struct command_details *command_details)
|
||||
switch_user(ROOT_UID, user_details.egid,
|
||||
user_details.ngroups, user_details.groups);
|
||||
if (ofd == -1) {
|
||||
warning("unable to write to %s", tf[i].ofile);
|
||||
warningx("contents of edit session left in %s", tf[i].tfile);
|
||||
warning(_("unable to write to %s"), tf[i].ofile);
|
||||
warningx(_("contents of edit session left in %s"), tf[i].tfile);
|
||||
close(tfd);
|
||||
continue;
|
||||
}
|
||||
@@ -313,7 +313,7 @@ sudo_edit(struct command_details *command_details)
|
||||
if (nwritten == -1)
|
||||
warning("%s", tf[i].ofile);
|
||||
else
|
||||
warningx("%s: short write", tf[i].ofile);
|
||||
warningx(_("%s: short write"), tf[i].ofile);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -321,11 +321,11 @@ sudo_edit(struct command_details *command_details)
|
||||
/* success, got EOF */
|
||||
unlink(tf[i].tfile);
|
||||
} else if (nread < 0) {
|
||||
warning("unable to read temporary file");
|
||||
warningx("contents of edit session left in %s", tf[i].tfile);
|
||||
warning(_("unable to read temporary file"));
|
||||
warningx(_("contents of edit session left in %s"), tf[i].tfile);
|
||||
} else {
|
||||
warning("unable to write to %s", tf[i].ofile);
|
||||
warningx("contents of edit session left in %s", tf[i].tfile);
|
||||
warning(_("unable to write to %s"), tf[i].ofile);
|
||||
warningx(_("contents of edit session left in %s"), tf[i].tfile);
|
||||
}
|
||||
close(ofd);
|
||||
}
|
||||
|
Reference in New Issue
Block a user