/usr/sbin/ldapfinger is in ldapscripts 2.0.8-1ubuntu1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | #!/bin/sh
# ldapfinger : displays a user/machine/group POSIX account's details
# Copyright (C) 2006-2017 Ganaƫl LAPLANCHE
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
# USA.
if [ "$1" = "-h" ] || [ "$1" = "--help" ]
then
echo "Usage : $0 [-u | -g | -m] [username | machinename | groupname | uid | gid]"
exit 1
fi
# Source runtime file
_RUNTIMEFILE="/usr/share/ldapscripts/runtime"
. "$_RUNTIMEFILE"
# Parse options
case "$1" in
"-u" | "-m")
if [ -z "$2" ]
then
# Current user
_USER="$USER"
else
_USER="$2"
fi
;;
"-g")
# Current user not useable (group required)
[ -z "$2" ] && end_die 'Please specify a gid or groupname'
_USER="$2"
;;
"")
# Current user
_USER="$USER"
;;
*)
_USER="$1"
;;
esac
case "$1" in
"-u")
_ldapsearch "$USUFFIX,$SUFFIX" "(&(objectClass=posixAccount)(|(uid=$_USER)(uidNumber=$_USER)))" || end_die "No user found"
;;
"-g")
_ldapsearch "$GSUFFIX,$SUFFIX" "(&(objectClass=$GCLASS)(|(cn=$_USER)(gidNumber=$_USER)))" || end_die "No group found"
;;
"-m")
_ldapsearch "$MSUFFIX,$SUFFIX" "(&(objectClass=posixAccount)(|(uid=$_USER)(uidNumber=$_USER)))" || end_die "No machine found"
;;
*)
_ldapsearch "$SUFFIX" "(|(&(objectClass=posixAccount)(|(uid=$_USER)(uidNumber=$_USER)))(&(objectClass=$GCLASS)(|(cn=$_USER)(gidNumber=$_USER))))" || end_die "No entry found"
;;
esac
end_ok
|