]> granicus.if.org Git - shadow/commitdiff
* src/su.c: non PAM enabled versions: do not fail if su is called
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sun, 20 May 2012 16:15:14 +0000 (16:15 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sun, 20 May 2012 16:15:14 +0000 (16:15 +0000)
without a controlling terminal. Ignore ENXIO errors when opening
/dev/tty.

ChangeLog
NEWS
src/su.c

index 081062218decaaf265415749f7712aa27701f99a..4924e91daa01aafa8b9f3168f17fc02d1f562704 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2012-05-20  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * src/su.c: non PAM enabled versions: do not fail if su is called
+       without a controlling terminal. Ignore ENXIO errors when opening
+       /dev/tty.
+
+2012-05-20  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * src/useradd.c: Cleanup, return code 13 no more used.
+       * man/useradd.8.xml: Document return code 14, and remove return
+       code 13.
+
 2012-05-20  Nicolas François  <nicolas.francois@centraliens.net>
 
        * NEWS, man/generate_mans.mak: Generate manpages in man1, man3,
diff --git a/NEWS b/NEWS
index a4c2ce3ea5cf6bdb6250f1e450c631360ba709f2..56094326f11b3899bde5ef5f35798ae68140e0f7 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,9 @@ shadow-4.1.5 -> shadow-4.1.5.1                                  UNRELEASED
 - login
   * Log into utmp(x) when PAM is enabled, but do not log into wtmp.
     This complete pam_lastlog which logs into wtmp and in into utmp(x).
+- su
+  * non PAM enabled versions: do not fail if su is called without a
+    controlling terminal.
 - userdel
   * Fix segfault when userdel removes the user's group.
 
index f5946cc3b5bc54c997fe2fbb4aaa2834720f42b6..363a8b858bd8283f51c187d1f27d8d774b7de3cf 100644 (file)
--- a/src/su.c
+++ b/src/su.c
@@ -1092,6 +1092,9 @@ int main (int argc, char **argv)
                if (fd >= 0) {
                        err = ioctl (fd, TIOCNOTTY, (char *) 0);
                        (void) close (fd);
+               } else if (ENXIO == errno) {
+                       /* There are no controlling terminal already */
+                       err = 0;
                }
 #endif                         /* USE_PAM */