Commit Graph

15 Commits

Author SHA1 Message Date
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