rpms/util-linux/FC-6 util-linux-2.13-fdisk-b-4096.patch, NONE, 1.1 util-linux-2.13-mkdir_p.patch, NONE, 1.1 util-linux-2.13-more-CLOEXEC.patch, NONE, 1.1 util-linux-2.13-namei-logic.patch, NONE, 1.1 util-linux-2.13-schedutils-SCHED_BATCH.patch, NONE, 1.1

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Fri Dec 15 14:25:15 UTC 2006


Author: kzak

Update of /cvs/dist/rpms/util-linux/FC-6
In directory cvs.devel.redhat.com:/tmp/cvs-serv3662

Added Files:
	util-linux-2.13-fdisk-b-4096.patch 
	util-linux-2.13-mkdir_p.patch 
	util-linux-2.13-more-CLOEXEC.patch 
	util-linux-2.13-namei-logic.patch 
	util-linux-2.13-schedutils-SCHED_BATCH.patch 
Log Message:
..forgot new patches in last commit ;-(

util-linux-2.13-fdisk-b-4096.patch:
 fdisk.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

--- NEW FILE util-linux-2.13-fdisk-b-4096.patch ---

 The "-b" option allows to manually define size of sector size. We need to support
 4096 bytes for really huge disks. [kzak 12/14/2006]
 
--- util-linux-2.13-pre7/fdisk/fdisk.c.kzak	2006-12-14 10:21:57.000000000 +0100
+++ util-linux-2.13-pre7/fdisk/fdisk.c	2006-12-14 10:22:21.000000000 +0100
@@ -2491,7 +2491,7 @@
 			*/
 			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;

util-linux-2.13-mkdir_p.patch:
 Makefile.in.in |   53 ++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 36 insertions(+), 17 deletions(-)

--- NEW FILE util-linux-2.13-mkdir_p.patch ---
--- util-linux-2.13-pre6/po/Makefile.in.in.mkdir_p	2005-10-14 22:22:14.000000000 +0200
+++ util-linux-2.13-pre6/po/Makefile.in.in	2006-10-24 22:48:30.000000000 +0200
@@ -1,5 +1,5 @@
 # Makefile for PO directory in any package using GNU gettext.
-# Copyright (C) 1995-1997, 2000-2005 by Ulrich Drepper <drepper at gnu.ai.mit.edu>
+# Copyright (C) 1995-1997, 2000-2006 by Ulrich Drepper <drepper at gnu.ai.mit.edu>
 #
 # This file can be copied and used freely without restrictions.  It can
 # be used in projects which are not available under the GNU General Public
@@ -8,7 +8,7 @@
 # Please note that the actual code of GNU gettext is covered by the GNU
 # General Public License and is *not* in the public domain.
 #
-# Origin: gettext-0.14.4
+# Origin: gettext-0.16
 
 PACKAGE = @PACKAGE@
 VERSION = @VERSION@
@@ -23,18 +23,38 @@
 
 prefix = @prefix@
 exec_prefix = @exec_prefix@
-datadir = $(prefix)/usr/share
-localedir = $(datadir)/locale
+datarootdir = @datarootdir@
+datadir = @datadir@
+localedir = @localedir@
 gettextsrcdir = $(datadir)/gettext/po
 
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @MKINSTALLDIRS@
-mkinstalldirs = $(SHELL) $(MKINSTALLDIRS)
 
-GMSGFMT = @GMSGFMT@
-MSGFMT = @MSGFMT@
-XGETTEXT = @XGETTEXT@
+# We use $(mkdir_p).
+# In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as
+# "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions,
+# @install_sh@ does not start with $(SHELL), so we add it.
+# In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined
+# either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake
+# versions, $(mkinstalldirs) and $(install_sh) are unused.
+mkinstalldirs = $(SHELL) @install_sh@ -d
+install_sh = $(SHELL) @install_sh@
+MKDIR_P = @MKDIR_P@
+mkdir_p = @mkdir_p@
+
+GMSGFMT_ = @GMSGFMT@
+GMSGFMT_no = @GMSGFMT@
+GMSGFMT_yes = @GMSGFMT_015@
+GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT))
+MSGFMT_ = @MSGFMT@
+MSGFMT_no = @MSGFMT@
+MSGFMT_yes = @MSGFMT_015@
+MSGFMT = $(MSGFMT_$(USE_MSGCTXT))
+XGETTEXT_ = @XGETTEXT@
+XGETTEXT_no = @XGETTEXT@
+XGETTEXT_yes = @XGETTEXT_015@
+XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT))
 MSGMERGE = msgmerge
 MSGMERGE_UPDATE = @MSGMERGE@ --update
 MSGINIT = msginit
