[Pkg-shadow-commits] r1067 - in trunk/debian: . patches
Nicolas FRANCOIS
nekral-guest at costa.debian.org
Fri Aug 4 21:01:16 UTC 2006
Author: nekral-guest
Date: 2006-08-04 21:01:15 +0000 (Fri, 04 Aug 2006)
New Revision: 1067
Modified:
trunk/debian/changelog
trunk/debian/patches/496_login_init_session
Log:
To fix the warning reported in #380522, update 496_login_init_session.
Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog 2006-08-04 20:59:21 UTC (rev 1066)
+++ trunk/debian/changelog 2006-08-04 21:01:15 UTC (rev 1067)
@@ -7,6 +7,8 @@
group identifiers were supported.
Closes: #381394, #381399, #381404, #381408, #381448
- 498_man_nonpam_undefined: Fix a build failure.
+ * Debian specific fixes:
+ - 496_login_init_session: only start a new session if we are init.
-- Nicolas FRANCOIS (Nekral) <nicolas.francois at centraliens.net> Fri, 4 Aug 2006 18:50:53 +0200
Modified: trunk/debian/patches/496_login_init_session
===================================================================
--- trunk/debian/patches/496_login_init_session 2006-08-04 20:59:21 UTC (rev 1066)
+++ trunk/debian/patches/496_login_init_session 2006-08-04 21:01:15 UTC (rev 1067)
@@ -1,5 +1,6 @@
Goal: Make login initialize a session to allow ^C and ^Z to work when
booting with init=/bin/login
+ Only do this if we are init (getppid() == 1)
Fix: #374547
@@ -19,14 +20,16 @@
#include "defines.h"
#include "faillog.h"
#include "failure.h"
-@@ -1046,6 +1047,10 @@
+@@ -1046,6 +1047,12 @@
}
/* child */
#endif
-+ /* start new session */
-+ setsid();
-+ if (ioctl(0, TIOCSCTTY, 1))
-+ fprintf(stderr,_("TIOCSCTTY failed on %s"),tty);
++ /* If we were init, we need to start the session */
++ if (getppid() == 1) {
++ setsid();
++ if (ioctl(0, TIOCSCTTY, 1))
++ fprintf(stderr,_("TIOCSCTTY failed on %s"),tty);
++ }
/* We call set_groups() above because this clobbers pam_groups.so */
#ifndef USE_PAM
@@ -42,14 +45,16 @@
#include "defines.h"
#include "getdef.h"
#include "prototypes.h"
-@@ -142,6 +143,10 @@
+@@ -142,6 +143,12 @@
#endif
exit (1); /* must be a terminal */
}
-+ /* start new session */
-+ setsid();
-+ if (ioctl(0, TIOCSCTTY, 1))
-+ fprintf(stderr,_("TIOCSCTTY failed"));
++ /* If we were init, we need to start the session */
++ if (getppid() == 1) {
++ setsid();
++ if (ioctl(0, TIOCSCTTY, 1))
++ fprintf(stderr,_("TIOCSCTTY failed"));
++ }
while (*envp) /* add inherited environment, */
addenv (*envp++, NULL); /* some variables change later */
More information about the Pkg-shadow-commits
mailing list