Package: ldapscripts
Version: 2.0.1-2
Severity: normal

The problem is in the usage of logname tool.
For example the following code fails on some configurations (default
wheezy machine accessed via ssh):

while read line; do
  logname
done < /etc/host


Ganael (upstream author) uses logname to get the id of current user (even
after su/sudo). Then he uses returned value in ldapid and ldapfinger (to show
the information about current user if no parameters are passed).
This value is also written into logfile.

The problem is that logname is not universal tool. It parses wtmp, which
could be empty in may cases. On the other hand it's really useful for
logging purpose.

I suggest to use logname for loggin, but do not abort if it fails.
Something like this:

LOG_USER=$(logname 2>/dev/null)
test -n "$LOG_USER" || LOG_USER=$(id -nu)

This will allow us to log real user if possible and do not abort if it's
not.

But for ldapid and ldapfinger we should use strict logic, which does not
depend on the phase of the moon. So I suggest not to use logname, but require
the argument.


-- System Information:
Debian Release: 6.0.7
  APT prefers oldstable-updates
  APT policy: (640, 'oldstable-updates'), (640, 'oldstable-proposed-updates'), 
(640, 'oldstable'), (620, 'testing'), (600, 'unstable'), (580, 'experimental'), 
(520, 'oldstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-5-xen-686 (SMP w/4 CPU cores)
Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages ldapscripts depends on:
ii  ldap-utils                    2.4.23-7.3 OpenLDAP utilities

Versions of packages ldapscripts recommends:
ii  pwgen                         2.06-1+b1  Automatic Password generation
ii  sharutils                     1:4.9-1    shar, unshar, uuencode, uudecode

Versions of packages ldapscripts suggests:
ii  nslcd                    0.7.15+squeeze4 Daemon for NSS and PAM lookups usi


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to