rpms/mkinitrd/devel mkinitrd-6.0.12-mkblkdevs.patch, NONE, 1.1 mkinitrd-6.0.12-scsi-unique-segv.patch, NONE, 1.1 mkinitrd.spec, 1.214, 1.215

Peter Jones (pjones) fedora-extras-commits at redhat.com
Tue Aug 28 21:55:17 UTC 2007


Author: pjones

Update of /cvs/extras/rpms/mkinitrd/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12078

Modified Files:
	mkinitrd.spec 
Added Files:
	mkinitrd-6.0.12-mkblkdevs.patch 
	mkinitrd-6.0.12-scsi-unique-segv.patch 
Log Message:
Update to -2


mkinitrd-6.0.12-mkblkdevs.patch:

--- NEW FILE mkinitrd-6.0.12-mkblkdevs.patch ---
commit a6fa01690a8d68314bf17cf1417a0ee919dd2849
Author: Peter Jones <pjones at redhat.com>
Date:   Tue Aug 28 17:50:06 2007 -0400

    Process subdirs right in mkblkdevs

diff --git a/ChangeLog b/ChangeLog
index 2b04830..640fc8e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2007-08-28  Peter Jones  <pjones at redhat.com>
 
+	* nash/devtree.c (nash_dev_tree_add_sysfs_dir): Fix this to actually
+	process subdirectories correctly.
+
+2007-08-28  Peter Jones  <pjones at redhat.com>
+
 	* grubby/grubby.c: Add traceback() and install it as the signal
 	handler for SIGSEGV.
 
diff --git a/nash/devtree.c b/nash/devtree.c
index f8ec4d5..e1480aa 100644
--- a/nash/devtree.c
+++ b/nash/devtree.c
@@ -554,7 +554,11 @@ try_sysfs_dir(char *sysfs_path, struct nash_block_dev **dev)
     char *bang = NULL;
     struct nash_block_dev *tmp = NULL;
 
-    if ((ret = nashParseSysfsDevno(sysfs_path, &devno)) <= 0)
+    /* < 0 means other error
+     *   0 means "no sysfs_path/dev file"
+     * > 0 means there was one
+     */
+    if ((ret = nashParseSysfsDevno(sysfs_path, &devno)) < 0)
         return ret;
 
     /* we can't just assign it to *dev, or gcc decides it's unused */
@@ -572,17 +576,19 @@ try_sysfs_dir(char *sysfs_path, struct nash_block_dev **dev)
 int nash_dev_tree_add_sysfs_dir(nashContext *nc, char *path)
 {
     struct nash_block_dev *bdev = NULL;
-    struct nash_dev_node *node;
     int ret;
     struct stat sb;
     int errnum;
 
-    stat(path, &sb);
+    lstat(path, &sb);
     if (!S_ISDIR(sb.st_mode))
         return 0;
 
     ret = try_sysfs_dir(path, &bdev);
-    if (ret == 0) {
+    if (ret > 0)
+        nash_dev_tree_process_bdev(nc, bdev);
+
+    if (ret >= 0) {
         DIR *dir;
         struct dirent *dent;
         char *subdir;
@@ -602,10 +608,6 @@ int nash_dev_tree_add_sysfs_dir(nashContext *nc, char *path)
                 break;
         }
         save_errno(errnum, closedir(dir));
-    } else if (ret > 0) {
-        node = nash_dev_tree_process_bdev(nc, bdev);
-        if (node)
-            ret = 0;
     }
     return ret;
 }

mkinitrd-6.0.12-scsi-unique-segv.patch:

--- NEW FILE mkinitrd-6.0.12-scsi-unique-segv.patch ---
commit 165b957e8194de6e5e7c05991d3e8a883b9eb908
Author: Peter Jones <pjones at redhat.com>
Date:   Tue Aug 28 10:55:59 2007 -0400

    Fix a missing check for null on scsi unique id...

diff --git a/bdevid/scsi.c b/bdevid/scsi.c
index 8d0eb72..cb8b10a 100644
--- a/bdevid/scsi.c
+++ b/bdevid/scsi.c
@@ -691,22 +691,24 @@ out:
          * and model into the unique id for absolutely no reason at all.
          * arrrrgh.
          */
-        if (priv->vendor && priv->vendor[0]) {
-            int l = strlen(priv->vendor);
-            if (!strncmp(priv->vendor, priv->unique_id_83, l)) {
-                if (priv->unique_id_83[l] == '-')
-                    l++;
-                memmove(priv->unique_id_83, priv->unique_id_83 + l,
-                        strlen(priv->unique_id_83) - l + 1);
+        if (priv->unique_id_83) {
+            if (priv->vendor && priv->vendor[0]) {
+                int l = strlen(priv->vendor);
+                if (!strncmp(priv->vendor, priv->unique_id_83, l)) {
+                    if (priv->unique_id_83[l] == '-')
+                        l++;
+                    memmove(priv->unique_id_83, priv->unique_id_83 + l,
+                            strlen(priv->unique_id_83) - l + 1);
+                }
             }
-        }
-        if (priv->model && priv->model[0]) {
-            int l = strlen(priv->model);
-            if (!strncmp(priv->model, priv->unique_id_83, l)) {
-                if (priv->unique_id_83[l] == '-')
-                    l++;
-                memmove(priv->unique_id_83, priv->unique_id_83 + l,
-                        strlen(priv->unique_id_83) - l + 1);
+            if (priv->model && priv->model[0]) {
+                int l = strlen(priv->model);
+                if (!strncmp(priv->model, priv->unique_id_83, l)) {
+                    if (priv->unique_id_83[l] == '-')
+                        l++;
+                    memmove(priv->unique_id_83, priv->unique_id_83 + l,
+                            strlen(priv->unique_id_83) - l + 1);
+                }
             }
         }
         *privp = priv;


Index: mkinitrd.spec
===================================================================
RCS file: /cvs/extras/rpms/mkinitrd/devel/mkinitrd.spec,v
retrieving revision 1.214
retrieving revision 1.215
diff -u -r1.214 -r1.215
--- mkinitrd.spec	27 Aug 2007 21:51:06 -0000	1.214
+++ mkinitrd.spec	28 Aug 2007 21:54:45 -0000	1.215
@@ -3,10 +3,12 @@
 Summary: Creates an initial ramdisk image for preloading modules.
 Name: mkinitrd
 Version: 6.0.12
-Release: 1%{?dist}
+Release: 2%{?dist}
 License: GPL
 Group: System Environment/Base
 Source0: mkinitrd-%{version}.tar.bz2
+Patch0: mkinitrd-6.0.12-scsi-unique-segv.patch
+Patch1: mkinitrd-6.0.12-mkblkdevs.patch
 
 ExclusiveOs: Linux
 Prereq: dev
@@ -66,6 +68,8 @@
 
 %prep
 %setup -q -n mkinitrd-%{version}
+%patch0 -p1 -b .scsi-unique-segv
+%patch1 -p1 -b .mkblkdevs
 
 %build
 make LIB=%{_lib}
@@ -113,6 +117,10 @@
 %{_libdir}/libbdevid.so.*
 
 %changelog
+* Mon Aug 27 2007 Peter Jones <pjones at redhat.com> - 6.0.12-2
+- Fix segfault in scsi vpd probe code
+- Fix block device creation
+
 * Mon Aug 27 2007 Peter Jones <pjones at redhat.com> - 6.0.12-1
 - Unmerge one of the 'bash' branch changes; it's not ready yet.
 




More information about the fedora-extras-commits mailing list