return (gettext("\tlist [-rH][-d max] "
"[-o property[,...]] [-t type[,...]] [-s property] ...\n"
"\t [-S property] ... "
- "[filesystem|volume|snapshot] ...\n"));
+ "[filesystem|volume|snapshot|snap] ...\n"));
case HELP_MOUNT:
return (gettext("\tmount\n"
"\tmount [-vO] [-o opts] <-a | filesystem>\n"));
case HELP_SHARE:
return (gettext("\tshare <-a | filesystem>\n"));
case HELP_SNAPSHOT:
- return (gettext("\tsnapshot [-r] [-o property=value] ... "
+ return (gettext("\tsnapshot|snap [-r] [-o property=value] ... "
"<filesystem@snapname|volume@snapname>\n"));
case HELP_UNMOUNT:
return (gettext("\tunmount [-f] "
boolean_t prtnum = B_FALSE;
boolean_t parseable = B_FALSE;
boolean_t sid2posix = B_FALSE;
- int error;
+ int error = 0;
int c;
zfs_sort_column_t *default_sortcol = NULL;
zfs_sort_column_t *sortcol = NULL;
flags &= ~ZFS_ITER_PROP_LISTSNAPS;
while (*optarg != '\0') {
static char *type_subopts[] = { "filesystem",
- "volume", "snapshot", "all", NULL };
+ "volume", "snapshot", "snap", "all", NULL };
switch (getsubopt(&optarg, type_subopts,
&value)) {
types |= ZFS_TYPE_VOLUME;
break;
case 2:
+ case 3:
types |= ZFS_TYPE_SNAPSHOT;
break;
- case 3:
+ case 4:
types = ZFS_TYPE_DATASET;
break;
zfs_free_sort_columns(sortcol);
if (ret == 0 && cb.cb_first && !cb.cb_scripted)
- (void) printf(gettext("no datasets available\n"));
+ (void) fprintf(stderr, gettext("no datasets available\n"));
return (ret);
}
while (curr < end) {
const char *who;
- zfs_deleg_who_type_t who_type;
+ zfs_deleg_who_type_t who_type = ZFS_DELEG_WHO_UNKNOWN;
char *endch;
char *delim = strchr(curr, ',');
char errbuf[256];
deleg_perm_node_t *deleg_node;
if (prev_weight != weight) {
- (void) printf(*title_ptr++);
+ (void) printf("%s", *title_ptr++);
prev_weight = weight;
}
const char *who = NULL;
if (prt_title) {
prt_title = B_FALSE;
- (void) printf(title);
+ (void) printf("%s", title);
}
switch (who_type) {
(void) snprintf(buf, ZFS_MAXNAMELEN+32,
gettext("---- Permissions on %s "),
node->fspn_fsperm.fsp_name);
- (void) printf(dsname);
+ (void) printf("%s", dsname);
left = 70 - strlen(buf);
while (left-- > 0)
(void) printf("-");
print_holds(scripted, cb.cb_max_namelen, cb.cb_max_taglen, nvl);
if (nvlist_empty(nvl))
- (void) printf(gettext("no datasets available\n"));
+ (void) fprintf(stderr, gettext("no datasets available\n"));
nvlist_free(nvl);
int flags = 0;
/* check options */
- while ((c = getopt(argc, argv, op == OP_MOUNT ? ":avo:" : "a"))
+ while ((c = getopt(argc, argv, op == OP_MOUNT ? ":avo:O" : "a"))
!= -1) {
switch (c) {
case 'a':
/* option validation is done later */
append_options(options, optarg);
break;
-
+ case 'O':
+ flags |= MS_OVERLAY;
+ break;
case ':':
(void) fprintf(stderr, gettext("missing argument for "
"'%c' option\n"), optopt);
cmdname = "receive";
/*
+ * The 'snap' command is an alias for 'snapshot'
+ */
+ if (strcmp(cmdname, "snap") == 0)
+ cmdname = "snapshot";
+
+ /*
* Special case '-?'
*/
if ((strcmp(cmdname, "-?") == 0) ||
/*
* Run the appropriate command.
*/
- libzfs_mnttab_cache(g_zfs, B_TRUE);
+ libzfs_mnttab_cache(g_zfs, B_FALSE);
if (find_command_idx(cmdname, &i) == 0) {
current_command = &command_table[i];
ret = command_table[i].func(argc - 1, argv + 1);
usage(B_FALSE);
ret = 1;
}
- libzfs_mnttab_cache(g_zfs, B_FALSE);
libzfs_fini(g_zfs);
(void) fclose(mnttab_file);