Bug 63116 - sessreg broken wrt very high UID's
sessreg broken wrt very high UID's
Product: Red Hat Public Beta
Classification: Retired
Component: XFree86 (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Mike A. Harris
David Lawrence
: 42850 (view as bug list)
Depends On:
Blocks: 61901
  Show dependency treegraph
Reported: 2002-04-10 04:32 EDT by panu.matilainen
Modified: 2007-04-18 12:41 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-05-03 10:00:20 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Quick-n-dirty patch to fix the problem (578 bytes, patch)
2002-04-10 04:33 EDT, panu.matilainen
no flags Details | Diff

  None (edit)
Description panu.matilainen 2002-04-10 04:32:14 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 Galeon/1.2.0 (X11; Linux i686; U;) Gecko/20020311

Description of problem:
Sessreg fails with -EFBIG causing xdm/kdm/gdm logins to fail when using a very
high UID values because it's not using the 64bit-interface to open lastlog file.
This also starts happening to all consequent sessreg attempts as the file has
grown too large...

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. useradd -u 11223344 highuid
2. strace sessreg -a highuid
3. (or try logging in as the user highuid from gdm)


Actual Results:  Last lines from the strace:

read(3, "root:x:0:0:root:/root:/bin/bash\n"..., 4096) = 1101
close(3)                                = 0
munmap(0x40018000, 4096)                = 0
open("/var/log/lastlog", O_RDWR)        = -1 EFBIG (File too large)

Expected Results:  Obviously it shouldn't return an error... 

Additional info:

I reported this bug originally for RH7.1 (#42850) but it is still present. Now
this might seem a non-issue because the problem only shows up with *very* high
UID values but it affects nearly every Linux user here at Nokia. Granted we may
have a crazy UID allocation scheme (which I can do nothing about) but still...

The attached quick-n-dirty patch fixes this by forcing sessreg to use open64 and
lseek64 when handling the lastlog file but I suppose that should be done with
compile-time options instead..

Pretty please.. it's not a *hard* bug to fix...
Comment 1 panu.matilainen 2002-04-10 04:33:35 EDT
Created attachment 53045 [details]
Quick-n-dirty patch to fix the problem
Comment 2 Mike A. Harris 2002-04-11 11:08:36 EDT
Modified patch to use lseek64() instead of llseek() as lseek64() is the
supported method, and llseek() is deprecated.

Applied patch to XFree86 4.2.0-6.63 and later releases in rawhide.  Please
test once it is publically available and report back.

Thanks also for the patch.
Comment 3 Mike A. Harris 2002-04-11 11:14:18 EDT
*** Bug 42850 has been marked as a duplicate of this bug. ***
Comment 4 Mike A. Harris 2002-04-11 11:19:23 EDT
Ok, I am officially a big moron.

The original patch DOES use lseek64().  Duh.  What I meant to say above,
is lseek64()'s 2nd argument takes an off64_t argument rather than an
loff_t argument.  My brain seems slow today.

- Function: off64_t lseek64 (int FILEDES, off64_t OFFSET, int WHENCE)

Time for some coffee.
Comment 5 panu.matilainen 2002-04-12 04:53:06 EDT
Thanks!! I still think the "correct" fix would be using something like
"FILE_OFFSET_BITS=64 LARGEFILE_SUPPORT=YES" as compile-flags instead of
hardwiring to foo64 but when I tried that it didn't change anything (but then
again I don't really know how those are supposed to work...) But hey, I'm NOT
complaining here :)
Comment 6 Panu Matilainen 2002-05-03 10:00:16 EDT
Sorry for the late test raport but yes, it's working now as expected, thanks!
Feel free to close the bug :)
Comment 7 Mike A. Harris 2002-05-03 16:26:19 EDT
CLosing fixed in rawhide.

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