1
0
Fork 0
forked from soccera/rdo
fixed parsing vulnerability rdo
Find a file
2022-12-03 18:52:46 -03:00
.gitignore First Commit 2021-07-13 21:33:12 +02:00
LICENSE First Commit 2021-07-13 21:33:12 +02:00
Makefile Add static compilation rule to makefile 2022-12-03 18:52:46 -03:00
rdo.c Fix string format, push version 1.4.2 2022-07-28 17:21:52 +02:00
rdo_sample.conf Add groups support 2022-03-08 17:32:53 +01:00
README.md Add own readpassphrase function 2022-05-05 08:21:48 +02:00
readpassphrase.h Use the correct file descriptor for printing 2022-05-06 08:19:18 +02:00
sessions.h Add groups support 2022-03-08 17:32:53 +01:00

RootDO AUR

This project aims to be a very slim alternative to both sudo and doas.

Installation

If you are on Arch Linux, you can download the package via the AUR.

You can clone and build rdo with the following set of commands:

git clone https://codeberg.org/sw1tchbl4d3/rdo
cd rdo
make
sudo make install

After that, you'll have to configure rdo to allow you to use it. To do this, edit /etc/rdo.conf, and set the group variable to the admin group you are in.

Then you're good to go!

To uninstall:

sudo make uninstall

Usage

rdo [command]

The configuration file has the following variables:

group=wheel
wrong_pw_sleep=1000
session_ttl=5
  • group: The group of users that is allowed to execute rdo.
  • wrong_pw_sleep: The amount of milliseconds to sleep at a wrong password attempt. Must be a positive integer. Set to 0 to disable.
  • session_ttl: The amount of minutes a session lasts. Must be a positive integer. Set to 0 to disable.

Benchmarks

The benchmark: Execute whoami (GNU coreutils 8.32) 1000 times.

Yes, this is a silly benchmark. Yes, the performance gain in real world application is close to nothing.

But it's fun!

Program Time
sudo 1.9.9 22.12s
opendoas 6.8.2 13.5s
rdo 1.4 3.5s
Baseline 2.1s

Baseline here is how long it took without any wrapper to make it root.

These benchmarks were done on a single core of an AMD FX-8350 processor, on Artix Linux version 5.16.12-zen1-1-zen.

sudo and opendoas were pulled from the pacman repos, rdo via AUR.

All configs were kept as default, except allow the wheel group on both + enable persist on doas.

Script used:

#!/bin/sh

$1 whoami

current=$(date +%s.%N)
for i in {1..1000}; do
	$1 whoami 2>&1 >/dev/null
done
done=$(date +%s.%N)

echo $done - $current | bc

The script requires bc to be installed, for floating point arithmetics.