shc icon indicating copy to clipboard operation
shc copied to clipboard

executable does not run again following reboot

Open james-h-dt opened this issue 1 year ago • 3 comments

Compiled simple shell script to executable with command line: shc -S -f <my-script-filename> Tested resulting executable several times. Runs as expected. Rebooted machine. Tried to run executable. Executable fails and outputs random-seeming characters to stdout

Workaround: Recompiled with modified flags: shc -r -S -f <my-script-filename> Executable now survives reboot.

james-h-dt avatar May 11 '23 17:05 james-h-dt

from shc.c:

-r Relax security. Make a redistributable binary"

ihiiro avatar Jun 28 '23 15:06 ihiiro

Interesting, I have the same issue. But I wonder, it is the very same machine, same architecture, same Linux OS, what is different after a reboot? There might be changes in /proc, /sys, and /dev - maybe. But what is the real explanation?

Martin.

M-Stenzel avatar Aug 09 '23 09:08 M-Stenzel

See also https://github.com/neurobin/shc/issues/130. Looks like the same issue.

No idea why "-r" switch works. The manual text talks about "relaxing security".

The "-r" switch seems to be an undocumented mandatory switch to get expected behaviour.

Agree would be interesting understanding why it's reqired.

Would be even better to either:

  1. get the man text updated. So everybody can understand its a mandatory switch.
  2. fix the tool. Such that it creates binaries which by default survive reboot. A typical user would expect this behaviour.

james-h-dt avatar Aug 09 '23 10:08 james-h-dt