From c6c794a27d7df0a3303b431b0b0b3c97e48d6deb Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 15 Oct 2024 13:27:27 -0400 Subject: [PATCH] comment --- Remote/Directory.hs | 6 +++--- ..._83dc4e317e09ad1e24fdd3ee347edb43._comment | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 doc/bugs/p2phttp__58___drop_difference_wideopen_unauth-readonly/comment_3_83dc4e317e09ad1e24fdd3ee347edb43._comment diff --git a/Remote/Directory.hs b/Remote/Directory.hs index cebd5e61fe..868dc43611 100644 --- a/Remote/Directory.hs +++ b/Remote/Directory.hs @@ -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) diff --git a/doc/bugs/p2phttp__58___drop_difference_wideopen_unauth-readonly/comment_3_83dc4e317e09ad1e24fdd3ee347edb43._comment b/doc/bugs/p2phttp__58___drop_difference_wideopen_unauth-readonly/comment_3_83dc4e317e09ad1e24fdd3ee347edb43._comment new file mode 100644 index 0000000000..4bea40da62 --- /dev/null +++ b/doc/bugs/p2phttp__58___drop_difference_wideopen_unauth-readonly/comment_3_83dc4e317e09ad1e24fdd3ee347edb43._comment @@ -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. +"""]]