Lines Matching defs:path

240 	 * Full path of last file to satisfy symlink checks.
437 la_opendirat(int fd, const char *path) {
461 return (open(path, flags));
463 return (openat(fd, path, flags));
586 * Clean up the requested path. This is necessary for correct
766 /* If path exceeds PATH_MAX, shorten the path. */
817 * because it is relative to the base dir and the edited path
1963 * intermediate dir and edit the path down to a shorter suffix. Note
1976 /* If path is short, avoid the open() below. */
1986 /* As long as the path is too long... */
1992 /* Exit if we find a too-long path component. */
2004 /* The chdir() succeeded; we've now shortened the path. */
2233 * TODO: consider using the cleaned-up path as the link
2634 int err, const char *errstr, const char *path)
2639 archive_string_sprintf(a_estr, "%s%s", errstr, path);
2644 * scan the path and both can be optimized by comparing against other
2648 * Checks the given path to see if any elements along it are symlinks. Returns
2652 check_symlinks_fsobj(char *path, int *a_eno, struct archive_string *a_estr,
2658 (void)path; /* UNUSED */
2677 if(path[0] == '\0')
2689 * head points to the current (relative) path
2699 "Could not open ", path);
2702 head = path;
2703 tail = path;
2706 /* Skip the root directory if the path is absolute. */
2707 if(tail == path && tail[0] == '/')
2710 * head, tail, path all alias the same string, which is
2721 /* Skip the next path element. */
2724 /* is this the last path component? */
2754 "Could not stat ", path);
2775 "Could not chdir ", path);
2798 path);
2814 if (!S_ISLNK(path)) {
2816 "Removing symlink ", path);
2833 "symlink ", path);
2859 "Could not stat ", path);
2880 "Could not chdir ", path);
2893 "symlink ", path);
2900 "Cannot extract through symlink ", path);
2962 * 1. Convert a path separator from '\' to '/' .
2970 cleanup_pathname_win(char *path)
2981 for (p = path; *p != '\0'; p++) {
2995 /* Rewrite the path name if its next character is unusable. */
3004 * Convert path separator in wide-character.
3006 p = path;
3028 * error for an empty path, a trailing '..', (if _SECURE_NODOTDOT is
3029 * set) any '..' in the path or (if ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS
3030 * is set) if the path is absolute.
3033 cleanup_pathname_fsobj(char *path, int *a_eno, struct archive_string *a_estr,
3039 dest = src = path;
3047 cleanup_pathname_win(path);
3112 * We've just copied zero or more path elements, not including the
3115 if (dest == path) {
3117 * Nothing got copied. The path must have been something
3148 * Create the parent directory of the specified path, assuming path
3152 create_parent_dir(struct archive_write_disk *a, char *path)
3158 slash = strrchr(path, '/');
3162 r = create_dir(a, path);
3170 * Returns ARCHIVE_OK if the path exists when we're done here.
3172 * Assumes path is in mutable storage; path is unchanged on exit.
3175 create_dir(struct archive_write_disk *a, char *path)
3184 slash = strrchr(path, '/');
3186 base = path;
3193 /* Don't bother trying to create null path, '.', or '..'. */
3196 r = create_dir(a, path);
3208 if (la_stat(path, &st) == 0) {
3213 "Can't create directory '%s'", path);
3216 if (unlink(path) != 0) {
3220 path);
3226 "Can't test directory '%s'", path);
3230 r = create_dir(a, path);
3249 if (mkdir(path, mode) == 0) {
3251 le = new_fixup(a, path);
3266 if (la_stat(path, &st) == 0 && S_ISDIR(st.st_mode))
3270 path);
3454 * ctime, fall back to default code path below if it fails