Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 329885 - sys-libs/pam-1.1.1-r2 marks tallylog as executable
Summary: sys-libs/pam-1.1.1-r2 marks tallylog as executable
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: PAM Gentoo Team (OBSOLETE)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-26 08:48 UTC by Hugo Mildenberger
Modified: 2010-07-28 20:38 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Output of emerge --info =sys-libs/pam-1.1.1-r2 (emerge_--info_pam.txt,4.45 KB, text/plain)
2010-07-26 08:52 UTC, Hugo Mildenberger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hugo Mildenberger 2010-07-26 08:48:20 UTC
# ls -l /var/log/tallylog 
-rwx------ 1 root root 64064 Apr  7 22:56 tallylog

I'm unsure which version of pam actually created this file. Maybe it was a predecessor version.
Comment 1 Hugo Mildenberger 2010-07-26 08:52:23 UTC
Created attachment 240187 [details]
Output of emerge --info =sys-libs/pam-1.1.1-r2
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2010-07-26 10:59:12 UTC
Please run `portageq owners / /var/log/tallylog' and post the output here.
Comment 3 Hugo Mildenberger 2010-07-26 14:34:31 UTC
$ portageq owners / /var/log/tallylog
None of the installed packages claim the file(s).

However, the file seems to contain a single valid counter:

$ pam_tally2 --file /var/log/tallylog
Login           Failures Latest failure     From
someone             1    03/28/10 23:18:31  somewhere (known ip)
Comment 4 Hugo Mildenberger 2010-07-26 14:38:02 UTC
$ strings /lib/security/pam_tally2.so | grep tallylog
/var/log/tallylog
Comment 5 Hugo Mildenberger 2010-07-26 14:50:53 UTC
Ok, this is from static int get_tally() from within pam_tally.c:

 374     lstat_ret = lstat(filename, &fileinfo);
 375     if (lstat_ret) {
 376       *tfile=open(filename, O_APPEND|O_CREAT, 0700);
 377       /* Create file, or append-open in pathological case. */

It uses open with mode 0700 (rwx). Thus it voluntarily creates a pathological case here.  
Comment 6 Diego Elio Pettenò (RETIRED) gentoo-dev 2010-07-26 15:32:49 UTC
You're right and the thing is still broken upstream; will fix without revbump, as it's far from being overly important IMHO.
Comment 7 Diego Elio Pettenò (RETIRED) gentoo-dev 2010-07-26 15:42:25 UTC
Committed, thanks, going to send it upstream in a moment ;)
Comment 8 Hugo Mildenberger 2010-07-28 20:33:06 UTC
Diego, your patch only addresses a newly created tallylog. Hence the pam ebuild should explicitly remove the executable bit from that file, if it exists.
Comment 9 Diego Elio Pettenò (RETIRED) gentoo-dev 2010-07-28 20:38:12 UTC
Sincerely, I'd like to mess with live filesystem permission the least possible, especially since it shouldn't be much of trouble beside being wrong..