rpms/util-linux-ng/devel mount.tmpfs, NONE, 1.1 util-linux-ng-2.14-fdisk-4k-I.patch, NONE, 1.1 util-linux-ng-2.14-fdisk-4k-II.patch, NONE, 1.1 util-linux-ng-2.14-fdisk-4k-III.patch, NONE, 1.1 util-linux-ng-2.14-flock-segfaults.patch, NONE, 1.1 util-linux-ng-2.14-login-remote.patch, NONE, 1.1 util-linux-ng-2.14-renice-n.patch, NONE, 1.1 util-linux-ng.spec, 1.41, 1.42 util-linux-ng-2.13-fdisk-b-4096.patch, 1.3, NONE util-linux-ng-2.13-login-pamstart.patch, 1.3, NONE

Karel Zak kzak at fedoraproject.org
Thu Mar 19 10:12:31 UTC 2009


Author: kzak

Update of /cvs/pkgs/rpms/util-linux-ng/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv8881

Modified Files:
	util-linux-ng.spec 
Added Files:
	mount.tmpfs util-linux-ng-2.14-fdisk-4k-I.patch 
	util-linux-ng-2.14-fdisk-4k-II.patch 
	util-linux-ng-2.14-fdisk-4k-III.patch 
	util-linux-ng-2.14-flock-segfaults.patch 
	util-linux-ng-2.14-login-remote.patch 
	util-linux-ng-2.14-renice-n.patch 
Removed Files:
	util-linux-ng-2.13-fdisk-b-4096.patch 
	util-linux-ng-2.13-login-pamstart.patch 
Log Message:
* Thu Mar 19 2009 Karel Zak <kzak at redhat.com>  2.14.2-5
- fix #489672 - flock segfaults when file name is not given (upstream)
- fix #476964 - Mount /var/tmp with tmpfs creates denials
- fix #487227 - fdisk 4KiB hw sectors support (upstream)
- fix #477303 - renice doesn't support -n option (upstream)



--- NEW FILE mount.tmpfs ---
#! /bin/bash
#
# Copyright (C) 2009 Eric Paris <eparis at redhat.com>
#                    Daniel Walsh <dwalsh at redhat.com>
#
# http://bugzilla.redhat.com/show_bug.cgi?id=476964
#

if ! echo "$@" | grep -q -E '(fs|def|root)?context='; then
  if con=$(ls -Zd "$2" | cut -f 5 -d ' '); then 
      /bin/mount "$@" -o rootcontext=\"$con\" -i -t tmpfs
      exit $?
  fi
fi

/bin/mount "$@" -i -t tmpfs

util-linux-ng-2.14-fdisk-4k-I.patch:

--- NEW FILE util-linux-ng-2.14-fdisk-4k-I.patch ---
>From 10e3d0319a009a86a92c26da274e50850da0a9b3 Mon Sep 17 00:00:00 2001
From: Eric Sandeen <sandeen at redhat.com>
Date: Thu, 26 Feb 2009 09:53:09 +0100
Subject: [PATCH] fdisk: doesn't handle large (4KiB) sectors properly

fdisk (at least with the -u option) does not handle sector sizes other
than 512.

Address-Red-Hat-Bugzilla: #487227
Signed-off-by: Eric Sandeen <sandeen at redhat.com>
Signed-off-by: Karel Zak <kzak at redhat.com>
---
 fdisk/fdisk.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/fdisk/fdisk.c b/fdisk/fdisk.c
index 9504e7a..0c83747 100644
--- a/fdisk/fdisk.c
+++ b/fdisk/fdisk.c
@@ -212,6 +212,7 @@ unsigned long long sector_offset = 1, extended_offset = 0, sectors;
 unsigned int	heads,
 	cylinders,
 	sector_size = DEFAULT_SECTOR_SIZE,
+	sector_factor = 1,
 	user_set_sector_size = 0,
 	units_per_sector = 1,
 	display_in_cyl_units = 1;
