Open GoogleCodeExporter opened 9 years ago
I am not sure about the authentication part of this as it may be difficult/not
possible to support it on all platforms. Nor do I know what apis are needed to
interface with that.
Its possible that on Linux/OSX I could just prompt for the password and do an
'su
chmod' when the file is first attempted to be modified and then change it back
to its
original values when the buffer is destroyed. That seems to leave a few hazards
open
though because if the program crashed or something they files would be left
open.
I think that the best solution for files that require access to files owned by
another user is to run Editra as that user. If it is possible to elevate what
user
the program is run as briefly it would be optimal, though again not sure on how
this
is handled.
When I need to edit root owned files I usually start the program as root.
Original comment by CodyPrec...@gmail.com
on 1 May 2010 at 3:12
Your comments got me thinking and looking. The best solution I found was to
use sudo to execute Editra.
by doing this :
echo "sudo password" | sudo -S /Applications/Editra.app/Contents/MacOSX/Editra
it will run editra as root.
What I haven't done yet is wrap that up into it's own script or executable so I
am able to simply click on an
icon in either Applications folder or elsewhere, but I know that is possible,
possibly by using AppleScript to
finish things up...
FYI, for anyone who may try this, you cannot do the following:
echo "sudo password" | sudo -S "open /Applications/Editra.app"
it appears the open command ignores sudo and runs it as the default GUI user.
You must dril into the app
directly as my first example shows...
Thanks!
Original comment by dlangh@gmail.com
on 1 May 2010 at 5:26
Original issue reported on code.google.com by
dlangh@gmail.com
on 30 Apr 2010 at 3:42