]> git.armaanb.net Git - opendoas.git/log
opendoas.git
7 years agobump version to v6.0 v6.0
Duncaen [Tue, 6 Sep 2016 00:58:42 +0000 (02:58 +0200)]
bump version to v6.0

7 years agoAdd closefrom(2) from openssh-portable
Duncaen [Tue, 6 Sep 2016 00:56:34 +0000 (02:56 +0200)]
Add closefrom(2) from openssh-portable

7 years agoPrint -a flag in usage() only if HAVE_BSD_AUTH_H
Philip K [Mon, 5 Sep 2016 16:26:24 +0000 (18:26 +0200)]
Print -a flag in usage() only if HAVE_BSD_AUTH_H

Closes: #11 [via git-merge-pr]
7 years agominor configure tweaks
Duncaen [Sat, 3 Sep 2016 21:02:49 +0000 (23:02 +0200)]
minor configure tweaks

7 years agoconfigure: error out if no authentication found and fix default CC
Duncaen [Fri, 2 Sep 2016 18:41:37 +0000 (20:41 +0200)]
configure: error out if no authentication found and fix default CC

7 years agoThe string with path to shell could be taken directly from struct passwd. At some...
zhuk [Mon, 18 Jul 2016 16:46:30 +0000 (16:46 +0000)]
The string with path to shell could be taken directly from struct passwd. At some point later the data it points to is overridden by getpwuid() call, resulting in garbage. The problem could be easily demonstreated by double doas call:

  $ doas doas -su _sndio
  doas: mpty: command not found

The fix is easy: just strdup() the pw_shell field value.

okay tedu@, tweaks from & okay natano@

7 years agoadd "recvfd" to doas(1) for use with skey.
semarie [Tue, 12 Jul 2016 12:10:42 +0000 (12:10 +0000)]
add "recvfd" to doas(1) for use with skey.

ok tb@ deraadt@

7 years agouse posix correct optstring
Duncaen [Wed, 29 Jun 2016 23:33:08 +0000 (01:33 +0200)]
use posix correct optstring

7 years agominor tweaks
Duncaen [Mon, 27 Jun 2016 19:45:26 +0000 (21:45 +0200)]
minor tweaks

7 years agominor tweaks; ok tedu
jmc [Mon, 27 Jun 2016 17:36:33 +0000 (17:36 +0000)]
minor tweaks; ok tedu

7 years agosomehow nopass snuck onto the :wheel example. i think it's better without.
tedu [Mon, 27 Jun 2016 15:47:38 +0000 (15:47 +0000)]
somehow nopass snuck onto the :wheel example. i think it's better without.

7 years agorevise environment handling. Add a setenv keyword for manipulating the environment...
tedu [Mon, 27 Jun 2016 15:41:17 +0000 (15:41 +0000)]
revise environment handling. Add a setenv keyword for manipulating the environment. keepenv now means only retain everything. (for one release, the old use of keepenv will still work.) Allow setting variables to new or existing values, and also removing vars when keepenv is used. ok djm martijn tb

7 years agomove a space to the correct spot
tedu [Fri, 24 Jun 2016 20:49:56 +0000 (20:49 +0000)]
move a space to the correct spot

7 years agoMerge pull request #8 from frgm/master
Duncan Overbruck [Mon, 27 Jun 2016 19:46:10 +0000 (21:46 +0200)]
Merge pull request #8 from frgm/master

configure: fix usage() formatting & fix make install

7 years agofix make install
Svyatoslav Mishyn [Mon, 27 Jun 2016 19:33:32 +0000 (22:33 +0300)]
fix make install

7 years agoconfigure: fix usage() formatting
Svyatoslav Mishyn [Mon, 27 Jun 2016 19:05:56 +0000 (22:05 +0300)]
configure: fix usage() formatting

7 years agobump to version v0.3.2 v0.3.2
Duncaen [Mon, 27 Jun 2016 16:50:34 +0000 (18:50 +0200)]
bump to version v0.3.2

7 years agofix --with(out)-pam configure option
Duncaen [Mon, 27 Jun 2016 16:47:24 +0000 (18:47 +0200)]
fix --with(out)-pam configure option

