Hello community,

here is the log from the commit of package sysvinit for openSUSE:Factory
checked in at Thu May 19 16:40:16 CEST 2011.



--------
--- sysvinit/sysvinit.changes   2011-04-15 16:49:22.000000000 +0200
+++ /mounts/work_src_done/STABLE/sysvinit/sysvinit.changes      2011-05-19 
12:55:24.000000000 +0200
@@ -1,0 +2,26 @@
+Thu May 19 12:53:51 CEST 2011 - wer...@suse.de
+
+-  Add latest change for sulogin multiple console devices support
+
+------------------------------------------------------------------
+Wed Apr 20 13:14:43 CEST 2011 - wer...@suse.de
+
+- Aoid possible trouble due raw pts/ptmx terminal line in both
+  blogd and startpar
+- Block SIGTTOU during tcsetattr(3) library call in both blogd
+  and startpar
+- Replace select(2) with pselect(2) in blogd and ensure that
+  the timeout structure will be reseted after a timeout
+
+------------------------------------------------------------------
+Tue Apr 19 15:51:23 CEST 2011 - wer...@suse.de
+
+- Correct shutdown messages of startpar send via blogd
+
+------------------------------------------------------------------
+Tue Apr 19 14:08:04 CEST 2011 - wer...@suse.de
+
+- Avoid possible races which can be happen if blogd sees a signal
+  and will exit then (related to bnc#642289)
+
+------------------------------------------------------------------
@@ -16 +42 @@
-- Let sulogin respect device on the comman line as well as the
+- Let sulogin respect device on the command line as well as the

calling whatdependson for head-i586


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ sysvinit.spec ++++++
--- /var/tmp/diff_new_pack.fdlDL4/_old  2011-05-19 16:39:39.000000000 +0200
+++ /var/tmp/diff_new_pack.fdlDL4/_new  2011-05-19 16:39:39.000000000 +0200
@@ -29,7 +29,7 @@
 Group:          System/Base
 AutoReqProv:    on
 Version:        2.88+
-Release:        46
+Release:        48
 Summary:        SysV-Style init
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 BuildRequires:  audit-devel libselinux-devel libsepol-devel pam-devel

++++++ showconsole-1.14.dif ++++++
--- /var/tmp/diff_new_pack.fdlDL4/_old  2011-05-19 16:39:39.000000000 +0200
+++ /var/tmp/diff_new_pack.fdlDL4/_new  2011-05-19 16:39:39.000000000 +0200
@@ -1,6 +1,53 @@
+--- blogd.8
++++ blogd.8    2011-04-19 11:59:52.704425678 +0000
+@@ -65,7 +65,7 @@ says
+ that it should stop writing to disk but
+ continue to repeat messages to the old
+ devices of the system console.
+-\."
++.\"
+ .SH BUGS
+ .B blogd
+ needs a mounted
 --- blogd.c
-+++ blogd.c    2011-03-31 14:59:37.543926064 +0000
-@@ -336,7 +336,7 @@ int main(int argc, char *argv[])
++++ blogd.c    2011-04-20 11:13:46.799926099 +0000
+@@ -41,6 +41,7 @@
+ # define _POSIX_MAX_CANON 255
+ #endif
+ extern volatile sig_atomic_t nsigsys;
++extern volatile sig_atomic_t signaled;
+ 
+ static const char console[] = "/dev/console";
+ 
+@@ -66,7 +67,7 @@ void error (const char *fmt, ...)
+     _logger(fmt, ap);
+     va_end(ap);
+     popd();
+-    exit (1);
++    exit(EXIT_FAILURE);
+ }
+ 
+ /*
+@@ -122,7 +123,6 @@ static struct sigaction saved_sigint;
+ static struct sigaction saved_sigquit;
+ static struct sigaction saved_sigterm;
+ static struct sigaction saved_sigsys;
+-static volatile sig_atomic_t signaled = 0;
+ 
+ static void sighandle(int sig)
+ {
+@@ -318,6 +318,10 @@ int main(int argc, char *argv[])
+     cfmakeraw(&o);
+     cfsetispeed(&o, ispeed);
+     cfsetospeed(&o, ospeed);
++    o.c_lflag &= ~ECHO;
++    o.c_lflag |= ISIG;
++    o.c_cc[VTIME] = 0;
++    o.c_cc[VMIN]  = CMIN;
+ 
+     if (openpty(&ptm, &pts, ptsname, &o, &w) < 0)
+       error("can not open pty/tty pair: %m\n");
+@@ -336,7 +340,7 @@ int main(int argc, char *argv[])
        dup2(0, 2);
  
      secondtty(cons, st.st_rdev);
@@ -9,7 +56,28 @@
      (void)ioctl(0, TIOCCONS, NULL);  /* Undo any current map if any */
      close(0);
  
