[7988] in Athena Bugs
decmips 7.3K: adduser
daemon@ATHENA.MIT.EDU (mhpower@ATHENA.MIT.EDU)
Tue Aug 20 19:51:49 1991
From: mhpower@ATHENA.MIT.EDU
To: testers@ATHENA.MIT.EDU
Date: Tue, 20 Aug 91 19:52:08 EDT
System name: podge
Type and version: KN01 7.3K (1 update(s) to same version)
Display type: PMAX-MFB
What were you trying to do?
Add an unprivileged local user account to a private workstation.
What's wrong:
# /etc/adduser
Enter login name for new user (initials, first or last name): sipbtest
Enter uid for new user [7784]: 262
Enter full name for new user: SIPB Test
What login group should this user go into [users]: sipbtest
Unknown group: sipbtest. Known groups are:
wheel daemon kmem staff
guest operator a_staff mit
tty nextbin gsipb gzephyr
rush2064 assassins-guild marc rsi-acl
gsipbbin tiger-team htg-people windowmgr
watchmkr xtankers clhdev clh
confused source-access mapledemo schemedev
charon-maintainer esg_0001 gsipb001 sstaff
gsipbsrc ambar gcharon c++-src-read
mhpower mitch riz le07
Do you want to add group sipbtest to the /etc/group file [yes]? yes
Adding new group to /etc/group file...
Enter group number for new group [20788]: 262
Enter another group that 'sipbtest' should be a member of
(<RETURN> only if none):
Enter parent directory for sipbtest [/usr/users]: /usr/tmp
The shells are:
# List of accepta # /bin/sh /bin/athena/tcsh
# Ftpd will not a # $Id: shel /bin/csh
Enter the users login shell name [/bin/csh]:
Adding new user ...
Creating home directory...
Until the password is set for sipbtest they will not be able to login.
Changing password for sipbtest
Enter new password:
Verify:
# /usr/ucb/rlogin podge -l sipbtest
...
podge> whoami
sipbtest
podge> groups
kmem
podge> ls -lg /dev/kmem
crw-r----- 1 root kmem 3, 1 Aug 14 02:41 /dev/kmem
podge> cp /usr/ucb/uptime .
podge> ./uptime
6:25pm up 23:39, 10 users, load average: 0.42, 0.25, 0.01
What should have happened:
It should not have granted user 'sipbtest' the access permissions
of group 'kmem'. The following patches should fix this problem.
*** adduser Tue Aug 20 18:36:50 1991
--- adduser.new Tue Aug 20 18:36:55 1991
***************
*** 253,261 ****
[yY]*|'')
echo ''
echo 'Adding new group to /etc/group file...'
! /usr/etc/addgroup "${LOGGROUP}"
! # Addgroup script returns the gid number.
! GID=${?}
break 2
;;
[nN]*)
--- 253,260 ----
[yY]*|'')
echo ''
echo 'Adding new group to /etc/group file...'
! # Addgroup script echoes the gid number.
! GID=`/usr/etc/addgroup "${LOGGROUP}"`
break 2
;;
[nN]*)
***************
*** 324,332 ****
[yY]*|'')
echo ''
echo 'Adding new group to /etc/group file...'
! /usr/etc/addgroup "${GROUP}"
! # Addgroup script returns the gid number.
! GID=${?}
continue 2
;;
[nN]*)
--- 323,330 ----
[yY]*|'')
echo ''
echo 'Adding new group to /etc/group file...'
! # Addgroup script echoes the gid number.
! GID=`/usr/etc/addgroup "${GROUP}"`
continue 2
;;
[nN]*)
*** addgroup Tue Aug 20 18:49:44 1991
--- addgroup.new Tue Aug 20 18:49:52 1991
***************
*** 34,40 ****
umask 027
if test ! -w /etc/group
then
! echo 'Please su to root first.'
exit 1
fi
#
--- 34,40 ----
umask 027
if test ! -w /etc/group
then
! echo 'Please su to root first.' 1>&2
exit 1
fi
#
***************
*** 73,79 ****
do
if test "${#}" -lt 1
then
! echo 'Enter group name for new group: ' \\c
if read GROUP
then
true
--- 73,79 ----
do
if test "${#}" -lt 1
then
! echo 'Enter group name for new group: ' \\c 1>&2
if read GROUP
then
true
***************
*** 86,98 ****
case "${GROUP}"
in
*:*)
! echo 'Error, illegal characters in group name.'
;;
'')
! echo 'Error, empty group name.'
;;
?????????*)
! echo 'Error, group name too long.'
;;
*)
#
--- 86,98 ----
case "${GROUP}"
in
*:*)
! echo 'Error, illegal characters in group name.' 1>&2
;;
'')
! echo 'Error, empty group name.' 1>&2
;;
?????????*)
! echo 'Error, group name too long.' 1>&2
;;
*)
#
***************
*** 100,106 ****
#
if grep -s "^${GROUP}:" /etc/group
then
! echo "Error, group ${GROUP} already in /etc/group file."
else
break
fi
--- 100,106 ----
#
if grep -s "^${GROUP}:" /etc/group
then
! echo "Error, group ${GROUP} already in /etc/group file." 1>&2
else
break
fi
***************
*** 122,130 ****
#
if test ! "${GID}"
then
! echo
! echo 'Error, the /etc/group file is corrupt!'
! echo "Exiting ${0} script. New entry not created!"
exit 1
fi
DEFGID=`expr "${GID}" + 5`
--- 122,130 ----
#
if test ! "${GID}"
then
! echo 1>&2
! echo 'Error, the /etc/group file is corrupt!' 1>&2
! echo "Exiting ${0} script. New entry not created!" 1>&2
exit 1
fi
DEFGID=`expr "${GID}" + 5`
***************
*** 131,138 ****
#
while true
do
! echo
! echo "Enter group number for new group [${DEFGID}]: " \\c
if read GNUM
then
case "${GNUM}"
--- 131,138 ----
#
while true
do
! echo 1>&2
! echo "Enter group number for new group [${DEFGID}]: " \\c 1>&2
if read GNUM
then
case "${GNUM}"
***************
*** 144,150 ****
*)
if expr "${GNUM}" : '[^0-9]' > /dev/null
then
! echo 'Error, group number must be all digits.'
else
#
# See if group number already exists in group file, if so get another.
--- 144,150 ----
*)
if expr "${GNUM}" : '[^0-9]' > /dev/null
then
! echo 'Error, group number must be all digits.' 1>&2
else
#
# See if group number already exists in group file, if so get another.
***************
*** 151,157 ****
#
if grep -s "^[^:]*:[^:]*:${GNUM}:" /etc/group
then
! echo "Error, Group number ${GNUM} is already in /etc/group file."
else
break
fi
--- 151,157 ----
#
if grep -s "^[^:]*:[^:]*:${GNUM}:" /etc/group
then
! echo "Error, Group number ${GNUM} is already in /etc/group file." 1>&2
else
break
fi
***************
*** 166,169 ****
# Add the group to the /etc/group file
#
echo "${GROUP}:*:${GNUM}:" >> /etc/group
! exit ${GNUM}
--- 166,169 ----
# Add the group to the /etc/group file
#
echo "${GROUP}:*:${GNUM}:" >> /etc/group
! echo ${GNUM}
Please describe any relevant documentation references:
adduser(8)