doas

https://man.openbsd.org/doas.1
git clone anongit@rnpnr.xyz:doas.git
Log | Files | Refs | Feed

Commit: 31985065c16a2aaa1ed610c91f077008253153b5
Parent: f1bd9876dc4c6328f7a4eddf37e20cd14580fe91
Author: 0x766F6964
Date:   Sat,  8 Aug 2020 11:50:22 -0600

update to latest src

Diffstat:
Mdoas.c | 10+++++++---
Mdoas.conf.5 | 11+++++++----
Mpersist.c | 2+-
3 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/doas.c b/doas.c @@ -1,4 +1,4 @@ -/* $OpenBSD: doas.c,v 1.81 2019/09/14 17:47:00 semarie Exp $ */ +/* $OpenBSD: doas.c,v 1.82 2019/10/18 17:15:45 tedu Exp $ */ /* * Copyright (c) 2015 Ted Unangst <tedu@openbsd.org> * @@ -59,9 +59,11 @@ parseuid(const char *s, uid_t *uid) if ((pw = getpwnam(s)) != NULL) { *uid = pw->pw_uid; + if (*uid == UID_MAX) + return -1; return 0; } - *uid = strtonum(s, 0, UID_MAX, &errstr); + *uid = strtonum(s, 0, UID_MAX - 1, &errstr); if (errstr) return -1; return 0; @@ -87,9 +89,11 @@ parsegid(const char *s, gid_t *gid) if ((gr = getgrnam(s)) != NULL) { *gid = gr->gr_gid; + if (*gid == GID_MAX) + return -1; return 0; } - *gid = strtonum(s, 0, GID_MAX, &errstr); + *gid = strtonum(s, 0, GID_MAX - 1, &errstr); if (errstr) return -1; return 0; diff --git a/doas.conf.5 b/doas.conf.5 @@ -1,4 +1,4 @@ -.\" $OpenBSD: doas.conf.5,v 1.41 2019/07/07 19:21:28 tedu Exp $ +.\" $OpenBSD: doas.conf.5,v 1.43 2020/05/16 16:58:11 jmc Exp $ .\" .\"Copyright (c) 2015 Ted Unangst <tedu@openbsd.org> .\" @@ -13,7 +13,7 @@ .\"WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\"ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\"OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -.Dd $Mdocdate: July 7 2019 $ +.Dd $Mdocdate: May 16 2020 $ .Dt DOAS.CONF 5 .Os .Sh NAME @@ -111,9 +111,12 @@ If quotes or backslashes are used in a word, it is not considered a keyword. .El .Sh FILES -.Bl -tag -width "/etc/doas.conf" +.Bl -tag -width /etc/examples/doas.conf -compact .It Pa /etc/doas.conf -doas configuration file. +.Xr doas 1 +configuration file. +.It Pa /etc/examples/doas.conf +Example configuration file. .El .Sh EXAMPLES The following example permits user aja to install packages diff --git a/persist.c b/persist.c @@ -102,7 +102,7 @@ openpersist(int *valid) *valid = clock_gettime(CLOCK_BOOTTIME, &ts) == 0 && fstat(fd, &st) == 0 && (ts.tv_sec < st.st_mtim.tv_sec || - ts.tv_sec == st.st_mtim.tv_sec && ts.tv_nsec < st.st_mtim.tv_nsec) && + (ts.tv_sec == st.st_mtim.tv_sec && ts.tv_nsec < st.st_mtim.tv_nsec)) && st.st_mtime - ts.tv_sec <= PERSIST_TIMEOUT; } return fd;