mirror_zfs/lib/libzfs
Brian Behlendorf 1a5c611a22 Make command line guid parsing more tolerant
Several of the zfs utilities allow you to pass a vdev's guid rather
than the device name.  However, the utilities are not consistent in
how they parse that guid.  For example, 'zinject' expects the guid
to be passed as a hex value while 'zpool replace' wants it as a
decimal.  The user is forced to just know what format to use.

This patch improve things by making the parsing more tolerant.
When strtol(3) is called using 0 for the base, rather than say
10 or 16, it will then accept hex, decimal, or octal input based
on the prefix.  From the man page.

    If base is zero or 16, the string may then include a "0x"
    prefix, and  the number  will  be read in base 16; otherwise,
    a zero base is taken as 10 (decimal) unless the next character
    is '0', in which case it  is  taken as 8 (octal).

NOTE: There may be additional conversions not caught be this patch.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Chris Dunlap <cdunlap@llnl.gov>
Issue #2
2014-04-02 13:10:08 -07:00
..
libzfs_changelist.c Remove ZFC_IOC_*_MINOR ioctl()s 2013-12-16 09:15:57 -08:00
libzfs_config.c Illumos #3464 2013-09-04 16:01:24 -07:00
libzfs_dataset.c Remount datasets for "zfs inherit". 2014-03-24 11:11:15 -07:00
libzfs_diff.c Illumos #3464 2013-09-04 16:01:24 -07:00
libzfs_fru.c cstyle: Resolve C style issues 2013-12-18 16:46:35 -08:00
libzfs_graph.c Illumos #3464 2013-09-04 16:01:24 -07:00
libzfs_import.c cstyle: Resolve C style issues 2013-12-18 16:46:35 -08:00
libzfs_iter.c Illumos #4061 2013-11-05 12:24:10 -08:00
libzfs_mount.c cstyle: Resolve C style issues 2013-12-18 16:46:35 -08:00
libzfs_pool.c Make command line guid parsing more tolerant 2014-04-02 13:10:08 -07:00
libzfs_sendrecv.c Remove ZFC_IOC_*_MINOR ioctl()s 2013-12-16 09:15:57 -08:00
libzfs_status.c Add generic errata infrastructure 2014-02-21 12:10:40 -08:00
libzfs_util.c cstyle: Resolve C style issues 2013-12-18 16:46:35 -08:00
Makefile.am Fix libzfs_core changes to follow GNU libtool guidelines 2013-10-10 16:56:51 -07:00