File:  [LON-CAPA] / loncom / Attic / lcuseradd
Revision 1.2: download - view: text, annotated - select for diffs
Sun Oct 29 22:07:20 2000 UTC (23 years, 5 months ago) by harris41
Branches: MAIN
CVS tags: HEAD
adjusting comments and shell command execution order in lcuserdel.  lcuseradd
is beginning to take form, but is still buggy...

#!/usr/bin/perl
#
# lcuseradd
#
# Scott Harrison
# October 27, 2000

use strict;

# This script is a setuid script that should
# be run by user 'www'.  It creates a /home/USERNAME directory
# as well as a /home/USERNAME/public_html directory.
# It adds user entries to
# /etc/passwd and /etc/groups.
# Passwords are set with lcpasswd.
# www becomes a member of this user group.

# Standard input usage
# First line is USERNAME
# Second line is PASSWORD

# Command-line arguments [USERNAME] [PASSWORD]
# Yes, but be very careful here (don't pass shell commands)
# and this is only supported to allow perl-system calls.

# Security
$ENV{'PATH'}=""; # Nullify path information.
$ENV{'BASH_ENV'}=""; # Nullify shell environment information.

# Add user entry to /etc/passwd and /etc/groups.

# Set password with lcpasswd (which creates smbpasswd entry).

# www becomes member of this user group


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>