The handling for `sub_uid_open` relies on `commonio_open` preserving
`errno`, which it appears to make an effort do, but doesn't explicitly
document.
Closes: https://github.com/shadow-maint/shadow/issues/1253
/* 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 target process\n"), Prog);
+ fprintf(stderr,
+ _("%s: Could not stat directory for target process: %s\n"),
+ Prog, strerror (errno));
return EXIT_FAILURE;
}
}
if (!sub_uid_open(O_RDONLY)) {
+ fprintf (stderr,
+ _("%s: cannot open %s: %s\n"),
+ Prog, sub_uid_dbname (), strerror (errno));
return EXIT_FAILURE;
}