Commit graph

22 commits

Author SHA1 Message Date
Jesse Smith e4d73c97a3 Added a new shell script called vidoas. This script creates a temporary
version of the doas.conf file. Then allows the user to edit it.
The new configuration file is checked for syntax and then, if it passes,
is installed on the system. If the syntax check fails the user is asked
to fix any errors.
2020-08-07 18:18:40 -03:00
Jesse Smith 5cd77cea5f Made sure parse.o is cleaned up. 2019-12-27 22:16:17 -04:00
ng0 dad0c10232 manpages: patch in the correct installed location of the config file.
This resolves http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=54717
2019-11-28 10:17:11 +00:00
Gordon Bergling b275ba2e56 Add support for building doas on macOS Catalina
- Adjust the Makefile and the README for macOS / Darwin specific build instructions
- Add bsd-closefrom.c as a more portable version of closefrom(2), which was
  obtained from the portable version of OpenSSH 8.1
2019-10-12 11:20:02 +02: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 2f83222829 Added optimization to Makefile (can be set/overruled using OPT).
Added flag to display all warnings during compiling.
Added status checks when parsing user/group IDs for Linux.
Make sure Linux drops original user's groups when running as another user.
2019-09-03 11:42:27 -03:00
Adam Malleo 9c53fdeb0b Add support for illumos 2019-09-02 12:37:58 -04:00
ng0 5bef71c735 Makefile: Add DESTDIR, MANDIR, and SYSCONFDIR variables. 2019-08-20 17:05:34 +00: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 1f76dd9515 Enabled doas to compile and run on NetBSD 8.1. 2019-06-24 19:15:03 -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 4bd6c1c178 Fixed issue with port of doas searching the user's full path for
commands matching the "cmd" parameter in doas.conf. The path
should be shortened to system-standard paths. This prevents
the user from injecting their own application with a familiar
name in their PATH variable and tricking doas into running it.
2017-09-05 21:40:47 -03:00
Tobias Kortkamp 7ab94a448a Restore old behavior on Linux which was broken by the last commit
Small change in the Makefile so doas compiles on Ubuntu 16.04
2016-11-03 21:28:20 +01:00
Tobias Kortkamp 08dab0cd9c Use setusercontext on FreeBSD and get rid of the geteuid/setuid workaround 2016-09-17 02:15:40 +02:00
Jesse Smith 47b4ab919a Linux port now compiles and runs. Properly authenticates. 2016-06-26 14:34:33 -03:00
Jesse Smith cdf69cb5f5 This commit allows doas to compile on Linux. Does not authenticate yet. 2016-06-26 11:41:31 -03:00
Jesse Smith f3958f04ad Added reallocarray.c to Makefile to insure it compiles. 2016-06-24 10:06:43 -03:00
Tobias Kortkamp aea70ce4ea Apply patches from security/doas port 2016-06-24 13:42:00 +02:00
Tobias Kortkamp 0e2179b92e Simplify Makefile and respect CFLAGS and LDFLAGS from environment 2016-06-24 13:38:10 +02: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