shadow: fix su controlling terminal #1521
authorPelle Johnsen <redacted>
Fri, 3 Jul 2015 11:44:10 +0000 (13:44 +0200)
committerPelle Johnsen <redacted>
Fri, 3 Jul 2015 11:44:10 +0000 (13:44 +0200)
Signed-off-by: Pelle Johnsen <redacted>
utils/shadow/Makefile
utils/shadow/patches/004-fix-su-controoling-term.patch [new file with mode: 0644]

index ad9bb11554e8ef50667d73f143b2f3c40de094e1..d56be82713f96467aebb8af9dd53ba98a92d8208 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2008-2014 OpenWrt.org
+# Copyright (C) 2008-2015 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=shadow
 PKG_VERSION:=4.2.1
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://pkg-shadow.alioth.debian.org/releases
diff --git a/utils/shadow/patches/004-fix-su-controoling-term.patch b/utils/shadow/patches/004-fix-su-controoling-term.patch
new file mode 100644 (file)
index 0000000..4c130c7
--- /dev/null
@@ -0,0 +1,16 @@
+--- a/src/su.c
++++ b/src/su.c
+@@ -1090,8 +1090,12 @@
+               if (fd >= 0) {
+                       err = ioctl (fd, TIOCNOTTY, (char *) 0);
++                      if (-1 == err && ENOTTY == errno) {
++                              /* There are no controlling terminal already */
++                              err = 0;
++                      }
+                       (void) close (fd);
+-              } else if (ENXIO == errno) {
++              } else if (ENXIO == errno || EACCES == errno) {
+                       /* There are no controlling terminal already */
+                       err = 0;
+               }
git clone https://git.99rst.org/PROJECT