From fff115d68f02fb3612d4e9cb6bca2a70f5f33601 Mon Sep 17 00:00:00 2001 From: cheloha Date: Tue, 14 Aug 2018 18:13:11 +0000 Subject: [PATCH] unveil(2) /etc/nologin.txt for reading ok deraadt --- sbin/nologin/nologin.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sbin/nologin/nologin.c b/sbin/nologin/nologin.c index a01f4211c4c..15875cc1b0e 100644 --- a/sbin/nologin/nologin.c +++ b/sbin/nologin/nologin.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nologin.c,v 1.6 2015/10/13 07:10:38 doug Exp $ */ +/* $OpenBSD: nologin.c,v 1.7 2018/08/14 18:13:11 cheloha Exp $ */ /* * Copyright (c) 1997, Jason Downs. All rights reserved. @@ -46,6 +46,8 @@ main(int argc, char *argv[]) ssize_t nrd; char nbuf[BUFSIZ]; + if (unveil(_PATH_NOLOGIN_TXT, "r") == -1) + err(1, "unveil"); if (pledge("stdio rpath", NULL) == -1) err(1, "pledge"); -- 2.20.1