Commit graph

79 commits

Author SHA1 Message Date
Jesse Smith 08872e70c9 Added explanation of what vidoas does to the top of the script. 2020-08-07 18:42:52 -03:00
Jesse Smith 0d53f98938 Updated doas.conf.5 manual page to include mention of the vidoas script. 2020-08-07 18:41:41 -03:00
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 04b377f6fd On Linux doas no longer requires the user to specify the double-dash (--)
prior to a command that accepts arguments. Patch provided by Martijn
van Duren.
2020-08-06 15:17:09 -03:00
Jesse Smith d49ac8e10c
Merge pull request #36 from helmat/master
Add option for full login
2020-06-21 11:08:22 -03:00
helmat 4702702752
Update doas.1 2020-06-21 15:31:05 +02:00
helmat 93a56843e4
Update doas.c 2020-06-21 15:29:37 +02:00
Jesse Smith 0a04433044
Update README.md 2020-06-07 14:40:45 -03:00
Jesse Smith 47f7dc7b3e
Added fix for CentOS installs
Added fix for CentOS (and related distros) where doas is prevented from using PAM to authenticate.
2020-06-07 14:39:46 -03:00
Jesse Smith 11a7ea1824 Added pam.conf.freebsd example file in the compat
directory to enable PAM configuration
on FreeBSD and related operating systems.
2020-04-20 19:52:48 -03:00
Jesse Smith f2a55eb049 Updated macOS install instructions to make sure PAM configuration works as expected. 2020-02-06 22:58:12 -04:00
Jesse Smith 3f69b3e4f5 Aded sample doas.conf file.
Closes GitHub issue #29
2020-01-04 19:56:46 -04:00
Jesse Smith 5cd77cea5f Made sure parse.o is cleaned up. 2019-12-27 22:16:17 -04:00
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 f88bb2e8c4
Merge pull request #27 from ng-0/fix-pkg54717
manpages: patch in the correct installed location of the config file.
2019-11-28 12:50:46 -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
Jesse Smith ebd62ce4ae
Merge pull request #25 from gbergling/master
Add support for building doas on macOS Catalina
2019-10-12 12:07:28 -03:00
Gordon Bergling 989da8fc41 Fix Typo in README 2019-10-12 11:26:10 +02: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 a6f487f708 Added untracked files from compat. 2019-09-10 14:05:57 -03: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 7007ce8ebd Fixed potential crash on Linux when target user is not
one of the valid users listed in doas.conf.
2019-09-03 17:36:04 -03:00
Jesse Smith 1c2858c681 Removed unused login_style variable on Linux. Is only
used when using BSD authorization.
2019-09-03 11:52:15 -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
Jesse Smith 79c6c61a73
Merge pull request #23 from Duncaen/setusercontext
fix the setusercontext(3) workaround
2019-09-03 10:43:56 -03:00
Duncan Overbruck 6cf0236184 fix the setusercontext(3) workaround
Seeing this being used on even more system like Illumos with this ugly
and security critical bug open makes me cringe every time I check if it
was finally fixed.

I reported it directly to the maintainer in 2017. I reported it to
pkgsrc-security@netbsd.org without a response.
2019-09-03 02:45:20 +02:00
Jesse Smith 6886689b6b Fixed typo in README file. 2019-09-02 14:10:12 -03:00
Jesse Smith 354625ddd5
Merge pull request #22 from amalleo25/illumos
Add support for illumos
2019-09-02 14:08:00 -03:00
Adam Malleo 9c53fdeb0b Add support for illumos 2019-09-02 12:37:58 -04:00
Jesse Smith 281bb99562
Update README.md 2019-08-23 21:58:14 -03:00
Jesse Smith 7374c5c4d2
Merge pull request #20 from ng-0/README-typos
fix typo in README and add pkgsrc.
2019-08-23 21:55:58 -03:00
ng0 ee4e9c017a fix typo in README and add pkgsrc. 2019-08-23 23:17:43 +00:00
Jesse Smith f400e06e1f
Merge pull request #18 from ng-0/netbsd-buildimprovements
Makefile: Add DESTDIR, MANDIR, and SYSCONFDIR variables.
2019-08-20 14:47:59 -03: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 a8cd6a47ad Removed unused variable assignment in execvpe.c 2019-07-21 20:13:56 -03:00
Jesse Smith b96ddd6c3f Fix format warning from Clang compiler. 2019-07-06 14:23:38 -03:00
Jesse Smith 3a208f47df
Create README.md 2019-06-24 20:22:33 -03:00
Jesse Smith 0e23c8e1cb Merge branch 'netbsd' 2019-06-24 19:17:59 -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 64d27e1c8b Whitespace change 2019-06-24 19:13:28 -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 fe6d3a342b Updated doas.c with patch from arthepsy. Fixes -n flag
so if a password prompt is required, doas will automatically fail.
2017-10-11 10:32:20 -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
Jesse Smith 261c216449 Updated license file.
Fixes potential buffer overflow on Linux systems. (Thanks to Duncaen for pointing out the issue.)
2017-02-24 10:46:46 -04: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
Jesse Smith ce871f82bc Updated documentation to include -- paramter and to make it clear
the persist keyword does not currently work on Linux or FreeBSD.
2017-02-17 11:24:29 -04:00
Jesse Smith fb1108b586 Merge pull request #10 from tuxillo/patch-2
Fix build for DragonFly BSD
2017-02-15 09:23:58 -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