rmlint
rmlint copied to clipboard
False positive "Bad UID" for LDAP users
I'm using rmlint on CentOS 7, with LDAP authentication.
$ rmlint --version
version 2.10.1 compiled: Jun 20 2020 at [14:37:22] "Ludicrous Lemur" (rev unknown)
$ id
uid=10166(orgads) gid=10011(linuxusers) groups=10011(linuxusers)
$ mkdir test; cd test; echo foo > bar
$ ls -l
total 4
-rw-r--r-- 1 orgads linuxusers 4 Sep 3 09:49 bar
$ ls -n
total 4
-rw-r--r-- 1 10166 10011 4 Sep 3 09:49 bar
$ rmlint
# Bad UID(s):
chown orgads '/home/orgads/test/bar'
$ ./rmlint.sh -d
# ///This script will be deleted after it runs///
[ 0%] chown orgads /home/orgads/test/bar
[100%] Done!
Deleting script ./rmlint.sh
$ rmlint
# Bad UID(s):
chown orgads '/home/orgads/test/bar'
This is strange. rmlint uses the getpwent() call to list all possible users (including LDAP according to man page) and checks the user ids from that.
Can you please paste the output of this oneliner (filtering sensitive and unneeded info where possible):
$ python3 -c 'import pwd, pprint; pprint.pprint(pwd.getpwall())'
I want to see if 10166 is in there (which would indicate a bug in rmlint somewhere).
As a workaround, you can run with out any UID check for now:
$ rmlint -T 'all -badids'
Looks like it reads from /etc/passwd, but LDAP users don't appear there. On the server I use they come from sss service.
/etc/nsswitch.conf:
passwd: files sss