Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=3294e61e4afaf97c252608320e6c3befed373e24

commit 3294e61e4afaf97c252608320e6c3befed373e24
Author: crazy <[EMAIL PROTECTED]>
Date:   Mon Oct 1 10:32:23 2007 +0200

util-linux-ng-2.13-2-i686
* relbump
* added patches from git to fix some strange bugs

diff --git a/source/base/util-linux-ng/FrugalBuild 
b/source/base/util-linux-ng/FrugalBuild
index 5d7a93a..eb2ac3f 100644
--- a/source/base/util-linux-ng/FrugalBuild
+++ b/source/base/util-linux-ng/FrugalBuild
@@ -3,7 +3,7 @@

pkgname=util-linux-ng
pkgver=2.13
-pkgrel=1
+pkgrel=2
pkgdesc="Miscellaneous system utilities for Linux"
url="http://www.kernel.org/pub/linux/utils/util-linux";
backup=('etc/sysconfig/console' 'etc/sysconfig/numlock')
@@ -18,8 +18,13 @@ 
source=(http://ftp.kernel.org/pub/linux/utils/util-linux-ng/v$pkgver/util-linux-
frugalwaregetty numlock rc.{bootclean,console,mount,rmount,swap,time} \
rc.bootclean-{de,hu}.po rc.mount-{de,hu}.po rc.rmount-{de,hu}.po \
rc.swap-{de,hu}.po rc.time-{de,hu}.po \
-       README.Frugalware)
-signatures=($source.sign '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' 
'')
+       README.Frugalware \
+       login_dont-segfault-on-EOF.patch \
+       mount_pointer-after-free.patch \
+       mount_privileges.patch \
+       namei_fifo.patch \
+       rtc_fix-rtc-option.patch)
+signatures=($source.sign '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' 
'' '' '' '' '' '')

