Bug 779874 - Compiled ksh93 shell code not executable
Summary: Compiled ksh93 shell code not executable
Status: NEW
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: Current
Hardware: All All
: P5 - None : Critical (vote)
Target Milestone: Current
Assignee: Michael Schröder
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-11 21:58 UTC by simon toedt
Modified: 2020-06-04 12:32 UTC (History)
4 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description simon toedt 2012-09-11 21:58:00 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111216 Firefox/9.0 SeaMonkey/2.6

On Solaris 11 it is possible to execute compiled shell code directly, e.g.
% echo "print hello" >xxx.sh
% shcomp xxx.sh xxx
% chmod a+x xxx
% ./xxx
hello

It turns out this is a one line entry for Linux, as described in http://www.mail-archive.com/ast-users@research.att.com/msg01730.html
########################
On Linux you can do this:
-- snip --
echo ':shbinexec:M::\x0b\x13\x08:\xff\xff\xff:/usr/bin/ksh93:O' >
/proc/sys/fs/binfmt_misc/register
-- snip --
After this point all compiled shell scripts (even those with only the
exec bit but not the read bit set) can be executed directly.
########################



Reproducible: Always

Steps to Reproduce:
1.See description
2.
3.



This feature is needed to port applications from Solaris to Suse. Thank you.
Comment 1 simon toedt 2012-09-24 10:37:02 UTC
Anyone? Klara? This should be *simple* to fix. One single-line entry in whatever configures binfmt_misc at system startup.
Comment 2 simon toedt 2013-07-19 03:06:53 UTC
One year later. Customer still unhappy.
Comment 3 Michal Vyskocil 2013-07-26 13:41:20 UTC
(In reply to comment #1)
> Anyone? Klara? This should be *simple* to fix. One single-line entry in
> whatever configures binfmt_misc at system startup.

It's the matter of proper configuration and I don't think it is a reasonable system default. All you need to do (guessing your 12.2 system runs systemd)

echo ':shbinexec:M::\x0b\x13\x08:\xff\xff\xff:/usr/bin/ksh93:O' /etc/binfmt.d/ksh93.conf
systemctl enable systemd-binfmt.service
systemctl start systemd-binfmt.service

and that's it.

@coolo: do you have an idea who shall be an assignee for such feature request?
Comment 4 Michal Vyskocil 2013-07-26 13:42:30 UTC
upps, missing redirection

echo ':shbinexec:M::\x0b\x13\x08:\xff\xff\xff:/usr/bin/ksh93:O' > /etc/binfmt.d/ksh93.conf
Comment 5 Stefan Behlert 2013-09-27 10:09:18 UTC
I assume that coolo has changed the infoprovider to answer comment 3 - but I only know for the Enterprise products how to file such a request. Use the fate.suse.com tool to file the feature request for openSUSE, for Enterprise products you can do so there, too, but better go through productmanagement.
Comment 7 Nathan Cutler 2017-08-14 15:09:43 UTC
Another four years have passed and ksh has receded further into history. openSUSE 12.2 is out of maintenance; changing product to Tumbleweed.
Comment 8 Michal Marek 2017-08-14 15:28:50 UTC
Reassigning to the right maintainer would be a good start.

As a matter of fact, there is *no* package in current Leap registering a binfmt_misc handler. Things like java or wine also need to be manually started. So this would be something new. Tumbleweed does have a java-binfmt-misc package.
Comment 9 Dr. Werner Fink 2017-08-14 15:30:44 UTC
(In reply to Michal Marek from comment #8)
> Reassigning to the right maintainer would be a good start.

Indeed
Comment 10 Dr. Werner Fink 2017-08-14 15:40:11 UTC
Beside this: I in doubt that the ksh maintainer is responsible for this.  This looks more like a configuration problem
Comment 11 Dr. Werner Fink 2017-08-14 15:52:39 UTC
Interesting .. there is a /bin/ksh93 but no /usr/bin/ksh93

OK ... getting root, doing

   echo ':kshbinexe:M::\x0b\x13\x08::/bin/ksh93:' > \
   /proc/sys/fs/binfmt_misc/register

now normal user doing

  /tmp> echo 'print hello' > xxx.sh
  /tmp> shcomp xxx.sh xxx
  /tmp> ksh93 ./xxx
  hello
  /tmp> chmod a+x xxx
  /tmp> xxx
  hello

... works!