From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96078701111420.tru64-unix-managers.marc@archive.invalid> From: Rick Beebe Date: Thu, 12 Mar 1998 21:13:17 +0000 To: tru64-unix-managers Subject: /etc/group format and usermod X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96078701111420 I've have a script that my users use to create pseudo-anonymous FTP accounts. All they enter is the username and password and the script creates all the necessary directories. In order for these to work right, the created accounts need to exist in a couple of groups. My script is a cut-down version of the standard adduser shell script and it adds people to groups with sed '/^'${GROUP}':/s/$/,'${USER}'/' /etc/ptmp/group > /etc/ptmp/tmpgroup In my testing this worked fine, but now some of these groups are getting quite large and the process has been failing because the group line is getting wrapped (often with multiple blank lines). I set out to fix this today and 'discovered' the other set of user management tools: useradd, groupadd, usermod etc. I tried usermod to add a user to one of these long groups and it seemed to work like a charm. But it also reformatted the group file. Where I originally had grpname:*:125:fred,john,.... --> to 60 names I now had grpname:*:125:fred,john, .... --> about 200 chars grpname:*:125:wendy,alice.... grpname:*:125:bonnie,charlie.... Cool, I thought, that's a much more readable format for the file..one I didn't know worked. The problem is, it doesn't work. FTP was the first casualty..if you weren't on the first line of a multi-line group then you weren't part of that group. I thought the functionality of reading such things was via standard system libraries so I decided to recompile FTP (we use wu-ftpd). That didn't work and then I noted that I could not su to root. Su (or login) couldn't figure out that I was in the system group. I put the group file back the way it was and I'm now on my quest to fix my original problem. My real question in all this is what good are these utilities, useradd, groupadd, et al, if they don't create files that the rest of the system can use? I don't see anything in the man pages to indicate why one should use useradd over adduser. This is on a DU 4.0B system. Any ideas? _______________________________________________________________________ Rick Beebe (203) 785-4566 Network Engineering Manager FAX: (203) 737-4037 ITS-Med Technology Operations Richard.Beebe@yale.edu Yale University School of Medicine P.O. Box 208089, New Haven, CT 06520-8089 _______________________________________________________________________