7 years agofix pamcleanup
Duncaen [Mon, 27 Jun 2016 16:19:31 +0000 (18:19 +0200)]
fix pamcleanup

7 years agofix sys/tree.h test
Duncaen [Mon, 27 Jun 2016 16:18:42 +0000 (18:18 +0200)]
fix sys/tree.h test

7 years agobump version 0.3.1 v0.3.1
Duncaen [Sun, 26 Jun 2016 21:23:30 +0000 (23:23 +0200)]
bump version 0.3.1

7 years agoremove pam_timestamp from pam config
Duncaen [Sun, 26 Jun 2016 21:22:52 +0000 (23:22 +0200)]
remove pam_timestamp from pam config

7 years agoremove unnecessary warning output
Duncaen [Sun, 26 Jun 2016 21:22:27 +0000 (23:22 +0200)]
remove unnecessary warning output

7 years agobump version 0.3 v0.3
Duncaen [Wed, 8 Jun 2016 11:42:17 +0000 (13:42 +0200)]
bump version 0.3

7 years agoadd --without-pam configure option to allow passwd/shadow auth
Duncaen [Sun, 26 Jun 2016 21:10:37 +0000 (23:10 +0200)]
add --without-pam configure option to allow passwd/shadow auth

7 years agofix err messages
Duncaen [Sat, 25 Jun 2016 15:41:04 +0000 (17:41 +0200)]
fix err messages

7 years agosome more cleanup and refactoring of pam code
Duncaen [Sat, 25 Jun 2016 15:37:49 +0000 (17:37 +0200)]
some more cleanup and refactoring of pam code

7 years agorename doas_pam.c to pam.c
Duncaen [Fri, 24 Jun 2016 14:50:17 +0000 (16:50 +0200)]
rename doas_pam.c to pam.c

7 years agoimport sys-tree.h from openssh-portable
Duncaen [Fri, 24 Jun 2016 14:33:42 +0000 (16:33 +0200)]
import sys-tree.h from openssh-portable

7 years agoMove the RB_ code from doas.h to env.c, and limit the environment interface to a...
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@

7 years agothe environment handling code was showing its age. just because environ is a char...
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)

7 years agodon't use specified twice in a sentence, noticed by jmc
tedu [Sat, 11 Jun 2016 17:17:10 +0000 (17:17 +0000)]
don't use specified twice in a sentence, noticed by jmc

7 years agoclarify some wording
tedu [Sat, 11 Jun 2016 05:04:03 +0000 (05:04 +0000)]
clarify some wording

7 years agospecify that default is deny if no rule matches
tedu [Sat, 11 Jun 2016 04:56:16 +0000 (04:56 +0000)]
specify that default is deny if no rule matches

7 years agoremove pledge seccomp shim
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.

7 years agoopen pam sessions with right user and remove setusercontext shim
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.

7 years agoRevert "sync with upstream (setenv)"
Duncaen [Wed, 8 Jun 2016 11:41:25 +0000 (13:41 +0200)]
Revert "sync with upstream (setenv)"

This reverts commit 7f11114f0f07c653e0ea3d4ae093d7dcdda4a4ef.

7 years agobump version to 0.2 v0.2
Duncaen [Sun, 5 Jun 2016 12:01:31 +0000 (14:01 +0200)]
bump version to 0.2

7 years agoadd more restrictive permissions and root:root as owner for binary
Duncaen [Sun, 5 Jun 2016 11:58:30 +0000 (13:58 +0200)]
add more restrictive permissions and root:root as owner for binary

7 years agofix ld and cflags
Duncaen [Sun, 5 Jun 2016 11:42:30 +0000 (13:42 +0200)]
fix ld and cflags

7 years agosync with upstream (setenv)
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@

7 years agoremove version.h and define VERSION in configure script
Duncaen [Sun, 5 Jun 2016 11:29:58 +0000 (13:29 +0200)]
remove version.h and define VERSION in configure script

7 years agocheck return value of setresuid
Duncaen [Thu, 2 Jun 2016 14:29:01 +0000 (16:29 +0200)]
check return value of setresuid

