return (a->lookup_gid)(a->lookup_gid_data, name, id);
return (id);
}
-
+
int64_t
archive_write_disk_uid(struct archive *_a, const char *name, la_int64_t id)
{
*/
mode = final_mode & 0777 & ~a->user_umask;
- /*
+ /*
* Always create writable such that [f]setxattr() works if we're not
* root.
*/
/*
* We are not the last element and we want to
* follow symlinks if they are a directory.
- *
+ *
* This is needed to extract hardlinks over
* symlinks.
*/
le = new_fixup(a, path);
if (le == NULL)
return (ARCHIVE_FATAL);
- le->fixup |=TODO_MODE_BASE;
+ le->fixup |= TODO_MODE_BASE;
le->mode = mode_final;
}
return (ARCHIVE_OK);
* don't add it to the fixup list here, as it's already been
* added.
*/
- if (la_stat(path, &st) == 0 && S_ISDIR(st.st_mode))
- return (ARCHIVE_OK);
+ if (errno == EEXIST) {
+ if (la_stat(path, &st) == 0) {
+ if (S_ISDIR(st.st_mode))
+ return (ARCHIVE_OK);
+ /* path exists but is not a directory */
+ errno = ENOTDIR;
+ } else {
+ /* restore original errno */
+ errno = EEXIST;
+ }
+ }
archive_set_error(&a->archive, errno, "Failed to create dir '%s'",
path);
#endif /* !_WIN32 || __CYGWIN__ */
-