fix perms for core.sharedRepository

These two missed setting it.

It rarely matters that the journal gets the right perm. But, when using
annex.alwayscommit=false, someone else may come along later and want
to append to the journal file.

It probably never matters what the sentinal perms are, but for
completeness..

Sponsored-by: Luke Shumaker on Patreon
This commit is contained in:
Joey Hess 2023-04-26 16:22:15 -04:00
parent f971b199ed
commit 0aa98aa09b
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 9 additions and 3 deletions

View file

@ -93,6 +93,8 @@ createInodeSentinalFile evenwithobjects =
s <- annexSentinalFile
createAnnexDirectory (parentDir (sentinalFile s))
liftIO $ writeSentinalFile s
setAnnexFilePerm (sentinalFile s)
setAnnexFilePerm (sentinalCacheFile s)
where
alreadyexists = liftIO. sentinalFileExists =<< annexSentinalFile
hasobjects

View file

@ -91,7 +91,10 @@ setJournalFile _jl ru file content = withOtherTmp $ \tmp -> do
let tmpfile = tmp P.</> jfile
liftIO $ withFile (fromRawFilePath tmpfile) WriteMode $ \h ->
writeJournalHandle h content
let mv = liftIO $ moveFile tmpfile (jd P.</> jfile)
let dest = jd P.</> jfile
let mv = do
liftIO $ moveFile tmpfile dest
setAnnexFilePerm dest
-- avoid overhead of creating the journal directory when it already
-- exists
mv `catchIO` (const (createAnnexDirectory jd >> mv))

View file

@ -29,9 +29,10 @@ git-annex (10.20230408) UNRELEASED; urgency=medium
--json-error-messages is enabled, output a JSON object indicating the
problem. (But git ls-files --error-unmatch still displays errors about
such files in some situations.)
* init: Bug fix: Create .git/annex/ and .git/annex/fsckdb/ directories with
permissions configured by core.sharedRepository.
* Warn about unsupported core.sharedRepository=0xxx when set.
* Bug fix: Create .git/annex/, .git/annex/fsckdb,
.git/annex/sentinal, .git/annex/sentinal.cache, and
.git/annex/journal/* with permissions configured by core.sharedRepository.
-- Joey Hess <id@joeyh.name> Sat, 08 Apr 2023 13:57:18 -0400