summarylogtreecommitdiffstats
path: root/shadow-strncpy-usage.patch
diff options
context:
space:
mode:
authorAlec Larsen2017-06-14 01:46:44 -0500
committerAlec Larsen2017-06-14 01:46:44 -0500
commit136bb3ccf00766db4de850ef3215ec1bb7ba4360 (patch)
tree89558bcb10b253c2c925c04a5bf00f6227a13986 /shadow-strncpy-usage.patch
downloadaur-136bb3ccf00766db4de850ef3215ec1bb7ba4360.tar.gz
Imports shadow-4.4 and applies Debian's 506_relaxed_usernames patch
Diffstat (limited to 'shadow-strncpy-usage.patch')
-rw-r--r--shadow-strncpy-usage.patch25
1 files changed, 25 insertions, 0 deletions
diff --git a/shadow-strncpy-usage.patch b/shadow-strncpy-usage.patch
new file mode 100644
index 000000000000..5aba8fa01f94
--- /dev/null
+++ b/shadow-strncpy-usage.patch
@@ -0,0 +1,25 @@
+diff -u shadow-4.1.5/src/usermod.c.orig shadow-4.1.5/src/usermod.c
+--- shadow-4.1.5/src/usermod.c.orig 2012-02-13 08:19:43.792146449 -0500
++++ shadow-4.1.5/src/usermod.c 2012-02-13 08:21:19.375114500 -0500
+@@ -182,7 +182,7 @@
+ struct tm *tp;
+
+ if (date < 0) {
+- strncpy (buf, "never", maxsize);
++ strncpy (buf, "never", maxsize - 1);
+ } else {
+ time_t t = (time_t) date;
+ tp = gmtime (&t);
+diff -u shadow-4.1.5/src/login.c.orig shadow-4.1.5/src/login.c
+--- shadow-4.1.5/src/login.c.orig 2012-02-13 08:19:50.951994454 -0500
++++ shadow-4.1.5/src/login.c 2012-02-13 08:21:04.490430937 -0500
+@@ -752,7 +752,8 @@
+ _("%s login: "), hostn);
+ } else {
+ strncpy (loginprompt, _("login: "),
+- sizeof (loginprompt));
++ sizeof (loginprompt) - 1);
++ loginprompt[sizeof (loginprompt) - 1] = '\0';
+ }
+
+ retcode = pam_set_item (pamh, PAM_USER_PROMPT, loginprompt);