496_login_init_session was applied upstream.
This commit is contained in:
Vendored
+1
@@ -13,6 +13,7 @@ shadow (1:4.1.1~rc1-1) UNRELEASED; urgency=low
|
||||
+ debian/patches/467_useradd_-r_LSB
|
||||
+ debian/patches/466_fflush-prompt
|
||||
+ debian/patches/480_getopt_args_reorder
|
||||
+ debian/patches/496_login_init_session
|
||||
* debian/watch: Add a watch file for shadow.
|
||||
|
||||
-- Nicolas FRANCOIS (Nekral) <nicolas.francois@centraliens.net> Sun, 24 Feb 2008 18:33:31 +0100
|
||||
|
||||
-60
@@ -1,60 +0,0 @@
|
||||
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) (see #380522)
|
||||
|
||||
Fix: #374547
|
||||
|
||||
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
|
||||
|
||||
Status wrt upstream: reported, not applied yet
|
||||
|
||||
Index: shadow-4.1.0/src/login.c
|
||||
===================================================================
|
||||
--- shadow-4.1.0.orig/src/login.c
|
||||
+++ shadow-4.1.0/src/login.c
|
||||
@@ -41,6 +41,7 @@
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/stat.h>
|
||||
+#include <sys/ioctl.h>
|
||||
#include "defines.h"
|
||||
#include "faillog.h"
|
||||
#include "failure.h"
|
||||
@@ -1070,6 +1071,12 @@
|
||||
}
|
||||
/* child */
|
||||
#endif
|
||||
+ /* 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
|
||||
Index: shadow-4.1.0/src/sulogin.c
|
||||
===================================================================
|
||||
--- shadow-4.1.0.orig/src/sulogin.c
|
||||
+++ shadow-4.1.0/src/sulogin.c
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <pwd.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
+#include <sys/ioctl.h>
|
||||
#include "defines.h"
|
||||
#include "getdef.h"
|
||||
#include "prototypes.h"
|
||||
@@ -142,6 +143,12 @@
|
||||
#endif
|
||||
exit (1); /* must be a terminal */
|
||||
}
|
||||
+ /* 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 */
|
||||
|
||||
Vendored
-1
@@ -24,7 +24,6 @@
|
||||
487_passwd_chauthtok_failed_message
|
||||
403_fix_PATH-MAX_hurd
|
||||
508_nologin_in_usr_sbin
|
||||
496_login_init_session
|
||||
505_useradd_recommend_adduser
|
||||
406_vipw_resume_properly
|
||||
407_adduser_disable_PUG_with-n
|
||||
|
||||
Reference in New Issue
Block a user