-@@ -351,22 +351,34 @@ exit(0);
+@@ -344,6 +348,20 @@ exit(0);
+       error("can not set console device to %s: %m\n", ptsname);
+     close(pts);
+ 
++    signaled = nsigsys = 0;
++    set_signal(SIGTTIN, &saved_sigttin, SIG_IGN);
++    set_signal(SIGTTOU, &saved_sigttou, SIG_IGN);
++    set_signal(SIGTSTP, &saved_sigtstp, SIG_IGN);
++    set_signal(SIGHUP,  &saved_sighup,  SIG_IGN);
++    set_signal(SIGINT,  &saved_sigint,  sighandle);
++    set_signal(SIGQUIT, &saved_sigquit, sighandle);
++    set_signal(SIGTERM, &saved_sigterm, sighandle);
++    set_signal(SIGSYS,  &saved_sigsys,  sigsys);
++    (void)siginterrupt(SIGINT,  0);
++    (void)siginterrupt(SIGQUIT, 0);
++    (void)siginterrupt(SIGTERM, 0);
++    (void)siginterrupt(SIGSYS,  0);
++
+     for (c = cons; c; c = c->next) {
+       int iflag, oflag;
+ #ifdef _PC_MAX_CANON
+@@ -351,22 +369,34 @@ exit(0);
  #endif
            c->max_canon = _POSIX_MAX_CANON;
        c->tlock = 0;
@@ -52,9 +120,205 @@
        if ((c->otio.c_lflag & ICANON) == 0) {
            c->otio.c_lflag |= ICANON | IEXTEN | ISIG | ECHO|ECHOE|ECHOK|ECHOKE;
            c->otio.c_oflag |= OPOST;
+@@ -384,20 +414,6 @@ exit(0);
+       }
+     }
+ 
+-    nsigsys = 0;
+-    set_signal(SIGTTIN, &saved_sigttin, SIG_IGN);
+-    set_signal(SIGTTOU, &saved_sigttou, SIG_IGN);
+-    set_signal(SIGTSTP, &saved_sigtstp, SIG_IGN);
+-    set_signal(SIGHUP,  &saved_sighup,  SIG_IGN);
+-    set_signal(SIGINT,  &saved_sigint,  sighandle);
+-    set_signal(SIGQUIT, &saved_sigquit, sighandle);
+-    set_signal(SIGTERM, &saved_sigterm, sighandle);
+-    set_signal(SIGSYS,  &saved_sigsys,  sigsys);
+-    (void)siginterrupt(SIGINT,  0);
+-    (void)siginterrupt(SIGQUIT, 0);
+-    (void)siginterrupt(SIGTERM, 0);
+-    (void)siginterrupt(SIGSYS,  0);
+-
+     atexit(exit_handler);     /* Register main exit handler */
+ 
+     switch ((pid = fork())) {
+@@ -427,7 +443,7 @@ exit(0);
+       }
+       fprintf(stdout, "\rBoot logging started on %s(%s) at %.24s\n", tty, 
console, stt);
+       fflush(stdout);
+-      _exit(0);               /* NEVER rise exit handlers here */
++      _exit(EXIT_SUCCESS);    /* NEVER rise exit handlers here */
+     }
+ 
+     atexit(flush_handler);    /* Register flush exit handler */
+@@ -436,7 +452,7 @@ exit(0);
+     while (!signaled)
+       safeIO();
+ 
+-    exit(0);                  /* Raise exit handlers */
++    exit(EXIT_SUCCESS);               /* Raise exit handlers */
+ }
+ 
+ static void flush_handler (void)
+--- isserial.8
++++ isserial.8 2011-04-19 11:59:52.772425964 +0000
+@@ -32,7 +32,7 @@ is
+ if
+ .B stdin
+ is a serial line otherwise not.
+-\."
++.\"
+ .SH FILES
+ .TP
+ .I /dev/console
 --- libconsole.c
