Open Znarkus opened 13 years ago
Textmate does this well, by opening them and when you try to save it prompts you to enter an admin account's username and password...
Exactly.
+1 for this. None of the newer editors do this, and it makes me revert to using vim or TextMate every time I need to edit a system owned file.
+1
Isn't this the same as Issue #24 (Use Authorization Services to allow editing of restricted files)?
Yes, it is the same issue. I get the impression that @fileability is avoiding the bug triage that desperately needs to happen here :P
If only @fileability would give me access i'd totally merge these bugs form em :)
Is indeed a duplicate of #24. I'll close that one, so we still have the comment count.
Edit:
So this bug is a right pain in the arse. First of all, we have to do our own writing to disk. ATM we just generate an NSData and let NSDocument do the writing to disk. If we roll our own, we lose lots of nice functionality.
It looks like I'll have to build a Foundation tool to do the writing and set permissions, then AuthorizationExecuteWithPrivileges()
it. Could possibly use authopen
instead, but since it ignores specified permissions, this seems a bad idea.
Probably also going to have problems with the App Store, - it looks as though BareBones have had to separate out both command line tools and authorisation services? Ref. http://www.barebones.com/support/bbedit/cmd-line-tools.html
+1
+1
Possibly doable using atomic writes -- copy the file to a tmp file, edit that, then during save cp it across after authenticating the subprocess. Extra bonus points if you can preserve current ownership.
+1
+1
+1
+1
+1
+1
+1
+1
So I'm still having to use textmate to edit /etc/hosts etc! Is this still a live issue?
+1 also still using textmate for this :(
+1
It would be great if we could edit files owned by root, like
/etc/hosts
and/etc/apache2/httpd.conf
. Thanks for this great app!