Bug 63116 - sessreg broken wrt very high UID's
Summary: sessreg broken wrt very high UID's
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Public Beta
Classification: Retired
Component: XFree86
Version: skipjack-beta2
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Mike A. Harris
QA Contact: David Lawrence
URL:
Whiteboard:
: 42850 (view as bug list)
Depends On:
Blocks: 61901
TreeView+ depends on / blocked
 
Reported: 2002-04-10 08:32 UTC by panu.matilainen
Modified: 2007-04-18 16:41 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2002-05-03 14:00:20 UTC
Embargoed:


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

Description panu.matilainen 2002-04-10 08:32:14 UTC
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:
Always

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)
_exit(0)             

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 08:33:35 UTC
Created attachment 53045 [details]
Quick-n-dirty patch to fix the problem

Comment 2 Mike A. Harris 2002-04-11 15:08:36 UTC
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 15:14:18 UTC
*** Bug 42850 has been marked as a duplicate of this bug. ***

Comment 4 Mike A. Harris 2002-04-11 15:19:23 UTC
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 08:53:06 UTC
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 14:00:16 UTC
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 20:26:19 UTC
CLosing fixed in rawhide.


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