]>
git.armaanb.net Git - opendoas.git/log
Duncaen [Fri, 24 Jun 2016 14:50:17 +0000 (16:50 +0200)]
rename doas_pam.c to pam.c
Duncaen [Fri, 24 Jun 2016 14:33:42 +0000 (16:33 +0200)]
import sys-tree.h from openssh-portable
martijn [Sun, 19 Jun 2016 19:29:43 +0000 (19:29 +0000)]
Move the RB_ code from doas.h to env.c, and limit the environment interface to a simple prepenv function.
OK tedu@
tedu [Thu, 16 Jun 2016 17:40:30 +0000 (17:40 +0000)]
the environment handling code was showing its age. just because environ is a char** array doesn't mean we must exclusively operate on such. convert to a red-black tree, manipulate as desired, then flatten to array. potentially overkill for the current operations, but reading the tea leaves i see that more manipulations are desired. ok tb (and some thought provoking disagreement from martijn)
tedu [Sat, 11 Jun 2016 17:17:10 +0000 (17:17 +0000)]
don't use specified twice in a sentence, noticed by jmc
tedu [Sat, 11 Jun 2016 05:04:03 +0000 (05:04 +0000)]
clarify some wording
tedu [Sat, 11 Jun 2016 04:56:16 +0000 (04:56 +0000)]
specify that default is deny if no rule matches
Duncaen [Wed, 8 Jun 2016 16:01:25 +0000 (18:01 +0200)]
remove pledge seccomp shim
This will never work, seccomp can't filter for paths (pointer) and all
rules are inherited by child processes.
pledge does not limit processes executed by execve.
Duncaen [Wed, 8 Jun 2016 15:50:28 +0000 (17:50 +0200)]
open pam sessions with right user and remove setusercontext shim
before this change the sessions were opened as the user running doas.
Now it sets its uid to root and then opens a pam session for the target
user.
The setusercontext shim was removed, because pam handles all this and
its easier to just call setresuid and setresgid instead.
Duncaen [Wed, 8 Jun 2016 11:41:25 +0000 (13:41 +0200)]
Revert "sync with upstream (setenv)"
This reverts commit
7f11114f0f07c653e0ea3d4ae093d7dcdda4a4ef .
Duncaen [Sun, 5 Jun 2016 12:01:31 +0000 (14:01 +0200)]
bump version to 0.2
Duncaen [Sun, 5 Jun 2016 11:58:30 +0000 (13:58 +0200)]
add more restrictive permissions and root:root as owner for binary
Duncaen [Sun, 5 Jun 2016 11:42:30 +0000 (13:42 +0200)]
fix ld and cflags
Duncaen [Sun, 5 Jun 2016 11:33:36 +0000 (13:33 +0200)]
sync with upstream (setenv)
add a doas.conf setenv directive that allows setting environment
variables explicitly and by copying existing environment variables
of a different name. E.g.
permit nopass setenv { PS1=$SUDO_PS1 FOO=bar } keepenv :wheel
ok tedu@ benno@
Duncaen [Sun, 5 Jun 2016 11:29:58 +0000 (13:29 +0200)]
remove version.h and define VERSION in configure script
Duncaen [Thu, 2 Jun 2016 14:29:01 +0000 (16:29 +0200)]
check return value of setresuid
Duncaen [Thu, 2 Jun 2016 14:27:31 +0000 (16:27 +0200)]
remove nonstandard sys/cdefs.h
Duncan Overbruck [Mon, 9 May 2016 19:12:31 +0000 (21:12 +0200)]
Merge pull request #7 from frgm/master
fix configure and add a new target - "uninstall"
Svyatoslav Mishyn [Mon, 9 May 2016 09:32:20 +0000 (12:32 +0300)]
fix configure script
* "+=" is not working in shell
* fix a typo (OS_FLAGS => OS_CFLAGS)
Svyatoslav Mishyn [Mon, 9 May 2016 09:23:55 +0000 (12:23 +0300)]
bsd.prog.mk: add "uninstall" target
Duncaen [Sun, 8 May 2016 20:55:52 +0000 (22:55 +0200)]
Add doas style prompt for pam authentication
The doas style prompt "doas ($USER@$HOST) password:" is used if pam
gives back a prompt that matches "Password:[ ]" in other cases the
prompt provided by pam is used.
Duncaen [Sun, 8 May 2016 20:23:26 +0000 (22:23 +0200)]
Make pam session handling more failsafe
Duncaen [Sun, 8 May 2016 19:32:55 +0000 (21:32 +0200)]
More configure and make cleanup
Duncan Overbruck [Sun, 8 May 2016 19:24:28 +0000 (21:24 +0200)]
Merge pull request #4 from frgm/master
fix make install
Svyatoslav Mishyn [Sun, 8 May 2016 19:10:01 +0000 (22:10 +0300)]
fix make install
man{1,5} is not expanded
set default DESTDIR to an empty string
`mkdir -p //usr/bin` - it creates dir, but looks not very nice
also remove "[settings]" from configure usage
Duncaen [Sun, 8 May 2016 18:03:04 +0000 (20:03 +0200)]
Fix horrible mistake
Duncaen [Sun, 8 May 2016 18:01:25 +0000 (20:01 +0200)]
Simply install and move version to configure script
Duncaen [Sun, 8 May 2016 17:38:18 +0000 (19:38 +0200)]
set PAM_USER, PAM_RUSER and PAM_TTY if available
Svyatoslav Mishyn [Sun, 8 May 2016 08:26:32 +0000 (11:26 +0300)]
configure: tune up a little bit
* add usage() function
* remove unused options
* stop parsing option(s) if unknown was found
* set up "--enable-debug" and "--enable-static" options
Closes: #1 [via git-merge-pr]
Duncaen [Sun, 8 May 2016 14:15:58 +0000 (16:15 +0200)]
Add proper pam session handling
Duncaen [Sat, 7 May 2016 17:02:55 +0000 (19:02 +0200)]
Enable style option only if bsd_auth.h is available
Duncaen [Sat, 7 May 2016 17:00:42 +0000 (19:00 +0200)]
Fix typos and configure pledge detection
Duncaen [Fri, 6 May 2016 01:41:13 +0000 (03:41 +0200)]
Testing only seccomp pledge
Duncaen [Fri, 6 May 2016 01:40:33 +0000 (03:40 +0200)]
Add more compatibility functions for linux support
Duncaen [Fri, 6 May 2016 01:37:58 +0000 (03:37 +0200)]
Actually open pam sessions
Duncaen [Fri, 6 May 2016 01:35:18 +0000 (03:35 +0200)]
Sync doas.c
Duncaen [Fri, 6 May 2016 01:00:16 +0000 (03:00 +0200)]
Add configure script
Nathan Holstein [Mon, 10 Aug 2015 02:05:34 +0000 (22:05 -0400)]
Generate automatic header dependencies.
Nathan Holstein [Mon, 10 Aug 2015 01:27:47 +0000 (21:27 -0400)]
Add version information to doas executable.
This pulls in the dependency on version.h and adds the -v command line
option to print the version and build information.
Nathan Holstein [Sun, 9 Aug 2015 21:52:39 +0000 (17:52 -0400)]
Generate a version header file from Git.
This adds a rule to create the version.h file from the Git version. This
enables automatically embedding the Git version information into the
executable.
Nathan Holstein [Fri, 7 Aug 2015 04:31:30 +0000 (00:31 -0400)]
Change formating of comic in README.
Nathan Holstein [Fri, 7 Aug 2015 04:28:04 +0000 (00:28 -0400)]
Add the XKCD comic to README.
Nathan Holstein [Thu, 6 Aug 2015 05:16:35 +0000 (01:16 -0400)]
Add PAM service definition for doas.
These are the same configuration in MacOSX's default service definition
for sudo.
Nathan Holstein [Thu, 6 Aug 2015 05:07:33 +0000 (01:07 -0400)]
Add IO error checking to auth_userokay().
Nathan Holstein [Thu, 6 Aug 2015 04:47:52 +0000 (00:47 -0400)]
Update README to match status of PAM integration.
Nathan Holstein [Thu, 6 Aug 2015 04:40:10 +0000 (00:40 -0400)]
Implement PAM authentication.
This now lets us check for a password. This still needs some error
checking logic within pam_conv(). The current state could fail an IO
operation but still return PAM_SUCCESS.
Nathan Holstein [Wed, 5 Aug 2015 15:01:36 +0000 (11:01 -0400)]
Merge doas.c 1.34 from OpenBSD CVS.
Nathan Holstein [Wed, 5 Aug 2015 14:58:19 +0000 (10:58 -0400)]
Switch an unsigned for a size_t.
Nathan Holstein [Wed, 5 Aug 2015 13:53:11 +0000 (09:53 -0400)]
Break out make functionality into utility makefile.
This reverts the contents of Makefile back to (nearly) what it was in
the initial import--setting a few variables and invoking a helper make
script.
All complexity is now moved into bsd.prog.mk. It should be a decent base
for use in other executables as well.
Nathan Holstein [Wed, 5 Aug 2015 13:53:11 +0000 (09:53 -0400)]
Add installation rules for man files.
Nathan Holstein [Wed, 5 Aug 2015 13:45:05 +0000 (09:45 -0400)]
Add license file.
Nathan Holstein [Wed, 5 Aug 2015 07:11:15 +0000 (03:11 -0400)]
Add a make rule to create ${BINDIR}.
Nathan Holstein [Wed, 5 Aug 2015 07:00:56 +0000 (03:00 -0400)]
Being integration of PAM into auth_userokay().
Nathan Holstein [Wed, 5 Aug 2015 06:52:21 +0000 (02:52 -0400)]
Add README.md.
Nathan Holstein [Wed, 5 Aug 2015 06:33:00 +0000 (02:33 -0400)]
Add copyright clauses to new code.
Nathan Holstein [Wed, 5 Aug 2015 04:38:16 +0000 (00:38 -0400)]
Fix memory corruption bug in rules parsing.
Various yacc rules for optional configuration items weren't properly
setting the empty items to NULL. As a result, the rules list ends up
with invalid contents, including invalid string pointers.
This bug doesn't occur with OpenBSD's yacc, since it memset()s yyval
upon each reduce. GNU Bison doesn't have the matching memset(), and
thus the difference in behaviors.
Nathan Holstein [Mon, 3 Aug 2015 22:28:22 +0000 (18:28 -0400)]
Import explicit_bzero() from OpenBSD.
Nathan Holstein [Sun, 2 Aug 2015 19:52:15 +0000 (15:52 -0400)]
Implement the semantics of setusercontext().
Nathan Holstein [Sun, 2 Aug 2015 18:54:11 +0000 (14:54 -0400)]
Warn when doas.conf doesn't exist.
The default error message is confusing, just let the user know the file
doesn't exist.
Nathan Holstein [Sun, 2 Aug 2015 18:53:48 +0000 (14:53 -0400)]
Restrict read permissions of doas binary.
This mimics the permissions of sudo from Mac OSX.
Additionally, some gymnastics are performed to set the permissions and
owners of the binary before copying it to BINDIR.
Nathan Holstein [Sun, 2 Aug 2015 17:30:58 +0000 (13:30 -0400)]
Add compatibility functions from OpenBSD.
This adds a shim library to mimic features of OpenBSD. Some of these
functions are written from scratch, others are simply copies of their
OpenBSD namesakes.
Current implementation of the from-scratch variants are simply shims
that intentionally fail. They'll need to be extended with secure
implementations.
Nathan Holstein [Sun, 2 Aug 2015 16:19:15 +0000 (12:19 -0400)]
Fix a group of sign comparison warnings.
These variables are used as offsets into arrays, and are never set to -1.
This commit just propagates the usage of size_t through from arraylen().
Nathan Holstein [Sun, 2 Aug 2015 16:13:47 +0000 (12:13 -0400)]
Fix a sign comparison warning.
The 'i' variable was only used in this loop, so move it locally and
change its type to unsigned.
Nathan Holstein [Sun, 2 Aug 2015 16:12:34 +0000 (12:12 -0400)]
Header file revamp to build on MacOSX.
Nathan Holstein [Sun, 2 Aug 2015 16:11:40 +0000 (12:11 -0400)]
Makefile for gmake on MacOSX.
Nathan Holstein [Sun, 2 Aug 2015 15:29:48 +0000 (11:29 -0400)]
Add a simple .gitignore.
Nathan Holstein [Sun, 2 Aug 2015 15:27:34 +0000 (11:27 -0400)]
Add git-cvsimport author conversion file.
This includes most of the authors, and the preponderance of the commits,
of the OpenBSD doas commiters.
Ted Unangst [Mon, 3 Aug 2015 15:31:05 +0000 (15:31 +0000)]
remove an extra getuid call, reported by Martijn van Duren
Ted Unangst [Thu, 30 Jul 2015 17:04:33 +0000 (17:04 +0000)]
make gid parsing look like uid parsing. from Martijn van Duren
ack deraadt
Vadim Zhukov [Thu, 30 Jul 2015 14:02:04 +0000 (14:02 +0000)]
Fix usage examples.
From Theo Buehler on misc@, thanks!
okay jmc@, deraadt@.
Ted Unangst [Wed, 29 Jul 2015 00:00:31 +0000 (00:00 +0000)]
refine a comment
Theo de Raadt [Tue, 28 Jul 2015 21:36:03 +0000 (21:36 +0000)]
wrap some exceedingly long lines
Vadim Zhukov [Tue, 28 Jul 2015 19:49:04 +0000 (19:49 +0000)]
Rename some variables and add few comments in keepenv handling code.
Makes the code more readable.
okay tedu@
Vadim Zhukov [Tue, 28 Jul 2015 14:08:52 +0000 (14:08 +0000)]
Fix keepenv handling. Initially reported by Ze Loff on misc@.
tedu@ agrees.
Ted Unangst [Mon, 27 Jul 2015 21:44:11 +0000 (21:44 +0000)]
default permitted target is all users, not root.
Jean-Marie Cannie [Mon, 27 Jul 2015 17:57:06 +0000 (17:57 +0000)]
some improvements from michael reed;
Marc Espie [Mon, 27 Jul 2015 15:38:11 +0000 (15:38 +0000)]
Add -n to usage. As noticed by Theo Buehler.
Ted Unangst [Sun, 26 Jul 2015 23:00:15 +0000 (23:00 +0000)]
small clarifications
Ted Unangst [Sun, 26 Jul 2015 22:44:33 +0000 (22:44 +0000)]
checkconfig doesn't return anymore, noted by zhuk
Marc Espie [Sun, 26 Jul 2015 20:47:01 +0000 (20:47 +0000)]
nflag (as in sudo, force non-interactive mode)
as discussed with ted@
Vadim Zhukov [Sun, 26 Jul 2015 19:49:11 +0000 (19:49 +0000)]
Oops, CVS mismerged changes, resulting in compilable and mostly working,
but somewhat wrong code. Well, the CVS mismerged but I just missed.
Ted Unangst [Sun, 26 Jul 2015 19:14:46 +0000 (19:14 +0000)]
tweak config checking slightly
Vadim Zhukov [Sun, 26 Jul 2015 19:08:17 +0000 (19:08 +0000)]
Stop exiting on cmdline overflow: it's used only for logging, so aborting
the whole process is stupid, and actually breaks things.
Noticed and analyzed by as well as input from nigel@.
Okay tedu@, espie@ and (if I understood correctly) hall@
Vadim Zhukov [Sun, 26 Jul 2015 17:24:02 +0000 (17:24 +0000)]
Implement command matching without execution. This just extends
functionality of the -C flag, so we are not introducing more garbage.
Input and okay from jmc@ (documentation) and tedu@ (everything).
Vadim Zhukov [Fri, 24 Jul 2015 06:36:42 +0000 (06:36 +0000)]
Further improve syntax error reporting in doas:
- teach parser to recover after error, allowing to report many errors
instead of the first one only;
- fix remaining error printouts without exact position.
Some ideas were taken from diff sent by dlg@ earlier, thanks!
okay tedu@, dlg@
Jean-Marie Cannie [Thu, 23 Jul 2015 15:26:37 +0000 (15:26 +0000)]
tweak previous;
Vadim Zhukov [Wed, 22 Jul 2015 20:15:24 +0000 (20:15 +0000)]
Implement quoting support in doas.conf. Now you can pass environment
variables and arguments with almost any values.
As a bonus, doas will now point to exact place where syntax error occured
most of times; there is some room for improvement, though.
okay tedu@
Vadim Zhukov [Wed, 22 Jul 2015 16:35:03 +0000 (16:35 +0000)]
Small tweaks:
- whitespace on empty line;
- use getuid() consistently.
okay tedu@
Jean-Marie Cannie [Wed, 22 Jul 2015 06:30:12 +0000 (06:30 +0000)]
tweak previous; ok zhuk
Theo de Raadt [Wed, 22 Jul 2015 05:37:23 +0000 (05:37 +0000)]
one whitespace out of place
Jean-Marie Cannie [Tue, 21 Jul 2015 17:49:33 +0000 (17:49 +0000)]
options w/o args go first in SYNOPSIS, and add -C to usage();
Ted Unangst [Tue, 21 Jul 2015 16:15:20 +0000 (16:15 +0000)]
oops, previous commit regarding cases should have just been for parse.y.
then a commit that says:
add a -C option to check config files without running. ok halex
then *this* commit:
use setresuid to be explicit. suggested by deraadt
Ted Unangst [Tue, 21 Jul 2015 16:12:04 +0000 (16:12 +0000)]
cases should line up with switch, from Dimitris Papastamos
Vadim Zhukov [Tue, 21 Jul 2015 11:04:06 +0000 (11:04 +0000)]
Add argument matching support to doas.
Input and generic support from many. Final okay from tedu@.
Ted Unangst [Mon, 20 Jul 2015 20:18:45 +0000 (20:18 +0000)]
SHELL is out, from Michael Reed
Jean-Marie Cannie [Mon, 20 Jul 2015 07:43:27 +0000 (07:43 +0000)]
whitespace;
Ted Unangst [Mon, 20 Jul 2015 01:04:37 +0000 (01:04 +0000)]
sf points out sudo doesn't allow SHELL in children
Ted Unangst [Mon, 20 Jul 2015 01:00:48 +0000 (01:00 +0000)]
check that badlisted env has = after the name
Ted Unangst [Mon, 20 Jul 2015 00:57:53 +0000 (00:57 +0000)]
rescope and rename some variables to reduce pressure on the alphabet
Ted Unangst [Mon, 20 Jul 2015 00:54:01 +0000 (00:54 +0000)]
introduce a minimal badset ($ENV) for environment stripping so that
root shells read the right .kshrc