| andrea 2007-11-19, 1:33 pm |
| On 19 Nov, 16:55, Sylvain Robitaille <s...@alcor.concordia.ca> wrote:
> andrea wrote:
>
> Too simple, unfortunately. Check out below ...
>
>
> Except it forces $EDITOR to vim (should perhaps do that only if $EDITOR
> isn't already set), and it functions on only one file at a time, which
> is contrary to most people's favorite editors. That becomes
> unintuitive for most people, though it may still work out alright for
> your own purposes.
Yes you're right, but a couple of questions, which is the right file
to set my favourite editor on ubuntu server (debian)?
To function with many files I could just shift until I finish the
arguments, is it right?
>
> What if we're working together, your favorite text editor is vim (so
> you're happy with the script), and my $EDITOR is already set to emacs?
>
>
> What if I wanted to edit 3, 5, 7, or "n" files at once? (what if the
> argument contains a wildcard, expanded by the shell into "n" files?)
>
I think there shortcuts to do this very easily (I think glob), I'll
look for them..
>
> You have a dangerous use of the /tmp directory here. You also make
> no effort to test for the existence of what you're placing into /tmp,
> either before or after. A malicious user (assume, for example, someone
> unauthorized to use the system, but who managed to compromise a regular
> user account) could cause some serious trouble by placing a symlink into
> /tmp, pointing at somewhere important (such as /etc, /usr, or even /)
> on your system. You'll get error messages, but your script will forge
> ahead faster than you can read them and by the time you realized what
> just happened it would be too late.
What could I do then to secure it? Just checks paths?
>
>
> The diff is backwards. You'll find it more intuitive to follow what has
> changed if you reverse the order of the files being diffed here.
Ok, but what's the difference? Isn't it symmetric?
>
> I hope I've helped ...
Yes of course thank you very much
|