LVM2 ./WHATS_NEW_DM libdm/libdevmapper.h libdm ...
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: prajnoha at sourceware.org 2012-02-15 11:27:02
Modified files:
. : WHATS_NEW_DM libdm : libdevmapper.h libdm-common.c libdm-common.h libdm/ioctl : libdm-iface.c libdm-targets.h
Log message:
Mangle device name on dm_task_set_name/newname call if necessary.
If dm_task_set_name/newname is called, the name provided will be automatically translated to correct encoded form with the hex enconding so any character not on udev whitelist will be mangled with \xNN format where NN is hex value of the character used.
By default, the name mangling mode used is the one set during configure with the '--with-default-name-mangling' option.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW_DM.diff?cvsroot=lvm2&r1=1.558&r2=1.559
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdevmapper.h.diff?cvsroot=lvm2&r1=1.179&r2=1.180
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-common.c.diff?cvsroot=lvm2&r1=1.138&r2=1.139
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-common.h.diff?cvsroot=lvm2&r1=1.10&r2=1.11
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/ioctl/libdm-iface.c.diff?cvsroot=lvm2&r1=1.134&r2=1.135
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/ioctl/libdm-targets.h.diff?cvsroot=lvm2&r1=1.33&r2=1.34
WHATS_NEW_DM +2 -0
@@ -1,5 +1,7 @@ Version 1.02.71 - ==================================== + Mangle device name on dm_task_set_name/newname call if necessary. + Add dm_set/get_name_mangling_mode to set/get name mangling in libdevmapper. Add configure --with-default-name-mangling. Test for parsed words in _umount() dmeventd snapshot plugin. Fix memory leak in fail path of parse_loop_device_name() in dmsetup.
libdm/libdevmapper.h +6 -0
@@ -287,6 +287,12 @@ } dm_string_mangling_t;/* +* Set/get mangling mode used for device-mapper names. +*/ +int dm_set_name_mangling_mode (dm_string_mangling_t name_mangling); +dm_string_mangling_t dm_get_name_mangling_mode (void ); + +/* * Configure the device-mapper directory */ int dm_set_dev_dir (const char *dir);
libdm/libdm-common.c +217 -51
342 lines not on this page · raw message
libdm/libdm-common.h +3 -0
@@ -18,6 +18,9 @@#include "libdevmapper.h" +int mangle_name (const char *str,size_t len,char *buf, +size_t buf_len,dm_string_mangling_t mode); +struct target *create_target (uint64_t start,uint64_t len,const char *type,const char *params);
libdm/ioctl/libdm-iface.c +1 -5
@@ -450,6 +450,7 @@_dm_zfree_dmi (dmt->dmi.v4);dm_free (dmt->dev_name); +dm_free (dmt->mangled_dev_name);dm_free (dmt->newname);dm_free (dmt->message);dm_free (dmt->geometry);
@@ -674,11 +675,6 @@ MINOR(dmt->dmi.v4->dev), read_ahead); } -const char *dm_task_get_name (const struct dm_task *dmt) -{ -return (dmt->dmi.v4->name); -} -const char *dm_task_get_uuid (const struct dm_task *dmt) {return (dmt->dmi.v4->uuid);
libdm/ioctl/libdm-targets.h +1 -0
@@ -33,6 +33,7 @@struct dm_task {int type;char *dev_name; +char *mangled_dev_name;struct target *head, *tail;