The attached patch enables SCM_CREDENTIALS for all log messages written. This has multiple benefits, most importantly: while previously log messages could not be authenticated this now provides a reliable way how at least local log messages can be made trustworthy, so that messages from privileged users can be securely distinguished from messages from unprivileged users. In addition this allows logging daemons to insert PID fields in log messages even if LOG_PID was not set on the client side. This patch should be compatible with existing syslogd implementations since the server side has to explicitly enable reception of SCM_CREDENTIALS with SO_PASSCRED. As long as they don't the data will silently be dropped by the kernel and syslogd implementations should see no difference at all from the traditional behaviour.
Created attachment 4942 [details] the patch
Never mind, the kernel attaches SCM_CREDENTIALS to every AF_UNIX packet anyway as it seems. This patch is hence redundant.