diff options
Diffstat (limited to 'meta')
| -rw-r--r-- | meta/recipes-extended/shadow/files/0001-Fix-can-not-print-full-login.patch | 41 | ||||
| -rw-r--r-- | meta/recipes-extended/shadow/shadow.inc | 1 |
2 files changed, 42 insertions, 0 deletions
diff --git a/meta/recipes-extended/shadow/files/0001-Fix-can-not-print-full-login.patch b/meta/recipes-extended/shadow/files/0001-Fix-can-not-print-full-login.patch new file mode 100644 index 0000000000..37ba5f3dc2 --- /dev/null +++ b/meta/recipes-extended/shadow/files/0001-Fix-can-not-print-full-login.patch | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | commit 670cae834827a8f794e6f7464fa57790d911b63c | ||
| 2 | Author: SoumyaWind <121475834+SoumyaWind@users.noreply.github.com> | ||
| 3 | Date: Tue Dec 27 17:40:17 2022 +0530 | ||
| 4 | |||
| 5 | shadow: Fix can not print full login timeout message | ||
| 6 | |||
| 7 | Login timed out message prints only first few bytes when write is immediately followed by exit. | ||
| 8 | Calling exit from new handler provides enough time to display full message. | ||
| 9 | |||
| 10 | Upstream-Status: Accepted [https://github.com/shadow-maint/shadow/commit/670cae834827a8f794e6f7464fa57790d911b63c] | ||
| 11 | |||
| 12 | diff --git a/src/login.c b/src/login.c | ||
| 13 | index 116e2cb3..c55f4de0 100644 | ||
| 14 | --- a/src/login.c | ||
| 15 | +++ b/src/login.c | ||
| 16 | @@ -120,6 +120,7 @@ static void get_pam_user (char **ptr_pam_user); | ||
| 17 | |||
| 18 | static void init_env (void); | ||
| 19 | static void alarm_handler (int); | ||
| 20 | +static void exit_handler (int); | ||
| 21 | |||
| 22 | /* | ||
| 23 | * usage - print login command usage and exit | ||
| 24 | @@ -391,11 +392,16 @@ static void init_env (void) | ||
| 25 | #endif /* !USE_PAM */ | ||
| 26 | } | ||
| 27 | |||
| 28 | +static void exit_handler (unused int sig) | ||
| 29 | +{ | ||
| 30 | + _exit (0); | ||
| 31 | +} | ||
| 32 | |||
| 33 | static void alarm_handler (unused int sig) | ||
| 34 | { | ||
| 35 | write (STDERR_FILENO, tmsg, strlen (tmsg)); | ||
| 36 | - _exit (0); | ||
| 37 | + signal(SIGALRM, exit_handler); | ||
| 38 | + alarm(2); | ||
| 39 | } | ||
| 40 | |||
| 41 | #ifdef USE_PAM | ||
diff --git a/meta/recipes-extended/shadow/shadow.inc b/meta/recipes-extended/shadow/shadow.inc index 5656a375b7..0ed220ac5c 100644 --- a/meta/recipes-extended/shadow/shadow.inc +++ b/meta/recipes-extended/shadow/shadow.inc | |||
| @@ -15,6 +15,7 @@ SRC_URI = "${GITHUB_BASE_URI}/download/${PV}/${BP}.tar.gz \ | |||
| 15 | file://0001-shadow-use-relaxed-usernames.patch \ | 15 | file://0001-shadow-use-relaxed-usernames.patch \ |
| 16 | ${@bb.utils.contains('PACKAGECONFIG', 'pam', '${PAM_SRC_URI}', '', d)} \ | 16 | ${@bb.utils.contains('PACKAGECONFIG', 'pam', '${PAM_SRC_URI}', '', d)} \ |
| 17 | file://useradd \ | 17 | file://useradd \ |
| 18 | file://0001-Fix-can-not-print-full-login.patch \ | ||
| 18 | " | 19 | " |
| 19 | 20 | ||
| 20 | SRC_URI:append:class-target = " \ | 21 | SRC_URI:append:class-target = " \ |
