|
C-Menu 0.2.9
A User Interface Toolkit
|
restricted shell to run bash as root More...
#include <cm.h>#include <libssh/libssh.h>#include <limits.h>#include <stdbool.h>#include <stddef.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <sys/resource.h>#include <sys/types.h>#include <sys/wait.h>#include <syslog.h>#include <termios.h>#include <unistd.h>Go to the source code of this file.
Functions | |
| void | ABEND (int e, char const *) |
| Abnormal termination - print an error message and exit. | |
| int | main (int argc, char **argv) |
| Main function for rsh. | |
Variables | |
| bool | f_verbose = false |
| void ABEND | ( | int | e, |
| char const * | s ) |
Abnormal termination - print an error message and exit.
| e | Error code |
| s | Error message |
This function prints the provided error message along with the error code and its corresponding string representation, then exits the program with a failure status.
Definition at line 159 of file rsh.c.
| int main | ( | int | argc, |
| char ** | argv ) |
Main function for rsh.
| argc | Argument count |
| argv | Argument vector |
If executed as 'rsh', this program sets the user ID and group ID to 0 (root) and then executes the user's default shell (or /usr/bin/bash if SHELL is not set) with the provided arguments. If no arguments are given, it runs the shell in interactive mode. To work properly, this program must be compiled and set with the setuid bit:
to verify proper operation:
Definition at line 66 of file rsh.c.
References ABEND(), and f_verbose.