> + }
> + }
> +
> + argc -= optind;
> + argv += optind;
> +
> + /* get vdev name */
> + if (argc < 1) {
> + (void) fprintf(stderr, gettext("missing vdev device name\n"));
> + usage(B_FALSE);
> + }
> +
> + /* Allow bare paths if they exist, otherwise prepend. */
> + if (stat(argv[0], &st) != 0 &&
> + strncmp(argv[0], ZFS_DISK_ROOTD, strlen(ZFS_DISK_ROOTD)) != 0)
> + ret = asprintf(&vdev, ZFS_DISK_ROOTD "%s", argv[0]);
printf args should be `"%s%s", ZFS_DISK_ROOTD, argv[0]` so that strange chars
in ZFS_DISK_ROOTD can't confuse printf (and so we aren't relying on the macro
evaluating to a string literal)
---
Reply to this email directly or view it on GitHub:
https://github.com/openzfs/openzfs/pull/32/files#r50648985
_______________________________________________
developer mailing list
developer@open-zfs.org
http://lists.open-zfs.org/mailman/listinfo/developer