Ver código fonte

shadow: fix su controlling terminal #1521

Signed-off-by: Pelle Johnsen <pelle.johnsen@gmail.com>
Pelle Johnsen 9 anos atrás
pai
commit
a14b3c8651

+ 2
- 2
utils/shadow/Makefile Ver arquivo

@@ -1,5 +1,5 @@
1 1
 #
2
-# Copyright (C) 2008-2014 OpenWrt.org
2
+# Copyright (C) 2008-2015 OpenWrt.org
3 3
 #
4 4
 # This is free software, licensed under the GNU General Public License v2.
5 5
 # See /LICENSE for more information.
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
9 9
 
10 10
 PKG_NAME:=shadow
11 11
 PKG_VERSION:=4.2.1
12
-PKG_RELEASE:=4
12
+PKG_RELEASE:=5
13 13
 
14 14
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 15
 PKG_SOURCE_URL:=http://pkg-shadow.alioth.debian.org/releases

+ 16
- 0
utils/shadow/patches/004-fix-su-controoling-term.patch Ver arquivo

@@ -0,0 +1,16 @@
1
+--- a/src/su.c
2
++++ b/src/su.c
3
+@@ -1090,8 +1090,12 @@
4
+ 
5
+ 		if (fd >= 0) {
6
+ 			err = ioctl (fd, TIOCNOTTY, (char *) 0);
7
++			if (-1 == err && ENOTTY == errno) {
8
++				/* There are no controlling terminal already */
9
++				err = 0;
10
++			}
11
+ 			(void) close (fd);
12
+-		} else if (ENXIO == errno) {
13
++		} else if (ENXIO == errno || EACCES == errno) {
14
+ 			/* There are no controlling terminal already */
15
+ 			err = 0;
16
+ 		}