]> granicus.if.org Git - zfs/commitdiff
Illumos 1765 - assert triggered in libzfs_import.c
authorPrasad Joshi <prasadjoshi124@gmail.com>
Sat, 4 Jul 2015 23:35:26 +0000 (01:35 +0200)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 14 Jul 2015 17:23:29 +0000 (10:23 -0700)
1765 assert triggered in libzfs_import.c trying to import pool
name beginning with a number
Reviewed-by: Garrett D'Amore <garrett@damore.org>
Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>

References:
  https://github.com/illumos/illumos-gate/commit/9edf9eb
  https://www.illumos.org/issues/1765

Ported-by: kernelOfTruth kerneloftruth@gmail.com
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #3562

cmd/zpool/zpool_main.c

index e6517574d0b5db801b5ca7b799717d65d9128aff..aa9b21dadf0c7b7a75c33bc77c917322717caf20 100644 (file)
@@ -25,6 +25,7 @@
  * Copyright (c) 2011, 2014 by Delphix. All rights reserved.
  * Copyright (c) 2012 by Frederik Wessels. All rights reserved.
  * Copyright (c) 2012 by Cyril Plisko. All rights reserved.
+ * Copyright (c) 2013 by Prasad Joshi (sTec). All rights reserved.
  */
 
 #include <assert.h>
@@ -2253,8 +2254,10 @@ zpool_do_import(int argc, char **argv)
 
                errno = 0;
                searchguid = strtoull(argv[0], &endptr, 10);
-               if (errno != 0 || *endptr != '\0')
+               if (errno != 0 || *endptr != '\0') {
                        searchname = argv[0];
+                       searchguid = 0;
+               }
                found_config = NULL;
 
                /*