when a script is not a script according to krun...
David Faure
faure at kde.org
Tue Mar 30 20:28:34 BST 2004
On Tuesday 30 March 2004 21:15, ian reinhart geiser wrote:
> David Faure said:
> > I don't see this here: with chmod -x, nothing happens when clicking on a
> > .sh file.
> > KRun tries to execute it, and
> > /bin/sh: line 1: /k/kdialog.sh: Permission denied
> > Maybe it depends on the shell.
> >
> Hrm, this is odd could you email me the script, cause on my debian system
> it executes a shell script chmod +x, but if its not chmod +x, it opens in
> the text editor.
#!/bin/sh
kdialog --msgbox "foobar"
> [...]
> > OTOH I don't know a good solution to that, so honouring the execute bit is
> > also fine by me. I don't think we want to use a different mimetype
> > depending
> > on it though, so this would require e.g. a modified version of
> > KRun::isExecutable()
> > that also takes the mode of the file.
> > Then we can add perl/python/kjsembed scripts there and add a test +x for
> > all mimetypes (except x-desktop).
> I truly do not want this to be a mime type issue. This is because
> sometimes scripts dont end in .sh, or .py they can have normal names.
That's totally unrelated. We have KMimeMagic, which can detect correct
mimetypes even if extensions are not provided. So recognizing that something
is a script _is_ a mimetype issue. Executing it or not, is a permission issue,
we agree on that (but the current code doesn't do that).
> I also believe
> for security issues that we should only execute the script if its been
> chmod +x. This way accidentally people dont click on a script in email
> and it runs. They should only run after the user has explicitly asked for
> it.
I'm fine with this.
> Is this something that is possible for KDE 3.3? I think modification of
> the KRun::isExecutable() sounds like the most scalable solution. Since we
> wont have to add in a million different scripting languages.
Ah I thought you wanted to make the change. OK, added to TODO list...
--
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
More information about the kde-core-devel
mailing list