mirror of
https://github.com/shadow-maint/shadow.git
synced 2026-01-26 14:03:17 +00:00
newgidmap: better error logging on failure
Much like the previous commit, similarly relies on `sub_gid_open` preserving `errno`.
This commit is contained in:
parent
f64f9fd1be
commit
ea109a3e4b
@ -190,8 +190,9 @@ int main(int argc, char **argv)
|
||||
|
||||
/* Get the effective uid and effective gid of the target process */
|
||||
if (fstat(proc_dir_fd, &st) < 0) {
|
||||
fprintf(stderr, _("%s: Could not stat directory for process\n"),
|
||||
Prog);
|
||||
fprintf(stderr,
|
||||
_("%s: Could not stat directory for target process: %s\n"),
|
||||
Prog, strerror (errno));
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
@ -211,6 +212,9 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
if (!sub_gid_open(O_RDONLY)) {
|
||||
fprintf (stderr,
|
||||
_("%s: cannot open %s: %s\n"),
|
||||
Prog, sub_gid_dbname (), strerror (errno));
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user