}
free(name);
+ struct adouble ad;
+ ad_init(&ad, dvolume.volinfo.v_adouble, dvolume.volinfo.v_ad_options);
+ if (ad_open_metadata(to, S_ISDIR(sb.st_mode) ? ADFLAGS_DIR : 0, O_RDWR, &ad) != 0) {
+ SLOG("Error opening adouble for: %s", to);
+ return 1;
+ }
+ ad_setid(&ad, sb.st_dev, sb.st_ino, cnid, newdid, dvolume.db_stamp);
+ ad_flush(&ad);
+ ad_close_metadata(&ad);
+
if (vflg)
printf("%s -> %s\n", from, to);
return (0);
execl(adexecp, "cp", vflg ? "-Rpv" : "-Rp", "--", from, to, (char *)NULL);
_exit(1);
}
- if (waitpid(pid, &status, 0) == -1) {
+ while ((waitpid(pid, &status, 0)) == -1) {
+ if (errno == EINTR)
+ continue;
SLOG("%s %s %s: waitpid: %s", adexecp, from, to, strerror(errno));
return (1);
}
case 0:
break;
default:
- SLOG("%s %s %s: terminated with %d (non-zero) status",
+ SLOG("%s cp %s %s: terminated with %d (non-zero) status",
adexecp, from, to, WEXITSTATUS(status));
return (1);
}
execl(adexecp, "rm", "-Rf", "--", from, (char *)NULL);
_exit(1);
}
- if (waitpid(pid, &status, 0) == -1) {
- SLOG("%s %s: waitpid: %s", adexecp, from, strerror(errno));
+ while ((waitpid(pid, &status, 0)) == -1) {
+ if (errno == EINTR)
+ continue;
+ SLOG("%s rm %s: waitpid: %s", adexecp, from, strerror(errno));
return (1);
}
if (!WIFEXITED(status)) {
- SLOG("%s %s: did not terminate normally", adexecp, from);
+ SLOG("%s rm %s: did not terminate normally", adexecp, from);
return (1);
}
switch (WEXITSTATUS(status)) {
case 0:
break;
default:
- SLOG("%s %s: terminated with %d (non-zero) status",
+ SLOG("%s rm %s: terminated with %d (non-zero) status",
adexecp, from, WEXITSTATUS(status));
return (1);
}
LOG(log_debug7, logtype_afpd, "set_acl: copied %d inherited ACEs", new_aces_count);
/* Now the ACEs from the client */
- if (EC_NEG1_CUSTOM(map_acl(DARWIN_2_SOLARIS,
- &new_aces[new_aces_count],
- daces,
- ace_count))) {
+ if ((ret = (map_acl(DARWIN_2_SOLARIS,
+ &new_aces[new_aces_count],
+ daces,
+ ace_count))) == -1) {
EC_STATUS(AFPERR_PARAM);
goto EC_CLEANUP;
}
/* Ressourcefork first.
Note: for dirs we set the same ACL on the .AppleDouble/.Parent _file_. This
might be strange for ACE_DELETE_CHILD and for inheritance flags. */
- if (EC_ZERO_CUSTOM(vol->vfs->vfs_acl(vol, name, ACE_SETACL, new_aces_count, new_aces))) {
+ if ((ret = (vol->vfs->vfs_acl(vol, name, ACE_SETACL, new_aces_count, new_aces))) != 0) {
LOG(log_error, logtype_afpd, "set_acl: error setting acl: %s", strerror(errno));
if (errno == (EACCES | EPERM))
EC_STATUS(AFPERR_ACCESS);
EC_STATUS(AFPERR_MISC);
goto EC_CLEANUP;
}
- if (EC_ZERO_CUSTOM(acl(name, ACE_SETACL, new_aces_count, new_aces))) {
+ if ((ret = (acl(name, ACE_SETACL, new_aces_count, new_aces)) != 0) {
LOG(log_error, logtype_afpd, "set_acl: error setting acl: %s", strerror(errno));
if (errno == (EACCES | EPERM))
EC_STATUS(AFPERR_ACCESS);