-/* $OpenBSD: nologin.c,v 1.5 2003/07/10 00:00:58 david Exp $ */
+/* $OpenBSD: nologin.c,v 1.6 2015/10/13 07:10:38 doug Exp $ */
/*
* Copyright (c) 1997, Jason Downs. All rights reserved.
*/
#include <sys/types.h>
+#include <err.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#define DEFAULT_MESG "This account is currently not available.\n"
/*ARGSUSED*/
-int main(int argc, char *argv[])
+int
+main(int argc, char *argv[])
{
int nfd;
ssize_t nrd;
char nbuf[BUFSIZ];
+ if (pledge("stdio rpath", NULL) == -1)
+ err(1, "pledge");
+
nfd = open(_PATH_NOLOGIN_TXT, O_RDONLY);
if (nfd < 0) {
write(STDOUT_FILENO, DEFAULT_MESG, strlen(DEFAULT_MESG));