Lines Matching defs:path
35 safely_chroot(const char *path, uid_t uid)
41 if (*path != '/')
42 fatal("chroot path does not begin at root");
43 if (strlen(path) >= sizeof(component))
44 fatal("chroot path too long");
47 * Descend the path, checking that each component is a
50 for (cp = path; cp != NULL;) {
52 strlcpy(component, path, sizeof(component));
55 memcpy(component, path, cp - path);
56 component[cp - path] = '\0';
69 fatal("chroot path %s\"%s\" is not a directory",
74 if (chdir(path) == -1)
75 fatal("Unable to chdir to chroot path \"%s\": "
76 "%s", path, strerror(errno));
121 /* for each component of the canonical path, walking upwards */
142 * dirname should always complete with a "/" path,
154 fprintf(stderr, "check-perm -m [chroot | keys-command] [path]\n");
161 const char *path = ".";
190 path = argv[0];
193 safely_chroot(path, getuid());
195 if (stat(path, &st) < 0)
196 fatal("Could not stat %s: %s", path, strerror(errno));
197 if (auth_secure_path(path, &st, NULL, 0,
199 fatal("Unsafe %s: %s", path, errmsg);