]> git.pld-linux.org Git - packages/shadow.git/commitdiff
fix su.c compilation
authorElan Ruusamäe <glen@delfi.ee>
Mon, 5 Dec 2016 20:50:22 +0000 (22:50 +0200)
committerElan Ruusamäe <glen@delfi.ee>
Mon, 5 Dec 2016 20:50:22 +0000 (22:50 +0200)
https://github.com/shadow-maint/shadow/issues/32

shadow.spec
su.patch [new file with mode: 0644]

index 401cf7ff90140edb9f69f0a87d268ddb49fdacc0..99201fef9627405f9ede481d429eece2b6b6780a 100644 (file)
@@ -61,6 +61,7 @@ Source23:     usermod.pamd
 Patch0:                %{name}-pld.patch
 # allow names with upper case letters or containing dot in the middle
 Patch1:                %{name}-goodname.patch
+Patch2:                su.patch
 URL:           https://github.com/shadow-maint/shadow
 BuildRequires: acl-devel
 BuildRequires: attr-devel
@@ -145,6 +146,7 @@ utilitários e senhas shadow em geral.
 %setup -q
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 
 %build
 %configure \
diff --git a/su.patch b/su.patch
new file mode 100644 (file)
index 0000000..832d411
--- /dev/null
+++ b/su.patch
@@ -0,0 +1,51 @@
+
+https://github.com/shadow-maint/shadow/issues/32
+
+From 67d2bb6e0a5ac124ce1f026dd5723217b1493194 Mon Sep 17 00:00:00 2001
+From: Serge Hallyn <serge@hallyn.com>
+Date: Sun, 18 Sep 2016 21:31:18 -0500
+Subject: [PATCH] su.c: fix missing length argument to snprintf
+
+---
+ src/su.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/su.c b/src/su.c
+index 0c50a94..93ffd2f 100644
+--- a/src/su.c
++++ b/src/su.c
+@@ -373,8 +373,8 @@ static void prepare_pam_close_session (void)
+                             stderr);
+               (void) kill (-pid_child, caught);
+-              snprintf (kill_msg, _(" ...killed.\n"));
+-              snprintf (wait_msg, _(" ...waiting for child to terminate.\n"));
++              snprintf (kill_msg, 256, _(" ...killed.\n"));
++              snprintf (wait_msg, 256, _(" ...waiting for child to terminate.\n"));
+               (void) signal (SIGALRM, kill_child);
+               (void) alarm (2);
+From 924cc346475dea7dc394316cd7c3d5d0414e538e Mon Sep 17 00:00:00 2001
+From: Adam Sampson <ats@offog.org>
+Date: Thu, 15 Sep 2016 16:54:42 +0100
+Subject: [PATCH] Use sizeof rather than hardcoding snprintf's size argument.
+
+---
+ src/su.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/su.c b/src/su.c
+index 93ffd2f..d605af8 100644
+--- a/src/su.c
++++ b/src/su.c
+@@ -373,8 +373,8 @@ static void prepare_pam_close_session (void)
+                             stderr);
+               (void) kill (-pid_child, caught);
+-              snprintf (kill_msg, 256, _(" ...killed.\n"));
+-              snprintf (wait_msg, 256, _(" ...waiting for child to terminate.\n"));
++              snprintf (kill_msg, sizeof kill_msg, _(" ...killed.\n"));
++              snprintf (wait_msg, sizeof wait_msg, _(" ...waiting for child to terminate.\n"));
+               (void) signal (SIGALRM, kill_child);
+               (void) alarm (2);
This page took 0.770572 seconds and 4 git commands to generate.