]> git.armaanb.net Git - opendoas.git/log
opendoas.git
4 years agotimestamp.c: remove warning for normal case v6.6.1
Duncan Overbruck [Mon, 3 Feb 2020 21:26:55 +0000 (22:26 +0100)]
timestamp.c: remove warning for normal case

4 years agotimestamp.c: check fstat(2) instead of separate stat(2)
Duncan Overbruck [Mon, 3 Feb 2020 21:19:45 +0000 (22:19 +0100)]
timestamp.c: check fstat(2) instead of separate stat(2)

4 years agotimestamp.c: correctly NUL terminate buffer read from /proc/pid/stat
Duncan Overbruck [Mon, 3 Feb 2020 21:17:43 +0000 (22:17 +0100)]
timestamp.c: correctly NUL terminate buffer read from /proc/pid/stat

This solves buf #28.

4 years agotimestamp.c: add some more error/warning messages
Duncan Overbruck [Mon, 3 Feb 2020 21:11:34 +0000 (22:11 +0100)]
timestamp.c: add some more error/warning messages

This might help to identify bugs/misbehaving systems
or attempts to mess with timestamp files.

4 years agotimestamp.c: already return on 22th field of /proc/ppid/stat
Duncan Overbruck [Fri, 6 Dec 2019 01:45:22 +0000 (02:45 +0100)]
timestamp.c: already return on 22th field of /proc/ppid/stat

this is the last field we are interested in and if we didn't reach it,
return an error.

4 years agodoas.c: initialize mygetpwuid_r result
Duncan Overbruck [Fri, 6 Dec 2019 01:44:46 +0000 (02:44 +0100)]
doas.c: initialize mygetpwuid_r result

This can't happen really happen, but makes scan-build happy.

4 years agolibopenbsd: define __dead as noreturn
Duncan Overbruck [Fri, 6 Dec 2019 01:43:57 +0000 (02:43 +0100)]
libopenbsd: define __dead as noreturn

4 years agoChange binary permissions to 4755. Closes #26
Ivy Foster [Wed, 8 Jan 2020 17:33:51 +0000 (11:33 -0600)]
Change binary permissions to 4755. Closes #26

The owner can be trusted to read and write their own files, and
there's no reason not to let others read the file.

4 years agoconfigure: remove version v6.6
Duncan Overbruck [Sat, 23 Nov 2019 15:21:04 +0000 (16:21 +0100)]
configure: remove version

4 years agodoas.c: remove dead ifdefs to unclutter code
Duncan Overbruck [Sat, 23 Nov 2019 14:18:44 +0000 (15:18 +0100)]
doas.c: remove dead ifdefs to unclutter code

4 years agotimestamp: simplify
Duncan Overbruck [Thu, 21 Nov 2019 17:01:36 +0000 (18:01 +0100)]
timestamp: simplify

4 years agoconfigure: make {UID,GID}_MAX configurable
Duncan Overbruck [Thu, 21 Nov 2019 16:14:43 +0000 (17:14 +0100)]
configure: make {UID,GID}_MAX configurable

4 years agoadd some checks to avoid UID_MAX (-1) here. this is not problematic with the current...
tedu [Fri, 18 Oct 2019 17:15:45 +0000 (17:15 +0000)]
add some checks to avoid UID_MAX (-1) here. this is not problematic with the current code, but it's probably safer this way. ok deraadt

