From df6ace1764fb1b391ecc9512de2b6a0551efd4e6 Mon Sep 17 00:00:00 2001 From: Ørjan Malde Date: Jun 01 2020 10:07:16 +0000 Subject: primitive nologin(8) implementation --- diff --git a/Makefile.am b/Makefile.am index 58c5a34..c3d5869 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,5 @@ bin_PROGRAMS = login +sbin_PROGRAMS = nologin login_SOURCES = @@ -13,3 +14,5 @@ endif login_SOURCES += login.c login_SOURCES += compat/explicit_bzero.c login_SOURCES += compat/timingsafe_memcmp.c + +nologin_SOURCES = nologin.c diff --git a/nologin.c b/nologin.c new file mode 100644 index 0000000..a1baf39 --- /dev/null +++ b/nologin.c @@ -0,0 +1,34 @@ +/* This file is part of mlogin. + + Copyright (c) 2020, Ørjan Malde + + mlogin is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, version 2.1 of the License only + + mlogin is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with mlogin. If not, see . */ + + +#include +#include +#include +#include + + +#define DEFAULT_MSG "This account is currently not available.\n" + +int main(int argc, char *argv[]) +{ + (void)argc; + (void)argv; + + write(STDOUT_FILENO, DEFAULT_MSG, strlen(DEFAULT_MSG)); + + exit(1); +}