7 years agoremove nonstandard sys/cdefs.h
Duncaen [Thu, 2 Jun 2016 14:27:31 +0000 (16:27 +0200)]
remove nonstandard sys/cdefs.h

7 years agoMerge pull request #7 from frgm/master v0.1
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"

7 years agofix configure script
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)

7 years agobsd.prog.mk: add "uninstall" target
Svyatoslav Mishyn [Mon, 9 May 2016 09:23:55 +0000 (12:23 +0300)]
bsd.prog.mk: add "uninstall" target

7 years agoAdd doas style prompt for pam authentication
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.

7 years agoMake pam session handling more failsafe
Duncaen [Sun, 8 May 2016 20:23:26 +0000 (22:23 +0200)]
Make pam session handling more failsafe

7 years agoMore configure and make cleanup
Duncaen [Sun, 8 May 2016 19:32:55 +0000 (21:32 +0200)]
More configure and make cleanup

7 years agoMerge pull request #4 from frgm/master
Duncan Overbruck [Sun, 8 May 2016 19:24:28 +0000 (21:24 +0200)]
Merge pull request #4 from frgm/master

fix make install

7 years agofix 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

7 years agoFix horrible mistake
Duncaen [Sun, 8 May 2016 18:03:04 +0000 (20:03 +0200)]
Fix horrible mistake

7 years agoSimply install and move version to configure script
Duncaen [Sun, 8 May 2016 18:01:25 +0000 (20:01 +0200)]
Simply install and move version to configure script

7 years agoset PAM_USER, PAM_RUSER and PAM_TTY if available
Duncaen [Sun, 8 May 2016 17:38:18 +0000 (19:38 +0200)]
set PAM_USER, PAM_RUSER and PAM_TTY if available

7 years agoconfigure: tune up a little bit
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]
7 years agoAdd proper pam session handling
Duncaen [Sun, 8 May 2016 14:15:58 +0000 (16:15 +0200)]
Add proper pam session handling

7 years agoEnable style option only if bsd_auth.h is available
Duncaen [Sat, 7 May 2016 17:02:55 +0000 (19:02 +0200)]
Enable style option only if bsd_auth.h is available

7 years agoFix typos and configure pledge detection
Duncaen [Sat, 7 May 2016 17:00:42 +0000 (19:00 +0200)]
Fix typos and configure pledge detection

7 years agoTesting only seccomp pledge
Duncaen [Fri, 6 May 2016 01:41:13 +0000 (03:41 +0200)]
Testing only seccomp pledge

7 years agoAdd more compatibility functions for linux support
Duncaen [Fri, 6 May 2016 01:40:33 +0000 (03:40 +0200)]
Add more compatibility functions for linux support

7 years agoActually open pam sessions
Duncaen [Fri, 6 May 2016 01:37:58 +0000 (03:37 +0200)]
Actually open pam sessions

7 years agoSync doas.c
Duncaen [Fri, 6 May 2016 01:35:18 +0000 (03:35 +0200)]
Sync doas.c

7 years agoAdd configure script
Duncaen [Fri, 6 May 2016 01:00:16 +0000 (03:00 +0200)]
Add configure script

8 years agoGenerate automatic header dependencies.
Nathan Holstein [Mon, 10 Aug 2015 02:05:34 +0000 (22:05 -0400)]
Generate automatic header dependencies.

8 years agoAdd version information to doas executable.
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.

8 years agoGenerate a version header file from Git.
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.

8 years agoChange formating of comic in README.
Nathan Holstein [Fri, 7 Aug 2015 04:31:30 +0000 (00:31 -0400)]
Change formating of comic in README.

8 years agoAdd the XKCD comic to README.
Nathan Holstein [Fri, 7 Aug 2015 04:28:04 +0000 (00:28 -0400)]
Add the XKCD comic to README.

8 years agoAdd PAM service definition for doas.
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.

8 years agoAdd IO error checking to auth_userokay().
Nathan Holstein [Thu, 6 Aug 2015 05:07:33 +0000 (01:07 -0400)]
Add IO error checking to auth_userokay().

