This commit is contained in:
Joey Hess 2024-10-15 13:27:27 -04:00
parent c1b0348307
commit c6c794a27d
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 22 additions and 3 deletions

View file

@ -252,9 +252,9 @@ finalizeStoreGeneric d tmp dest = do
retrieveKeyFileM :: RawFilePath -> ChunkConfig -> CopyCoWTried -> Retriever
retrieveKeyFileM d (LegacyChunks _) _ = Legacy.retrieve locations' d
retrieveKeyFileM d NoChunks cow = fileRetriever' $ \dest k p iv -> do
src <- liftIO $ fromRawFilePath <$> getLocation d k
void $ liftIO $ fileCopier cow src (fromRawFilePath dest) p iv
--retrieveKeyFileM d NoChunks cow = fileRetriever' $ \dest k p iv -> do
-- src <- liftIO $ fromRawFilePath <$> getLocation d k
-- void $ liftIO $ fileCopier cow src (fromRawFilePath dest) p iv
retrieveKeyFileM d _ _ = byteRetriever $ \k sink ->
sink =<< liftIO (L.readFile . fromRawFilePath =<< getLocation d k)

View file

@ -0,0 +1,19 @@
[[!comment format=mdwn
username="joey"
subject="""comment 3"""
date="2024-10-15T16:33:06Z"
content="""
It's not a special case about locking. p2phttp always uses 403 when
the mode it's serving does not allow the class of action.
Eg with --unauth-appendonly a remove request will cause a 403 response.
And with --unauth-readonly any non-read request does.
The docs say:
"When authentication is successful but does not allow a request to be
performed, it will fail with 403 Forbidden."
A 401 does make git-annex prompt for a password. p2phttp responds to that
when --authenv is used and the client didn't basic authenticate.
"""]]