Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -552,9 +552,12 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='sudosh2'
PACKAGE_TARNAME='sudosh2'
PACKAGE_VERSION='1.0.4'
PACKAGE_STRING='sudosh2 1.0.4'
PACKAGE_BUGREPORT='josh@shortcutsolutions.net'
PACKAGE_VERSION='1.0.4-ta1'
PACKAGE_STRING='sudosh2 1.0.4-ta1'
#PACKAGE_BUGREPORT='josh@shortcutsolutions.net'
# Not trying to steal credit here... just don't want josh to have to field
# bug reports for our hacks. :)
PACKAGE_BUGREPORT='support@trueability.com'
PACKAGE_URL=''

ac_unique_file="src/"
Expand Down Expand Up @@ -1251,7 +1254,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures sudosh2 1.0.4 to adapt to many kinds of systems.
\`configure' configures sudosh2 1.0.4-ta1 to adapt to many kinds of systems.

Usage: $0 [OPTION]... [VAR=VALUE]...

Expand Down Expand Up @@ -1322,7 +1325,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of sudosh2 1.0.4:";;
short | recursive ) echo "Configuration of sudosh2 1.0.4-ta1:";;
esac
cat <<\_ACEOF

Expand Down Expand Up @@ -1415,7 +1418,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
sudosh2 configure 1.0.4
sudosh2 configure 1.0.4-ta1
generated by GNU Autoconf 2.65

Copyright (C) 2009 Free Software Foundation, Inc.
Expand Down Expand Up @@ -1840,7 +1843,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by sudosh2 $as_me 1.0.4, which was
It was created by sudosh2 $as_me 1.0.4-ta1, which was
generated by GNU Autoconf 2.65. Invocation command line was

$ $0 $@
Expand Down Expand Up @@ -2766,7 +2769,7 @@ fi

# Define the identity of the package.
PACKAGE=sudosh2
VERSION=1.0.4
VERSION=1.0.4-ta1


cat >>confdefs.h <<_ACEOF
Expand Down Expand Up @@ -5651,7 +5654,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by sudosh2 $as_me 1.0.4, which was
This file was extended by sudosh2 $as_me 1.0.4-ta1, which was
generated by GNU Autoconf 2.65. Invocation command line was

CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -5717,7 +5720,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
sudosh2 config.status 1.0.4
sudosh2 config.status 1.0.4-ta1
configured by $0, generated by GNU Autoconf 2.65,
with options \\"\$ac_cs_config\\"

Expand Down
8 changes: 8 additions & 0 deletions src/parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ void parse(option * c, const char *file)
strcpy(c->defshell, "/bin/sh");
c->priority=-1; // No defaults here
c->facility=-1; // or here...
c->permissive=0; //
c->clearenvironment=1;
f = fopen(file, "r");
if (f==NULL)
Expand Down Expand Up @@ -61,6 +62,12 @@ void parse(option * c, const char *file)
}
// fprintf(stderr, "Parsed key [%s] and value [%s]\n",key, value);

if (strcmp(key,"permissive") == 0){
if(strncmp(value, "y", 1) == 0 || strncmp(value,"Y", 1) == 0)
{
c->permissive = 1;
}
}
if (strcmp(key,"-cargallow")==0)
{
strcat(c->argallow,"$");
Expand Down Expand Up @@ -335,6 +342,7 @@ fclose(f);
. -c arg allow
. syslog.priority
. syslog.facility
. permissive

So for backwards compatibility, we need to be able to deal with whitespace. To make things easier, I'll just kill all whitespace.
*/
Expand Down
1 change: 1 addition & 0 deletions src/struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ struct s_option {
int facility;
int clearenvironment;
char argallow[BUFSIZ];
int permissive;
};

typedef struct s_option option;
7 changes: 4 additions & 3 deletions src/sudosh.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,9 @@ main (int argc, char *argv[], char *environ[])

if (c_str[0]!=0)
{
// Test for methods of escape
if (strchr(c_command,';')!=NULL ||
// Test for methods of escape if not in permissive mode
if (!sudosh_option.permissive &&
strchr(c_command,';')!=NULL ||
strchr(c_command,'&') !=NULL ||
strchr(c_command,'|') !=NULL ||
strchr(c_command,'<') !=NULL ||
Expand All @@ -199,7 +200,7 @@ main (int argc, char *argv[], char *environ[])
sprintf(argtest,"$%.100s$",c_str);
// fprintf(stderr,"Testing for %s\n",argtest);

if (strstr(sudosh_option.argallow,argtest)!=NULL)
if (sudosh_option.permissive || strstr(sudosh_option.argallow,argtest)!=NULL)
{
FILE *f;
snprintf (script.name, (size_t) BUFSIZ - 1,
Expand Down
49 changes: 0 additions & 49 deletions sudosh-replay.8

This file was deleted.