From 5d4c2354745c6ae50b56bcd52e20ac4ab23f6e34 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 14 Apr 2016 17:39:48 -0400 Subject: [PATCH] response --- ...eb15c0031c18ba6d0922bb7ae8ed3._comment.swo | Bin 0 -> 16384 bytes ..._35eeb15c0031c18ba6d0922bb7ae8ed3._comment | 89 ++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 doc/bugs/shouldn__39__t_keep_permissions_of_the_ssh_remote__63__/.comment_1_35eeb15c0031c18ba6d0922bb7ae8ed3._comment.swo create mode 100644 doc/bugs/shouldn__39__t_keep_permissions_of_the_ssh_remote__63__/comment_1_35eeb15c0031c18ba6d0922bb7ae8ed3._comment diff --git a/doc/bugs/shouldn__39__t_keep_permissions_of_the_ssh_remote__63__/.comment_1_35eeb15c0031c18ba6d0922bb7ae8ed3._comment.swo b/doc/bugs/shouldn__39__t_keep_permissions_of_the_ssh_remote__63__/.comment_1_35eeb15c0031c18ba6d0922bb7ae8ed3._comment.swo new file mode 100644 index 0000000000000000000000000000000000000000..66b87434fd6aee115f4d327e1f0da549b1ce1fdf GIT binary patch literal 16384 zcmeHOO^h5z6|NXU*npGBfXMM>y-L>JnckkCUGJ{FCTlyGMYh+<`bT7AwQIU-cG}z1 z)pYmlcnCPxKoAE6HzW`ehj2jTMotJJaRHJ8AR#3jkcbdMh+~j~fbUiHj3>M6wTw9+ zt4I4y&(zPWS6@}Vs`sY0gH^q{n=J;Gn>six)%kp=QS2RFZZ^TO1wm+-7w2S9cP|y zdwEBBS=RAV)z!K3y!nRb&HB3ARdMdsyvCeTt=gRLx{aD&TWHDoz+J4@TdiYKEvTU3 zctzQ}=~?EN3_NfQ^zwFf;h<>LYcBWg@Z?kUi9?qkxNepmDj6slC>bajC>bajC>baj zC>bajxHAKJazMO{>;pxS3&r!H9nTLH-#=D7y&d_**YZ&^P%=<5P%=<5P%=<5P%=<5 zP%=<5P%=<5P%`j;$bbxlcmvM;!H1z7e*Yi(|9^R0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*v`>0=*^xo^#099|ntTo1@XP3JdWcrR1 Annex a) -> Annex a + withShared a = a =<< coreSharedRepository <$> Annex.getGitConfig + + @@ -82,7 +88,7 @@ createAnnexDirectory dir = walk dir [] =<< top + setAnnexDirPerm p + + {- Normally, blocks writing to an annexed file, and modifies file + - - permissions to allow reading it. + + - permissions to not allow writing it and otherwise reflect the umask. + - + - When core.sharedRepository is set, the write bits are not removed from + - the file, but instead the appropriate group write bits are set. This is + @@ -98,9 +104,18 @@ freezeContent file = unlessM crippledFileSystem $ + addModes [ownerReadMode, groupReadMode, ownerWriteMode, groupWriteMode] + go AllShared = liftIO $ void $ tryIO $ modifyFileMode file $ + addModes (readModes ++ writeModes) + - go _ = liftIO $ modifyFileMode file $ + - removeModes writeModes . + - addModes [ownerReadMode] + +#ifndef mingw32_HOST_OS + + go _ = liftIO $ bracket + + (liftIO $ setFileCreationMask 0o22) -- set umask to get it + + (liftIO . setFileCreationMask) + + $ \umask -> modifyFileMode file $ + + removeModes writeModes . + + (\mode -> mode .&. complement umask) + +#else + + go _ = liftIO $ modifyFileMode file $ + + removeModes writeModes . + + addModes [ ownerReadMode ] + +#endif + + isContentWritePermOk :: FilePath -> Annex Bool + isContentWritePermOk file = ifM crippledFileSystem + +The umask-based mode setting could be put into every remote +that uses a transfer method that preserves permissions. (Including the +external special remote I suppose, since it *might* do so.) Or put in +`gitViaTmp` but there are a few places `getViaTmp` is used that do not +involve transfers from remotes. + +Also this would add the overhead of umask()+stat()+chmod()+umask() +to every file downloaded by git-annex, on top of the chmodding it already +does. +"""]]