-+++ libconsole.c       2011-03-31 14:44:34.988426227 +0000
-@@ -302,7 +302,7 @@ out:
++++ libconsole.c       2011-04-20 11:13:46.815926166 +0000
+@@ -59,6 +59,27 @@
+ #include "listing.h"
+ 
+ /*
++ * Used to ignore some signals during pselect(2)
++ */
++static sigset_t omask;
++
++/*
++ * Remember if we're signaled.
++ */
++volatile sig_atomic_t signaled;
++
++/*
++ * Error raised in exit handler should not call exit(3) its self
++ */
++#define lerror(fmt, args...)      \
++    do {                          \
++      if (signaled) {             \
++          warn(fmt, args);        \
++              goto out;           \
++      } error(fmt, args);         \
++    } while (0)
++
++/*
+  * push and popd direcotry changes
+  */
+ 
+@@ -182,7 +203,9 @@ static inline void safeout (int fd, cons
+       if (p < 0) {
+           if (errno == EPIPE) {
+               warn("error on writing to fd %d: %m\n", fd);
+-              exit (0);
++              if (signaled)
++                  goto out;
++              exit(EXIT_SUCCESS);
+           }
+           if (errno == EINTR) {
+               errno = 0;
+@@ -192,8 +215,9 @@ static inline void safeout (int fd, cons
+               int ret;
+               fd_set check;
+ 
+-              if (repeated++ > 1000)
+-                  error("repeated error on writing to fd %d: %m\n", fd);
++              if (repeated++ > 1000) {
++                  lerror("repeated error on writing to fd %d: %m\n", fd);
++              }
+ 
+               FD_ZERO (&check);
+               FD_SET (fd, &check);
+@@ -201,30 +225,33 @@ static inline void safeout (int fd, cons
+               /* Avoid high load: wait upto two seconds if system is not 
ready */
+               errno = 0;
+               do {
+-                  struct timeval two = {2, 0};
+-                  ret = select(fd + 1, (fd_set*)0, &check, (fd_set*)0, &two);
++                  struct timespec two = {2, 0};
++                  ret = pselect(fd + 1, (fd_set*)0, &check, (fd_set*)0, &two, 
&omask);
+ 
+               } while ((ret < 0) && (errno == EINTR));
+ 
+-              if (ret < 0)
+-                  error("can not write to fd %d: %m\n", fd);
++              if (ret < 0) {
++                  lerror("can not write to fd %d: %m\n", fd);
++              }
+ 
+               errno = 0;
+               continue;
+           }
+           if (errno == EIO) {
+-              if ((eiocount++ > 10) || !vc_reconnect)
+-                  error("can not write to fd %d: %m\n", fd);
++              if ((eiocount++ > 10) || !vc_reconnect) {
++                  lerror("can not write to fd %d: %m\n", fd);
++              }
+               (*vc_reconnect)(fd);
+               errno = 0;
+               continue;
+           }
+-          error("can not write to fd %d: %m\n", fd);
++          lerror("can not write to fd %d: %m\n", fd);
+       }
+       repeated = 0;
+       ptr += p;
+       s -= p;
+     }
++out:
+     errno = saveerr;
+ }
+ 
+@@ -244,14 +271,14 @@ static inline ssize_t safein (int fd, ch
+     t=0;
+     if ((ioctl(fd, FIONREAD, &t) < 0) || (t == 0)) {
+       fd_set check;
+-      struct timeval zero = {0, 0};
++      struct timespec zero = {0, 0};
+ 
+       do {
+           FD_ZERO (&check);
+           FD_SET (fd, &check);
+ 
+           /* Avoid deadlock: do not read if nothing is in there */
+-          if (select(fd + 1, &check, (fd_set*)0, (fd_set*)0, &zero) <= 0)
++          if (pselect(fd + 1, &check, (fd_set*)0, (fd_set*)0, &zero, &omask) 
<= 0)
+               break;
+ 
+           r = read (fd, ptr, s);
+@@ -260,11 +287,11 @@ static inline ssize_t safein (int fd, ch
+ 
+       /* Do not exit on a broken FIFO */
+       if (r < 0 && errno != EPIPE) {
+-          if (noerr)
++          if (noerr || signaled)
+               goto out;
+           if (fd == 0 && errno == EIO)
+               warn("\e[31m\e[1msystem console stolen at line %d!\e[m\n", 
__LINE__);
+-          error("Can not read from fd %d: %m\n", fd);
++          lerror("Can not read from fd %d: %m\n", fd);
+       }
+ 
+       goto out;
+@@ -277,17 +304,18 @@ static inline ssize_t safein (int fd, ch
+     while (t > 0) {
+       ssize_t p = read (fd, ptr, t);
+       if (p < 0) {
+-          if (repeated++ > 1000)
+-              error("Repeated error on reading from fd %d: %m\n", fd);
++          if (repeated++ > 1000) {
++              lerror("Repeated error on reading from fd %d: %m\n", fd);
++          }
+           if (errno == EINTR || errno == EAGAIN) {
+               errno = 0;
+               continue;
+           }
+-          if (noerr)
++          if (noerr || signaled)
+               goto out;
+           if (fd == 0 && errno == EIO)
+               warn("\e[31m\e[1msystem console stolen at line %d!\e[m\n", 
__LINE__);
+-          error("Can not read from fd %d: %m\n", fd);
++          lerror("Can not read from fd %d: %m\n", fd);
+       }
+       repeated = 0;
+       ptr += p;
+@@ -302,7 +330,7 @@ out:
  /*
   * The stdio file pointer for our log file
   */
@@ -63,7 +327,194 @@
  static FILE * flog = NULL;
  static int fdread  = -1;
  static int fdfifo  = -1;
-@@ -1463,6 +1463,10 @@ static void consalloc(struct console *re
+@@ -310,7 +338,7 @@ static int fdfifo  = -1;
+ /*
+  * Signal control for writing on log file
+  */
+-volatile sig_atomic_t nsigsys = 0;
++volatile sig_atomic_t nsigsys;
+ static volatile sig_atomic_t nsigio = -1;
+ static sigset_t save_oldset;
+ 
+@@ -402,7 +430,7 @@ xout:
+ static inline void writelog(void)
+ {
+     if (!flog)
+-      goto xout;
++      return;
+     clearerr(flog);
+     lock(&llock);
+     while (avail > 0) {
+@@ -412,7 +440,7 @@ static inline void writelog(void)
+           ret = TRANS_BUFFER_SIZE;
+ 
+       if (!flog)
+-          goto xout;;
++          break;
+       ret = fwrite(head, sizeof(unsigned char), ret, flog);
+       if (!ret && ferror(flog))
+           break;
+@@ -429,12 +457,10 @@ static inline void writelog(void)
+       }
+     }
+     unlock(&llock);
+-    if (!flog)
+-      goto xout;;
+-    fflush(flog);
+-    fdatasync(fileno(flog));
+-xout:
+-    return;
++    if (flog) {
++      fflush(flog);
++      fdatasync(fileno(flog));
++    }
+ }
+ 
+ static inline void flushlog(void)
+@@ -771,6 +797,12 @@ void prepareIO(void (*rfunc)(int), void
+     pgroup  = pgrp;
+     fdread  = in;
+ 
++    (void)sigfillset(&omask);
++    (void)sigdelset(&omask, SIGQUIT);
++    (void)sigdelset(&omask, SIGTERM);
++    (void)sigdelset(&omask, SIGSYS);
++    (void)sigdelset(&omask, SIGIO);
++
+     if (fifo_name && fdfifo < 0) {
+       struct stat st;
+       errno = 0;
+@@ -789,7 +821,7 @@ void prepareIO(void (*rfunc)(int), void
+ /*
+  * Seek for input, more input ...
+  */
+-static void more_input (struct timeval *timeout, const int noerr)
++static void more_input (struct timespec *timeout, const int noerr)
+ {
+     fd_set watch;
+     int nfds, wfds;
+@@ -803,19 +835,16 @@ static void more_input (struct timeval *
+     } else
+       wfds = fdread + 1;
+ 
+-    nfds = select(wfds, &watch, (fd_set*)0, (fd_set*)0, timeout);
++    nfds = pselect(wfds, &watch, (fd_set*)0, (fd_set*)0, timeout, &omask);
+ 
+-    if (nfds < 0) {
++    if (nfds <= 0) {
+       timeout->tv_sec  = 0;
+-      timeout->tv_usec = 0;
+-      if (errno != EINTR)
+-          error ("select(): %m\n");
++      timeout->tv_nsec = 0;
++      if (nfds < 0 && errno != EINTR && !signaled)
++          error ("pselect(): %m\n");
+       goto nothing;
+     }
+ 
+-    if (!nfds)
+-      goto nothing;
+-
+     if (FD_ISSET(fdread, &watch)) {
+       const ssize_t cnt = safein(fdread, (char*)trans, sizeof(trans), noerr);
+       static struct winsize owz;
+@@ -863,7 +892,7 @@ nothing:
+  */
+ void safeIO (void)
+ {
+-    struct timeval timeout;
++    struct timespec timeout;
+     static int log = -1;
+ 
+     if (!nsigio) /* signal handler set but no signal recieved */
+@@ -898,8 +927,12 @@ void safeIO (void)
+           (*vr_access)();
+           vr_access = NULL;
+       }
+-      if ((flog = fdopen (log, "a")) == NULL)
+-              error("Can not open %s: %m\n", BOOT_LOGFILE);
++      lock(&llock);
++      if ((flog = fdopen (log, "a")) == NULL) {
++          unlock(&llock);
++          error("Can not open %s: %m\n", BOOT_LOGFILE);
++      }
++      unlock(&llock);
+ 
+       nsigio = SIGIO; /* We do not need a signal handler */
+       (void)signal(SIGIO, SIG_IGN);
+@@ -927,7 +960,7 @@ skip:
+     }
+ 
+     timeout.tv_sec  = 5;
+-    timeout.tv_usec = 0;
++    timeout.tv_nsec = 0;
+     more_input(&timeout, 0);
+ 
+     if (flog && !running) {
+@@ -958,7 +991,7 @@ skip:
+  */
+ void closeIO(void)
+ {
+-    struct timeval timeout;
++    struct timespec timeout;
+     struct console * c;
+     int n = 240;
+ 
+@@ -983,12 +1016,12 @@ void closeIO(void)
+       n--;
+ 
+       timeout.tv_sec  = 0;
+-      timeout.tv_usec = 25*1000;
++      timeout.tv_nsec = 25*1000*1000;
+ 
+       more_input(&timeout, 1);
+       (void)tcdrain(fdread);
+ 
+-    } while (timeout.tv_sec || timeout.tv_usec);
++    } while (timeout.tv_sec || timeout.tv_nsec);
+ 
+     if (running) {
+       lock(&ljoin);
+@@ -998,20 +1031,16 @@ void closeIO(void)
+       pthread_cancel(lthread);
+     }
+ 
+-    if (!flog)
+-      goto xout;
+-
+-    writelog();
+-
+-    if (!nl)
+-      fputc('\n', flog);
+-
+-    if (!flog)
+-      goto xout;
+-
+-    (void)fclose(flog);
++    if (flog) {
++      writelog();
++      if (!nl)
++          fputc('\n', flog);
++      (void)fclose(flog);
++    }
++    lock(&llock);
+     flog = NULL;
+-xout:
++    unlock(&llock);
++
+     if (fdfifo >= 0) {
+       close(fdfifo);
+       fdfifo = -1;
+@@ -1101,7 +1130,7 @@ static dev_t fallback(const pid_t pid, c
+ 
+               printf("|%u|%u|", tty, ttypgrp);  /* stdout to pipe synchronize 
... */
+ 
+-              exit(0);
++              exit(EXIT_SUCCESS);
+           } break;
+       case -1:
+           error("can not execute: %m\n");
+@@ -1463,6 +1492,10 @@ static void consalloc(struct console *re
        return;
      }
      tail->next = newc;
@@ -93,3 +544,23 @@
 +extern struct console *cons;
  #define alignof(type)         ((sizeof(type)+(sizeof(void*)-1)) & 
~(sizeof(void*)-1))
  #define strsize(string)               ((strlen(string)+1)*sizeof(char))
+--- showconsole.8
++++ showconsole.8      2011-04-19 11:59:52.844425538 +0000
+@@ -41,7 +41,7 @@ Without any argument or the option
+ the
+ .B setconsole
+ undo any redirection.
+-\."
++.\"
+ .SH OPTIONS
+ .TP
+ .B \-n
+@@ -50,7 +50,7 @@ the device file name.  This can be used
+ kernel for the major and minor device numbers of a not
+ existing device file in
+ .IR /dev .
+-\."
++.\"
+ .SH BUGS
+ .B showconsole
+ needs a mounted

++++++ startpar-0.57.dif ++++++
--- /var/tmp/diff_new_pack.fdlDL4/_old  2011-05-19 16:39:39.000000000 +0200
+++ /var/tmp/diff_new_pack.fdlDL4/_new  2011-05-19 16:39:39.000000000 +0200
@@ -1,6 +1,14 @@
 --- makeboot.c
-+++ makeboot.c 2010-10-12 16:42:54.000000000 +0000
-@@ -407,6 +407,7 @@ void check_run_files(const char *action,
++++ makeboot.c 2011-04-19 13:45:33.532428242 +0000
+@@ -320,6 +320,7 @@ static void filter_files(const char *dir
+                       t = lookup_target(dirlist[i]->d_name + 3);
+                       if (t) {
+                               t->status = 1;
++                              t->filter_prefix = filter_prefix;
+                               if (asprintf(&t->arg0, "%s/%s", path, 
dirlist[i]->d_name) < 0)
+                                       t->arg0 = (char*)0;
+                       }
+@@ -407,6 +408,7 @@ void check_run_files(const char *action,
   */
  #ifndef USE_BLOGD
  # define bootlog(arg...)
@@ -8,8 +16,27 @@
  #endif
  
  /*
+@@ -437,7 +439,7 @@ struct makenode *pickup_task(void)
+                       close(fd);
+               }
+ #endif
+-              bootlog(B_NOTICE, "service %s %s", best->name, (filter_prefix 
== 'K') ? "stop" : "start");
++              bootlog(B_NOTICE, "service %s %s", best->name, 
(best->filter_prefix == 'K') ? "stop" : "start");
+               best->status = T_RUNNING;
+       }
+       return best;
+--- makeboot.h
++++ makeboot.h 2011-04-19 13:45:22.304426128 +0000
+@@ -35,6 +35,7 @@ struct makenode {
+       struct makenode *next;
+       int interactive;
+       int importance;
++      int filter_prefix;
+ };
+ 
+ /* dependency and selection list nodes */
 --- proc.c
-+++ proc.c     2011-03-11 16:00:04.491925980 +0000
++++ proc.c     2011-03-11 16:00:04.000000000 +0000
 @@ -94,3 +94,74 @@ int read_proc(unsigned long int * const
      return 0;
  }
@@ -94,7 +121,7 @@
 -extern void unraw_consoles(void);
 -extern void raw_consoles(void);
 --- startpar.c
-+++ startpar.c 2011-03-11 15:59:16.388425553 +0000
++++ startpar.c 2011-04-20 11:13:07.375925983 +0000
 @@ -52,6 +52,12 @@
  #include <string.h>
  #include <stdlib.h>
@@ -156,7 +183,7 @@
    sigprocmask(SIG_UNBLOCK, &nmask, NULL);
  
    (void)signal(SIGINT,  SIG_DFL);
-@@ -473,6 +467,7 @@ void run(struct prg *p)
+@@ -473,12 +467,14 @@ void run(struct prg *p)
    (void)signal(SIGTERM, SIG_DFL);
    (void)signal(SIGCHLD, SIG_DFL);
    (void)signal(SIGTTIN, SIG_DFL);
@@ -164,16 +191,28 @@
  
    if (setpgid(0, 0))
      perror("setpgid");
-@@ -486,7 +481,7 @@ void run(struct prg *p)
+ 
+   if (m && p->fd)
+     {
++      sigset_t smask, omask;
+       TEMP_FAILURE_RETRY(close(1));
+       if (open(m, O_RDWR) != 1)
+       {
+@@ -486,8 +482,12 @@ void run(struct prg *p)
          _exit(1);
        }
        TEMP_FAILURE_RETRY(dup2(1, 2));
 -      if (tcsetattr(1, TCSANOW, &tio))
++      sigemptyset(&smask);
++      sigaddset(&smask, SIGTTOU);
++      sigprocmask(SIG_BLOCK, &smask, &omask);
 +      if (tcsetattr(1, TCSANOW, &tio) && errno != ENOTTY)
        perror("tcsetattr");
++      sigprocmask(SIG_SETMASK, &omask, NULL);
        if (wzok)
        ioctl(1, TIOCSWINSZ, &wz);
-@@ -582,14 +577,7 @@ int run_single(const char *prg, const ch
+       putenv(sz.env_row);
+@@ -582,14 +582,7 @@ int run_single(const char *prg, const ch
      {
        sigset_t nmask;
  
@@ -189,7 +228,7 @@
        sigprocmask(SIG_UNBLOCK, &nmask, NULL);
  
        (void)signal(SIGINT,  SIG_DFL);
-@@ -599,6 +587,7 @@ int run_single(const char *prg, const ch
+@@ -599,6 +592,7 @@ int run_single(const char *prg, const ch
        (void)signal(SIGTERM, SIG_DFL);
        (void)signal(SIGCHLD, SIG_DFL);
        (void)signal(SIGTTIN, SIG_DFL);
@@ -197,7 +236,7 @@
  
        TEMP_FAILURE_RETRY(dup2(2, 1));
        closeall();
-@@ -632,19 +621,20 @@ void do_forward(void)
+@@ -632,19 +626,20 @@ void do_forward(void)
        {
          if (errno == EINTR)
            continue;
@@ -220,7 +259,7 @@
              rr = r;
            }
          r -= rr;
-@@ -730,9 +720,23 @@ void detach(struct prg *p, const int sto
+@@ -730,9 +725,23 @@ void detach(struct prg *p, const int sto
      {
        if ((pid = fork()) == 0)
        {
@@ -244,7 +283,7 @@
          execlp(myname, myname, "-f", "--", p->name, NULL);
          do_forward();
        }
-@@ -833,6 +837,8 @@ int main(int argc, char **argv)
+@@ -833,6 +842,8 @@ int main(int argc, char **argv)
    char *splashopt = 0;
    sigset_t nmask, omask, smask;
  
@@ -253,7 +292,7 @@
    (void)sigemptyset(&nmask);
    (void)sigaddset(&nmask, SIGHUP);
    sigprocmask(SIG_UNBLOCK, &nmask, NULL);
-@@ -1015,7 +1021,8 @@ int main(int argc, char **argv)
+@@ -1015,10 +1026,15 @@ int main(int argc, char **argv)
  
    if (tcgetattr(0, &tio))
      {
@@ -263,3 +302,10 @@
        tcgetattr(2, &tio);
      }
    cfmakeraw(&tio);
++  tio.c_lflag &= ~ECHO;
++  tio.c_lflag |= ISIG;
++  tio.c_cc[VTIME] = 0;
++  tio.c_cc[VMIN]  = CMIN;
+ 
+   if (ioctl(0, TIOCGWINSZ, &wz) == 0)
+     wzok = 1;

++++++ sysvinit-2.88dsf-multiple-sulogin.patch ++++++
--- /var/tmp/diff_new_pack.fdlDL4/_old  2011-05-19 16:39:39.000000000 +0200
+++ /var/tmp/diff_new_pack.fdlDL4/_new  2011-05-19 16:39:39.000000000 +0200
@@ -1,7 +1,5 @@
-Index: src/sulogin.c
-===================================================================
---- src/sulogin.c      (revision 98)
-+++ src/sulogin.c      (working copy)
+--- src/sulogin.c
++++ src/sulogin.c      2011-05-19 10:47:11.783926103 +0000
 @@ -28,8 +28,10 @@
   *
   */
@@ -732,7 +730,7 @@
  
        /*
         *      See if we have a timeout flag.
-@@ -510,115 +874,128 @@ int main(int argc, char **argv)
+@@ -510,115 +874,138 @@ int main(int argc, char **argv)
        }
  
        if (geteuid() != 0) {
@@ -761,7 +759,14 @@
 -                      fprintf(stderr, "%s: not a tty\n", tty);
 -                      close(fd);
 -              } else {
--
++      /*
++       *      See if we need to open an other tty device.
++       */
++      if (optind < argc)
++              tty = argv[optind];
++      if (!tty || *tty == '\0') 
++              tty = getenv("CONSOLE");
+ 
 -                      /*
 -                       *      Only go through this trouble if the new
 -                       *      tty doesn't fall in this process group.
@@ -777,7 +782,11 @@
 -                                              setpgid(0, getpgid(getppid()));
 -                                      setsid();
 -                              }
--
++      /*
++       *      Detect possible consoles, use stdin as fallback.
++       */
++      detect_consoles(tty, 0);
+ 
 -                              signal(SIGHUP, SIG_IGN);
 -                              if (ttypgrp > 0)
 -                                      ioctl(0, TIOCNOTTY, (char *)1);
@@ -807,23 +816,20 @@
 -              setsid();
 -              if (ioctl(0, TIOCSCTTY, (char *)1))
 -                      perror("ioctl(TIOCSCTTY)");
--      }
 +      /*
-+       *      See if we need to open an other tty device.
++       * Should not happen
 +       */
-+      if (optind < argc)
-+              tty = argv[optind];
-+      if (!tty || *tty == '\0') 
-+              tty = getenv("CONSOLE");
++      if (!consoles) {
++              if (!errno)
++                      errno = ENOMEM;
++              fprintf(stderr, "sulogin: cannot open console: %m\n\r");
++              exit(1);
+       }
  
 -#if defined(SANE_TIO) && (SANE_TIO == 1)
 -      fixtty();
 -#endif
-+      /*
-+       *      Detect possible consoles, use stdin as fallback.
-+       */
-+      detect_consoles(tty, 0);
- 
+-
        /*
         *      Get the root password.
         */
@@ -949,10 +955,8 @@
 -       */
        return 0;
  }
-Index: src/consoles.c
-===================================================================
---- src/consoles.c     (revision 100)
-+++ src/consoles.c     (working copy)
+--- src/consoles.c
++++ src/consoles.c     2011-04-01 10:37:59.827926346 +0000
 @@ -27,9 +27,21 @@
  #include <string.h>
  #include <sys/types.h>
@@ -1396,10 +1400,8 @@
 +                      consoles->fd = fallback;
        }
  }
-Index: src/consoles.h
-===================================================================
---- src/consoles.h     (revision 100)
-+++ src/consoles.h     (working copy)
+--- src/consoles.h
++++ src/consoles.h     2011-04-01 09:25:53.402826920 +0000
 @@ -21,13 +21,28 @@
   * Author: Werner Fink <wer...@suse.de>
   */
@@ -1433,10 +1435,8 @@
  extern struct console *consoles;
 -extern void detect_consoles(void);
 +extern void detect_consoles(const char *, int);
-Index: src/Makefile
-===================================================================
---- src/Makefile       (revision 100)
-+++ src/Makefile       (working copy)
+--- src/Makefile
++++ src/Makefile       2010-03-23 15:11:12.000000000 +0000
 @@ -112,7 +112,7 @@ utmpdump:  utmpdump.o
  runlevel:     runlevel.o
  


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Remember to have fun...

-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to