Code Monkey home page Code Monkey logo

shc-3.8.9's People

Contributors

existz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

shc-3.8.9's Issues

Not makeself compatible

Tried to used shc mixed with makeself and the result are small binary files compared with the original makeself scripts.

To test it:

wget https://josm.openstreetmap.de/josm-tested.jar
mkdir files
mv josm-tested.jar files/
echo '#!/bin/sh' > files/run.sh
echo 'java -jar ./josm-tested.jar' >> files/run.sh
chmod u+x files/run.sh
makeself files test.run "test" ./run.sh

Now the file 'test.run' works ok. Just go and apply some shc magic:

shc -rT -f ./test.run 
shc: WARNING!!
   Scripts of length near to (or higher than) the current System limit on
   "maximum size of arguments to EXEC", could comprise its binary execution.
   In the current System the call sysconf(_SC_ARG_MAX) returns 2097152 bytes
   and your script "./test.run" is 8400754 bytes length.

Well, is a warning. Lets take a look at the filesizes:

du -sh test.run test.run.x
8,1M    test.run
28K test.run.x

Where did the data go?

On Cygwin: sys/ptrace.h: No such file or directory

On latest version of Cygwin:

~/shc/shc-3.8.9
$ make test
*** Compiling script "match"
CFLAGS="-Wall " ./shc -v -f match
shc shll=sh
shc [-i]=-c
shc [-x]=exec '%s' "$@"
shc [-l]=
shc opts=
shc: cc -Wall match.x.c -o match.x
match.x.c:260:24: fatal error: sys/ptrace.h: No such file or directory
#include <sys/ptrace.h>
^
compilation terminated.
./shc: No error
makefile:43: recipe for target 'match.x' failed

make: * * * [match.x] Error 1

How do we solve this?

shc-3.8.9 compiled script can't be used in Bourne shell scripts

To duplicate, compile match.x first:

 make
  make test

Verify it works:

$ ./match.x bash
/usr/bin/bashbug
/bin/bash
/bin/rbash
...

Now put that into shell scripts:

$ echo ./match.x bash > /tmp/test.sh

$ sh -x /tmp/test.sh
+ ./match.x bash
/bin/sh: 0: Can't open bash

Ref: http://sfxpt.wordpress.com/2014/02/23/shc-3-8-9-is-not-usable/

[Update]:

Seems that shc-3.8.9 is hard wired to bash -- everything bash works whereas everything Bourne shell (sh) won't work:

$ cat /tmp/test-sh.sh
#!/bin/sh
./match.x bash

$ /tmp/test-sh.sh
^C

I.e., scripts with Bourne shell (sh) Shebang will hung until break.

However, everything bash works. I.e. both bash -x /tmp/test.sh and the following script work:

$ cat /tmp/test-bash.sh
#!/bin/bash
./match.x bash

Thanks to Jahidul Hamid (neurobin) finding that out.

Operation not permitted when run or make test

UPDATE:

Please note that the bug reported here has been fixed.

If it is still happening to you, please do a strace as normal user and compare with the two traces posted here. If it's the same as Nick777818's -- the wait4 Operation was not permitted, or anything else,

please open another bug rather than following up here.

Original question:

I got "Operation not permitted" when trying to to run "make test", like this:

$ ./match.x sh
./match.x: Operation not permitted
Killed

Here are the details:

~/prj/shc-3.8.9$ make
make: *** No rule to make target shc.c', needed byshc'. Stop.

~/prj/shc-3.8.9$ ln -s shc-3.8.9.c shc.c

~/prj/shc-3.8.9$ make
cc -Wall shc.c -o shc
*** ¿Do you want to probe shc with a test script?
*** Please try... make test

~/prj/shc-3.8.9$ make test
*** Compiling script "match"
CFLAGS="-Wall " ./shc -v -f match
shc: WARNING!!
Scripts of length near to (or higher than) the current System limit on
"maximum size of arguments to EXEC", could comprise its binary execution.
In the current System the call sysconf(_SC_ARG_MAX) returns -1 bytes
and your script "match" is 336 bytes length.
shc shll=sh
shc [-i]=-c
shc [-x]=exec '%s' "$@"
shc [-l]=
shc opts=
shc: cc -Wall match.x.c -o match.x
shc: strip match.x
shc: chmod go-r match.x
*** Running a compiled test script!
*** It must show files with substring "sh" in your PATH...
./match.x sh
./match.x: Operation not permitted
make: *** [make_the_test] Killed

Here is my system:

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=13.04
DISTRIB_CODENAME=raring
DISTRIB_DESCRIPTION="Ubuntu 13.04"
NAME="Ubuntu"
VERSION="13.04, Raring Ringtail"

$ cat /proc/version
Linux version 3.8.0-19-generic (buildd@allspice) (gcc version 4.7.3 (Ubuntu/Linaro 4.7.3-1ubuntu1) ) #30-Ubuntu SMP Wed May 1 16:35:23 UTC 2013
$ uname -rsm
Linux 3.8.0-19-generic x86_64

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.