Skip to content

chmod and chown support#16

Open
dipcore wants to merge 2 commits into
spion:masterfrom
dipcore:master
Open

chmod and chown support#16
dipcore wants to merge 2 commits into
spion:masterfrom
dipcore:master

Conversation

@dipcore

@dipcore dipcore commented Oct 6, 2016

Copy link
Copy Markdown

No description provided.

@spion

spion commented Oct 6, 2016

Copy link
Copy Markdown
Owner

Might be a good idea to use shell_escape_path like the other functions

@dipcore

dipcore commented Oct 6, 2016

Copy link
Copy Markdown
Author

yes, right, added

@dipcore

dipcore commented Oct 6, 2016

Copy link
Copy Markdown
Author

Hm, found one more interesting thing, it seems like it looses permissions, if I try to edit a file.
before editing 755, after 644

Don't you mind, if I add a debug mode and logging to syslog instead of cout ?

@dipcore

dipcore commented Oct 6, 2016

Copy link
Copy Markdown
Author

What I see in logs if I try to save it:

--*-- exec_command: adb shell "ls -l -a -d '/system/etc/init.d/10adbd'"
--*-- exec_command: adb shell "ls -l -a -d '/etc'"
--*-- exec_command: adb shell "ls -l -a -d '/system'"
--*-- exec_command: adb shell "ls -l -a -d '/system/etc'"
--*-- exec_command: adb shell "ls -l -a -d '/system/etc/init.d'"
--*-- exec_command: adb shell "ls -l -a -d '/system/etc/init.d/.#10adbd'"
--*-- exec_command: adb shell "ls -l -a -d '/system/etc/init.d/10adbd'"
--*-- exec_command: adb shell "chown 0.0 /system/etc/init.d/10adbd"
--*-- exec_command: adb shell "ls -l -a -d '/system/etc/init.d/10adbd'"
--*-- exec_command: adb shell "chmod 755 /system/etc/init.d/10adbd"
--*-- exec_command: adb shell "ls -l -a -d '/system/etc/init.d/10adbd'"
--*-- exec_command: adb shell "ls -l -a -d '/system/etc/init.d/10adbd'"
--*-- exec_command: adb shell "ls -l -a -d '/system/etc/init.d/10adbd'"
1 KB/s (74 bytes in 0.041s)
--*-- exec_command: adb push '/tmp/adbfs-eSuqrf/-system-etc-init.d-10adbd' '/system/etc/init.d/10adbd'
--*-- exec_command: adb shell "sync"

So the problem seems in the last adb push
What do you think ?

@spion

spion commented Oct 7, 2016

Copy link
Copy Markdown
Owner

Looks like adb push resets the permissions. Might need to come up with a scheme to preserve them in the dictionary then chmod after the push.

chen3feng added a commit to chen3feng/adbfs that referenced this pull request Jun 28, 2026
Two related macOS write-path fixes:

chmod/chown (backport of spion#16, with the path properly
single-quoted -- the original left it unquoted and broke on paths with
spaces). Implementing chmod also stops `cp -p`/copyfile failing with
"fchmod failed: Function not implemented".

Extended-attribute ops (get/set/list/removexattr) that accept and discard.
adbfs can't persist xattrs on the device, but implementing these makes the
volume advertise native xattr support, so macOS stores its metadata via
setxattr (which we drop) instead of scattering AppleDouble "._" sidecars
over the phone -- and cp/cp -p stop failing on the extended-attribute copy.

Verified on a device: with macFUSE, cp/cp -p/ditto/redirect all exit 0 and
no ._ files appear; data md5 matches. On fuse-t (NFS-backed) the copies
also stop erroring, though ._ files still appear since NFS bypasses the
xattr ops. Builds clean against both macFUSE and fuse-t.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants