Bug 1192

Summary: Problem With Adduser - Messes up group file
Product: [Retired] Red Hat Linux Reporter: Lee Cashmore <cardy165>
Component: shadow-utilsAssignee: David Lawrence <dkl>
Status: CLOSED WORKSFORME QA Contact:
Severity: medium Docs Contact:
Priority: high    
Version: 5.2   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 1999-03-26 20:47:10 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Lee Cashmore 1999-02-16 10:16:43 UTC
Whilst adding 2023 users using the shadow-utils application

    adduser

I told it to add each of the users to the groups  user and
stud.

i.e. adduser -G user,stud a123456

The problem is that in the group file the adduser utility
had added a large number of the users correctly i.e.

stud::502:a1,a2,a3,a4,a5,a6,a7,a8,a9

but then I noticed that the rest of the users has been added
in the following format


stud::502:a1,a2,a3,a4,a5,a6,a7,a8,a9
,a10
,a11
,a12
,a13
,a14

and so on. The line for stud goes accross to column 8226
I can provide a full example if it is required

Comment 1 dennyf 1999-03-01 00:18:59 UTC
Also the "newusers" command adds users to the group file.

is this *normal* I have not seen this on other UNIX versions and some
utilitys will choke on the group file when written this way.

------- Email Received From  Lee Cashmore <leec.ac.uk> 03/01/99 04:46 -------


------- Email Received From  Lee Cashmore <leec.ac.uk> 03/10/99 06:59 -------

Comment 2 David Lawrence 1999-03-26 20:36:59 UTC
I was unable to replicate this bug using the shadow-utils-980403-8
package.
I used newuser to add a long text file of user lines and I was unable
to get this to fail as specified. I also created a home directory with
proper group ownerships and was able to create files with all members
of the group. I added several hundred members to a single group and
the lines were not broken as specified.

Comment 3 Jay Turner 1999-03-26 20:47:59 UTC
This bug appears to be fixed with the newest version of shadow utils
tha tis in 5.9This bug appears to be fixed with the newest version of shadow utils
tha tis in 5.9

------- Email Received From  Lee Cashmore <leec.ac.uk> 03/26/99 18:48 -------

Comment 4 Ian Macdonald 1999-05-01 17:38:59 UTC
Well, I'm still seeing the same problem when I recompile the SRPM of
shadow-utils from RH 6.0 on a RH 5.2 machine and install the resulting
binary.

Interestingly, the long group lines are truncated after precisely 8192
characters, which is a sure sign that a constant somewhere needs to be
increased.

Looking through the source, I came across commonio.c, which seems to
contain the offending piece of code. I tried applying the following
patch:

--- shadow-980403.orig/lib/commonio.c   Thu Apr  2 23:51:40 1998
+++ shadow-980403/lib/commonio.c        Thu Apr 29 15:11:28 1999
@@ -382,7 +382,7 @@
 int
 commonio_open(struct commonio_db *db, int mode)
 {
-       char    buf[8192];
+       char    buf[32768];
        char    *cp;
        char *line;
        struct commonio_entry *p;

Unfortunately, the resulting useradd segfaulted when adding a new
user.

I'm not a C programmer, so I can't fix this problem. Maybe I was
barking up completely the wrong tree, anyway.

Can anyone else provide the code necessary to allow useradd to handle
group lines with more than 8192 characters?

Comment 5 Leszek Matok 2002-10-03 21:46:30 UTC
It's a real shame this bug isn't fixed after 4 years in Red Hat Linux 8.0 :(
Check out my comments on bug 60304...