@@ -905,11 +906,10 @@ get_partition_table_geometry(void) {
 
 void
 get_geometry(int fd, struct geom *g) {
-	int sec_fac;
 	unsigned long long llsectors, llcyls;
 
 	get_sectorsize(fd);
-	sec_fac = sector_size / 512;
+	sector_factor = sector_size / 512;
 	guess_device_type(fd);
 	heads = cylinders = sectors = 0;
 	kern_heads = kern_sectors = 0;
@@ -934,7 +934,7 @@ get_geometry(int fd, struct geom *g) {
 	if (dos_compatible_flag)
 		sector_offset = sectors;
 
-	llcyls = total_number_of_sectors / (heads * sectors * sec_fac);
+	llcyls = total_number_of_sectors / (heads * sectors * sector_factor);
 	cylinders = llcyls;
 	if (cylinders != llcyls)	/* truncated? */
 		cylinders = ~0;
@@ -1640,7 +1640,7 @@ list_disk_geometry(void) {
 	       heads, sectors, cylinders);
 	if (units_per_sector == 1)
 		printf(_(", total %llu sectors"),
-		       total_number_of_sectors / (sector_size/512));
+		       total_number_of_sectors / sector_factor);
 	printf("\n");
 	printf(_("Units = %s of %d * %d = %d bytes\n"),
 	       str_units(PLURAL),
@@ -2030,7 +2030,7 @@ add_partition(int n, int sys) {
 		if (display_in_cyl_units || !total_number_of_sectors)
 			llimit = heads * sectors * cylinders - 1;
 		else
-			llimit = total_number_of_sectors - 1;
+			llimit = (total_number_of_sectors / sector_factor) - 1;
 		limit = llimit;
 		if (limit != llimit)
 			limit = 0x7fffffff;
-- 
1.6.0.6


util-linux-ng-2.14-fdisk-4k-II.patch:

--- NEW FILE util-linux-ng-2.14-fdisk-4k-II.patch ---
diff -up util-linux-ng-2.14.2/fdisk/fdisk.c.kzak util-linux-ng-2.14.2/fdisk/fdisk.c
--- util-linux-ng-2.14.2/fdisk/fdisk.c.kzak	2009-03-19 09:59:50.000000000 +0100
+++ util-linux-ng-2.14.2/fdisk/fdisk.c	2009-03-19 09:59:50.000000000 +0100
@@ -216,7 +216,7 @@ unsigned int	heads,
 	units_per_sector = 1,
 	display_in_cyl_units = 1;
 
-unsigned long long total_number_of_sectors;
+unsigned long long total_number_of_sectors;	/* (!) 512-byte sectors */
 
 #define dos_label (!sun_label && !sgi_label && !aix_label && !mac_label && !osf_label)
 int	sun_label = 0;			/* looking at sun disklabel */
@@ -892,7 +892,7 @@ get_partition_table_geometry(void) {
 
 void
 get_geometry(int fd, struct geom *g) {
-	unsigned long long llsectors, llcyls;
+	unsigned long long llcyls;
 
 	get_sectorsize(fd);
 	sector_factor = sector_size / 512;
@@ -911,10 +911,8 @@ get_geometry(int fd, struct geom *g) {
 		pt_sectors ? pt_sectors :
 		kern_sectors ? kern_sectors : 63;
 
-	if (blkdev_get_sectors(fd, &llsectors) == -1)
-		llsectors = 0;
-
-	total_number_of_sectors = llsectors;
+	if (blkdev_get_sectors(fd, &total_number_of_sectors) == -1)
+		total_number_of_sectors = 0;
 
 	sector_offset = 1;
 	if (dos_compatible_flag)
@@ -1922,7 +1920,8 @@ check(int n, unsigned int h, unsigned in
 static void
 verify(void) {
 	int i, j;
-	unsigned long total = 1;
+	unsigned long long total = 1;
+	unsigned long long n_sectors = (total_number_of_sectors / sector_factor);
 	unsigned long long first[partitions], last[partitions];
 	struct partition *p;
 
@@ -1985,12 +1984,12 @@ verify(void) {
 		}
 	}
 
-	if (total > total_number_of_sectors)
-		printf(_("Total allocated sectors %ld greater than the maximum"
-			" %lld\n"), total, total_number_of_sectors);
-	else if (total < total_number_of_sectors)
-		printf(_("%lld unallocated sectors\n"),
-		       total_number_of_sectors - total);
+	if (total > n_sectors)
+		printf(_("Total allocated sectors %llu greater than the maximum"
+			" %llu\n"), total, n_sectors);
+	else if (total < n_sectors)
+		printf(_("%lld unallocated %d-byte sectors\n"),
+		       n_sectors - total, sector_size);
 }
 
 static void

util-linux-ng-2.14-fdisk-4k-III.patch:

--- NEW FILE util-linux-ng-2.14-fdisk-4k-III.patch ---
>From 8905beda2abb59b48ba00c5d521c934ead4df80b Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak at redhat.com>
Date: Mon, 9 Mar 2009 09:52:08 +0100
Subject: [PATCH] fdisk: support "-b 4096" option

The fdisk code is more ready for 4kB sectors and it makes sense to
support such sectr size for "-b" option.

Address-Red-Hat-Bugzilla: #218915
Signed-off-by: Karel Zak <kzak at redhat.com>
---
 fdisk/fdisk.8 |    2 +-
 fdisk/fdisk.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fdisk/fdisk.8 b/fdisk/fdisk.8
index aea8820..30ee9d4 100644
--- a/fdisk/fdisk.8
+++ b/fdisk/fdisk.8
@@ -166,7 +166,7 @@ program and Linux partitions with the Linux fdisk or Linux cfdisk program.
 .SH OPTIONS
 .TP
 .BI "\-b " sectorsize
-Specify the sector size of the disk. Valid values are 512, 1024, or 2048.
+Specify the sector size of the disk. Valid values are 512, 1024, 2048 or 4096.
 (Recent kernels know the sector size. Use this only on old kernels or
 to override the kernel's ideas.)
 .TP
diff --git a/fdisk/fdisk.c b/fdisk/fdisk.c
index b7e517a..5593503 100644
--- a/fdisk/fdisk.c
+++ b/fdisk/fdisk.c
@@ -2612,7 +2612,7 @@ main(int argc, char **argv) {
 			*/
 			sector_size = atoi(optarg);
 			if (sector_size != 512 && sector_size != 1024 &&
-			    sector_size != 2048)
+			    sector_size != 2048 && sector_size != 4096)
 				fatal(usage);
 			sector_offset = 2;
 			user_set_sector_size = 1;
-- 
1.6.0.6


util-linux-ng-2.14-flock-segfaults.patch:

--- NEW FILE util-linux-ng-2.14-flock-segfaults.patch ---
>From 841f86dbc2e35166fd43341c8eb144680b0c7ece Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak at redhat.com>
Date: Wed, 11 Mar 2009 12:49:50 +0100
Subject: [PATCH] flockc: segfaults when file name is not given

$ flock -s
Segmentation fault

ltrace:
__libc_start_main(0x8048870, 2, 0xbfe9f404, 0x8049070, 0x8049060 <unfinished ...>
getopt_long(2, 0xbfe9f404, "+sexnouw:hV?", 0x80494e0, 0xbfe9f354) = 115
getopt_long(2, 0xbfe9f404, "+sexnouw:hV?", 0x80494e0, 0xbfe9f354) = -1
strtol(0, 0xbfe9f34c, 10, 0x80494e0, 0xbfe9f354 <unfinished ...>
--- SIGSEGV (Segmentation fault) ---
+++ killed by SIGSEGV +++

Addresses-Red-Had-Bugzilla: #489672
Signed-off-by: Karel Zak <kzak at redhat.com>
---
 sys-utils/flock.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/sys-utils/flock.c b/sys-utils/flock.c
index 029e436..3386e15 100644
--- a/sys-utils/flock.c
+++ b/sys-utils/flock.c
@@ -217,7 +217,7 @@ int main(int argc, char *argv[])
 	   EX_NOINPUT);
     }
 
-  } else {
+  } else if (optind < argc) {
     /* Use provided file descriptor */
 
     fd = (int)strtol(argv[optind], &eon, 10);
@@ -226,8 +226,15 @@ int main(int argc, char *argv[])
       exit(EX_USAGE);
     }
 
+  } else {
+    /* Bad options */
+
+    fprintf(stderr, "%s: requires file descriptor, file or directory\n",
+		program);
+    exit(EX_USAGE);
   }
 
+
   if ( have_timeout ) {
     if ( timeout.it_value.tv_sec == 0 &&
 	 timeout.it_value.tv_usec == 0 ) {
-- 
1.6.0.6


util-linux-ng-2.14-login-remote.patch:

--- NEW FILE util-linux-ng-2.14-login-remote.patch ---
>From 067f5343c86ed6dd135cdf57eb99aa3f982fceed Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak at redhat.com>
Date: Tue, 17 Mar 2009 21:00:42 +0100
Subject: [PATCH] login: use "remote" as a PAM service name for "login -h"

Signed-off-by: Karel Zak <kzak at redhat.com>
---
 login-utils/login.1 |   10 ++++++++++
 login-utils/login.c |    2 +-
 2 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/login-utils/login.1 b/login-utils/login.1
index 9ddf25b..1227381 100644
--- a/login-utils/login.1
+++ b/login-utils/login.1
@@ -105,6 +105,14 @@ to pass the name of the remote host to
 so that it may be placed in utmp and wtmp.  Only the superuser may use
 this option.
 
+Note that the \fB-h\fP option has impact on the \fBPAM service name\fP. The standard
+service name is "login", with the \fB-h\fP option the name is "remote". It's
+necessary to create a proper PAM config files (e.g.
+.I /etc/pam.d/login
+and 
+.I /etc/pam.d/remote
+).
+
 .SH "SPECIAL ACCESS RESTRICTIONS"
 The file
 .I /etc/securetty
@@ -297,6 +305,8 @@ are allowed to log in from anywhere as is standard behavior.
 .I /etc/passwd
 .I /etc/nologin
 .I /etc/usertty
+.I /etc/pam.d/login
+.I /etc/pam.d/remote
 .I .hushlogin
 .fi
 .SH "SEE ALSO"
diff --git a/login-utils/login.c b/login-utils/login.c
index d362113..c924a1f 100644
--- a/login-utils/login.c
+++ b/login-utils/login.c
@@ -552,7 +552,7 @@ main(int argc, char **argv)
      * Therefore, we are safe not setting it to anything
      */
 
-    retcode = pam_start("login",username, &conv, &pamh);
+    retcode = pam_start(hflag?"remote":"login",username, &conv, &pamh);
     if(retcode != PAM_SUCCESS) {
 	fprintf(stderr, _("%s: PAM failure, aborting: %s\n"),
 		"login", pam_strerror(pamh, retcode));
-- 
1.6.0.6


util-linux-ng-2.14-renice-n.patch:

--- NEW FILE util-linux-ng-2.14-renice-n.patch ---
>From 7cfbafda9c484a8cadefc47ee115086e803d9391 Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak at redhat.com>
Date: Mon, 9 Mar 2009 21:09:50 +0100
Subject: [PATCH] renice: add -n option for compatibility with POSIX

The -n option is required by POSIX.1-200x.

Signed-off-by: Karel Zak <kzak at redhat.com>
---
 sys-utils/renice.1 |    7 ++++++-
 sys-utils/renice.c |   12 +++++++++---
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/sys-utils/renice.1 b/sys-utils/renice.1
index 3c20d6e..32a23e1 100644
--- a/sys-utils/renice.1
+++ b/sys-utils/renice.1
@@ -29,7 +29,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\"     @(#)renice.8	8.1 (Berkeley) 6/9/93
+.\"     @(#)renice.8   8.1 (Berkeley) 6/9/93
 .\"
 .Dd June 9, 1993
 .Dt RENICE 1
@@ -39,6 +39,7 @@
 .Nd alter priority of running processes
 .Sh SYNOPSIS
 .Nm renice
+.Op Fl n
 .Ar priority
 .Oo
 .Op Fl p
@@ -74,6 +75,10 @@ their process ID's.
 Options supported by
 .Nm renice :
 .Bl -tag -width Ds
+.It Fl n, Fl Fl priority
+The scheduling
+.Ar priority
+of the process, process group, or user.
 .It Fl g, Fl Fl pgrp
 Force 
 .Ar who
diff --git a/sys-utils/renice.c b/sys-utils/renice.c
index ac05d25..879e8bd 100644
--- a/sys-utils/renice.c
+++ b/sys-utils/renice.c
@@ -51,14 +51,15 @@ int donice(int,int,int);
 void usage(int rc)
 {
 	printf( _("\nUsage:\n"
-		" renice priority [-p|--pid] pid [... pid]\n"
-		" renice priority  -g|--pgrp pgrp [... pgrp]\n"
-		" renice priority  -u|--user user [... user]\n"
+		" renice [-n] priority [-p|--pid] pid  [... pid]\n"
+		" renice [-n] priority  -g|--pgrp pgrp [... pgrp]\n"
+		" renice [-n] priority  -u|--user user [... user]\n"
 		" renice -h | --help\n"
 		" renice -v | --version\n\n"));
 
 	exit(rc);
 }
+
 /*
  * Change the priority (nice) of processes
  * or groups of processes which are already
@@ -93,6 +94,11 @@ main(int argc, char **argv)
 	if (argc < 2)
 		usage(EXIT_FAILURE);
 
+	if (strcmp(*argv, "-n") == 0 || strcmp(*argv, "--priority") == 0) {
+		argc--;
+		argv++;
+	}
+
 	prio = strtol(*argv, &endptr, 10);
 	if (*endptr)
 		usage(EXIT_FAILURE);
-- 
1.6.0.6



Index: util-linux-ng.spec
===================================================================
RCS file: /cvs/pkgs/rpms/util-linux-ng/devel/util-linux-ng.spec,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- util-linux-ng.spec	25 Feb 2009 23:34:24 -0000	1.41
+++ util-linux-ng.spec	19 Mar 2009 10:11:58 -0000	1.42
@@ -2,7 +2,7 @@
 Summary: A collection of basic system utilities
 Name: util-linux-ng
 Version: 2.14.2
-Release: 4%{?dist}
+Release: 5%{?dist}
 License: GPLv2 and GPLv2+ and BSD with advertising and Public Domain
 Group: System Environment/Base
 URL: ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng
@@ -42,6 +42,7 @@
 Source2: util-linux-ng-remote.pamd
 Source3: util-linux-ng-chsh-chfn.pamd
 Source4: util-linux-ng-60-raw.rules
+Source5: mount.tmpfs
 Source8: nologin.c
 Source9: nologin.8
 Source11: http://download.sourceforge.net/floppyutil/floppy-%{floppyver}.tar.bz2
@@ -78,28 +79,45 @@
 Requires: udev
 %endif
 
-# 91174 - Patch to enabled remote service for login/pam
-Patch0: util-linux-ng-2.13-login-pamstart.patch
-# RHEL/Fedora specific mount options
-Patch1: util-linux-ng-2.14-mount-managed.patch
+### Floppy patches (Fedora/RHEL specific)
+###
+# add a missing header
+Patch0: util-linux-ng-2.13-floppy-locale.patch
 # add note about ATAPI IDE floppy to fdformat.8
-Patch3: util-linux-ng-2.13-fdformat-man-ide.patch
+Patch1: util-linux-ng-2.13-fdformat-man-ide.patch
 # 169628 - /usr/bin/floppy doesn't work with /dev/fd0
-Patch4: util-linux-ng-2.13-floppy-generic.patch
-# 151635 - makeing /var/log/lastlog
-Patch5: util-linux-ng-2.13-login-lastlog.patch
+Patch2: util-linux-ng-2.13-floppy-generic.patch
+
+### Fedora/RHEL specific patches -- need to die!
+###
+# remove partitions
+Patch3: util-linux-ng-2.14-blockdev-rmpart.patch
+# RHEL/Fedora specific mount options
+Patch4: util-linux-ng-2.14-mount-managed.patch
 # 199745 - Non-existant simpleinit(8) mentioned in ctrlaltdel(8)
-Patch6: util-linux-ng-2.13-ctrlaltdel-man.patch
-# 218915 - fdisk -b 4K (move to upstream?)
-Patch7: util-linux-ng-2.13-fdisk-b-4096.patch
+Patch5: util-linux-ng-2.13-ctrlaltdel-man.patch
+
+### Ready for upstream?
+###
 # 231192 - ipcs is not printing correct values on pLinux
-Patch8: util-linux-ng-2.14-ipcs-32bit.patch
-# add a missing header
-Patch9: util-linux-ng-2.13-floppy-locale.patch
-# remove partitions
-Patch10: util-linux-ng-2.14-blockdev-rmpart.patch
+Patch6: util-linux-ng-2.14-ipcs-32bit.patch
+# 151635 - makeing /var/log/lastlog
+Patch7: util-linux-ng-2.13-login-lastlog.patch
+
+### Upstream patches (backported to the current Fedora/RHEL)
+###
+# 91174 - Patch to enabled remote service for login/pam
+Patch8: util-linux-ng-2.14-login-remote.patch
+# 218915, 487227 - fdisk 4KiB hw sectors support
+Patch9:  util-linux-ng-2.14-fdisk-4k-I.patch
+Patch10: util-linux-ng-2.14-fdisk-4k-II.patch
+Patch11: util-linux-ng-2.14-fdisk-4k-III.patch
 # Add -r options to dmesg (upstream patch)
-Patch11: util-linux-ng-2.14-dmesg-r.patch
+Patch12: util-linux-ng-2.14-dmesg-r.patch
+# 489672 - flock segfaults when file name is not given
+Patch13: util-linux-ng-2.14-flock-segfaults.patch
+# 477303 - renice doesn't support -n option
+Patch14: util-linux-ng-2.14-renice-n.patch
 
 %description
 The util-linux-ng package contains a large variety of low-level system
@@ -122,6 +140,9 @@
 %patch9 -p1
 %patch10 -p1
 %patch11 -p1
+%patch12 -p1
+%patch13 -p1
+%patch14 -p1
 
 %build
 unset LINGUAS || :
@@ -222,6 +243,10 @@
 ln -sf ../../sbin/hwclock ${RPM_BUILD_ROOT}/usr/sbin/hwclock
 ln -sf hwclock ${RPM_BUILD_ROOT}/sbin/clock
 
+# install tmpfs mount helper
+pushd ${RPM_BUILD_ROOT}/sbin
+install -m 755 %{SOURCE5} ./mount.tmpfs
+popd
 
 # Final cleanup
 %ifnarch %cytune_archs
@@ -505,6 +530,9 @@
 
 %attr(4755,root,root)	/bin/mount
 %attr(4755,root,root)	/bin/umount
+
+%attr(755,root,root)	/sbin/mount.tmpfs
+
 /sbin/swapon
 /sbin/swapoff
 %{_mandir}/man5/fstab.5*
@@ -516,6 +544,12 @@
 /sbin/losetup
 
 %changelog
+* Thu Mar 19 2009 Karel Zak <kzak at redhat.com>  2.14.2-5
+- fix #489672 - flock segfaults when file name is not given (upstream)
+- fix #476964 - Mount /var/tmp with tmpfs creates denials
+- fix #487227 - fdisk 4KiB hw sectors support (upstream)
+- fix #477303 - renice doesn't support -n option (upstream)
+
 * Wed Feb 25 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.14.2-4
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
 


--- util-linux-ng-2.13-fdisk-b-4096.patch DELETED ---


--- util-linux-ng-2.13-login-pamstart.patch DELETED ---




More information about the fedora-extras-commits mailing list