7 buildProduct ? # can be "client" or "daemon"
8 if buildClient != null then
10 buildClient is deprecated;
11 use buildProduct instead
12 '' (if buildClient then "client" else "daemon")
16 # Remove them before next version of either Nixpkgs or bsd-finger itself
20 assert lib.elem buildProduct [
24 stdenv.mkDerivation (finalAttrs: {
25 pname = "bsd-finger" + lib.optionalString (buildProduct == "daemon") "d";
29 url = "http://ftp.de.debian.org/debian/pool/main/b/bsd-finger/bsd-finger_${finalAttrs.version}.orig.tar.bz2";
30 hash = "sha256-KLNNYF0j6mh9eeD8SMA1q+gPiNnBVH56pGeW0QgcA2M=";
35 debianRevision = "17";
38 "https://sources.debian.org/data/main/b/bsd-finger/${finalAttrs.version}-${debianRevision}/debian/patches/${patchName}.patch";
41 # Patches original finger sources to make the programs more robust and
44 url = generateUrl "01-legacy";
45 hash = "sha256-84znJLXez4w6WB2nOW+PHK/0srE0iG9nGAjO1/AGczw=";
48 # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=518559
50 # Doesn't work with a non-iterable nsswitch source
52 # Currently, "finger tabbott" works by iterating through the list of users
53 # on the system using getpwent and checking if any of them match
56 # Some nsswitch backends (including Hesiod and LDAP[1]) do not support
57 # iterating through the complete list of users. These nsswitch backends
58 # instead only fully support looking up a user's information by username
61 # So, if tabbott is a user whose nsswitch information comes from LDAP,
62 # then "finger tabbott" will incorrectly report "finger: tabbott: no such
63 # user." "finger -m tabbott" does work correctly, however, because it
64 # looks up the matching username using getpwnam.
66 # A fix for this is to always look up an argument to finger for a username
67 # match, and having -m only control whether finger searches the entire
68 # user database for real name matches. Patch attached.
70 # This patch has the advantageous side effect that if there are some real
71 # name matches and a username match, finger will always display the
72 # username match first (rather than in some random place in the list).
76 # [1] with LDAP, it is typically the case that one can iterate through
77 # only the first 100 results from a query.
79 url = generateUrl "02-518559-nsswitch-sources";
80 hash = "sha256-oBXJ/kr/czevWk0TcsutGINNwCoHnEStRT8Jfgp/lbM=";
83 # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=468454
84 # Implement IPv6 capacity for the server Fingerd.
86 url = generateUrl "03-468454-fingerd-ipv6";
87 hash = "sha256-a5+qoy2UKa2nCJrwrfJ5VPZoACFXFQ1j/rweoMYW1Z0=";
90 # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=468454
91 # Implement IPv6 capability for the client Finger.
93 url = generateUrl "04-468454-finger-ipv6";
94 hash = "sha256-cg93NL02lJm/5Freegb3EbjDAQVkurLEEJifcyQRRfk=";
97 # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=547014
98 # From: "Matthew A. Dunford" <mdunford@lbl.gov>
100 # finger segfaults when it comes across a netgroup entry in /etc/passwd.
101 # A netgroup entry doesn't include many of the fields in a normal passwd
102 # entry, so pw->pw_gecos is set to NULL, which causes finger to core dump.
104 # Here is part of a /etc/passwd file with a netgroup entry:
106 # nobody:x:65534:65534:nobody:/nonexistent:/bin/sh +@operator
108 # This patch sidesteps what finger considers a malformed passwd entry:
110 url = generateUrl "05-547014-netgroup";
111 hash = "sha256-d+ufp7nPZwW+t+EWASzHrXT/O6zSzt6OOV12cKVo3P0=";
114 # Decrease timeout length during connect().
115 # In cases where a name server is answering with A as well as AAAA
116 # records, but the system to be queried has lost a corresponding address,
117 # the TCP handshake timeout will cause a long delay before allowing the
118 # query of the next address family, or the next address in general.
120 # The use of a trivial signal handler for SIGALRM allows the reduction of
121 # this timeout, thus producing better responsiveness for the interactive
122 # user of the Finger service.
123 # Author: Mats Erik Andersson <debian@gisladisker.se>
125 url = generateUrl "06-572211-decrease-timeout";
126 hash = "sha256-KtNGU5mmX1nnxQc7XnYoUuVW4We2cF81+x6EQrHF7g0=";
129 # Use cmake as build system
131 url = generateUrl "use-cmake-as-buildsystem";
132 hash = "sha256-YOmkF6Oxowy15mCE1pCvHKnLEXglijWFG6eydnZJFhM=";
135 # Debian-specific changes to the cmake build system (that NixOS will also
137 # Adds -D_GNU_SOURCE, which will enable many C extensions that finger
140 url = generateUrl "use-cmake-as-buildsystem-debian-extras";
141 hash = "sha256-T3DWpyyz15JCiVJ41RrJEhsmicei8G3OaKpxvzOCcBU=";
144 # Fix typo at fingerd man page (Josue Ortega <josue@debian.org>)
146 url = generateUrl "fix-fingerd-man-typo";
147 hash = "sha256-f59osGi0a8Tkm2Vxg2+H2brH8WproCDvbPf4jXwi6ag=";
151 env.NIX_CFLAGS_COMPILE = "-D_GNU_SOURCE";
158 "daemon" = "fingerd";
183 mkdir -p $out/${bindir} $out/man/${mandir}
186 postInstall = lib.optionalString (buildProduct == "daemon") ''
188 ln -s in.fingerd fingerd
195 "client" = "User information lookup program";
196 "daemon" = "Remote user information server";
199 license = lib.licenses.bsdOriginal;
203 "daemon" = "fingerd";
206 maintainers = with lib.maintainers; [ AndersonTorres ];
207 platforms = lib.platforms.linux;