DataMuseum.dk

Presents historical artifacts from the history of:

RC9000

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about RC9000

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: @ T u

⟦a9008ebab⟧ TextFile

    Length: 1156 (0x484)
    Types: TextFile
    Notes: @(#)uniq_lnam.sh 13.1 (RC International) 91/07/25
    Names: »uniq_lnam«

Derivation

└─⟦50656ff4a⟧ Bits:30010538 TX 3.1 Coldstart
    └─⟦bbf173f5c⟧ »0004« 
        └─⟦this⟧ »./usr/sadm/sysadm/bin/uniq_lnam« 

TextFile

#	@(#)uniq_lnam.sh	13.1 (RC International) 91/07/25

#	Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T
#	  All Rights Reserved

#	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T
#	The copyright notice above does not evidence any
#	actual or intended publication of such source code.

#!/sbin/sh
#ident	"@(#)oamintf:usermgmt/uniq_lnam.sh	1.3"

################################################################################
#	Command Name: uniq_lnam
#
# 	This functions is used for checking if login ID is unique.
#	 
#	Grep for 'login ID' in /etc/passwd, it must be at the
#	beginning of the line.  If the name is found exit 2
#	(false - since the name is already taken), exit 0 if
#	the name is not found (true - the name chosen is unique).
#
#	$1 - User input
#	$2 - Field default (only in usermod)
################################################################################

NOTHING=1	# Nothing entered
NOTUNIQ=2	# Not unique
OK=0		# login name (ID) is valid
# Nothing entered
test -z "$1" && exit $NOTHING

# Choose default
test "$1" = "$2" && exit $OK

if grep "^$1:" /etc/passwd > /dev/null 2>&1
then
	exit $NOTUNIQ
else
	exit $OK
fi