8 years agoUpdate README to match status of PAM integration.
Nathan Holstein [Thu, 6 Aug 2015 04:47:52 +0000 (00:47 -0400)]
Update README to match status of PAM integration.

8 years agoImplement PAM authentication.
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.

8 years agoMerge doas.c 1.34 from OpenBSD CVS.
Nathan Holstein [Wed, 5 Aug 2015 15:01:36 +0000 (11:01 -0400)]
Merge doas.c 1.34 from OpenBSD CVS.

8 years agoSwitch an unsigned for a size_t.
Nathan Holstein [Wed, 5 Aug 2015 14:58:19 +0000 (10:58 -0400)]
Switch an unsigned for a size_t.

8 years agoBreak out make functionality into utility makefile.
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.

8 years agoAdd installation rules for man files.
Nathan Holstein [Wed, 5 Aug 2015 13:53:11 +0000 (09:53 -0400)]
Add installation rules for man files.

8 years agoAdd license file.
Nathan Holstein [Wed, 5 Aug 2015 13:45:05 +0000 (09:45 -0400)]
Add license file.

8 years agoAdd a make rule to create ${BINDIR}.
Nathan Holstein [Wed, 5 Aug 2015 07:11:15 +0000 (03:11 -0400)]
Add a make rule to create ${BINDIR}.

8 years agoBeing integration of PAM into auth_userokay().
Nathan Holstein [Wed, 5 Aug 2015 07:00:56 +0000 (03:00 -0400)]
Being integration of PAM into auth_userokay().

8 years agoAdd README.md.
Nathan Holstein [Wed, 5 Aug 2015 06:52:21 +0000 (02:52 -0400)]
Add README.md.

8 years agoAdd copyright clauses to new code.
Nathan Holstein [Wed, 5 Aug 2015 06:33:00 +0000 (02:33 -0400)]
Add copyright clauses to new code.

8 years agoFix memory corruption bug in rules parsing.
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.

8 years agoImport explicit_bzero() from OpenBSD.
Nathan Holstein [Mon, 3 Aug 2015 22:28:22 +0000 (18:28 -0400)]
Import explicit_bzero() from OpenBSD.

8 years agoImplement the semantics of setusercontext().
Nathan Holstein [Sun, 2 Aug 2015 19:52:15 +0000 (15:52 -0400)]
Implement the semantics of setusercontext().

8 years agoWarn when doas.conf doesn't exist.
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.

8 years agoRestrict read permissions of doas binary.
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.

8 years agoAdd compatibility functions from OpenBSD.
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.

8 years agoFix a group of sign comparison warnings.
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().

8 years agoFix a sign comparison warning.
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.

8 years agoHeader file revamp to build on MacOSX.
Nathan Holstein [Sun, 2 Aug 2015 16:12:34 +0000 (12:12 -0400)]
Header file revamp to build on MacOSX.

8 years agoMakefile for gmake on MacOSX.
Nathan Holstein [Sun, 2 Aug 2015 16:11:40 +0000 (12:11 -0400)]
Makefile for gmake on MacOSX.

8 years agoAdd a simple .gitignore.
Nathan Holstein [Sun, 2 Aug 2015 15:29:48 +0000 (11:29 -0400)]
Add a simple .gitignore.

8 years agoAdd git-cvsimport author conversion file.
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.

8 years agoremove an extra getuid call, reported by Martijn van Duren
Ted Unangst [Mon, 3 Aug 2015 15:31:05 +0000 (15:31 +0000)]
remove an extra getuid call, reported by Martijn van Duren

8 years agomake gid parsing look like uid parsing. from 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

8 years agoFix usage examples.
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@.

8 years agorefine a comment
Ted Unangst [Wed, 29 Jul 2015 00:00:31 +0000 (00:00 +0000)]
refine a comment

8 years agowrap some exceedingly long lines
Theo de Raadt [Tue, 28 Jul 2015 21:36:03 +0000 (21:36 +0000)]
wrap some exceedingly long lines

8 years agoRename some variables and add few comments in keepenv handling code.
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@