@@ -158,7 +178,7 @@
 install-exec:
 install-data: install-data- at USE_NLS@
 	if test "$(PACKAGE)" = "gettext-tools"; then \
-	  $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
+	  $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
 	  for file in $(DISTFILES.common) Makevars.template; do \
 	    $(INSTALL_DATA) $(srcdir)/$$file \
 			    $(DESTDIR)$(gettextsrcdir)/$$file; \
@@ -171,13 +191,13 @@
 	fi
 install-data-no: all
 install-data-yes: all
-	$(mkinstalldirs) $(DESTDIR)$(datadir)
+	$(mkdir_p) $(DESTDIR)$(datadir)
 	@catalogs='$(CATALOGS)'; \
 	for cat in $$catalogs; do \
 	  cat=`basename $$cat`; \
 	  lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
 	  dir=$(localedir)/$$lang/LC_MESSAGES; \
-	  $(mkinstalldirs) $(DESTDIR)$$dir; \
+	  $(mkdir_p) $(DESTDIR)$$dir; \
 	  if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
 	  $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
 	  echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
@@ -217,19 +237,19 @@
 installdirs-exec:
 installdirs-data: installdirs-data- at USE_NLS@
 	if test "$(PACKAGE)" = "gettext-tools"; then \
-	  $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
+	  $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
 	else \
 	  : ; \
 	fi
 installdirs-data-no:
 installdirs-data-yes:
-	$(mkinstalldirs) $(DESTDIR)$(datadir)
+	$(mkdir_p) $(DESTDIR)$(datadir)
 	@catalogs='$(CATALOGS)'; \
 	for cat in $$catalogs; do \
 	  cat=`basename $$cat`; \
 	  lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
 	  dir=$(localedir)/$$lang/LC_MESSAGES; \
-	  $(mkinstalldirs) $(DESTDIR)$$dir; \
+	  $(mkdir_p) $(DESTDIR)$$dir; \
 	  for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
 	    if test -n "$$lc"; then \
 	      if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
@@ -374,8 +394,7 @@
 
 Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@
 	cd $(top_builddir) \
-	  && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
-	       $(SHELL) ./config.status
+	  && $(SHELL) ./config.status $(subdir)/$@.in po-directories
 
 force:
 

util-linux-2.13-more-CLOEXEC.patch:
 more.c |    1 +
 1 files changed, 1 insertion(+)

--- NEW FILE util-linux-2.13-more-CLOEXEC.patch ---

When you view a file with the more command and run a shell, the file descriptor
for reading the file is leaked to that process.

To test, more any file. Then do !/bin/sh. At the prompt do "ls -l /proc/$$/fd"
and you'll see the leaked fd.

From: Steve Grubb <sgrubb at redhat.com>

--- util-linux-2.13-pre7/text-utils/more.c.cloexec	2006-12-14 14:05:31.000000000 +0100
+++ util-linux-2.13-pre7/text-utils/more.c	2006-12-14 14:04:57.000000000 +0100
@@ -478,6 +478,7 @@
 	}
 	if (magic(f, fs))
 		return((FILE *)NULL);
+	fcntl(fileno(f), F_SETFD, FD_CLOEXEC );
 	c = Getc(f);
 	*clearfirst = (c == '\f');
 	Ungetc (c, f);

util-linux-2.13-namei-logic.patch:
 namei.1 |    4 ----
 namei.c |   39 +++++++++++++++++++++++++++++++--------
 2 files changed, 31 insertions(+), 12 deletions(-)

--- NEW FILE util-linux-2.13-namei-logic.patch ---
--- util-linux-2.13-pre7/misc-utils/namei.1.nodir	2006-12-15 10:58:38.000000000 +0100
+++ util-linux-2.13-pre7/misc-utils/namei.1	2006-12-15 10:58:51.000000000 +0100
@@ -52,9 +52,5 @@
 Roger Southwick  (rogers at amadeus.wr.tek.com)
 .SH BUGS
 To be discovered.
