2 The UUID code in the mount command is broken -- en example UUID= in the fstab
3 file is reason for SIGSEG when non-root user tries umount any device.
4 -- 03/30/2006 Karel Zak <kzak@redhat.com>
6 --- util-linux-2.13-pre6/mount/mount_blkid.h.uuid 2006-03-29 15:34:24.000000000 +0200
7 +++ util-linux-2.13-pre6/mount/mount_blkid.h 2006-03-29 15:34:57.000000000 +0200
9 extern const char *mount_get_devname_by_uuid(const char *uuid);
10 extern const char *mount_get_devname_by_label(const char *label);
11 extern const char *mount_get_volume_label_by_spec(const char *spec);
12 +extern const char *mount_get_volume_uuid_by_spec(const char *spec);
13 extern const char *mount_get_devname(const char *spec);
14 extern const char *mount_get_devname_for_mounting(const char *spec);
15 --- util-linux-2.13-pre6/mount/mount_blkid.c.uuid 2006-03-29 15:33:44.000000000 +0200
16 +++ util-linux-2.13-pre6/mount/mount_blkid.c 2006-03-29 15:34:14.000000000 +0200
21 +mount_get_volume_uuid_by_spec(const char *spec) {
22 + return blkid_get_tag_value(blkid, "UUID", spec);
26 mount_get_devname(const char *spec) {
27 return blkid_get_devname(blkid, spec, 0);
29 --- util-linux-2.13-pre6/mount/fstab.c.uuid 2006-03-29 15:29:28.000000000 +0200
30 +++ util-linux-2.13-pre6/mount/fstab.c 2006-03-29 15:36:30.000000000 +0200
33 has_label(const char *device, const char *label) {
37 - devlabel = mount_get_volume_label_by_spec(device);
38 - ret = !strcmp(label, devlabel);
39 - /* free(devlabel); */
41 + if (!(devlabel = mount_get_volume_label_by_spec(device)))
43 + return !strcmp(label, devlabel);
47 has_uuid(const char *device, const char *uuid){
51 - devuuid = mount_get_devname_by_uuid(device);
52 - ret = !strcmp(uuid, devuuid);
53 - /* free(devuuid); */
55 + if (!(devuuid = mount_get_volume_uuid_by_spec(device)))
57 + return !strcmp(uuid, devuuid);
60 /* Find the entry (SPEC,FILE) in fstab */