I need a shell, a clone of bash shell (say cloneshell a.k.a. clsh) with the following modifications:
1) When clsh is spawned, it analyzes the first command typed in and matches it with a specific pattern.
* If the pattern is matched the shell will allow the user to continue normal operation of bash
* If the pattern is not matched
* it will perform a special action such as writing down the fact that the pattern was not matched, the uid, time and some other details in a file
* it will not run the ls/cd/etc.. commands from the standard /usr/bin or /usr/sbin location instead from a backup replica location such as /usr/bin/clsh/
* It is assumed that a copy of binaries in /usr/bin /usr/sbin is present in /usr/bin/clsh/
* clsh must be indistinguishable from bash when echo $SHELL is typed
* clsh must be delivered as an installer just like the standard bash .[login to view URL] file obtained from main bash web-page. The unzipped folder must contain a similar configure/makefile setup
* the code submitted must be commented (absolutely necessary)
* If you are making changes to standard bash code, a separate file detailing high level changes/additions such as function names and what they do must be provided
* If you are not touching main bash code, and are writing new code, a file containing a high level overview of the functions in the various files and what they do must be provided
* When clsh is installed, the following must be a configurable option
* the user for whom clsh instance is being installed
* the number of pattern(s) that a user must type in
* when should the user type them in (e.g. first command, within first 2-5 commands, first command and 3rd command specifically
* the patterns themselves
* the configuration process should have an option for someone to point to a file containing entries like (an example follows below)
## Deliverables
requirements may be modified
An example of the file which may be pointed to during installation
* * username:abcd
* numofpattern=3
* order=withinfirst5commands
* patterns=igor:ldd:sudo (instead of the actual pattern, could store SHA1/MD5 hashes too)
* username:abcd1
* numofpattern=2
* order=1and5command (means command # 1 and # 5 specifically)
* patterns=igor:ldd
* Even if Ctrl-D/C is pressed when the shell is spawned the appropriate action, depending on whether it was an "expected" sequence or not must be taken.
Various authentication methods:
1) Admin can specify exact commands (ls, cd, sudo..) which the user (abcd) must type and the exact positions (1st command and 4th command and 5th command)
2) Admin can specify exact commands (ls, cd, sudo..) which the user (abcd) must type and the range of positions (between 1st command and 4th command) here the order matters, ls then cd then sudo
3) Admin can specify exact commands (ls, cd, sudo..) which the user (abcd) must type and the range of positions (between 1st command and 4th command) here the order does not matter, ls then sudo then cd is ok
When the program gets "installed" on the server, it should read a file containing:
+ username:abcd
+ numofpattern=3
+ order=withinfirst5commands
+ ordermatters=yes
+ patterns=igor:ldd:sudo (instead of the actual pattern, could store SHA1/MD5 hashes too)
+ username:abcd1
+ numofpattern=2
+ order=1and5command (means command # 1 and # 5 specifically)
+ patterns=igor:ldd
+ username:abcd3
+ numofpattern=2
+ order=withinfirst3commands
+ ordermatters=no
+ patterns=igor:ldd
More rationale: I need a bash shell clone, not just one shell script. The user should not be able to detect that his commands are being matched with patterns.
example: In case you want to insert a line of code in a user's .bash_profile and link it to a script, the user can easily detect this by looking at his/her bash_profile/bashrc etc.. thereby the need for the shell itself to transparently analyze the typed commands.
* * *This broadcast message was sent to all bidders on Wednesday Aug 26, 2009 3:50:32 PM:
Other requirements section has been finalized.