]> sourceware.org Git - lvm2.git/commitdiff
Add configure --with-default-name-mangling.
authorPeter Rajnoha <prajnoha@redhat.com>
Wed, 15 Feb 2012 11:17:57 +0000 (11:17 +0000)
committerPeter Rajnoha <prajnoha@redhat.com>
Wed, 15 Feb 2012 11:17:57 +0000 (11:17 +0000)
This option configures the default name mangling mode used, one of:
AUTO, NONE and HEX.

The name mangling is primarily used to support udev character whitelist
(0-9, A-Z, a-z, #*-.:=@_) so any character that is not on udev whitelist
will get translated into an encoded form \xNN where NN is the hex value
of the character.

WHATS_NEW_DM
configure.in
libdm/libdevmapper.h

index 0f598c6d4684432282ef874296fffbc60fbe5762..86f5633370af08f44a64acf90df390a465e126fd 100644 (file)
@@ -1,5 +1,6 @@
 Version 1.02.71 - 
 ====================================
+  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.
   Check for missing reply_uuid in dm_event_get_registered_device().
index a4006bcb3b600da031339a692ccaeb6452e2d93e..784cfa1c4fc3636b02e6a65a354342c76eaa4491 100644 (file)
@@ -229,6 +229,20 @@ esac
 AC_MSG_RESULT(on $ADD_NODE)
 AC_DEFINE_UNQUOTED([DEFAULT_DM_ADD_NODE], $add_on, [Define default node creation behavior with dmsetup create])
 
+AC_MSG_CHECKING(default name mangling)
+AC_ARG_WITH(default-name-mangling,
+           AC_HELP_STRING([--with-default-name-mangling=MANGLING],
+                          [default name mangling: auto/none/hex [[MANGLING=auto]]]),
+           MANGLING=$withval, MANGLING=auto)
+case "$MANGLING" in
+ auto) mangling=DM_STRING_MANGLING_AUTO;;
+ disabled) mangling=DM_STRING_MANGLING_NONE;;
+ hex) mangling=DM_STRING_MANGLING_HEX;;
+ *) AC_MSG_ERROR([--with-default-name-mangling parameter invalid]);;
+esac
+AC_MSG_RESULT($MANGLING)
+AC_DEFINE_UNQUOTED([DEFAULT_DM_NAME_MANGLING], $mangling, [Define default name mangling behaviour])
+
 ################################################################################
 dnl -- LVM1 tool fallback option
 AC_MSG_CHECKING(whether to enable lvm1 fallback)
index 61a4374f74e2b377b3345a53d38b9e0f3f4aab1b..b7bb94f16ff82aa35307af42529213a0098b6259 100644 (file)
@@ -273,6 +273,19 @@ int dm_task_run(struct dm_task *dmt);
  */
 void dm_task_update_nodes(void);
 
+/*
+ * Mangling support
+ *
+ * Character whitelist: 0-9, A-Z, a-z, #+-.:=@_
+ * HEX mangling format: \xNN, NN being the hex value of the character.
+ * (whitelist and format supported by udev)
+*/
+typedef enum {
+       DM_STRING_MANGLING_NONE, /* do not mangle at all */
+       DM_STRING_MANGLING_AUTO, /* mangle only if not already mangled with hex, error when mixed */
+       DM_STRING_MANGLING_HEX   /* always mangle with hex encoding, no matter what the input is */
+} dm_string_mangling_t;
+
 /*
  * Configure the device-mapper directory
  */
This page took 0.036968 seconds and 5 git commands to generate.