]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
su: change error message
authorKarel Zak <kzak@redhat.com>
Mon, 25 Mar 2019 15:39:43 +0000 (16:39 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 25 Mar 2019 15:39:43 +0000 (16:39 +0100)
We use PAM and if pam_strerror() returns nothing we have no clue why
authentication failed. It's mistake to blame incorrect password if
there are many possible reason...

Addresses: https://github.com/karelzak/util-linux/issues/778
Signed-off-by: Karel Zak <kzak@redhat.com>
login-utils/su-common.c

index 1662d21bbac3cf82fa7432e85b715d6cd303e5a5..94289898d44c0e02e82855fb57cd99c47f513922 100644 (file)
@@ -734,7 +734,7 @@ static void supam_authenticate(struct su_context *su)
                msg = pam_strerror(su->pamh, rc);
                pam_end(su->pamh, rc);
                sleep(getlogindefs_num("FAIL_DELAY", 1));
-               errx(EXIT_FAILURE, "%s", msg ? msg : _("incorrect password"));
+               errx(EXIT_FAILURE, "%s", msg ? msg : _("authentication failed"));
        }
 }