when a script is not a script according to krun...

ian reinhart geiser geiseri at yahoo.com
Tue Mar 30 21:01:30 BST 2004


David Faure said:
> 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"
I think I know why mine behaves differntly :) I have started mucking
around in here to make the execute bit be respected, in fact didn't we
maby discuss this at n7y? At any rate I think my current approach may be
misdirected, and might be better in the KRun::isExecutable() method.
[...]
>> 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 guess the question begs to be asked do we check if the mimetype is a
script and to check for the execute bit, or to just check for the execute
big alone?  Do you see any issue with just looking at the execute bit
alone?

>> I also believe
[...]
>> wont have to add in a million different scripting languages.
> Ah I thought you wanted to make the change. OK, added to TODO list...
If it means I can have it yet this week, Im more than willing to do so and
think I might have half of it done already.  No need to add it to your
list, unless you really want more work ;)

Cheers
-ian reinhart geiser



!DSPAM:4069d416141661687623343!






More information about the kde-core-devel mailing list