Skip to content

Commit e010a95

Browse files
committed
test(files): cover live photo peers in read-only shares
Add integration tests that renaming a live photo still renames its peer, and that a peer in a share without delete permission is not moved out of the share. The move step now also records server errors, as an aborted live photo rename answers with a 500. Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-4RX49FAX. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent c1dd135 commit e010a95

2 files changed

Lines changed: 23 additions & 1 deletion

File tree

‎build/integration/features/bootstrap/WebDav.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public function userMovesFile($user, $entry, $fileSource, $fileDestination) {
113113
$headers['Destination'] = $fullUrl . $fileDestination;
114114
try {
115115
$this->response = $this->makeDavRequest($user, 'MOVE', $fileSource, $headers);
116-
} catch (\GuzzleHttp\Exception\ClientException $e) {
116+
} catch (\GuzzleHttp\Exception\BadResponseException $e) {
117117
$this->response = $e->getResponse();
118118
}
119119
}

‎build/integration/files_features/live-photos.feature‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,25 @@ Feature: live photos
8989
And as "user0" the file "/local_storage/live-photos/IMG.jpg" exists
9090
And as "user0" the file "/IMG.jpg" does not exist
9191
And User "user0" deletes folder "/local_storage/live-photos"
92+
93+
Scenario: Renaming a live photo also renames its peer
94+
Given User "user0" uploads file with content "photo" to "/photo.jpg"
95+
And User "user0" uploads file with content "video" to "/photo.mov"
96+
And User "user0" links "/photo.jpg" as live photo to "/photo.mov"
97+
And User "user0" links "/photo.mov" as live photo to "/photo.jpg"
98+
When User "user0" moves file "/photo.jpg" to "/renamed.jpg"
99+
Then as "user0" the file "/renamed.jpg" exists
100+
And as "user0" the file "/renamed.mov" exists
101+
And as "user0" the file "/photo.mov" does not exist
102+
103+
Scenario: Renaming a live photo does not move its peer out of a read-only share
104+
Given user "user1" exists
105+
And User "user0" created a folder "/handbook"
106+
And User "user0" uploads file with content "chapter one" to "/handbook/chapter.txt"
107+
And folder "/handbook" of user "user0" is shared with user "user1" with permissions 1
108+
And User "user1" uploads file with content "photo" to "/photo.jpg"
109+
And User "user1" links "/photo.jpg" as live photo to "/handbook/chapter.txt"
110+
When User "user1" moves file "/photo.jpg" to "/mine.jpg"
111+
Then as "user0" the file "/handbook/chapter.txt" exists
112+
And as "user1" the file "/handbook/chapter.txt" exists
113+
And as "user1" the file "/mine.txt" does not exist

0 commit comments

Comments
 (0)