mautrix / imessage

A Matrix-iMessage puppeting bridge
https://go.mau.fi/mautrix-imessage/
GNU Affero General Public License v3.0
341 stars 37 forks source link

Update permissions of temporary file because the native imessage agent on iOS doesn't have root permissions #44

Closed CarlAmbroselli closed 2 years ago

CarlAmbroselli commented 2 years ago

Sorry for filing https://github.com/mautrix/imessage/pull/43, this turned out to be a red herring. After the PR was closed I had no other way of getting this build than setting up the local iMessage go build environment myself, so I went ahead and did that last night.

When testing out, I learned that the deletion of the file isn't the issue, but rather that on iOS the IMFileTransferCenter daemon doesn't run as root user (obviously) and hence isn't able to read the temp folder with 700 permissions created as root.

After changing both the temp folder permissions, as well as the file permissions sending images from matrix via Barcelona to iMessage works like a charm.

CarlAmbroselli commented 2 years ago

@EricRabil / @tulir would one of you review this? Have this running since a few days now and haven't found any issues or crashes around attachments yet

CarlAmbroselli commented 2 years ago

@tulir updated the PR to have different permissions depending on if it's built for mac or iOS