site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:in-reply-to:references:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer; b=SLmAwZ0/XT0X6kE6AEh/f9bIHe1FYo43Cu9hHp9dq03eT6PxLf0egiM0V7srKa7/0+uNs1ZHGfJjq7/2vk92k3nfHxFNfxBgsbMecld59ZN/dFa08engL6dMDYg274T9d0t8zje78366IE+zLXzift4bp1Qdny9bnL0jMeWyX/Y= On 29/06/2006, at 2:49 PM, Jordan K. Hubbard wrote: and #include <stdio.h> #include <unistd.h> #include <fcntl.h> #include <err.h> #include <errno.h> #include <string.h> #include "copyfile.h" int main (int argc, char **argv) { char *fname_src = "/tmp"; char *template = "/tmp/test.XXXXX"; char fname[32]; char *fname_tmp; int fd; strncpy(fname, template, sizeof(fname)); fname_tmp = mktemp(fname); return 0; } -- Seeya...Q -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- _____ / Quinton Dolan - qdolan@gmail.com __ __/ / / __/ / / / __ / _/ / / Gold Coast, QLD, Australia __/ __/ __/ ____/ / - / Ph: +61 419 729 806 _______ / _\ _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... Actually attempting to test this just now (under 10.4.6) consistently leads to a rsync EXC_BAD_ACCESS crash in acl_from_text and copyfile. Basically this seems to occur anytime I try to rsync a file with both and ACL and EA. If you can send me your data as an attachment, or file a radar and attach the data to it, I'll see that it's looked at. It shouldn't crash, obviously. - Jordan If you want a couple more things to look into that are broken try these two: a) If chflags +uchg is set on a file copyfile() will replicate this onto rsync's temporary ._* files, which rsync is then unable to delete, and are left behind in /tmp. b) When acl's are disabled for a filesystem (sudo fsaclctl -p / -d) the following code works. With acl's enabled (sudo fsaclctl -p / -e) it fails. The difference is the behaviour of mktemp(3), without ACL's it will create a temporary file, with ACL's enabled it doesn't, a situation that copyfile() seems unable to handle. If you were to use mkstemp(3) instead this problem does not occur. if (fname_tmp && copyfile(fname_src, fname_tmp, NULL, COPYFILE_NOFOLLOW | COPYFILE_PACK | COPYFILE_METADATA)==0 && (fd = open(fname_tmp, O_RDONLY, 0)) >= 0) { printf("Copyfile worked\n"); unlink(fname_tmp); } else { printf("Copyfile failed\n"); printf("fname_tmp = %s\nfname_src = %s\nfd = %d\n", fname_tmp, fname_src, fd); err(errno, "%s", fname_tmp); } This email sent to site_archiver@lists.apple.com
participants (1)
-
Q