[linux-lvm] lvcreate segfault

Jay Weber jweber at valinux.com
Wed May 2 18:55:29 UTC 2001


And here's a fix.

--- lvcreate.c.orig	Wed May  2 12:08:43 2001
+++ lvcreate.c	Wed May  2 12:23:50 2001
@@ -448,6 +448,10 @@
       strncpy ( lv_snapshot_name, lv_name, sizeof ( lv_name) - 1);
       dummy = argv[optind];
       LVM_CHECK_DEFAULT_VG_NAME ( dummy, buffer, NAME_LEN);
+      if (dummy == NULL) {
+	fprintf(stderr, "%s -- snapshot name not present, supply -n
option!\n\n", cmd);
+	return LVM_EINVALID_CMD_LINE;
+      }
       strncpy ( lv_name, dummy, sizeof ( lv_name) - 1);
       dummy = NULL;
       lv_name[sizeof ( lv_name) - 1] = 0;


On Wed, 2 May 2001, Jay Weber wrote:

> Date: Wed, 2 May 2001 09:58:41 -0700 (PDT)
> From: Jay Weber <jweber at valinux.com>
> Reply-To: linux-lvm at sistina.com
> To: linux-lvm at sistina.com
> Subject: [linux-lvm] lvcreate segfault
>
> Hi,
>
> Just noticed this one.
>
> [root at slippey /root]# lvcreate -l5 -s snap /dev/vol/foo
> Segmentation fault (core dumped)
>
> Haven't looked at it much, off to a meeting now (sigh), but it appears to
> be a simple option parsing problem when using -s.
>
> A proper command for that to work would be:
> lvcreate -l5 -s -n snap /dev/vol/foo
>
> _______________________________________________
> linux-lvm mailing list
> linux-lvm at sistina.com
> http://lists.sistina.com/mailman/listinfo/linux-lvm
>




More information about the linux-lvm mailing list