Skip to content

Commit

Permalink
prepare for new release with Merge pull request neurobin#83 from RKX1…
Browse files Browse the repository at this point in the history
…209/fix_nullptr_ref
  • Loading branch information
neurobin committed Jul 1, 2019
1 parent d5d1b89 commit 71ac875
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 6 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
CHANGES

4.0.2 Mon 01 Jul 2019 02:57:36 PM UTC

* Fix typo
* Fix NULL-ptr dereference in shll string (Thanks to Ren Kimura<https://github.com/RKX1209>)

4.0.1 Tue Nov 20 08:22:20 UTC 2018

* Add LDFLAGS environment variable (Thanks to zboszor <https://github.com/zboszor>)
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AC_INIT([shc], [4.0.1], [http://github.com/neurobin/shc/issues])
AC_INIT([shc], [4.0.2], [http://github.com/neurobin/shc/issues])
AC_CONFIG_AUX_DIR(config)
#prefix="/usr"
AC_CONFIG_SRCDIR([src/shc.c])
Expand Down
2 changes: 1 addition & 1 deletion man.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ <h1 id="description">DESCRIPTION</h1>
<p>If you supply an expiration date with the <code>-e</code> option, the compiled binary will refuse to run after the date specified. The message <strong>Please contact your provider</strong> will be displayed instead. This message can be changed with the <code>-m</code> option.</p>
<p>You can compile any kind of shell script, but you need to supply valid <code>-i</code>, <code>-x</code> and <code>-l</code> options.</p>
<p>The compiled binary will still be dependent on the shell specified in the first line of the shell code (i.e. <code>#!/bin/sh</code>), thus <strong>shc</strong> does not create completely independent binaries.</p>
<p><strong>shc</strong> itself is not a compiler such as cc, it rather encodes and encrypts a shell script and generates C source code with the added expiration capability. It then uses the system compiler to compile a stripped binary which behaves exactly like the original script. Upon execution, the compiled binary will decrypt and execute the code with the shell <code>-c</code> option. Unfortunatelly, it will not give you any speed improvement as a real C program would.</p>
<p><strong>shc</strong> itself is not a compiler such as cc, it rather encodes and encrypts a shell script and generates C source code with the added expiration capability. It then uses the system compiler to compile a stripped binary which behaves exactly like the original script. Upon execution, the compiled binary will decrypt and execute the code with the shell <code>-c</code> option. Unfortunately, it will not give you any speed improvement as a real C program would.</p>
<p><strong>shc</strong>'s main purpose is to protect your shell scripts from modification or inspection. You can use it if you wish to distribute your scripts but don't want them to be easily readable by other people.</p>
<h1 id="options">OPTIONS</h1>
<p>-e <em>date</em> : Expiration date in <em>dd/mm/yyyy</em> format <code>[none]</code></p>
Expand Down
2 changes: 1 addition & 1 deletion man.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ thus **shc** does not create completely independent binaries.
**shc** itself is not a compiler such as cc, it rather encodes and encrypts a shell script and generates C source code with the added expiration capability.
It then uses the system compiler to compile a stripped binary which behaves exactly like the original script.
Upon execution, the compiled binary will decrypt and execute the code with the shell `-c` option.
Unfortunatelly, it will not give you any speed improvement as a real C program would.
Unfortunately, it will not give you any speed improvement as a real C program would.

**shc**'s main purpose is to protect your shell scripts from modification or inspection.
You can use it if you wish to distribute your scripts but don't want them to be easily readable by other people.
Expand Down
2 changes: 1 addition & 1 deletion shc.1
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ It then uses the system compiler to compile a stripped binary which
behaves exactly like the original script.
Upon execution, the compiled binary will decrypt and execute the code
with the shell \f[C]\-c\f[] option.
Unfortunatelly, it will not give you any speed improvement as a real C
Unfortunately, it will not give you any speed improvement as a real C
program would.
.PP
\f[B]shc\f[]\[aq]s main purpose is to protect your shell scripts from
Expand Down
8 changes: 6 additions & 2 deletions src/shc.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

static const char my_name[] = "shc";
static const char version[] = "Version 4.0.1";
static const char version[] = "Version 4.0.2";
static const char subject[] = "Generic Shell Script Compiler";
static const char cpright[] = "GNU GPL Version 3";
static const struct { const char * f, * s, * e; }
Expand Down Expand Up @@ -265,7 +265,7 @@ static const char * RTC[] = {
" BPF_STMT(BPF_LD+BPF_W+BPF_ABS, offsetof(struct seccomp_data, nr)),",
"",
" /* list of allowed syscalls */",
" Allow(exit_group), /* exits a processs */",
" Allow(exit_group), /* exits a process */",
" Allow(brk), /* for malloc(), inside libc */",
" Allow(mmap), /* also for malloc() */",
" Allow(munmap), /* for free(), inside libc */",
Expand Down Expand Up @@ -971,6 +971,10 @@ int eval_shell(char * text)

shll = realloc(shll, strlen(shll) + 1);
ptr = strrchr(shll, (int)'/');
if (!ptr) {
fprintf(stderr, "%s: invalid shll\n", my_name);
return -1;
}
if (*ptr == '/')
ptr++;
if (verbose) fprintf(stderr, "%s shll=%s\n", my_name, ptr);
Expand Down

0 comments on commit 71ac875

Please sign in to comment.