Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Jan 1998 10:36:24 -0800 (PST)
From:      David Muir Sharnoff <muir@idiom.com>
To:        freebsd-isp@FreeBSD.ORG
Subject:   Re: How to lock out a nonpaying user
Message-ID:  <199801201836.KAA21613@idiom.com>

next in thread | raw e-mail | index | archive | help

I took a stab at this problem a few years ago (note date on file).

This works great.  It gives me a large set of messages.  I lock someone
out by changing their shell.

Now, the question I have is, how do you have RADIUS respond with a message
when someone tries to log in via PPP?

-Dave



#ifdef notdef
/*
 *
 * given that this is called with an argv[0] like "-badpasswd" (init does
 * this if the shell entry is "/.*/badpasswd"  Then cat whatever is
 * in the file $MSGDIR/badpasswd to stdout and exit.
 *
 * To give someone a shell that just prints out a message, make 
 * a file (called "name") with the message in /usr/adm/shells/msgs 
 * and then do a ln /usr/adm/shells/name /usr/adm/shells/shell.
 *
 * muir@cogsci 3/30/86
 *
 */
#endif


#include <stdio.h>
#include <strings.h>
#include <sys/file.h>

#define	MSGDIR	"/usr/adm/shells/msgs"

char	buf[BUFSIZ];

main(argc,argv)
int	argc;
char	*argv[];
{
	register	int	input;
	register	char	name[1024];
	register	int	bytes;

	sprintf (name,"%s/%s",MSGDIR,argv[0]+1);

	input = open (name, O_RDONLY);
	if (input < 0) {
		puts ("there has been a error, please contact");
		puts ("the system manager to have your account fixed.");
		perror(name);
		exit(1);
	}
	
	while ((bytes = read(input,buf,BUFSIZ)) > 0)
		write (1,buf,bytes);
	close (input);
	exit(0);
}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199801201836.KAA21613>