FreeNOS
|
Login program which starts the user shell. More...
#include <Login.h>
Public Member Functions | |
Login (int argc, char **argv) | |
Constructor. More... | |
virtual | ~Login () |
Destructor. More... | |
virtual Result | exec () |
Execute the application. More... | |
Public Member Functions inherited from POSIXApplication | |
POSIXApplication (int argc, char **argv) | |
Class constructor. More... | |
virtual | ~POSIXApplication () |
Class destructor. More... | |
Public Member Functions inherited from Application | |
Application (int argc, char **argv) | |
Class constructor. More... | |
virtual | ~Application () |
Class destructor. More... | |
virtual int | run () |
Run the application. More... | |
Private Member Functions | |
const char * | getUsername () const |
Read username from standard input. More... | |
void | printPrompt () const |
Print the login program prompt. More... | |
Additional Inherited Members | |
Public Types inherited from Application | |
enum | Result { Success, NotFound, IOError, InvalidArgument, ShowUsage, TimedOut, OutOfMemory } |
Result codes. More... | |
Protected Member Functions inherited from POSIXApplication | |
virtual Result | output (const char *string) const |
Print text to output. More... | |
int | runProgram (const char *path, const char **argv) |
Runs an external program. More... | |
Protected Member Functions inherited from Application | |
virtual Result | initialize () |
Initialize the application. More... | |
virtual Result | output (String &string) const |
Print string to output. More... | |
ArgumentParser & | parser () |
Get program arguments parser. More... | |
const ArgumentParser & | parser () const |
Get constant program arguments parser. More... | |
const ArgumentContainer & | arguments () const |
Get program arguments. More... | |
void | setVersion (const String &version) |
Set program version. More... | |
Protected Attributes inherited from Application | |
int | m_argc |
Input argument count. More... | |
char ** | m_argv |
Input argument values. More... | |
Login::Login | ( | int | argc, |
char ** | argv | ||
) |
Constructor.
Definition at line 29 of file Login.cpp.
References Application::parser(), ArgumentParser::registerPositional(), and ArgumentParser::setDescription().
|
virtual |
Execute the application.
Implements Application.
Definition at line 92 of file Login.cpp.
References Application::arguments(), close(), errno, ERROR, forkexec(), getUsername(), O_RDONLY, O_RDWR, open(), printPrompt(), strerror(), strlen(), Application::Success, and waitpid().
|
private |
|
private |
Print the login program prompt.
Definition at line 41 of file Login.cpp.
References printf(), utsname::release, utsname::sysname, and uname().
Referenced by exec().