Bug 1192 - Problem With Adduser - Messes up group file
Problem With Adduser - Messes up group file
Status: CLOSED WORKSFORME
Product: Red Hat Linux
Classification: Retired
Component: shadow-utils (Show other bugs)
5.2
i386 Linux
high Severity medium
: ---
: ---
Assigned To: David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-02-16 05:16 EST by Lee Cashmore
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 1999-03-26 15:47:10 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Lee Cashmore 1999-02-16 05:16:43 EST
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-02-28 19:18:59 EST
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@mailer.tcat.ac.uk> 03/01/99 04:46 -------


------- Email Received From  Lee Cashmore <leec@mailer.tcat.ac.uk> 03/10/99 06:59 -------
Comment 2 David Lawrence 1999-03-26 15:36:59 EST
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 15:47:59 EST
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@mailer.tcat.ac.uk> 03/26/99 18:48 -------
Comment 4 Ian Macdonald 1999-05-01 13:38:59 EDT
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 17:46:30 EDT
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...

Note You need to log in before you can comment on or make changes to this bug.