From 324342ebf3a6b6e6d69268dc8640c642fdb25778 Mon Sep 17 00:00:00 2001
From: Robbie Harwood <rharwood@redhat.com>
Date: Thu, 28 Apr 2016 16:20:22 -0400
Subject: [PATCH] krb5-1.14.3-ksu_root_prompt.patch
Backport: 2f8b9ef90829b031448d4547190c72438a69aacd
---
src/clients/ksu/main.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/clients/ksu/main.c b/src/clients/ksu/main.c
index 1b2ca83..cab0c18 100644
--- a/src/clients/ksu/main.c
+++ b/src/clients/ksu/main.c
@@ -122,7 +122,7 @@ main (argc, argv)
extern char * getpass(), *crypt();
int pargc;
char ** pargv;
- krb5_boolean stored = FALSE, cc_reused = FALSE;
+ krb5_boolean stored = FALSE, cc_reused = FALSE, given_princ = FALSE;
krb5_boolean zero_password;
krb5_boolean restrict_creds;
krb5_deltat lifetime, rlife;
@@ -244,6 +244,7 @@ main (argc, argv)
com_err(prog_name, retval, _("when parsing name %s"), optarg);
errflg++;
}
+ given_princ = TRUE;
break;
#ifdef DEBUG
case 'D':
@@ -468,7 +469,7 @@ main (argc, argv)
if ((source_uid == 0) || (target_uid == source_uid)){
#ifdef GET_TGT_VIA_PASSWD
- if ((!all_rest_copy) && client != NULL && (stored == FALSE)){
+ if (!all_rest_copy && given_princ && client != NULL && !stored) {
fprintf(stderr, _("WARNING: Your password may be exposed if you "
"enter it here and are logged\n"));
fprintf(stderr, _(" in remotely using an unsecure "
--
2.8.0.rc3