1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

Add configure --with-default-name-mangling.

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.
This commit is contained in:
Peter Rajnoha 2012-02-15 11:17:57 +00:00
parent 351aefc8a0
commit 53f3ebce92
3 changed files with 28 additions and 0 deletions

View 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().

View 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)

View 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
*/