From 137f209a3fa7b1fe867be5823ba4cffa911dcac7 Mon Sep 17 00:00:00 2001 From: Andy McFadden Date: Tue, 6 Jan 2015 10:50:30 -0800 Subject: [PATCH] Set the Finder info before the access permissions Looks like setxattr() requires write access, so we need to set the Finder info before we "lock" the file. --- nufxlib/FileIO.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nufxlib/FileIO.c b/nufxlib/FileIO.c index c4c11db..9d20366 100644 --- a/nufxlib/FileIO.c +++ b/nufxlib/FileIO.c @@ -1097,15 +1097,16 @@ NuError Nu_CloseOutputFile(NuArchive* pArchive, const NuRecord* pRecord, err = Nu_SetFileDates(pArchive, pRecord, pathnameUNI); BailError(err); - err = Nu_SetFileAccess(pArchive, pRecord, pathnameUNI); - BailError(err); - #if defined(MAC_LIKE) /* could also do this earlier and pass the fd for fsetxattr */ + /* NOTE: must do this before Nu_SetFileAccess */ err = Nu_SetFinderInfo(pArchive, pRecord, pathnameUNI); BailError(err); #endif + err = Nu_SetFileAccess(pArchive, pRecord, pathnameUNI); + BailError(err); + bail: return kNuErrNone; }