Commit Graph

39 Commits

Author SHA1 Message Date
Linux User
9f0238d788 pause for some time on wrong password 2021-10-25 16:57:44 +02:00
Linux User
b97be63e1a reset terminal state on termination 2021-10-25 16:50:57 +02:00
Linux User
fedeed40ec changed config, + became permit and - deny 2021-10-24 22:04:41 +02:00
874ee585b7 updated readme 2021-07-25 18:18:14 +02:00
720f956267 suggest config file permissions 2021-07-25 18:06:28 +02:00
9c6f7703dc fix typos 2021-07-16 11:15:27 +02:00
e2284c301b added manual pages 2021-07-15 23:18:46 +02:00
990136a6a7 bug fixes
- typo in help message
- config not ignoring tabs
- groups not using target user group list
2021-07-15 23:17:57 +02:00
37967a87c0 added help message 2021-07-14 19:41:35 +02:00
475aa341c5 implemented "nolog" option 2021-07-14 19:28:12 +02:00
f489885e3e implemented config persist 2021-07-14 16:52:09 +02:00
391353cea6 more comment and bug fix
commented some stuff and fixed config parser ignoring invalid config keywords
2021-07-14 10:00:07 +02:00
86a6af5073 less free()s
allocate user info in a structure on the stack, this way memory is managed for
us and we don't have to free most things that would be difficult to free.
2021-07-13 17:17:25 +02:00
3f1bf8c5be I know what to do 2021-07-13 13:26:31 +02:00
e63109a763 improvements and fixes 2021-07-13 13:25:34 +02:00
d6c13b3d39 first working config file 2021-07-12 23:19:47 +02:00
c1050a27f9 added erroring functions 2021-07-11 13:35:36 +02:00
01c4b00352 only openbsd doesn't use -lcrypt 2021-07-11 13:35:13 +02:00
1594ec867b fix nasty expired pointer 2021-07-09 21:47:53 +02:00
2e181319ed make: resolve LDFLAGS based on system 2021-07-09 23:43:40 +02:00
9494b18325 compiles on openbsd 2021-07-09 20:54:24 +02:00
fb6c872dc7 authenticate using /etc/shadow
completely remove the dependency on PAM, it is unnecessary in this sort of
simple program
2021-07-09 18:01:09 +02:00
074ebfec6c updated todo 2021-06-18 12:06:41 +02:00
6c929ad26d fixed auth tries
open and close the pam context between each authentication attempt to prevent
errors with consecutive authentications, this is a hack but I don't know a
better way.
2021-04-15 14:56:28 +02:00
c21ca28ae9 remove unused stuff
removed commented execvpe() implem.
removed some FIXME and TODO comments
checked error value in one case
moved up auth() a couple of lines
2021-04-15 14:43:41 +02:00
fe9d88e7f9 env flag
implemented -e flag:
it copies the elements of env that we want to keep, clears the environment and
sets it to only the saved and default elements.

also removed the code for copying the environment and allocating a new one
2021-04-04 19:34:10 +02:00
5412a3785e change env
us now changes the environment variables listed in TODO before executing the
command, also added but commented out a version where the env gets copied and
the execution happens trough the musl implementation of execvpe(3)
2021-04-04 12:42:03 +02:00
72c217d74a reverted to the old exec way
this branch will contain a version of us which doesn't use a subshell as
a proxy but directly applies the privilege escalation to the command
2021-04-03 18:03:13 +02:00
a666081599 touches to shell proxy
reworked the privilege escalation works by changing the way target user info
is passed around, now we pass struct passwd* and struct group* instead of
strings wich allows much greater flexibility.
Also now us mimics the behavior of sudo and doas regarding the shell proxies:
- commands are started under a subshell, that shell is the user's
- if no command is specified just the shell is executed
2021-04-03 17:17:23 +02:00
37c594c1bd implemented shell wrapper
commands are now run in a subshell, this is often needed for chains of commands
where it is not the main command to need the privilege but a subcommand does,
for example

us echo 30 > /sys/class/backlight/*/brightness

it is not echo that needs the elevated privilege but the redirection '>' does.
2021-04-03 01:40:59 +02:00
704914f4cb updated project description 2021-04-03 01:22:36 +02:00
eefd0545cd todo and notes
added two files,
TODO: things that still need to be taken care of that may be too long to
	write in the source code
config.template: mockups of the config file
2021-04-03 01:20:48 +02:00
5ef9bd4200 command line options
added command line options, for now only -u and -g are listed and implemented,
they allow to change user and group target (default is root)
2021-03-28 16:58:28 +02:00
778168b21a debug options
correctly compile in debug mode
2021-03-28 16:57:44 +02:00
b96d4648a3 licensed code
licensed all code under GPLv3 only license.
2021-03-27 23:01:22 +01:00
1c75e7dd3c working permissions
fixed problem where only euid and egid were set so programs complained, now
us correctly sets e/ruid, e/rgid and groups list to match the wanted user
2021-03-27 22:34:01 +01:00
981fed3499 planning comments 2021-03-24 23:39:20 +01:00
8fef02de37 pam authentication
us now attempts to verify the authentication using PAM, after three failed
attempts it stops execution
2021-03-23 15:11:37 +01:00
e891693f6f initial commie 2021-03-22 14:06:08 +01:00