]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/patches/ppp/0013-everywhere-O_CLOEXEC-harder.patch
ppp: update to 2.4.9
[people/pmueller/ipfire-2.x.git] / src / patches / ppp / 0013-everywhere-O_CLOEXEC-harder.patch
index e3608a0d6872f9f79b110b57dba37cd2c085c020..0fb0287790cfd391dc5338e7be417afb09d751fe 100644 (file)
@@ -27,10 +27,10 @@ index 6ea6c1f..faced53 100644
        free(path);
        errno = err;
 diff --git a/pppd/main.c b/pppd/main.c
-index 6d50d1b..4880377 100644
+index 87a5d29..152e4a2 100644
 --- a/pppd/main.c
 +++ b/pppd/main.c
-@@ -420,7 +420,7 @@ main(argc, argv)
+@@ -400,7 +400,7 @@ main(int argc, char *argv[])
        die(0);
  
      /* Make sure fds 0, 1, 2 are open to somewhere. */
@@ -39,12 +39,12 @@ index 6d50d1b..4880377 100644
      if (fd_devnull < 0)
        fatal("Couldn't open %s: %m", _PATH_DEVNULL);
      while (fd_devnull <= 2) {
-@@ -1679,7 +1679,7 @@ device_script(program, in, out, dont_wait)
+@@ -1642,7 +1642,7 @@ device_script(char *program, int in, int out, int dont_wait)
      if (log_to_fd >= 0)
        errfd = log_to_fd;
      else
--      errfd = open(_PATH_CONNERRS, O_WRONLY | O_APPEND | O_CREAT, 0600);
-+      errfd = open(_PATH_CONNERRS, O_WRONLY | O_APPEND | O_CREAT | O_CLOEXEC, 0600);
+-      errfd = open(_PATH_CONNERRS, O_WRONLY | O_APPEND | O_CREAT, 0644);
++      errfd = open(_PATH_CONNERRS, O_WRONLY | O_APPEND | O_CREAT | O_CLOEXEC, 0644);
  
      ++conn_running;
      pid = safe_fork(in, out, errfd);
@@ -140,16 +140,17 @@ index 8a12fa0..00a2cf5 100644
      if (mfd >= 0) {
        int ptn;
        if (ioctl(mfd, TIOCGPTN, &ptn) >= 0) {
-@@ -2581,7 +2581,7 @@ get_pty(master_fdp, slave_fdp, slave_name, uid)
+@@ -2851,7 +2851,8 @@
            if (ioctl(mfd, TIOCSPTLCK, &ptn) < 0)
                warn("Couldn't unlock pty slave %s: %m", pty_name);
  #endif
 -          if ((sfd = open(pty_name, O_RDWR | O_NOCTTY)) < 0)
-+          if ((sfd = open(pty_name, O_RDWR | O_NOCTTY | O_CLOEXEC)) < 0)
++
++            if ((sfd = open(pty_name, O_RDWR | O_NOCTTY | O_CLOEXEC)) < 0)
+           {
                warn("Couldn't open pty slave %s: %m", pty_name);
-       }
-     }
-@@ -2592,10 +2592,10 @@ get_pty(master_fdp, slave_fdp, slave_name, uid)
+               close(mfd);
+@@ -2865,10 +2866,10 @@
        for (i = 0; i < 64; ++i) {
            slprintf(pty_name, sizeof(pty_name), "/dev/pty%c%x",
                     'p' + i / 16, i % 16);