Hey all,
this moring i've make use of command :
sudo mate <file name>
in order to edit a config file.
i've discovered afterwards TextMate had change the file owner from "news" to "yvon" (my short login name).
then i had to chown over it.
is that a normal behaviour or does i, as I think, forgot something ?
best,
Yvon
Le 2 nov. 06 à 23:00, Allan Odgaard a écrit :
This calls mate as super user, but mate only passes a file name to TextMate, which is still running as your regular user -- so this doesn’t work as you expect.
ok thanks, and using :
sudo open -a <absolute_path_2_TextMate> <my_config_file> would open another TextMate ?
best,
Yvon
On 3. Nov 2006, at 05:09, Une Bévue wrote:
This calls mate as super user, but mate only passes a file name to TextMate, which is still running as your regular user -- so this doesn’t work as you expect.
ok thanks, and using : sudo open -a <absolute_path_2_TextMate> <my_config_file> would open another TextMate ?
No, it would effectively do the same as mate (i.e. sending the filename to TextMate).
There basically is no way you can currently do what you want -- but since ‘sudo mate’ is (by several users) expected to transfer the super user privileges to TextMate (for just that file), I will look into how this could possibly be pulled off sometime in the future (it would be a nice little feature).
Le 3 nov. 06 à 05:24, Allan Odgaard a écrit :
There basically is no way you can currently do what you want -- but since ‘sudo mate’ is (by several users) expected to transfer the super user privileges to TextMate (for just that file), I will look into how this could possibly be pulled off sometime in the future (it would be a nice little feature).
this little feature is allready implemented in SubEthaEdit... (afaik)
something i didn't understood, suppose i write a wrapper to mate "sudo_mate" even launching TextMate like that :
sudo /Applications/TextMate/TextMate.app/Contents/MacOS/TextMate blahblah
textmate isn't aware of the user ? because of internals, that's to say after lauchning the parent process above another child is open which doesn't have the same perms ????
best,
Yvon
On Nov 3, 2006, at 12:06 AM, Une Bévue wrote:
something i didn't understood, suppose i write a wrapper to mate "sudo_mate" even launching TextMate like that :
sudo /Applications/TextMate/TextMate.app/Contents/MacOS/TextMate blahblah
In my experience, any time I need to edit a file I don't have access to, TextMate will realize that and authenticate me so I can save the file. This probably requires you to be in the admin group, but then so does sudo (by default), right? The only possible drawback is that new files might not get root as the owner. But maybe in that case you could just do:
sudo touch foo.txt mate foo.txt
Rob
On Nov 2, 2006, at 11:24 PM, Allan Odgaard wrote:
There basically is no way you can currently do what you want -- but since ‘sudo mate’ is (by several users) expected to transfer the super user privileges to TextMate (for just that file), I will look into how this could possibly be pulled off sometime in the future (it would be a nice little feature).
This starts up a second instance of TextMate running as root:
sudo /Applications/TextMate.app/Contents/MacOS/TextMate
You could then open/save <my_config_file> from within that TextMate.
I have a feeling though that this is a pretty bad idea with potential to wreak all sorts of havoc.
j.