build() {
Fbuild --enable-arch --enable-raw --with-fsprobe=blkid --enable-elvtune \
diff --git a/source/base/util-linux-ng/login_dont-segfault-on-EOF.patch 
b/source/base/util-linux-ng/login_dont-segfault-on-EOF.patch
new file mode 100644
index 0000000..d9a049a
--- /dev/null
+++ b/source/base/util-linux-ng/login_dont-segfault-on-EOF.patch
@@ -0,0 +1,36 @@
+From: Karel Zak <[EMAIL PROTECTED]>
+Date: Thu, 20 Sep 2007 22:34:30 +0000 (+0200)
+Subject: login: login segfaults on EOF (rh#298461)
+X-Git-Url: 
http://git.kernel.org/?p=utils%2Futil-linux-ng%2Futil-linux-ng.git;a=commitdiff_plain;h=e797d83232802cf439b2ed893e784d3636357349
+
+login: login segfaults on EOF (rh#298461)
+
+Stupid bug in audit code:
+
+  $ login
+  login: ^D
+  login: ^D
+  Segmentation fault
+
+Signed-off-by: Karel Zak <[EMAIL PROTECTED]>
+---
+
+diff --git a/login-utils/login.c b/login-utils/login.c
+index e582779..1af8792 100644
+--- a/login-utils/login.c
++++ b/login-utils/login.c
+@@ -330,12 +330,12 @@ logaudit(const char *tty, const char *username, const 
char *hostname,
+       audit_fd = audit_open();
+       if (audit_fd == -1)
+               return;
+-      if (!pwd)
++      if (!pwd && username)
+               pwd = getpwnam(username);
+       if (pwd)
+               snprintf(buf, sizeof(buf), "uid=%d", pwd->pw_uid);
+       else
+-              snprintf(buf, sizeof(buf), "acct=%s", username);
++              snprintf(buf, sizeof(buf), "acct=%s", username ? username : 
"(unknown)");
+
+       audit_log_user_message(audit_fd, AUDIT_USER_LOGIN,
+               buf, hostname, NULL, tty, status);
diff --git a/source/base/util-linux-ng/mount_pointer-after-free.patch 
b/source/base/util-linux-ng/mount_pointer-after-free.patch
new file mode 100644
index 0000000..a1d2d27
--- /dev/null
+++ b/source/base/util-linux-ng/mount_pointer-after-free.patch
@@ -0,0 +1,42 @@
+From: Norbert Buchmuller <[EMAIL PROTECTED]>
+Date: Sun, 2 Sep 2007 20:08:53 +0000 (-0600)
+Subject: mount: chain of symlinks to fstab causes use of pointer after free
+X-Git-Url: 
http://git.kernel.org/?p=utils%2Futil-linux-ng%2Futil-linux-ng.git;a=commitdiff_plain;h=a9d6150d12b368820a98cb26ec0d9f76fa4f0905
+
+mount: chain of symlinks to fstab causes use of pointer after free
+
+Looking at the source in 'mount/realpath.c' we find that when dealing with
+the second or later symlink in the chain, a memory block was free()d before
+copying its contents to a newly allocated block.
+---
+
+diff --git a/mount/realpath.c b/mount/realpath.c
+index 9dc517e..d659685 100644
+--- a/mount/realpath.c
++++ b/mount/realpath.c
+@@ -97,6 +97,7 @@ myrealpath(const char *path, char *resolved_path, int 
maxreslth) {
+               } else {
+ #ifdef resolve_symlinks               /* Richard Gooch dislikes sl resolution 
*/
+                       int m;
++                      char *newbuf;
+
+                       /* Note: readlink doesn't add the null byte. */
+                       link_path[n] = '\0';
+@@ -110,12 +111,12 @@ myrealpath(const char *path, char *resolved_path, int 
maxreslth) {
+
+                       /* Insert symlink contents into path. */
+                       m = strlen(path);
++                      newbuf = xmalloc(m + n + 1);
++                      memcpy(newbuf, link_path, n);
++                      memcpy(newbuf + n, path, m + 1);
+                       if (buf)
+                               free(buf);
+-                      buf = xmalloc(m + n + 1);
+-                      memcpy(buf, link_path, n);
+-                      memcpy(buf + n, path, m + 1);
+-                      path = buf;
++                      path = buf = newbuf;
+ #endif
+               }
+               *npath++ = '/';
+
diff --git a/source/base/util-linux-ng/mount_privileges.patch 
b/source/base/util-linux-ng/mount_privileges.patch
new file mode 100644
index 0000000..a3758dd
--- /dev/null
+++ b/source/base/util-linux-ng/mount_privileges.patch
@@ -0,0 +1,52 @@
+From: Ludwig Nussel <[EMAIL PROTECTED]>
+Date: Thu, 20 Sep 2007 12:57:20 +0000 (+0200)
+Subject: mount: doesn't drop privileges properly when calling helpers
+X-Git-Url: 
http://git.kernel.org/?p=utils%2Futil-linux-ng%2Futil-linux-ng.git;a=commitdiff_plain;h=ebbeb2c7ac1b00b6083905957837a271e80b187e
+
+mount: doesn't drop privileges properly when calling helpers
+
+{,u}mount calls setuid() and setgid() in the wrong order and doesn't checking
+the return value of set{u,g}id(() when running helpers like mount.nfs.
+
+Signed-off-by: Ludwig Nussel <[EMAIL PROTECTED]>
+Signed-off-by: Karel Zak <[EMAIL PROTECTED]>
+---
+
+diff --git a/mount/mount.c b/mount/mount.c
+index 40699f3..5bc2b30 100644
+--- a/mount/mount.c
++++ b/mount/mount.c
+@@ -634,8 +634,12 @@ check_special_mountprog(const char *spec, const char 
*node, const char *type, in
+                char *oo, *mountargs[10];
+                int i = 0;
+
+-               setuid(getuid());
+-               setgid(getgid());
++               if(setgid(getgid()) < 0)
++                       die(EX_FAIL, _("mount: cannot set group id: %s"), 
strerror(errno));
++
++               if(setuid(getuid()) < 0)
++                       die(EX_FAIL, _("mount: cannot set user id: %s"), 
strerror(errno));
++
+                oo = fix_opts_string (flags, extra_opts, NULL);
+                mountargs[i++] = mountprog;                            /* 1 */
+                mountargs[i++] = (char *) spec;                        /* 2 */
+diff --git a/mount/umount.c b/mount/umount.c
+index b3100c9..3221619 100644
+--- a/mount/umount.c
++++ b/mount/umount.c
+@@ -102,8 +102,12 @@ check_special_umountprog(const char *spec, const char 
*node,
+                               char *umountargs[8];
+                               int i = 0;
+
+-                              setuid(getuid());
+-                              setgid(getgid());
++                              if(setgid(getgid()) < 0)
++                                      die(EX_FAIL, _("umount: cannot set 
group id: %s"), strerror(errno));
++
++                              if(setuid(getuid()) < 0)
++                                      die(EX_FAIL, _("umount: cannot set user 
id: %s"), strerror(errno));
++
+                               umountargs[i++] = umountprog;
+                               umountargs[i++] = xstrdup(node);
+                               if (nomtab)
diff --git a/source/base/util-linux-ng/namei_fifo.patch 
b/source/base/util-linux-ng/namei_fifo.patch
new file mode 100644
index 0000000..cedc193
--- /dev/null
+++ b/source/base/util-linux-ng/namei_fifo.patch
@@ -0,0 +1,60 @@
+From: Li Zefan <[EMAIL PROTECTED]>
+Date: Mon, 10 Sep 2007 08:20:48 +0000 (+0800)
+Subject: namei: add to identify FIFO (named pipe) and update manpage
+X-Git-Url: 
http://git.kernel.org/?p=utils%2Futil-linux-ng%2Futil-linux-ng.git;a=commitdiff_plain;h=f062c8a69a4ebae1f3b24da6fb2be1cc51a69f7c
+
+namei: add to identify FIFO (named pipe) and update manpage
+
+namei can't identify FIFO, and it will complain that it's an unknown type.
+
+Signed-off-by: Li Zefan <[EMAIL PROTECTED]>
+---
+
+diff --git a/misc-utils/namei.1 b/misc-utils/namei.1
+index ad37574..394eb6d 100644
+--- a/misc-utils/namei.1
++++ b/misc-utils/namei.1
+@@ -33,6 +33,7 @@ outputs a the following characters to identify the file 
types found:
+     s = socket
+     b = block device
+     c = character device
++    p = FIFO (named pipe)
+     - = regular file
+     ? = an error of some kind
+ .fi
+diff --git a/misc-utils/namei.c b/misc-utils/namei.c
+index b0c33e8..9480675 100644
+--- a/misc-utils/namei.c
++++ b/misc-utils/namei.c
+@@ -30,6 +30,7 @@ For each line output, the program puts a file type first:
+     s = socket
+     b = block device
+     c = character device
++    p = FIFO (named pipe)
+     - = regular file
+     ? = an error of some kind
+
+@@ -46,6 +47,9 @@ chdir to /,  or if it encounters an unknown file type.
+ - fixed logic; don't follow the path if a component is not directory
+ - fixed infinite loop of symbolic links; stack size is very limited
+
++2007-09-10 Li Zefan <[EMAIL PROTECTED]>
++- added to identify FIFO
++
+ -------------------------------------------------------------*/
+
+ #include <stdio.h>
+@@ -306,6 +310,13 @@ namei(char *file, int lev, mode_t *lastmode) {
+                   (void)printf(" s %s\n", buf);
+               break;
+
++              case S_IFIFO:
++              if (mflag)
++                      printf(" p%s %s\n", pperm(stb.st_mode), buf);
++              else
++                      printf(" p %s\n", buf);
++              break;
++
+           case S_IFREG:
+               if(mflag)
+                   (void)printf(" -%s %s\n", pperm(stb.st_mode), buf);
diff --git a/source/base/util-linux-ng/rtc_fix-rtc-option.patch 
b/source/base/util-linux-ng/rtc_fix-rtc-option.patch
new file mode 100644
index 0000000..b06b48b
--- /dev/null
+++ b/source/base/util-linux-ng/rtc_fix-rtc-option.patch
@@ -0,0 +1,71 @@
+From: Matthias Koenig <[EMAIL PROTECTED]>
+Date: Thu, 20 Sep 2007 09:11:18 +0000 (+0200)
+Subject: hwclock: fix --rtc option
+X-Git-Url: 
http://git.kernel.org/?p=utils%2Futil-linux-ng%2Futil-linux-ng.git;a=commitdiff_plain;h=5d1f6bae3b298809ecd63b3e55f6ab30caaa4dbf
+
+hwclock: fix --rtc option
+
+The --rtc option does not set the name of the device correctly.
+It still uses /dev/rtc even if the --rtc option is given.
+
+Testcase:
+$ mv /dev/rtc /dev/foo
+$ hwclock --show --debug --rtc=/dev/foo
+hwclock from util-linux-2.13-rc2
+Using /dev interface to clock.
+Last drift adjustment done at 1190198135 seconds after 1969
+Last calibration done at 1190198135 seconds after 1969
+Hardware clock is on local time
+Assuming hardware clock is kept in local time.
+Waiting for clock tick...
+hwclock: open() of /dev/rtc failed, errno=2: No such file or directory.
+...got clock tick
+
+Co-Author: Karel Zak <[EMAIL PROTECTED]>
+Signed-off-by: Matthias Koenig <[EMAIL PROTECTED]>
+Signed-off-by: Karel Zak <[EMAIL PROTECTED]>
+---
+
+diff --git a/hwclock/rtc.c b/hwclock/rtc.c
+index f8e626e..724daf9 100644
+--- a/hwclock/rtc.c
++++ b/hwclock/rtc.c
+@@ -104,24 +104,21 @@ open_rtc(void) {
+               "/dev/misc/rtc",
+               NULL
+       };
+-      char **p = fls;
+-      char *fname = rtc_dev_name ? : *p;
+-
+-      do {
+-              int fd = open(fname, O_RDONLY);
+-
+-              if (fd < 0 && errno == ENOENT) {
+-                      if (fname == rtc_dev_name)
+-                              break;
+-                      fname = *++p;
+-              } else {
+-                      rtc_dev_name = *p;
+-                      return fd;
+-              }
+-      } while(fname);
+-
+-      if (!rtc_dev_name)
+-              rtc_dev_name = *fls;
++      char **p;
++
++      /* --rtc option has been given */
++      if (rtc_dev_name)
++              return open(rtc_dev_name, O_RDONLY);
++
++      for (p=fls; *p; ++p) {
++              int fd = open(*p, O_RDONLY);
++
++              if (fd < 0 && errno == ENOENT)
++                      continue;
++              rtc_dev_name = *p;
++              return fd;
++      }
++      rtc_dev_name = *fls;    /* default */
+       return -1;
+ }
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to