Page MenuHomeFreeBSD

D5916.id17261.diff
No OneTemporary

D5916.id17261.diff

Index: head/libexec/fingerd/Makefile
===================================================================
--- head/libexec/fingerd/Makefile
+++ head/libexec/fingerd/Makefile
@@ -1,6 +1,8 @@
# @(#)Makefile 8.1 (Berkeley) 6/4/93
# $FreeBSD$
+.include <src.opts.mk>
+
PROG= fingerd
LIBADD= util
MAN= fingerd.8
@@ -8,4 +10,10 @@
WARNS?= 2
WFORMAT=0
+.if ${MK_BLACKLIST_SUPPORT} != "no"
+CFLAGS+= -DUSE_BLACKLIST -I${SRCTOP}/contrib/blacklist/include
+LIBADD+= blacklist
+LDFLAGS+=-L${LIBBLACKLISTDIR}
+.endif
+
.include <bsd.prog.mk>
Index: head/libexec/fingerd/fingerd.c
===================================================================
--- head/libexec/fingerd/fingerd.c
+++ head/libexec/fingerd/fingerd.c
@@ -57,6 +57,9 @@
#include <stdlib.h>
#include <string.h>
#include "pathnames.h"
+#ifdef USE_BLACKLIST
+#include <blacklist.h>
+#endif
void logerr(const char *, ...) __printflike(1, 2) __dead2;
@@ -153,12 +156,18 @@
*ap = strtok(lp, " \t\r\n");
if (!*ap) {
if (secure && ap == &av[4]) {
+#ifdef USE_BLACKLIST
+ blacklist(1, STDIN_FILENO, "nousername");
+#endif
puts("must provide username\r\n");
exit(1);
}
break;
}
if (secure && strchr(*ap, '@')) {
+#ifdef USE_BLACKLIST
+ blacklist(1, STDIN_FILENO, "noforwarding");
+#endif
puts("forwarding service denied\r\n");
exit(1);
}
@@ -197,6 +206,9 @@
}
dup2(STDOUT_FILENO, STDERR_FILENO);
+#ifdef USE_BLACKLIST
+ blacklist(0, STDIN_FILENO, "success");
+#endif
execv(prog, comp);
write(STDERR_FILENO, prog, strlen(prog));
#define MSG ": cannot execute\n"

File Metadata

Mime Type
text/plain
Expires
Sat, May 16, 12:38 AM (11 h, 8 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33104430
Default Alt Text
D5916.id17261.diff (1 KB)

Event Timeline