4 years agocorrect some unveil(2) violations due to "login.conf.db" access (the .db version...
semarie [Sat, 14 Sep 2019 17:47:00 +0000 (17:47 +0000)]
correct some unveil(2) violations due to "login.conf.db" access (the .db version of "login.conf"), and stat(2) on _PATH_MASTERPASSWD_LOCK (via pw_mkdb(3)).

problem initially noted by myself for passwd(1)
millert@ reported similar problem on chpass(1), su(1), doas(1) and encrypt(1)
mestre@ noted chpass(1) too

ok mestre@ millert@

4 years agofixup unveil
Duncan Overbruck [Sat, 19 Oct 2019 13:02:58 +0000 (15:02 +0200)]
fixup unveil

4 years agofix one last edge case regarding PATH, allows simpler config.
tedu [Sun, 7 Jul 2019 19:21:28 +0000 (19:21 +0000)]
fix one last edge case regarding PATH, allows simpler config.

4 years agonote that authentication is required, unless otherwise configured. ok sthen
tedu [Thu, 4 Jul 2019 19:04:17 +0000 (19:04 +0000)]
note that authentication is required, unless otherwise configured. ok sthen

4 years agosnprintf/vsnprintf return < 0 on error, rather than -1.
deraadt [Wed, 3 Jul 2019 03:24:02 +0000 (03:24 +0000)]
snprintf/vsnprintf return < 0 on error, rather than -1.

4 years agofix some more fallout from setting path in setusercontext. restore previous behavior...
tedu [Sat, 29 Jun 2019 22:35:37 +0000 (22:35 +0000)]
fix some more fallout from setting path in setusercontext. restore previous behavior of using user PATH if no cmd restriction in the rule. run into by espie

4 years agoadd an example hint that shows how original path can be retained
tedu [Mon, 24 Jun 2019 14:45:52 +0000 (14:45 +0000)]
add an example hint that shows how original path can be retained

4 years agotweak wording a bit. always talk about creating a new environment. also document...
tedu [Fri, 21 Jun 2019 17:02:27 +0000 (17:02 +0000)]
tweak wording a bit. always talk about creating a new environment. also document DOAS_USER. ok deraadt jmc

4 years agomore precisely describe what happens to the environment without keepenv; OK tedu@
schwarze [Wed, 19 Jun 2019 09:55:55 +0000 (09:55 +0000)]
more precisely describe what happens to the environment without keepenv; OK tedu@

4 years agomention that doas(1) resets the umask(2); OK tedu@
schwarze [Wed, 19 Jun 2019 09:50:13 +0000 (09:50 +0000)]
mention that doas(1) resets the umask(2); OK tedu@

4 years agosetusercontext resets PATH (which we want). but then it becomes impossible to access...
tedu [Mon, 17 Jun 2019 19:51:23 +0000 (19:51 +0000)]
setusercontext resets PATH (which we want). but then it becomes impossible to access the old PATH. save a copy in case we need it later. bug report from espie.

4 years agomention environment resetting here as well. ok millert
tedu [Mon, 17 Jun 2019 18:44:44 +0000 (18:44 +0000)]
mention environment resetting here as well. ok millert

4 years agoalways reset the "su" variables, which is more consistent and predictable. ok martijn...
tedu [Mon, 17 Jun 2019 16:01:26 +0000 (16:01 +0000)]
always reset the "su" variables, which is more consistent and predictable. ok martijn millert

4 years agoredo the environment inheritance to not inherit. it was intended to make life easier...
tedu [Sun, 16 Jun 2019 18:16:34 +0000 (18:16 +0000)]
redo the environment inheritance to not inherit. it was intended to make life easier, but it can be surprising or even unsafe. instead, reset just about everything to the target user's values. ok deraadt martijn Thanks to Sander Bos in particular for pointing out some nasty edge cases.

4 years agoa few cleanups and simplifications possible now that static pw is gone. noted by...
tedu [Wed, 12 Jun 2019 02:50:29 +0000 (02:50 +0000)]
a few cleanups and simplifications possible now that static pw is gone. noted by martijn. ok martijn.

4 years agouse getpwuid_r to avoid problems with hidden static storage. ok deraadt lteo martijn
tedu [Mon, 10 Jun 2019 18:11:27 +0000 (18:11 +0000)]
use getpwuid_r to avoid problems with hidden static storage. ok deraadt lteo martijn

4 years agolibopenbsd/closefrom.c: remove config.h include
Duncan Overbruck [Fri, 26 Jul 2019 15:46:17 +0000 (17:46 +0200)]
libopenbsd/closefrom.c: remove config.h include

4 years agoREADME.md: update the readme to match the current state
Duncan Overbruck [Fri, 26 Jul 2019 15:39:27 +0000 (17:39 +0200)]
README.md: update the readme to match the current state

4 years agolibopenbsd: remove MacOSX compat functions, its not supported anyways
Duncan Overbruck [Fri, 26 Jul 2019 15:13:55 +0000 (17:13 +0200)]
libopenbsd: remove MacOSX compat functions, its not supported anyways

4 years agolibopenbsd/closefrom.c: sync with sudo
Duncan Overbruck [Fri, 26 Jul 2019 15:01:54 +0000 (17:01 +0200)]
libopenbsd/closefrom.c: sync with sudo

4 years agotimestamp: error out if fstat and lstat st_ino and st_dev are not the same
Duncan Overbruck [Fri, 26 Jul 2019 14:39:36 +0000 (16:39 +0200)]
timestamp: error out if fstat and lstat st_ino and st_dev are not the same

5 years agopam: close timestamp fd in both both processes
Duncaen [Wed, 30 Jan 2019 22:43:12 +0000 (23:43 +0100)]
pam: close timestamp fd in both both processes

5 years agoshadow: clear phassphrase earlier
Duncaen [Wed, 30 Jan 2019 22:35:25 +0000 (23:35 +0100)]
shadow: clear phassphrase earlier

5 years agoAdd generated file parse.c to .gitignore and 'make clean'
Ivy Foster [Wed, 30 Jan 2019 19:39:50 +0000 (13:39 -0600)]
Add generated file parse.c to .gitignore and 'make clean'

Closes: #24 [via git-merge-pr]
5 years agoconfigure: list --with-timestamp in help, since without is default
Ivy Foster [Wed, 30 Jan 2019 19:35:14 +0000 (13:35 -0600)]
configure: list --with-timestamp in help, since without is default

5 years agoshadow: clear the password even after a mismatch
Duncaen [Wed, 30 Jan 2019 22:17:49 +0000 (23:17 +0100)]
shadow: clear the password even after a mismatch

5 years agoclear the password even after a mismatch
tedu [Thu, 17 Jan 2019 05:35:35 +0000 (05:35 +0000)]
clear the password even after a mismatch

5 years agoDo for most running out of memory err() what was done for most running out of memory...
krw [Wed, 11 Jul 2018 07:39:22 +0000 (07:39 +0000)]
Do for most running out of memory err() what was done for most running out of memory log_warn(). i.e. ("%s", __func__) instead of manual function names and redundant verbiage about which wrapper detected the out of memory condition.

ok henning@

5 years agopam: add timestamp support
Duncaen [Wed, 30 Jan 2019 22:07:19 +0000 (23:07 +0100)]
pam: add timestamp support

5 years agotimestamp: rename and simplify
Duncaen [Wed, 30 Jan 2019 21:31:47 +0000 (22:31 +0100)]
timestamp: rename and simplify

5 years agolibopenbsd: minor cleanup
Duncaen [Wed, 30 Jan 2019 21:29:11 +0000 (22:29 +0100)]
libopenbsd: minor cleanup

5 years agodoas: remove unnecessary configure checks, move shadow to its own file
Duncaen [Wed, 30 Jan 2019 21:28:22 +0000 (22:28 +0100)]
doas: remove unnecessary configure checks, move shadow to its own file

5 years agodoas: remove v flag, not neccessary, upstream doesn't have it and __DATE__ is bad...
Duncaen [Wed, 30 Jan 2019 20:19:37 +0000 (21:19 +0100)]
doas: remove v flag, not neccessary, upstream doesn't have it and __DATE__ is bad for reproducible builds

5 years agolibopenbsd/closefrom: correctly handle snprintf truncation
Duncaen [Wed, 30 Jan 2019 20:06:15 +0000 (21:06 +0100)]
libopenbsd/closefrom: correctly handle snprintf truncation

5 years agolibopenbsd/readpassphrase: update to latest version from openssh-portable
Duncaen [Wed, 30 Jan 2019 19:59:40 +0000 (20:59 +0100)]
libopenbsd/readpassphrase: update to latest version from openssh-portable

5 years agoadjust yyerror() to precede with "progname: " the error message string
gsoares [Wed, 30 Jan 2019 19:49:19 +0000 (20:49 +0100)]
adjust yyerror() to precede with "progname: " the error message string
OK tedu@ phessler@

5 years agodoas.c: put login_style in ifdef to compile on Linux
Ivy Foster [Wed, 30 Jan 2019 19:23:40 +0000 (13:23 -0600)]
doas.c: put login_style in ifdef to compile on Linux

Closes: #23 [via git-merge-pr]
5 years agolowercase doas ee cummings style
tedu [Wed, 7 Feb 2018 05:13:57 +0000 (05:13 +0000)]
lowercase doas ee cummings style

5 years agonot necessarily the same name, but the indicated name
tedu [Wed, 7 Feb 2018 05:05:46 +0000 (05:05 +0000)]
not necessarily the same name, but the indicated name

6 years agopam: check watch child pid
Duncaen [Fri, 6 Apr 2018 16:16:30 +0000 (18:16 +0200)]
pam: check watch child pid

6 years agopersist_timestamp: add start time and document implementation details
Duncaen [Fri, 6 Apr 2018 16:10:26 +0000 (18:10 +0200)]
persist_timestamp: add start time and document implementation details

6 years agopersist_timestamp: move timespec macros to libopenbsd
Duncaen [Tue, 12 Dec 2017 16:14:45 +0000 (17:14 +0100)]
persist_timestamp: move timespec macros to libopenbsd

6 years agopersist_timestamp: create timestamp file with O_NOFOLLOW and don't leak the name
Duncaen [Tue, 12 Dec 2017 15:42:11 +0000 (16:42 +0100)]
persist_timestamp: create timestamp file with O_NOFOLLOW and don't leak the name

6 years agopersist_timestamp: remove goto from persist_open
Duncaen [Tue, 12 Dec 2017 15:38:08 +0000 (16:38 +0100)]
persist_timestamp: remove goto from persist_open

6 years agopersist_timestamp: persist_check was only used internally, make it static
Duncaen [Tue, 12 Dec 2017 15:36:35 +0000 (16:36 +0100)]
persist_timestamp: persist_check was only used internally, make it static

6 years agopersist_timestamp: use open directory fd to check and work with timestamp files
Duncaen [Tue, 12 Dec 2017 15:25:33 +0000 (16:25 +0100)]
persist_timestamp: use open directory fd to check and work with timestamp files

6 years agopersist_timestamp: add session id to timestamps
Duncaen [Tue, 12 Dec 2017 14:29:03 +0000 (15:29 +0100)]
persist_timestamp: add session id to timestamps

6 years agopersist_timestamp: make tmpfs requirement optional and only available on linux
Duncaen [Tue, 12 Dec 2017 13:57:50 +0000 (14:57 +0100)]
persist_timestamp: make tmpfs requirement optional and only available on linux

6 years agopersist_timestamp: use CLOCK_MONOTONIC_RAW
Duncaen [Tue, 12 Dec 2017 02:07:52 +0000 (03:07 +0100)]
persist_timestamp: use CLOCK_MONOTONIC_RAW

6 years agopersist_timestamp: don't allow og+rwx permission for timestamp directory
Duncaen [Tue, 12 Dec 2017 01:17:09 +0000 (02:17 +0100)]
persist_timestamp: don't allow og+rwx permission for timestamp directory

6 years agopersist_timestamp: cleanup
Duncaen [Tue, 12 Dec 2017 01:13:29 +0000 (02:13 +0100)]
persist_timestamp: cleanup

6 years agopersist_timestamp: use /proc/self/stat to get tty_nr
Duncaen [Tue, 12 Dec 2017 01:08:30 +0000 (02:08 +0100)]
persist_timestamp: use /proc/self/stat to get tty_nr

6 years agoadd initial timestamp file support, disabled by default and only with shadow auth
Duncaen [Mon, 11 Dec 2017 19:20:57 +0000 (20:20 +0100)]
add initial timestamp file support, disabled by default and only with shadow auth

6 years agoconfigure: update version
Duncaen [Mon, 11 Dec 2017 14:45:05 +0000 (15:45 +0100)]
configure: update version

6 years agoconfigure: fix usage
Duncaen [Mon, 11 Dec 2017 14:44:52 +0000 (15:44 +0100)]
configure: fix usage

6 years agoman pages with pseudo synopses which list filenames end up creating very ugly output...
jmc [Thu, 13 Jul 2017 19:16:33 +0000 (19:16 +0000)]
man pages with pseudo synopses which list filenames end up creating very ugly output in man -k; after some discussion with ingo, we feel the simplest fix is to remove such SYNOPSIS sections: the info is hardly helpful at page top, is contained already in FILES, and there are sufficiently few that just zapping them is simple;

ok schwarze, who also helpfully ran things through a build to check
output;

6 years agono need to generate y.tab.h if nothing uses it, set YFLAGS to nothing instead of...
espie [Mon, 3 Jul 2017 22:21:47 +0000 (22:21 +0000)]
no need to generate y.tab.h if nothing uses it, set YFLAGS to nothing instead of CLEANFILES += y.tab.h

okay millert@

6 years agofor password failure, print Authorization failed instead of EPERM. will make things...
tedu [Sat, 27 May 2017 09:51:07 +0000 (09:51 +0000)]
for password failure, print Authorization failed instead of EPERM. will make things less confusing with commands rejected by config file.

6 years agoa little const here and there to prevent rules from changing
tedu [Thu, 6 Apr 2017 21:14:12 +0000 (21:14 +0000)]
a little const here and there to prevent rules from changing

6 years agoprepenv can take a const rule
tedu [Thu, 6 Apr 2017 21:12:06 +0000 (21:12 +0000)]
prepenv can take a const rule

6 years agosimplify example. list of ports variables was non-exahustive, which means what exactl...
tedu [Mon, 20 Mar 2017 14:35:06 +0000 (14:35 +0000)]
simplify example. list of ports variables was non-exahustive, which means what exactly? there should be a better place for such lists.

6 years agoadd a geteuid check to make sure we're root before plowing into setauth. spare some...
tedu [Sat, 14 Jan 2017 18:51:24 +0000 (18:51 +0000)]
add a geteuid check to make sure we're root before plowing into setauth. spare some debugging effort in case doas is not installed setuid.

6 years agoenvlist and arglist are both string lists; simplify ok benno
tedu [Mon, 2 Jan 2017 01:40:20 +0000 (01:40 +0000)]
envlist and arglist are both string lists; simplify ok benno

6 years agoit has been six months and two days... remove keepenv { obsolete } syntax
tedu [Thu, 29 Dec 2016 19:12:42 +0000 (19:12 +0000)]
it has been six months and two days... remove keepenv { obsolete } syntax

6 years agoBe more explicit about the "args" syntax. In part from a patch from Anton dot Lindqvi...
schwarze [Mon, 5 Dec 2016 10:58:07 +0000 (10:58 +0000)]
Be more explicit about the "args" syntax. In part from a patch from Anton dot Lindqvist at gmail dot com. OK tedu@

6 years agomissing semicolon at end of rule. yacc doesn't seem to mind, though. from Edakawa
tedu [Thu, 10 Nov 2016 16:00:40 +0000 (16:00 +0000)]
missing semicolon at end of rule. yacc doesn't seem to mind, though. from Edakawa

6 years agoAdd back the call to yyparse() that was accidentally dropped in the previous commit...
tb [Wed, 5 Oct 2016 23:28:28 +0000 (23:28 +0000)]
Add back the call to yyparse() that was accidentally dropped in the previous commit. Fortunately, doas fails closed...

ok tedu

6 years agomove yyparse decl next to yyfp
tedu [Wed, 5 Oct 2016 17:40:25 +0000 (17:40 +0000)]
move yyparse decl next to yyfp

6 years agoas a result of the env rework, arraylen() is only used in parse.y. move it there...
tedu [Wed, 5 Oct 2016 17:36:53 +0000 (17:36 +0000)]
as a result of the env rework, arraylen() is only used in parse.y. move it there and make it static.

6 years agouse static in the right places to seperate modules better ok tedu
deraadt [Thu, 15 Sep 2016 00:58:23 +0000 (00:58 +0000)]
use static in the right places to seperate modules better ok tedu

6 years ago-L means no command
tedu [Sun, 4 Sep 2016 15:20:37 +0000 (15:20 +0000)]
-L means no command

6 years agodon't allow combining nopass and persist in a single rule
tedu [Sun, 4 Sep 2016 15:11:13 +0000 (15:11 +0000)]
don't allow combining nopass and persist in a single rule

6 years agothe sudo timeout was 5 minutes i believe, so we'll match that.
tedu [Sat, 3 Sep 2016 11:03:18 +0000 (11:03 +0000)]
the sudo timeout was 5 minutes i believe, so we'll match that.

6 years agoclarify that -L will exit without running a command.
tedu [Fri, 2 Sep 2016 20:38:05 +0000 (20:38 +0000)]
clarify that -L will exit without running a command.

6 years agoadd support for the verified auth ioctls using 'persist' rules. ok deraadt henning
tedu [Fri, 2 Sep 2016 18:12:30 +0000 (18:12 +0000)]
add support for the verified auth ioctls using 'persist' rules. ok deraadt henning

6 years agounconst these parameters; i won't be changing bsd auth today.
tedu [Thu, 1 Sep 2016 17:30:52 +0000 (17:30 +0000)]
unconst these parameters; i won't be changing bsd auth today.

6 years agomove the authentication code to a function
tedu [Thu, 1 Sep 2016 13:16:38 +0000 (13:16 +0000)]
move the authentication code to a function

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