forked from soccera/rdo
Add version and usage if no arguments are given.
This commit is contained in:
parent
7df91d5f0b
commit
f2137dc28d
1 changed files with 7 additions and 2 deletions
9
rdo.c
9
rdo.c
|
@ -9,6 +9,8 @@
|
|||
#include <bsd/readpassphrase.h>
|
||||
#include "sessions.h"
|
||||
|
||||
#define VERSION "1.2"
|
||||
|
||||
void getconf(FILE* fp, const char* entry, char* result, size_t len_result) {
|
||||
char* line = NULL;
|
||||
size_t len = 0;
|
||||
|
@ -49,8 +51,11 @@ int main(int argc, char** argv) {
|
|||
char username[64], wrong_pw_sleep[64], session_ttl[64], password[128];
|
||||
unsigned int sleep_ms, tries, ts_ttl;
|
||||
|
||||
if (argc < 2)
|
||||
errx(1, "Please specify a program to run");
|
||||
if (argc == 1) {
|
||||
printf("RootDO version: %s\n\n", VERSION);
|
||||
printf("Usage: %s [command]\n", argv[0]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ruid = getuid();
|
||||
if (ruid == 0)
|
||||
|
|
Loading…
Add table
Reference in a new issue