diff options
Diffstat (limited to 'source/a/shadow/shadow.login.display.short.hostname.diff')
-rw-r--r-- | source/a/shadow/shadow.login.display.short.hostname.diff | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/source/a/shadow/shadow.login.display.short.hostname.diff b/source/a/shadow/shadow.login.display.short.hostname.diff index ad5c3eba..53a22f8b 100644 --- a/source/a/shadow/shadow.login.display.short.hostname.diff +++ b/source/a/shadow/shadow.login.display.short.hostname.diff @@ -1,5 +1,6 @@ ---- ./libmisc/loginprompt.c.orig 2014-03-01 12:59:51.000000000 -0600 -+++ ./libmisc/loginprompt.c 2017-11-21 18:17:27.492000123 -0600 +diff -u -r --new-file shadow-4.8.1.orig/libmisc/loginprompt.c shadow-4.8.1/libmisc/loginprompt.c +--- shadow-4.8.1.orig/libmisc/loginprompt.c 2019-07-23 10:26:08.000000000 -0500 ++++ shadow-4.8.1/libmisc/loginprompt.c 2020-02-06 17:29:43.386954096 -0600 @@ -99,6 +99,15 @@ } } @@ -16,3 +17,22 @@ printf (prompt, buf); (void) fflush (stdout); } +diff -u -r --new-file shadow-4.8.1.orig/src/login.c shadow-4.8.1/src/login.c +--- shadow-4.8.1.orig/src/login.c 2020-01-12 07:58:49.000000000 -0600 ++++ shadow-4.8.1/src/login.c 2020-02-06 17:29:33.191954722 -0600 +@@ -761,6 +761,15 @@ + + /* Make the login prompt look like we want it */ + if (gethostname (hostn, sizeof (hostn)) == 0) { ++ /* Trim away everything after the first '.': */ ++ int i = 0; ++ while (hostn[i] != '\0' && i < sizeof(hostn) - 1) { ++ if (hostn[i] == '.') { ++ hostn[i] = '\0'; ++ break; ++ } ++ i++; ++ } + snprintf (loginprompt, + sizeof (loginprompt), + _("%s login: "), hostn); |