zoneadm.c (20c8013f7d176d8bb197f289e6b14411470350cf) zoneadm.c (5c358068de4c8e0501c222176f3b0f4559531dd3)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
8 *

--- 1931 unchanged lines hidden (view full) ---

1940verify_fs_zfs(struct zone_fstab *fstab)
1941{
1942 zfs_handle_t *zhp;
1943 char propbuf[ZFS_MAXPROPLEN];
1944
1945 zfs_set_error_handler(zfs_fs_err_handler);
1946
1947 if ((zhp = zfs_open(fstab->zone_fs_special, ZFS_TYPE_ANY)) == NULL) {
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
8 *

--- 1931 unchanged lines hidden (view full) ---

1940verify_fs_zfs(struct zone_fstab *fstab)
1941{
1942 zfs_handle_t *zhp;
1943 char propbuf[ZFS_MAXPROPLEN];
1944
1945 zfs_set_error_handler(zfs_fs_err_handler);
1946
1947 if ((zhp = zfs_open(fstab->zone_fs_special, ZFS_TYPE_ANY)) == NULL) {
1948 (void) fprintf(stderr, gettext("cannot verify fs %s: "
1948 (void) fprintf(stderr, gettext("could not verify fs %s: "
1949 "could not access zfs dataset '%s'\n"),
1950 fstab->zone_fs_dir, fstab->zone_fs_special);
1951 return (Z_ERR);
1952 }
1953
1954 if (zfs_get_type(zhp) != ZFS_TYPE_FILESYSTEM) {
1955 (void) fprintf(stderr, gettext("cannot verify fs %s: "
1956 "'%s' is not a filesystem\n"),
1957 fstab->zone_fs_dir, fstab->zone_fs_special);
1958 zfs_close(zhp);
1959 return (Z_ERR);
1960 }
1961
1962 if (zfs_prop_get(zhp, ZFS_PROP_MOUNTPOINT, propbuf, sizeof (propbuf),
1963 NULL, NULL, 0, 0) != 0 || strcmp(propbuf, "legacy") != 0) {
1949 "could not access zfs dataset '%s'\n"),
1950 fstab->zone_fs_dir, fstab->zone_fs_special);
1951 return (Z_ERR);
1952 }
1953
1954 if (zfs_get_type(zhp) != ZFS_TYPE_FILESYSTEM) {
1955 (void) fprintf(stderr, gettext("cannot verify fs %s: "
1956 "'%s' is not a filesystem\n"),
1957 fstab->zone_fs_dir, fstab->zone_fs_special);
1958 zfs_close(zhp);
1959 return (Z_ERR);
1960 }
1961
1962 if (zfs_prop_get(zhp, ZFS_PROP_MOUNTPOINT, propbuf, sizeof (propbuf),
1963 NULL, NULL, 0, 0) != 0 || strcmp(propbuf, "legacy") != 0) {
1964 (void) fprintf(stderr, gettext("cannot verify fs %s: zfs '%s' "
1965 "mountpoint is not \"legacy\"\n"),
1964 (void) fprintf(stderr, gettext("could not verify fs %s: "
1965 "zfs '%s' mountpoint is not \"legacy\"\n"),
1966 fstab->zone_fs_dir, fstab->zone_fs_special);
1967 zfs_close(zhp);
1968 return (Z_ERR);
1969 }
1970
1971 zfs_close(zhp);
1972 return (Z_OK);
1973}

--- 5 unchanged lines hidden (view full) ---

1979verify_fs_special(struct zone_fstab *fstab)
1980{
1981 struct stat st;
1982
1983 if (strcmp(fstab->zone_fs_type, MNTTYPE_ZFS) == 0)
1984 return (verify_fs_zfs(fstab));
1985
1986 if (stat(fstab->zone_fs_special, &st) != 0) {
1966 fstab->zone_fs_dir, fstab->zone_fs_special);
1967 zfs_close(zhp);
1968 return (Z_ERR);
1969 }
1970
1971 zfs_close(zhp);
1972 return (Z_OK);
1973}

--- 5 unchanged lines hidden (view full) ---

1979verify_fs_special(struct zone_fstab *fstab)
1980{
1981 struct stat st;
1982
1983 if (strcmp(fstab->zone_fs_type, MNTTYPE_ZFS) == 0)
1984 return (verify_fs_zfs(fstab));
1985
1986 if (stat(fstab->zone_fs_special, &st) != 0) {
1987 (void) fprintf(stderr, gettext("cannot verify fs "
1987 (void) fprintf(stderr, gettext("could not verify fs "
1988 "%s: could not access %s: %s\n"), fstab->zone_fs_dir,
1989 fstab->zone_fs_special, strerror(errno));
1990 return (Z_ERR);
1991 }
1992
1993 if (strcmp(st.st_fstype, MNTTYPE_NFS) == 0) {
1994 /*
1995 * TRANSLATION_NOTE

--- 1745 unchanged lines hidden ---
1988 "%s: could not access %s: %s\n"), fstab->zone_fs_dir,
1989 fstab->zone_fs_special, strerror(errno));
1990 return (Z_ERR);
1991 }
1992
1993 if (strcmp(st.st_fstype, MNTTYPE_NFS) == 0) {
1994 /*
1995 * TRANSLATION_NOTE

--- 1745 unchanged lines hidden ---