atg / chocolat-public

Public bug tracker for the private chocolat project
http://chocolatapp.com
180 stars 4 forks source link

Edit files owned by root #238

Open Znarkus opened 13 years ago

Znarkus commented 13 years ago

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!

tarnfeld commented 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...

Znarkus commented 13 years ago

Exactly.

tonyarnold commented 13 years ago

+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.

OscarGodson commented 13 years ago

+1

timhatch commented 13 years ago

Isn't this the same as Issue #24 (Use Authorization Services to allow editing of restricted files)?

tonyarnold commented 13 years ago

Yes, it is the same issue. I get the impression that @fileability is avoiding the bug triage that desperately needs to happen here :P

OscarGodson commented 13 years ago

If only @fileability would give me access i'd totally merge these bugs form em :)

atg commented 13 years ago

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.

timhatch commented 13 years ago

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

matrushka commented 13 years ago

+1

amcgregor commented 13 years ago

+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.

fantattitude commented 13 years ago

+1

johnmichel commented 12 years ago

+1

emilsundberg commented 12 years ago

+1

mangnus commented 12 years ago

+1

franciscolourenco commented 12 years ago

+1

AlexandreBernard commented 12 years ago

+1

jwriteclub commented 11 years ago

+1

tobiastom commented 11 years ago

+1

lperry65 commented 11 years ago

So I'm still having to use textmate to edit /etc/hosts etc! Is this still a live issue?

kritzikratzi commented 10 years ago

+1 also still using textmate for this :(

gdelmas commented 10 years ago

+1