rpms/util-linux/devel util-linux-2.12p-cal-wide.patch, NONE, 1.1 util-linux-2.12p-col-EILSEQ.patch, NONE, 1.1 util-linux-2.13-mount-twiceloop.patch, NONE, 1.1 util-linux-2.13-audit-hwclock.patch, 1.3, 1.4 util-linux.spec, 1.101, 1.102

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Tue Jan 3 17:50:24 UTC 2006


Author: kzak

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

Modified Files:
	util-linux-2.13-audit-hwclock.patch util-linux.spec 
Added Files:
	util-linux-2.12p-cal-wide.patch 
	util-linux-2.12p-col-EILSEQ.patch 
	util-linux-2.13-mount-twiceloop.patch 
Log Message:
col and cal wide chars fix, 'mount -o loop' fix

util-linux-2.12p-cal-wide.patch:
 cal.c |   29 ++++++++++++-----------------
 1 files changed, 12 insertions(+), 17 deletions(-)

--- NEW FILE util-linux-2.12p-cal-wide.patch ---
--- util-linux-2.12p/misc-utils/cal.c.wide	2004-12-05 20:20:36.000000000 +0100
+++ util-linux-2.12p/misc-utils/cal.c	2006-01-02 15:13:50.000000000 +0100
@@ -368,7 +368,7 @@
   int i, wd;
 #ifdef ENABLE_WIDECHAR
   wchar_t day_headings_wc[22],j_day_headings_wc[29];
-  wchar_t wd_wc[10];
+  char *cur_dh = day_headings, *cur_j_dh = j_day_headings;
 #endif
 
   strcpy(day_headings,"");
@@ -385,30 +385,25 @@
 #endif
 
   for(i = 0 ; i < 7 ; i++ ) {
+     ssize_t space_left;
      wd = (i + week1stday) % 7;
 #ifdef ENABLE_WIDECHAR
-     mbstowcs(wd_wc,weekday(wd),10);
-     if (wcswidth(wd_wc,10) < 3)
-	     wcscat(j_day_headings_wc,L" ");
-     if (wcswidth(wd_wc,10) < 2) {
-	     wcscat(day_headings_wc, L" ");
-	     wcscat(j_day_headings_wc, L" ");
-     }
-     wcsncat(day_headings_wc,wd_wc,2);
-     wcsncat(j_day_headings_wc,wd_wc,3);
-     wcscat(day_headings_wc, L" ");
-     wcscat(j_day_headings_wc, L" ");
+     swprintf(day_headings_wc, sizeof(day_headings_wc)/sizeof(day_headings_wc[0]),
+		L"%1.2s ", weekday(wd));
+     swprintf(j_day_headings_wc, sizeof(j_day_headings_wc)/sizeof(j_day_headings_wc[0]),
+		L"%3.3s ", weekday(wd));
+     space_left = sizeof(day_headings)-(cur_dh-day_headings);
+     if(space_left <= 0) break;
+     cur_dh += wcstombs(cur_dh,day_headings_wc, space_left);
+     space_left = sizeof(j_day_headings)-(cur_j_dh-j_day_headings);
+     if(space_left <= 0) break;
+     cur_j_dh +=  wcstombs(cur_j_dh,j_day_headings_wc, space_left);
 #else
      sprintf(eos(day_headings), "%2.2s ", weekday(wd));
      sprintf(eos(j_day_headings), "%3.3s ", weekday(wd));
 #endif
   }
 
-#ifdef ENABLE_WIDECHAR
-  wcstombs(day_headings,day_headings_wc,sizeof(day_headings));
-  wcstombs(j_day_headings,j_day_headings_wc,sizeof(j_day_headings));
-#endif
-
   trim_trailing_spaces(day_headings);
   trim_trailing_spaces(j_day_headings);
 #undef weekday

util-linux-2.12p-col-EILSEQ.patch:
 col.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

