blinksh / blinksh/blink

Creating/modifying files via Files.app fails with "SFTP server: Permission denied" despite correct permissions

Open
#2,109 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Swift
Stars
6.9k
Forks
746
PR merge metrics
No merged PRs in 30d

Description

### Checklist

- [ ] Using latest version on the [App Store](http://itunes.apple.com/app/id1156707581)
- [X] Read the [docs](http://blink.sh/docs/)
- [X] Searched for [existing GitHub issues](https://github.com/blinksh/blink/issues)

### Configuration

Blink v18.1.1.979 (TestFlight), iOS 18.3.2

### Describe the bug

Trying to create a new file or modify an existing file in the Blink file provider fails. The log shows "SFTP server: Permission denied". Modifying or creating the file over SSH in the Blink app works as expected, and creating new folders or deleting files via Files.app also works as expected. Uploading a file via the macOS sftp client works as well.

Edit: In fact, trying to edit an existing file deletes (!!!!!) the file on the remote server. Good thing I have backups.

### Expected behavior
Modifying files in the remote storage via the File Provider works.

### Screenshots

![image](https://github.com/user-attachments/assets/4fda5ddc-deaf-469e-a142-5d1913b4abcd)

 [2025-03-17T03:10:09Z] : [INFO] : createItem Test.txt : Requested with NSFileProviderItemFields: [.contents, .filename, .parentItemIdentifier, .typeAndCreator, .creationDate, .contentModificationDate, .lastUsedDate] and NSFileProviderCreateItemOptions: []

[2025-03-17T03:10:09Z] : [INFO] : createItem Test.txt : Is a File
[2025-03-17T03:10:09Z] : [INFO] : createItem Test.txt : Creating file saiko/Test.txt...
[2025-03-17T03:10:09Z] : [DEBUG] : createItem Test.txt : Ensure can create file at saiko with Test.txt
[2025-03-17T03:10:09Z] : [DEBUG] : createItem Test.txt : No file. Can create.
[2025-03-17T03:10:09Z] : [DEBUG] : createItem Test.txt : Copy file .blink.tmp.67318699...
[2025-03-17T03:10:09Z] : [ERROR] : createItem Test.txt : Creating file error: Fail(msg: "SFTP server: Permission denied")
[2025-03-17T03:10:10Z] : [INFO] : WorkingSet : Timer triggered
[2025-03-17T03:10:10Z] : [INFO] : WorkingSet : Preparing changes. 0 items in commit.
[2025-03-17T03:10:10Z] : [INFO] : WorkingSet : No changes.
[2025-03-17T03:10:14Z] : [DEBUG] : WorkingSet : Deinit

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the failure from Files.app using the reported Blink and iOS versions, then trace the File Provider `createItem` path indicated by the log, including the temporary-file copy operation. Done means creating and editing remote files succeeds without permission errors or deleting the original, while folder creation, deletion, and SSH behavior remain intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.