Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 127383 Details for
Bug 188262
sys-apps/sysvinit-2.86-r8 fails to write utmp entry before getty needs to update it
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch for sysvinit race condition
sysvinit-2.86-utmp-race-cond.patch (text/plain), 1.51 KB, created by
Gil Kloepfer
on 2007-08-09 19:12:43 UTC
(
hide
)
Description:
Proposed patch for sysvinit race condition
Filename:
MIME Type:
Creator:
Gil Kloepfer
Created:
2007-08-09 19:12:43 UTC
Size:
1.51 KB
patch
obsolete
>--- src/init.c.ORIG 2004-07-30 07:16:20.000000000 -0500 >+++ src/init.c 2007-06-15 14:07:39.774320481 -0500 >@@ -949,6 +949,25 @@ > sigprocmask(SIG_SETMASK, &omask, NULL); > > /* >+ * Update utmp/wtmp file prior to starting >+ * any child. This MUST be done right here in >+ * the child process in order to prevent a race >+ * condition that occurs when the child >+ * process' time slice executes before the >+ * parent (can and does happen in a uniprocessor >+ * environment). If the child is a getty and >+ * the race condition happens, then init's utmp >+ * update will happen AFTER the getty runs >+ * and expects utmp to be updated already! >+ * >+ * Do NOT log if process field starts with '+' >+ * FIXME: that's for compatibility with *very* >+ * old getties - probably it can be taken out. >+ */ >+ if (ch->action == RESPAWN && ch->process[0] != '+') >+ write_utmp_wtmp("", ch->id, getpid(), INIT_PROCESS, ""); >+ >+ /* > * In sysinit, boot, bootwait or single user mode: > * for any wait-type subprocess we _force_ the console > * to be its controlling tty. >@@ -1088,15 +1107,7 @@ > case ONDEMAND: > case RESPAWN: > ch->flags |= RUNNING; >- if (spawn(ch, &(ch->pid)) < 0) break; >- /* >- * Do NOT log if process field starts with '+' >- * FIXME: that's for compatibility with *very* >- * old getties - probably it can be taken out. >- */ >- if (ch->process[0] != '+') >- write_utmp_wtmp("", ch->id, ch->pid, >- INIT_PROCESS, ""); >+ (void)spawn(ch, &(ch->pid)); > break; > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 188262
: 127383