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...
Created attachment 53045 [details] Quick-n-dirty patch to fix the problem
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.
*** Bug 42850 has been marked as a duplicate of this bug. ***
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.
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 :)
Sorry for the late test raport but yes, it's working now as expected, thanks! Feel free to close the bug :)
CLosing fixed in rawhide.