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:
i just dis a small over a file on my desktop :
~/Desktop/sudo_textmate%> ls -al -rw-rw-rw- 1 news admin 122 Nov 3 11:01 essai-sudo-config
i open it with TextMate, add "Hello world !" inside and save it.
TextMate didn't ask in authetification and the file has now those user:group :
~/Desktop/sudo_textmate%> ls -al -rw-rw-rw- 1 yvon yvon 140 Nov 3 18:16 essai-sudo-config
(yvon being my login name)
this should be considered as a bug afaik ?
TextMate would have either not open the file or ask for authentification ...
I'm usinf TextMate Version 1.5.4 (1324).
also for mate it is, in my opinion, about the same because on my box mate leaves in :
~/Desktop/sudo_textmate%> which mate /opt/local/bin/mate
where all the bins are aware of which root|user opened a file...
best,
Yvon Le 3 nov. 06 à 16:20, Rob McBroom a écrit :
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:
i just dis a small over a file on my desktop :
~/Desktop/sudo_textmate%> ls -al -rw-rw-rw- 1 news admin 122 Nov 3 11:01 essai-sudo-config
i open it with TextMate, add "Hello world !" inside and save it.
TextMate didn't ask in authetification and the file has now those user:group :
~/Desktop/sudo_textmate%> ls -al -rw-rw-rw- 1 yvon yvon 140 Nov 3 18:16 essai-sudo-config
(yvon being my login name)
this should be considered as a bug afaik ?
TextMate would have either not open the file or ask for authentification ...
I'm usinf TextMate Version 1.5.4 (1324).
also for mate it is, in my opinion, about the same because on my box mate leaves in :
~/Desktop/sudo_textmate%> which mate /opt/local/bin/mate
where all the bins are aware of which root|user opened a file...
HOWEVER other people don't have this experience with TextMate, they have veryfied TextMate doesn't change file owber and asks for authentification.
then the prob comes from my machine...
i'm wiping out TextMate and related to get a fresh install...
best,
Yvon
On 3. Nov 2006, at 19:13, 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
As for why this is not a good idea (as you asked in the other letter) then it is because you are running TextMate as root, and TextMate will run *a lot* of other code, load frameworks, have input manager code injected into it, etc. and all that code will run as root.
As for why your wrapper did not work, you need to call ‘mate -w’ to have mate wait till TextMate is done writing the file.
~/Desktop/sudo_textmate%> ls -al -rw-rw-rw- 1 news admin 122 Nov 3 11:01 essai-sudo-config
i open it with TextMate, add "Hello world !" inside and save it.
TextMate didn't ask in authetification and the file has now those user:group :
It did not ask because you made the file writable by the world, so it was allowed to write to the file.
~/Desktop/sudo_textmate%> ls -al -rw-rw-rw- 1 yvon yvon 140 Nov 3 18:16 essai-sudo-config
(yvon being my login name)
this should be considered as a bug afaik ?
TextMate shouldn’t really care about these things -- it writes the data to the disk, the file system will stamp it with a date, who wrote it, etc.
That said, I can’t reproduce your problem.
Could you try write to the file from shell instead -- and while I did test it with Atomic Saves enabled in Preferences, try disable that.
TextMate would have either not open the file or ask for authentification ...
For that, you should not make it writable by the world.
Le 3 nov. 06 à 23:55, Allan Odgaard a écrit :
As for why this is not a good idea (as you asked in the other letter) then it is because you are running TextMate as root, and TextMate will run *a lot* of other code, load frameworks, have input manager code injected into it, etc. and all that code will run as root.
OK, it's what i've understood...
As for why your wrapper did not work, you need to call ‘mate -w’ to have mate wait till TextMate is done writing the file.
fine thanks, i'll put that "-w" in my notes...
It did not ask because you made the file writable by the world, so it was allowed to write to the file.
right i didn't catched that because i was stuck with user:group ;-)
That said, I can’t reproduce your problem.
other guys from a french shell mailing list too, they said, in short, TextMate behaves correctly.
let me tell you what i've done in the mean time.
delete "everything" (found by locate TextMate) belonging to TextMate.
"re-install" a fresh downloaded TextMate.
try again BUT with my mystake "-rw-rw-rw-" at that time.
i edit the file the result being a change in user:group, then i realize the background window within TextMate was black, then i've trashed the "" prefs too (i had forgotten that in the previous step.
after that i edit again the same file and verified user:group (still with the bad "rw-rw-rw-" ) here TextMate change the contents of the file save it WITHOUT modifying user:group....
then at least a part of my prob comes from "com.macromates.textmate.plist" or the other one i don't have the name.
unfortunately because i've done that by rm -f, I don't have anymore those prefs files.
right now if i open the file "essai-sudo-config" :
TextMate let me edit it BUT asks for authetification when saving.
from TextMate everything is OK deleting the prefs....
Satisfied by TextMate, I've re-installed mate :
~/Desktop/sudo_textmate%> which mate /Users/yvon/bin/mate
then, i've done a (without the famous -w) :
~/Desktop/sudo_textmate%> mate essai-sudo-config
here again i got wrong user:group afterwars (TextMate didn't ask for autheticating).
is that a normal behaviour of mate I ask for that particular point to you because to me i've got contradictory answers from this mailing list.
thanks for all !
best,
Yvon