From ca3ed0e2aecc977e391be740acc4b1ff2fdc4790 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Tue, 5 Feb 2008 10:58:04 +0000 Subject: [PATCH] Replace the nologin shell script with a tiny c version. Just for the sake of completeness :) --- sbin/nologin/Makefile | 6 ++++-- sbin/nologin/nologin.c | 42 ++++++++++++++++++++++++++++++++++++++++++ sbin/nologin/nologin.sh | 40 ---------------------------------------- 3 files changed, 46 insertions(+), 42 deletions(-) create mode 100644 sbin/nologin/nologin.c delete mode 100644 sbin/nologin/nologin.sh diff --git a/sbin/nologin/Makefile b/sbin/nologin/Makefile index 36d6d8f6db..75d1f94504 100644 --- a/sbin/nologin/Makefile +++ b/sbin/nologin/Makefile @@ -1,8 +1,10 @@ # @(#)Makefile 8.2 (Berkeley) 4/22/94 # $FreeBSD: src/sbin/nologin/Makefile,v 1.6.6.2 2001/04/25 14:04:15 ru Exp $ -# $DragonFly: src/sbin/nologin/Makefile,v 1.2 2003/06/17 04:27:34 dillon Exp $ +# $DragonFly: src/sbin/nologin/Makefile,v 1.3 2008/02/05 10:58:04 matthias Exp $ -SCRIPTS=nologin.sh +PROG= nologin +SRCS= nologin.c MAN= nologin.5 nologin.8 +WARNS= 6 .include diff --git a/sbin/nologin/nologin.c b/sbin/nologin/nologin.c new file mode 100644 index 0000000000..75661248dc --- /dev/null +++ b/sbin/nologin/nologin.c @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2008 The DragonFly Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name of The DragonFly Project nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific, prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $DragonFly: src/sbin/nologin/nologin.c,v 1.1 2008/02/05 10:58:04 matthias Exp $ + */ + +#include +#include + +int +main(int __unused argc, char __unused **argv) +{ + printf("This account is currently not available.\n"); + _exit(1); +} diff --git a/sbin/nologin/nologin.sh b/sbin/nologin/nologin.sh deleted file mode 100644 index 95c22b57dc..0000000000 --- a/sbin/nologin/nologin.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh -p -# -# Copyright (c) 1992, 1993 -# The Regents of the University of California. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. All advertising materials mentioning features or use of this software -# must display the following acknowledgement: -# This product includes software developed by the University of -# California, Berkeley and its contributors. -# 4. Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. -# -# @(#)nologin.sh 8.1 (Berkeley) 6/5/93 -# $FreeBSD: src/sbin/nologin/nologin.sh,v 1.4 1999/08/28 00:13:57 peter Exp $ -# $DragonFly: src/sbin/nologin/Attic/nologin.sh,v 1.2 2003/06/17 04:27:34 dillon Exp $ -# - -echo 'This account is currently not available.' -exit 1 -- 2.11.4.GIT