X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=meta-starlingx%2Fmeta-stx-flock%2Fstx-integ%2Ffiles%2Fibsh%2Fibsh-0.3e-cgcs.patch;fp=meta-starlingx%2Fmeta-stx-flock%2Fstx-integ%2Ffiles%2Fibsh%2Fibsh-0.3e-cgcs.patch;h=0000000000000000000000000000000000000000;hb=6fc6934434f70595536a387ece31bc30141cafb5;hp=de22da0df3001b3d5416af488306b2c7e9378147;hpb=eb1e26510491ba49de693ab3b0498edcb06be6c5;p=pti%2Frtp.git diff --git a/meta-starlingx/meta-stx-flock/stx-integ/files/ibsh/ibsh-0.3e-cgcs.patch b/meta-starlingx/meta-stx-flock/stx-integ/files/ibsh/ibsh-0.3e-cgcs.patch deleted file mode 100644 index de22da0..0000000 --- a/meta-starlingx/meta-stx-flock/stx-integ/files/ibsh/ibsh-0.3e-cgcs.patch +++ /dev/null @@ -1,84 +0,0 @@ -Index: cgcs-users-1.0-r0/main.c -=================================================================== ---- cgcs-users-1.0-r0.orig/main.c -+++ cgcs-users-1.0-r0/main.c -@@ -37,6 +37,7 @@ - - /* Header files */ - #include "ibsh.h" -+#include "stdlib.h" - - /* Main: */ - /* Handle arguments, read config files, start command processing. */ -@@ -57,13 +58,28 @@ - /* use our builtin code, otherwise use execve. After execve, check if the user didnt */ - /* use the last command to create some illegal content. If yes, erase that. Give the */ - /* notice only afterwards. */ -+ -+void ALRMhandler(int sig) { -+ OPENLOG; -+ syslog(LOG_INFO, "CLI timeout, user %s has logged out.", loggedin.uname); -+ CLOSELOG; -+ exit(0); -+} -+ - int main(int argc, char **argv) - { - char temp[STRING_SIZE], *buf; - struct stat info; - uid_t ruid, euid; - gid_t rgid, egid; -+ unsigned int tout_cli = 0; - -+ const char* tout = getenv("TMOUT"); -+ if (tout) -+ tout_cli = atoi(tout); -+ else -+ //default to 5 mins -+ tout_cli = 300; - - /* setuid protection */ - ruid = getuid(); -@@ -107,6 +123,7 @@ int main(int argc, char **argv) - signal( SIGQUIT, SIG_IGN ); - signal( SIGTERM, SIG_IGN ); - signal( SIGTSTP, SIG_IGN ); -+ signal( SIGALRM, ALRMhandler ); - LoadConfig(); - - /* Command mode */ -@@ -144,6 +161,7 @@ int main(int argc, char **argv) - /* will be allowed to run, unless it is mentioned in the */ - /* config files. Files that are created with an extension */ - /* that is listed in the other config file, must be deleted! */ -+ alarm(tout_cli); - for ( ; ; ) { - /* Where is he ? */ - getcwd(real_path, STRING_SIZE); -@@ -153,12 +171,12 @@ int main(int argc, char **argv) - } - /* We don't want the user to know where he actually is. */ - /* This is the prompt! */ -- printf("[%s]%% ", jail_path); -+ printf("[%s]%% ", loggedin.uname); - /* scanf("%s", user_command); */ - myscanf(user_command, real_path); -+ alarm(tout_cli); - /* Command interpretation and execution. */ - if ( (CommandOK(user_command, loggedin.udir, jail_path, filtered_command)) == 0 ) { -- printf("Sorry, can't let you do that!\n"); - log_attempt(loggedin.uname); /* v0.2a */ - continue; - } -Index: cgcs-users-1.0-r0/config.c -=================================================================== ---- cgcs-users-1.0-r0.orig/config.c -+++ cgcs-users-1.0-r0/config.c -@@ -166,7 +166,6 @@ int LoadConfig( void ) - // Delete '\n' - tmp2[i][strlen(tmp2[i]) - 1] = '\0'; - strncpy(extensions[i],tmp2[i],strlen(tmp2[i])); -- printf("EXTENSIONS %s\n",extensions[i]); - i++; - } - }