Bug 486744 - /bin/sh: bad interpreter: input/output error - while executing a file on a CIFS share
Summary: /bin/sh: bad interpreter: input/output error - while executing a file on a CI...
Status: RESOLVED NOT A BUG
Alias: None
Product: kde
Classification: I don't know
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-07 17:08 UTC by Daniel
Modified: 2024-05-08 09:12 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel 2024-05-07 17:08:32 UTC
***
I'm reporting this here, because Dolphin (the filemanager) told me so.
***

SUMMARY

If executing a file on a smb share, mounted with cifs, errors occure:
/bin/sh: bad interpreter: input/output error
(original german text --> bash: ./test.sh: /bin/sh: Defekter Interpreter: Eingabe-/Ausgabefehler)

If executing it from Dolphin gives an error message:
'Unbekannter Fehlercode 100
execvp: Eingabe-/Ausgabefehler
Bitte senden Sie einen ausführlichen Problembericht an https://bugs.kde.org.'

File 'test.sh' content:
    #!/bin/sh
    echo "test"

STEPS TO REPRODUCE
1. you nead at least a server (NAS) with smb shares and cifs installed on your system.
2. add to fstab: '//192.168.1.15/Netshare  /home/username/Netshare  cifs  noauto,users,rw,exec,credentials=/home/username/.config/.smb-cred  0 0' (address of the server and name of the share)
3. mount it with '$ mount ~/Netshare' (the folder Netshare has to exist)
4. create a file 'test.sh' on this share
    #!/bin/sh
    echo "test"
5. try to execute it with '$ ./test.sh' 
6. try to execute any executable from this share

OBSERVED RESULT

The script is not executed.

The execution gives an error:
(original german text --> bash: ./test.sh: /bin/sh: Defekter Interpreter: Eingabe-/Ausgabefehler)

Executing from Dolphin too:
'Unbekannter Fehlercode 100
execvp: Eingabe-/Ausgabefehler
Bitte senden Sie einen ausführlichen Problembericht an https://bugs.kde.org.'

EXPECTED RESULT

A simple echo: 
Test

SOFTWARE/OS VERSIONS

Operating System: Ubuntu Studio 22.04
KDE Plasma Version: 5.24.7
KDE Frameworks Version: 5.92.0
Qt Version: 5.15.3
Kernel Version: 6.5.0-26-lowlatency (64-bit)
Graphics Platform: X11
Processors: 16 × 13th Gen Intel® Core™ i7-13700K
Memory: 62.5 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 3060/PCIe/SSE2

ADDITIONAL INFORMATION

I've also tried to add 'file_mode=0777,dir_mode=0777,' to the fstab entry, with no success.

If I'm using '$ /bin/bash ./test.sh' the script is running.
If I copy the script to a local drive, it's running.

The file on the smb share has the attributes 'rwx' set, for users and groups.
Programs on the same drive are running under Windows 10.

I've also tried to upgrade the kernel to the next one (6.5.0-27-lowlatency), but then I had copy problems on the share and had to downgrade again to solve it.
Comment 1 Paul Worrall 2024-05-08 09:12:28 UTC
This is not an issue with KDE software, I suggest you search for the solution elsewhere, maybe https://unix.stackexchange.com/questions/34822/is-it-possible-to-enable-execution-of-files-from-a-cifs-mount-in-bash