Commit graph

93 commits

Author SHA1 Message Date
lily
0b38e485b2 fix readme 2025-08-13 11:23:36 +10:00
lily
d96d862383 fix readme 2025-08-13 11:22:01 +10:00
lily
71896dabaa add manpage and fix makefile 2025-08-13 11:13:10 +10:00
2180cc7119 Merge pull request 'changed compiler to cc, shortened rdo.c' (#1) from coast/rdo:main into master
Reviewed-on: #1
2025-08-12 22:37:28 +00:00
1f3611e4c1 changed compiler to cc, shortened rdo.c 2025-08-13 02:04:32 +03:30
lily
20a97c65ad add ebuild 2025-08-13 08:34:13 +10:00
lily
4aab1431ed fix parsing vulnerability 2025-08-13 08:12:38 +10:00
sw1tchbl4d3
81a2ea4414 lock tty ioctl to openbsd 2023-02-05 12:43:21 +01:00
sw1tchbl4d3
4309fe26d9 clean up bsd compatibility functions 2023-02-05 10:21:01 +01:00
sw1tchbl4d3
ca8a3ee603 void unused parameters in ioctl session route 2023-02-04 10:40:14 +01:00
sw1tchbl4d3
44d44e86d1 Add support for TIOCSETVERAUTH ioctl 2023-02-04 10:32:21 +01:00
sw1tchbl4d3
6a34dbb90a /run -> /var/run
Closes #17
2023-02-02 20:29:24 +01:00
sw1tchbl4d3
bd8380d809 Bump to 1.4.3 2023-02-02 20:21:15 +01:00
sw1tchbl4d3
c9d468df67 Move binary file to /usr/local/bin
Seems more appropriate for a custom binary
2023-02-02 20:19:42 +01:00
sw1tchbl4d3
5f395137e3 Reference root group by ID 2023-02-02 19:54:31 +01:00
sw1tchbl4d3
c17cc8a416 Remove outdated crypt.h reference 2023-02-02 19:37:58 +01:00
sw1tchbl4d3
c3f0b728ba Add support for platforms without shadow.h 2023-02-02 19:14:46 +01:00
sw1tchbl4d3
0b30c02c4a Merge pull request 'Implement benchmark build stage on Dockerfile' (#15) from henriquehbr/rdo:benchmark-container into main
Reviewed-on: https://codeberg.org/sw1tchbl4d3/rdo/pulls/15
2022-12-27 14:23:06 +00:00
Henrique Borges
319f8f83a4 Implement benchmark on a Dockerfile 2022-12-27 11:21:01 -03:00
sw1tchbl4d3
b34d64fd5c Don't search for tty, open it directly. 2022-12-20 22:51:14 +01:00
sw1tchbl4d3
2f0bdc7712 Convert indentation for all files to spaces
To unify things.
2022-12-17 00:37:56 +01:00
sw1tchbl4d3
3dcb269236 Add instructions for reading the password from stdin 2022-12-17 00:33:56 +01:00
sw1tchbl4d3
abab0046ee Add ability to read password from stdin
This can be done by supplying `-` as the first argument.
2022-12-17 00:25:24 +01:00
sw1tchbl4d3
9ce20a62a4 Simplify tty finding process in readpassphrase
This went through a bunch of hoops before to acquire a file descriptor
we already had, this is now ommited.
2022-12-17 00:12:03 +01:00
sw1tchbl4d3
c1acb73270 Merge pull request 'Allow specifying custom installation directory' (#16) from henriquehbr/rdo:custom-destdir into main
Reviewed-on: https://codeberg.org/sw1tchbl4d3/rdo/pulls/16
2022-12-15 17:34:59 +00:00
Henrique Borges
415eab0e6b Allow specifying custom installation directory 2022-12-15 14:10:01 -03:00
sw1tchbl4d3
7ab7f4bd65 Merge pull request 'Add static compilation rule to makefile' (#12) from henriquehbr/rdo:main into main
Reviewed-on: https://codeberg.org/sw1tchbl4d3/rdo/pulls/12
2022-12-04 11:05:53 +00:00
Henrique Borges
30c3a46310 Replace --static flag with -static-pie 2022-12-04 08:03:31 -03:00
Henrique Borges
ac5b102245 Add static compilation rule to makefile 2022-12-03 18:52:46 -03:00
sw1tchbl4d3
46872e4ebd Fix string format, push version 1.4.2 2022-07-28 17:21:52 +02:00
sw1tchbl4d3
fd4ee6a712 Use the correct file descriptor for printing
Before we used printf("\n"); to simulate the enter key the user pressed,
which prints to normal stdout, which could have been redirected.
Now we directly write to the found TTY.

We also close the TTY file descriptor on every code path now.
2022-05-06 08:19:18 +02:00
sw1tchbl4d3
66d15caad4 Bump version to 1.4.1
From now on we will bump the minor version for feature additions, and
the patch version will signify smaller changes.
As we removed the libbsd dependency, I'd like to publish this version.
2022-05-05 08:28:36 +02:00
sw1tchbl4d3
d09a59a77e Add own readpassphrase function
This removes the libbsd dependency.
Fixed #10.
2022-05-05 08:21:48 +02:00
sw1tchbl4d3
c82d7e777e Change HOME to /root on exec
This affected some programs like vim, which put root-owned swap files
into the normal user's swap directory, since $HOME didn't change.

Fixes #11
2022-05-05 07:28:12 +02:00
sw1tchbl4d3
599aa73a8c Update install procedure to new group feature
I knew I forgot it somewhere...
2022-03-08 18:12:42 +01:00
sw1tchbl4d3
6e02a05f10 Update benchmarks
You may wonder why the benchmark times overall increased, on a
seemingly better processor.
That is most likely because the single core performance of the
FX series is worse than the single core performance of the Intel laptop
processor I benchmarked on before.
2022-03-08 18:10:57 +01:00
sw1tchbl4d3
c901cbb6c1 Push version to 1.4
With groups support now added, this warrants a new full release.
2022-03-08 17:35:03 +01:00
sw1tchbl4d3
35232fef05 Add groups support
rdo now supports taking a group name instead of only allowing a single
user.
This also completely removes the user option, as it isn't necessary
anymore with groups support.
2022-03-08 17:32:53 +01:00
sw1tchbl4d3
5404c11700 Rename sleep_ms to sleep_us
The variable name was misleading, as we didn't calculate the time to
sleep in milliseconds, but in microseconds.
2022-03-08 17:03:14 +01:00
sw1tchbl4d3
368026d4b4 Remove unnecessary ruid==0 check
This is not necessary, as we checked it already on line 62.
2022-03-08 16:59:45 +01:00
sw1tchbl4d3
41dfdb321f Remove LSAN from the debug build
For some unknown reason LSAN catches a SIGSEGV (rdo.c:45) when enabled,
but removing it also removes the supposed SIGSEGV it catches.
To repro, build the earlier build with LSAN, and enter a file that
doesnt exist.
As long as I don't know why LSAN thinks this simple error message causes
a segmentation fault, I will remove it.
2022-03-08 16:51:04 +01:00
sw1tchbl4d3
08d66239fa Reduce memory access in runprog
Previously, we used a for loop to rearrange argv to omit the first
argument, the rdo call itself.
It's way smarter to just dereference the first argv argument, and use it
as an argv pointer, to achieve the same result.
2022-03-08 16:42:43 +01:00
sw1tchbl4d3
9395a6ca7e Fix debug build
GCC doesnt want to compile a binary with fortify when optimizations are
disabled, so we move the fortification process into the release flags.
2022-03-08 16:26:18 +01:00
sw1tchbl4d3
cfa1b3b10f Make the hashing failure error message more descriptive
This error occurs when the user we try to hash the password for doesn't
have a password, as seen in #8.

We now mention this, to avoid future confusion.
2022-02-12 08:07:48 +01:00
sw1tchbl4d3
8c0e7560ba Error if euid != 0
This can happen if the rdo binary isn't set up as SUID.
2022-02-09 20:17:45 +01:00
sw1tchbl4d3
a76a602886 Clarify build instructions in README 2022-02-09 20:16:13 +01:00
sw1tchbl4d3
6b6d607ea6 Be more specific with getpwnam() errors
getpwnam() does not populate errno when the user simply doesn't exist,
making err() print "Success" as the error.

We now check for errno == 0, and print a different error message for it.
2022-02-09 20:06:28 +01:00
sw1tchbl4d3
f1b75ffe48 Tighten permissions for the config file 2022-02-09 19:48:32 +01:00
sw1tchbl4d3
97bb40e37b Refactor Makefile
These changes make rdo build on my rpi, probably because this specific
GCC version requires arguments in the order we now supply.

We also disable ASAN in the debug build (for now), as it seems to cause
a segfault on my rpi.
2022-02-09 19:37:43 +01:00
sw1tchbl4d3
1bc833693b Add checks for crypt() and getspnam() failure 2022-02-08 21:09:36 +01:00