Lines Matching defs:path
53 * read-only. In addition, if the "same" zone with a different root path is
317 * path and resolves them all down to an absolute path.
320 resolve_lofs(zlog_t *zlogp, char *path, size_t pathlen)
327 if ((len = resolvepath(path, tmppath, sizeof (tmppath))) == -1)
330 (void) strlcpy(path, tmppath, sizeof (tmppath));
350 if (strncmp(mnp->mnt_mountp, path, len) == 0 &&
351 (path[len] == '/' || path[len] == '\0'))
366 * want this path to be made read-write.
381 /* use temporary buffer because new path might be longer */
383 mnp->mnt_special, path + len);
384 if ((len = resolvepath(tmppath, path, pathlen)) == -1)
386 path[len] = '\0';
453 char path[MAXPATHLEN];
456 if (snprintf(path, sizeof (path), "%s%s", prefix, subdir) >
457 sizeof (path)) {
463 if (lstat(path, &st) == 0) {
478 "%s is not in /etc", path);
483 "%s is not a directory", path);
490 if (mkdirp(path, mode) != 0) {
494 "sure %s exists in the global zone.", path, subdir);
496 zerror(zlogp, B_TRUE, "mkdirp of %s failed", path);
500 (void) chown(path, userid, groupid);
584 * This converts a zone root path (normally of the form .../root) to a Live
677 char *path;
695 path = mnp->mnt_mountp;
705 if (umount2(path, MS_FORCE) == 0)
712 if (umount2(path, MS_FORCE) == 0) {
724 "unable to unmount '%s'", path);
732 if (!unmounted && umount2(path, 0) != 0)
786 forkexec(zlog_t *zlogp, const char *path, char *const argv[])
806 (void) execv(path, argv);
821 "signal %d", path, WTERMSIG(child_status));
826 zerror(zlogp, B_FALSE, "failed to exec %s", path);
833 isregfile(const char *path)
837 if (stat64(path, &st) == -1)
926 * Check if a given mount point path exists.
929 * component of the mount point path, so it must be a directory.
931 * path, so the mount point itself can be anything aside from a
934 * If the path is invalid then a negative value is returned. If the
935 * path exists and is a valid mount point path then 0 is returned.
936 * If the path doesn't exist return a positive value.
939 valid_mount_point(zlog_t *zlogp, const char *path, const boolean_t leaf)
945 if (lstat(path, &statbuf) != 0) {
948 zerror(zlogp, B_TRUE, "can't stat %s", path);
952 zerror(zlogp, B_FALSE, "%s is a symlink", path);
956 zerror(zlogp, B_FALSE, "%s is not a directory", path);
959 if ((res = resolvepath(path, respath, sizeof (respath))) == -1) {
960 zerror(zlogp, B_TRUE, "unable to resolve path %s", path);
964 if (strcmp(path, respath) != 0) {
968 zerror(zlogp, B_FALSE, "%s is not a canonical path", path);
975 * Validate a mount point path. A valid mount point path is an
976 * absolute path that either doesn't exist, or, if it does exists it
977 * must be an absolute canonical path that doesn't have any symbolic
978 * links in it. The target of a mount point path can be any filesystem
983 * If the path is invalid then a negative value is returned. If the
984 * path exists and is a valid mount point path then 0 is returned.
985 * If the path doesn't exist return a positive value.
995 * Sanity check the target mount point path.
1009 * to detect the end of paths below. If the path already ends
1011 * cannonical path check in valid_mount_point()).
1021 * Starting with rootpath, verify the mount path one component
1030 /* This is an intermediary mount path component. */
1033 /* This is the last component of the mount path. */
1194 char path[MAXPATHLEN];
1205 /* The mount point path doesn't exist, create it now. */
1216 * to make sure that the mount point path is canonical,
1217 * which it can only do if the path exists, so now that
1218 * we've created the path we have to verify it again.
1230 (void) snprintf(path, sizeof (path), "%s%s", rootpath,
1253 * already been pre-pended with any alternate root path by the
1274 * read-write path.
1308 fsptr->zone_fs_special, path)) != 0)
1322 return (mount_one_dev(zlogp, path, mount_cmd));
1651 * source path for a lofs mount in a given zone needs
1694 zerror(zlogp, B_TRUE, "unable to determine zone path");
2901 char path[MAXPATHLEN];
2935 (void) snprintf(path, sizeof (path), "%s%s", rootpath,
2937 if (di_prof_init(path, &prof) != 0) {
3664 * Return true if the path is its own zfs file system. We determine this
3665 * by stat-ing the path to see if it is zfs and stat-ing the parent to see
3672 char *path;
3682 if ((path = strdup(zonepath)) == NULL)
3685 parent = dirname(path);
3687 free(path);
3718 zerror(zlogp, B_TRUE, "unable to determine zone path");
3732 zerror(zlogp, B_FALSE, "cannot open ZFS dataset for path '%s'",
3957 /* Skip over zones with bad path */
4075 char path[MAXPATHLEN];
4144 /* Skip over zones with bad path */
4153 if (snprintf(path, MAXPATHLEN,
4159 (void) umount(path);
4167 (void) snprintf(path, MAXPATHLEN, "/zone/%s/home", zone_name);
4169 (void) umount(path);
4737 * Next, we reduce to the shortest path and search for loopback mounts
4769 * zone. First, resolve the root path down so that we're not
5187 zerror(zlogp, B_FALSE, "unable to determine zone path");