diff mbox series

[2/3] cifs-utils/svcgssd: Display principal if set

Message ID 20220607081909.1216287-2-marcel@linux-ng.de (mailing list archive)
State New, archived
Headers show
Series [1/3] cifs-utils/svcgssd: Fix use-after-free bug (config variables) | expand

Commit Message

marcel@linux-ng.de June 7, 2022, 8:19 a.m. UTC
From: Marcel Ritter <marcel@linux-ng.de>

It's a little irritating to only see the template "<...>@<...>" if you
set a specific principal name. So let's show it (if set).

---
 utils/gssd/svcgssd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/utils/gssd/svcgssd.c b/utils/gssd/svcgssd.c
index a242b789..ce78d8f7 100644
--- a/utils/gssd/svcgssd.c
+++ b/utils/gssd/svcgssd.c
@@ -295,9 +295,9 @@  main(int argc, char *argv[])
 				(const gss_OID)GSS_C_NT_HOSTBASED_SERVICE);
 		if (status == FALSE) {
 			printerr(0, "unable to obtain root (machine) credentials\n");
-			printerr(0, "do you have a keytab entry for "
-				"nfs/<your.host>@<YOUR.REALM> in "
-				"/etc/krb5.keytab?\n");
+			printerr(0, "do you have a keytab entry for %s in"
+				"/etc/krb5.keytab?\n",
+				principal ? principal : "nfs/<your.host>@<YOUR.REALM>");
 			exit(1);
 		}
 	} else {