lists.arthurdejong.org
RSS feed

Re: pid formatted incorrectly in debug message (wrong printf format?)

[Date Prev][Date Next] [Thread Prev][Thread Next]

Re: pid formatted incorrectly in debug message (wrong printf format?)



On Fri, 2018-09-07 at 20:13 +0100, Norman Gray wrote:
> When running nslcd in debug mode (`nslcd -d`), I see lines such as
> 
>      DEBUG: connection from pid=18446744073709551615 uid=0 gid=0
> 
> This is an implausible pid number.  This originates from a line
> 
>      log_log(LOG_DEBUG, "connection from pid=%lu uid=%lu gid=%lu",
>            (unsigned long int)pid, (unsigned long int)uid, (unsigned 
> long int)gid);
> 
> in nslcd.c (I'm looking at both the repo).
> 
> That pid number is -1 as a long unsigned.  Thus the problem here
> appears to be that getpeercred is failing to obtain the PID and
> either not reporting it or not detecting it.

Yes, the pid should probably not be logged if it cannot be determined.
I've just pushed a fix that should avoid logging unavailable
information.

> (if so, that's also a problem).

I don't think that FreeBSD's LOCAL_PEERCRED facility exposes the
process ID of the socket peer. I sadly can't test this at the moment
because by FreeBSD virtual machine is not working. I'm not aware of any
other mechanism to find the PID of the nslcd client.

Kind regards,

-- 
-- arthur - arthur@arthurdejong.org - https://arthurdejong.org/ --

-- 
To unsubscribe send an email to
nss-pam-ldapd-users-unsubscribe@lists.arthurdejong.org or see
https://lists.arthurdejong.org/nss-pam-ldapd-users/