--- NEW FILE util-linux-2.12p-col-EILSEQ.patch ---
--- util-linux-2.12p/text-utils/col.c.EILSEQ	2002-03-09 00:05:12.000000000 +0100
+++ util-linux-2.12p/text-utils/col.c	2006-01-02 18:00:06.000000000 +0100
@@ -128,6 +128,7 @@
 	int this_line;			/* line l points to */
 	int nflushd_lines;		/* number of lines that were flushed */
 	int adjust, opt, warned;
+	int ret = 0;
 
 	setlocale(LC_ALL, "");
 	bindtextdomain(PACKAGE, LOCALEDIR);
@@ -175,8 +176,15 @@
 	cur_line = max_line = nflushd_lines = this_line = 0;
 	cur_set = last_set = CS_NORMAL;
 	lines = l = alloc_line();
-
-	while ((ch = getwchar()) != WEOF) {
+	
+	while (feof(stdin)==0) {
+		errno = 0;
+		if ((ch = getwchar()) == WEOF) {
+			if (errno==EILSEQ)
+				perror("col");
+			ret = 1;
+			break;
+		}	
 		if (!iswgraph(ch)) {
 			switch (ch) {
 			case BS:		/* can't go back further */
@@ -332,7 +340,7 @@
 	flush_blanks();
 	if (ferror(stdout) || fclose(stdout))
 		return 1;
-	return 0;
+	return ret;
 }
 
 void flush_lines(int nflush)

util-linux-2.13-mount-twiceloop.patch:
 fstab.c |   21 +++++++++++++++++++++
 mount.c |    9 +++++++--
 2 files changed, 28 insertions(+), 2 deletions(-)

--- NEW FILE util-linux-2.13-mount-twiceloop.patch ---
--- util-linux-2.13-pre6/mount/fstab.c.twiceloop	2006-01-03 18:35:05.000000000 +0100
+++ util-linux-2.13-pre6/mount/fstab.c	2006-01-03 18:37:44.000000000 +0100
@@ -254,6 +254,27 @@
 	return (ct == 1);
 }
 
+/*
+ * Given the loop file LOOPFILE, and the mount point DIR, check that
+ * same file is already mounted on same directory 
+ *
+ * Don't forget there's 
+ *   /path/loopfile /path/dir loop=/dev/loop0
+ * in mtab for loop devices.
+ */
+int
+is_mounted_same_loopfile(const char *loopfile, const char *dir) {
+	struct mntentchn *mc, *mc0;
+	int ct = 0;
+
+	mc0 = mtab_head();
+	for (mc = mc0->prev; mc && mc != mc0; mc = mc->prev)
+		if (streq(mc->m.mnt_fsname, loopfile) && 
+		    streq(mc->m.mnt_dir, dir))
+			ct++;
+	return (ct == 1);
+}
+
 /* Given the name FILE, try to find the option "loop=FILE" in mtab.  */ 
 struct mntentchn *
 getmntoptfile (const char *file) {
--- util-linux-2.13-pre6/mount/mount.c.twiceloop	2006-01-03 18:35:06.000000000 +0100
+++ util-linux-2.13-pre6/mount/mount.c	2006-01-03 18:37:44.000000000 +0100
@@ -671,7 +671,7 @@
 
 static int
 loop_check(const char **spec, const char **type, int *flags,
-	   int *loop, const char **loopdev, const char **loopfile) {
+	   int *loop, const char **loopdev, const char **loopfile, const char *dir) {
   int looptype;
   unsigned long long offset;
 
@@ -709,6 +709,11 @@
     } else {
       int loopro = (*flags & MS_RDONLY);
 
+      if (is_mounted_same_loopfile(*loopfile, dir)) {
+	error(_("mount: %s already mounted on %s"), *loopfile, dir);
+	return EX_FAIL;
+      }
+      
       if (!*loopdev || !**loopdev)
 	*loopdev = find_unused_loop_device();
       if (!*loopdev)
@@ -856,7 +861,7 @@
        * stale assignments of files to loop devices. Nasty when used for
        * encryption.
        */
-      res = loop_check(&spec, &types, &flags, &loop, &loopdev, &loopfile);
+      res = loop_check(&spec, &types, &flags, &loop, &loopdev, &loopfile, node);
       if (res)
 	  goto out;
   }

util-linux-2.13-audit-hwclock.patch:
 Makefile.am |    3 ++-
 audit.c     |   50 ++++++++++++++++++++++++++++++++++++++++++++++++++
 audit.h     |   34 ++++++++++++++++++++++++++++++++++
 clock.h     |    7 ++++++-
 hwclock.c   |   40 ++++++++++++++++++++++++++++++----------
 kd.c        |    5 +++--
 rtc.c       |    7 ++++---
 7 files changed, 129 insertions(+), 17 deletions(-)

Index: util-linux-2.13-audit-hwclock.patch
===================================================================
RCS file: /cvs/dist/rpms/util-linux/devel/util-linux-2.13-audit-hwclock.patch,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- util-linux-2.13-audit-hwclock.patch	25 Oct 2005 22:07:29 -0000	1.3
+++ util-linux-2.13-audit-hwclock.patch	3 Jan 2006 17:50:20 -0000	1.4
@@ -46,7 +46,7 @@
 +{
 +	if (audit_this) {
 +		audit_log_user_message(audit_fd, AUDIT_USYS_CONFIG, 
-+			"changing system time", NULL, NULL, NULL, status);
++			"changing system time", NULL, NULL, NULL, status ? 0 : 1);
 +		close(audit_fd);
 +	}
 +	exit(status);


Index: util-linux.spec
===================================================================
RCS file: /cvs/dist/rpms/util-linux/devel/util-linux.spec,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -r1.101 -r1.102
--- util-linux.spec	12 Dec 2005 16:28:43 -0000	1.101
+++ util-linux.spec	3 Jan 2006 17:50:20 -0000	1.102
@@ -25,7 +25,7 @@
 Summary: A collection of basic system utilities.
 Name: util-linux
 Version: 2.13
-Release: 0.12
+Release: 0.13
 License: distributable
 Group: System Environment/Base
 
@@ -161,7 +161,12 @@
 Patch218: util-linux-2.13-cramfs-zerofiles.patch
 # 172203 - mount man page in RHEL4 lacks any info on cifs mount options
 Patch219: util-linux-2.12a-mount-man-cifs.patch
-
+# better wide chars usage in the cal command (based on the old 'moremisc' patch)
+Patch220: util-linux-2.12p-cal-wide.patch
+# 176441: col truncates data
+Patch221: util-linux-2.12p-col-EILSEQ.patch
+# 174111 - mount allows loopback devices to be mounted more than once to the same mount point
+Patch222: util-linux-2.13-mount-twiceloop.patch
 
 # When adding patches, please make sure that it is easy to find out what bug # the 
 # patch fixes.
@@ -233,6 +238,9 @@
 %patch217 -p1
 %patch218 -p1
 %patch219 -p1
+%patch220 -p1
+%patch221 -p1
+%patch222 -p1
 
 %build
 unset LINGUAS || :
@@ -616,6 +624,12 @@
 /sbin/losetup
 
 %changelog
+* Tue Jan  3 2006 Karel Zak <kzak at redhat.com> 2.13-0.13
+- fix #174676 - hwclock audit return code mismatch
+- fix #176441: col truncates data
+- fix #174111 - mount allows loopback devices to be mounted more than once to the same mount point
+- better wide chars usage in the cal command (based on the old 'moremisc' patch)
+
 * Mon Dec 12 2005 Karel Zak <kzak at redhat.com> 2.13-0.12
 - rebuilt
 




More information about the fedora-cvs-commits mailing list