1
0
Fork 0
forked from soccera/rdo

Add version and usage if no arguments are given.

This commit is contained in:
remoof 2021-07-17 18:29:39 +02:00
parent 7df91d5f0b
commit f2137dc28d

9
rdo.c
View file

@ -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)