-.SH CAVEATS
-.I Namei
-will follow an infinite loop of symbolic links forever.  To escape, use
-SIGINT (usually ^C).
 .SH "SEE ALSO"
 ls(1), stat(1)
--- util-linux-2.13-pre7/misc-utils/namei.c.nodir	2006-12-14 21:38:41.000000000 +0100
+++ util-linux-2.13-pre7/misc-utils/namei.c	2006-12-15 10:58:31.000000000 +0100
@@ -42,6 +42,10 @@
 1999-02-22 Arkadiusz Mi¶kiewicz <misiek at pld.ORG.PL>
 - added Native Language Support
 
+2006-12-15 Karel Zak <kzak at redhat.com> 
+- fixed logic; don't follow the path if a component is not directory
+- fixed infinite loop of symbolic links; stack size is very limited
+
 -------------------------------------------------------------*/
 
 #include <stdio.h>
@@ -66,7 +70,7 @@
 #endif
 
 static char *pperm(unsigned short);
-static void namei(char *, int);
+static void namei(char *, int, mode_t *);
 static void usage(void);
 
 int
@@ -107,9 +111,10 @@
 
 
     for(; optind < argc; optind++){
+	mode_t lastmode = 0;
 	(void)printf("f: %s\n", argv[optind]);
 	symcount = 1;
-	namei(argv[optind], 0);
+	namei(argv[optind], 0, &lastmode);
 
 	if(chdir(curdir) == -1){
 	    (void)fprintf(stderr,
@@ -131,8 +136,10 @@
 #define NODEV		(dev_t)(-1)
 #endif
 
+int kzak;
+
 static void
-namei(char *file, int lev) {
+namei(char *file, int lev, mode_t *lastmode) {
     char *cp;
     char buf[BUFSIZ], sym[BUFSIZ];
     struct stat stb;
@@ -143,7 +150,7 @@
      * See if the file has a leading /, and if so cd to root
      */
     
-    if(*file == '/'){
+    if(file && *file == '/'){
 	while(*file == '/')
 	    file++;
 	
@@ -166,7 +173,7 @@
 	    (void)printf(" d /\n");
     }
 
-    for(;;){
+    for(; file && *file;){
 
 	if (strlen(file) >= BUFSIZ) {
 		fprintf(stderr,_("namei: buf overflow\n"));
@@ -198,6 +205,20 @@
 	for(i = 0; i < lev; i++)
 	    (void)printf("  ");
 
+
+	/*
+	 * Previous element in the path wasn't directory, it means 
+	 * we cannot walk on *path*  and check the actual element by lstat(), because
+	 * there could be a component with same name. Try:
+	 *
+	 * $ touch a b
+	 * $ namei a/b    <-- "a" is not directory so namei shouldn't check for "b"
+	 */
+	if (*lastmode && S_ISDIR(*lastmode)==0 && S_ISLNK(*lastmode)==0){
+	    (void)printf(" ? %s - %s (%d)\n", buf, strerror(ENOENT), ENOENT);
+	    return;
+	}
+
 	/*
 	 * See what type of critter this file is
 	 */
@@ -207,6 +228,8 @@
 	    return;
 	}
 
+	*lastmode = stb.st_mode;
+
 	switch(stb.st_mode & S_IFMT){
 	    case S_IFDIR:
 
@@ -241,7 +264,6 @@
 		 * Sigh, another symlink.  Read its contents and
 		 * call namei()
 		 */
-		
 		bzero(sym, BUFSIZ);
 		if(readlink(buf, sym, BUFSIZ) == -1){
 		    (void)printf(_(" ? problems reading symlink %s - %s (%d)\n"), buf, ERR);
@@ -255,11 +277,12 @@
 
 		if(symcount > 0 && symcount++ > MAXSYMLINKS){
 		    (void)printf(_("  *** EXCEEDED UNIX LIMIT OF SYMLINKS ***\n"));
-		    symcount = -1;
 		} else {
 		    (void)printf("\n");
-		    namei(sym, lev + 1);
+		    namei(sym, lev + 1, lastmode);
 		}
+		if (symcount > MAXSYMLINKS)
+		    return;
 		break;
 
 	    case S_IFCHR:

util-linux-2.13-schedutils-SCHED_BATCH.patch:
 chrt.1 |    7 ++++++-
 chrt.c |   26 +++++++++++++++++++++-----
 2 files changed, 27 insertions(+), 6 deletions(-)

--- NEW FILE util-linux-2.13-schedutils-SCHED_BATCH.patch ---
--- util-linux-2.13-pre6/schedutils/chrt.1.batch	2006-11-10 13:23:37.000000000 -0500
+++ util-linux-2.13-pre6/schedutils/chrt.1	2006-11-10 13:27:23.000000000 -0500
@@ -36,10 +36,11 @@
 .BR chrt (1)
 sets or retrieves the real-time scheduling attributes of an existing PID or
 runs COMMAND with the given attributes.  Both policy (one of
+.BR SCHED_OTHER ,
 .BR SCHED_FIFO ,
 .BR SCHED_RR ,
 or
-.BR SCHED_OTHER )
+.BR SCHED_BATCH )
 and priority can be set and retrieved.
 .SH OPTIONS
 .TP
@@ -48,6 +49,10 @@
 .TP
 
 .TP
+.B -b, --batch
+set scheduling policy to
+.BR SCHED_BATCH
+.TP
 .B -f, --fifo
 set scheduling policy to
 .BR SCHED_FIFO
--- util-linux-2.13-pre6/schedutils/chrt.c.batch	2005-08-14 11:18:54.000000000 -0400
+++ util-linux-2.13-pre6/schedutils/chrt.c	2006-11-10 13:27:52.000000000 -0500
@@ -36,6 +36,8 @@
 	fprintf(stderr, "usage: %s [options] [prio] [pid | cmd [args...]]\n",
 			cmd);
 	fprintf(stderr, "manipulate real-time attributes of a process\n");
+	fprintf(stderr, "  -b, --batch                        "
+			"set policy to SCHED_BATCH\n");
 	fprintf(stderr, "  -f, --fifo                         "
 			"set policy to SCHED_FF\n");
 	fprintf(stderr, "  -p, --pid                          "
@@ -83,6 +85,9 @@
 	case SCHED_RR:
 		printf("SCHED_RR\n");
 		break;
+	case SCHED_BATCH:
+		printf("SCHED_BATCH\n");
+		break;
 	default:
 		printf("unknown\n");
 	}
@@ -101,6 +106,13 @@
 {
 	int max, min;
 
+	max = sched_get_priority_max(SCHED_OTHER);
+	min = sched_get_priority_min(SCHED_OTHER);
+	if (max >= 0 && min >= 0)
+		printf("SCHED_OTHER min/max priority\t: %d/%d\n", min, max);
+	else
+		printf("SCHED_OTHER not supported?\n");
+
 	max = sched_get_priority_max(SCHED_FIFO);
 	min = sched_get_priority_min(SCHED_FIFO);
 	if (max >= 0 && min >= 0)
@@ -115,12 +127,12 @@
 	else
 		printf("SCHED_RR not supported?\n");
 
-	max = sched_get_priority_max(SCHED_OTHER);
-	min = sched_get_priority_min(SCHED_OTHER);
+	max = sched_get_priority_max(SCHED_BATCH);
+	min = sched_get_priority_min(SCHED_BATCH);
 	if (max >= 0 && min >= 0)
-		printf("SCHED_OTHER min/max priority\t: %d/%d\n", min, max);
+		printf("SCHED_BATCH min/max priority\t: %d/%d\n", min, max);
 	else
-		printf("SCHED_OTHER not supported?\n");
+		printf("SCHED_BATCH not supported?\n");
 }
 
 int main(int argc, char *argv[])
@@ -130,6 +142,7 @@
 	pid_t pid = 0;
 
 	struct option longopts[] = {
+		{ "batch",	0, NULL, 'b' },
 		{ "fifo",	0, NULL, 'f' },
 		{ "pid",	0, NULL, 'p' },
 		{ "help",	0, NULL, 'h' },
@@ -141,11 +154,14 @@
 		{ NULL,		0, NULL, 0 }
 	};
 
-	while((i = getopt_long(argc, argv, "+fphmorvV", longopts, NULL)) != -1)
+	while((i = getopt_long(argc, argv, "+bfphmorvV", longopts, NULL)) != -1)
 	{
 		int ret = 1;
 
 		switch (i) {
+		case 'b':
+			policy = SCHED_BATCH;
+			break;
 		case 'f':
 			policy = SCHED_FIFO;
 			break;




More information about the fedora-cvs-commits mailing list