summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarel Zak2019-06-18 11:26:12 +0200
committerKarel Zak2019-06-18 11:26:12 +0200
commitfdf62463ce5461c7cc1d2799a031fc8cbbd02b62 (patch)
tree9694e2e61dca1ca1302a68a8b8b0bc0f2a3cd7a4
parentMerge branch 'topic/wdctl' (diff)
parentsu: More descriptive error message on malformed user entry (diff)
downloadkernel-qcow2-util-linux-fdf62463ce5461c7cc1d2799a031fc8cbbd02b62.tar.gz
kernel-qcow2-util-linux-fdf62463ce5461c7cc1d2799a031fc8cbbd02b62.tar.xz
kernel-qcow2-util-linux-fdf62463ce5461c7cc1d2799a031fc8cbbd02b62.zip
Merge branch 'su_err_msg' of https://github.com/jhrozek/util-linux
* 'su_err_msg' of https://github.com/jhrozek/util-linux: su: More descriptive error message on malformed user entry
-rw-r--r--login-utils/su-common.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/login-utils/su-common.c b/login-utils/su-common.c
index caabe23a6..4d91b22e4 100644
--- a/login-utils/su-common.c
+++ b/login-utils/su-common.c
@@ -1446,7 +1446,9 @@ int su_main(int argc, char **argv, int mode)
|| !su->pwd->pw_passwd
|| !su->pwd->pw_name || !*su->pwd->pw_name
|| !su->pwd->pw_dir || !*su->pwd->pw_dir)
- errx(EXIT_FAILURE, _("user %s does not exist"), su->new_user);
+ errx(EXIT_FAILURE,
+ _("user %s does not exist or the user entry does not "
+ "contain all the required fields"), su->new_user);
su->new_user = su->pwd->pw_name;
su->old_user = xgetlogin();