1
0
mirror of https://github.com/slicer69/doas synced 2024-07-05 17:08:34 +00:00
Commit Graph

13 Commits

Author SHA1 Message Date
Jesse Smith
a006f46031 On some platforms (seemingly Linux and macOS) it is possible for
repeated calls to getpwuid() can over-write the original struct passwd
strucuture. This can lead to the original user's environment data
being overwritten by the target user's, even when "keepenv" is
specified in the doas.conf file.

We now do a deep copy of the original and target users' struct passwd
information to avoid over-writting the original on platforms where libc
uses a static area for all calls.
2019-12-27 22:10:57 -04:00
Jesse Smith
705dd9ce24 Reorganized compatibility code and Makefile.
- amalleo25
Provided cleaner fix for crash when user/command has
no valid match in the doas.conf file.
- amalleo25
Removed option to match UID with -u flag. Provided
usernames must now match a username, not UID. This was
ambigious if a user had a numeric username.
- Jesse
2019-09-10 13:56:32 -03:00
Jesse Smith
8e9c2bde06 Removed the transfer of most environment variables, such as USER, HOME,
and PATH from the original user to the target user. This could cause
files in the wrogn path or home directory to be read (or written to),
which resulted in potential security problems.

This has been changed so that only DISPLAY and TERM are passed to the
new environment. This is fine for running command line programs. When
GUI programs need to be run, "keepenv" can be added to the user's
doas.conf entry. This results in variables like HOME being copied
to the target user, allowing GUI programs to run.

Many thanks to Sander Bos for reporting this issue and explaining
how it can be exploited.

This commit also adds the ability to pass a customized PATH to
target users. The new PATH can be set at compile time in the
Makefile. The default path is provided in the Makefile and commented
out.
2019-08-03 17:39:15 -03:00
Jesse Smith
fd79e385d7 Minor fixes to avoid compiling error on FreeBSD following Linux fixes. 2019-03-10 19:22:09 -03:00
Jesse Smith
c8cb4d999e Avoid echoing stdin when output is piped to doas.
Fix asprintf() compile warning when building on Linux.
2019-03-10 19:11:40 -03:00
Jesse Smith
31f072078a Merge branch 'katakk-up' Brings us up to speed with OpenBSD 5.9. 2017-02-17 11:25:54 -04:00
Antonio Huete Jimenez
89ef570890 Fix build for DragonFly BSD
Until our sys/tree.h gets synced.
2017-02-15 11:33:34 +01:00
katakk
453102110a Merge, update from OpenBSD 2017-01-24 01:12:56 +09:00
Jesse Smith
cdf69cb5f5 This commit allows doas to compile on Linux. Does not authenticate yet. 2016-06-26 11:41:31 -03:00
Tobias Kortkamp
64ab988d34 Change realloc() back to reallocarray() 2016-06-24 13:29:08 +02:00
User Jesse
e6f145622d Removed unused reallocarr.c file and removed references to it from Makefile.
Fixed typo in parse.y which used + instead of * when calculating memory usage.
2016-06-22 22:59:03 +00:00
Jesse Smith
d55af6cdf4 This is the initial port of doas to FreeBSD. It compiles, installs and works.
Could probably use a clean-up, but this code is functional on FreeBSD 10.3.
2016-06-22 12:21:34 -03:00
Jesse Smith
cb8d475985 Initial upload from OpenBSD
This is the initial upload from OpenBSD. Kept for history and comparision with future releases.
2016-06-22 12:17:53 -03:00