summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2003-11-04 00:32:16 +0000
committerMike Frysinger <vapier@gentoo.org>2003-11-04 00:32:16 +0000
commite94ad473c6157a8f911a7f7a5c29c6f2e3708007 (patch)
tree1d0849b107d462dbb631000b0c2d8202cbbc64a3 /net-misc/mdidentd/files
parentdb3 and other cleanups (diff)
downloadgentoo-2-e94ad473c6157a8f911a7f7a5c29c6f2e3708007.tar.gz
gentoo-2-e94ad473c6157a8f911a7f7a5c29c6f2e3708007.tar.bz2
gentoo-2-e94ad473c6157a8f911a7f7a5c29c6f2e3708007.zip
initial ebuild #31618
Diffstat (limited to 'net-misc/mdidentd/files')
-rw-r--r--net-misc/mdidentd/files/1.04a-pidfile.patch17
-rw-r--r--net-misc/mdidentd/files/1.04a-security.patch77
-rw-r--r--net-misc/mdidentd/files/digest-mdidentd-1.04a1
-rw-r--r--net-misc/mdidentd/files/mdidentd.conf.d7
-rw-r--r--net-misc/mdidentd/files/mdidentd.init.d22
5 files changed, 124 insertions, 0 deletions
diff --git a/net-misc/mdidentd/files/1.04a-pidfile.patch b/net-misc/mdidentd/files/1.04a-pidfile.patch
new file mode 100644
index 000000000000..ec75f22b85b6
--- /dev/null
+++ b/net-misc/mdidentd/files/1.04a-pidfile.patch
@@ -0,0 +1,17 @@
+--- mdidentd/identd.cpp.orig 2003-11-03 19:21:50.175424408 -0500
++++ mdidentd/identd.cpp 2003-11-03 19:25:05.683702632 -0500
+@@ -709,6 +709,14 @@
+ return -1;
+
+ default:
++ FILE *pidfile;
++ /* make the pid file */
++ pidfile = fopen("/var/run/mdidentd.pid", "w");
++ if (pidfile) {
++ fprintf(pidfile, "%i", xx);
++ fclose(pidfile);
++ } else
++ perror("Could not write pidfile");
+ return xx;
+
+ }
diff --git a/net-misc/mdidentd/files/1.04a-security.patch b/net-misc/mdidentd/files/1.04a-security.patch
new file mode 100644
index 000000000000..70815d38434c
--- /dev/null
+++ b/net-misc/mdidentd/files/1.04a-security.patch
@@ -0,0 +1,77 @@
+--- ezbounce-1.04a/mdidentd/identd.cpp
++++ ezbounce-1.04a/mdidentd/identd.cpp 2003-10-20 20:23:26.000000000 +0000
+@@ -44,6 +44,7 @@
+
+ #include <unistd.h>
+ #include <sys/socket.h>
++#include <pwd.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <arpa/inet.h>
+@@ -76,6 +77,7 @@
+ static bool foreground, auto_kill; /* Some options */
+ bool no_real;
+ static uid_t uid; /* Become this user after binding sock */
++static gid_t gid; /* Primary group of uid */
+ static unsigned int hard_limit; /* Max # of fake idents */
+ static unsigned int num_conns;
+ static unsigned int num_unix;
+@@ -179,10 +181,16 @@
+ id = argv[y+1];
+ if (!id)
+ {
+- fprintf(stderr, "Option '-u' requires numeric user id to follow it\n");
++ fprintf(stderr, "Option '-u' requires user id to follow it\n");
+ exit(1);
+ }
+- uid = (uid_t) atoi(id);
++ struct passwd *pw_ent;
++ if (!(pw_ent = getpwnam(id))) {
++ fprintf(stderr, "Option '-u' requires valid user id to follow it\n");
++ exit(1);
++ }
++ uid = pw_ent->pw_uid;
++ gid = pw_ent->pw_gid;
+ y++;
+ break;
+ case 'h':
+@@ -277,9 +285,6 @@
+ unix_listen_fd = -1;
+ return 0;
+ }
+- /* Must make it world writable if we expect to receive connections
+- on it */
+- fchmod(unix_listen_fd, 0777);
+ return 1;
+ }
+
+@@ -396,7 +401,7 @@
+ * see if matches any of our fake ones, if not..
+ * its time to load the user's other identd.
+ *
+- * Currently replies system name as 'OTHER'.
++ * Currently replies system name as 'UNIX'.
+ */
+ static int reply(conn * c)
+ {
+@@ -422,8 +427,8 @@
+ if (table->lookup(p1, p2, ident, sizeof(ident)))
+ {
+ syslog(LOG_INFO, "Request from %s for: %d , %d ", inet_ntoa(sin.sin_addr), p1, p2);
+- syslog(LOG_INFO, "(fake) reply: %d, %d : USERID : OTHER :%s", p1, p2, ident);
+- fdprintf(c->fd, "%d , %d : USERID : OTHER :%s\r\n",
++ syslog(LOG_INFO, "(fake) reply: %d , %d : USERID : UNIX : %s", p1, p2, ident);
++ fdprintf(c->fd, "%d , %d : USERID : UNIX : %s\r\n",
+ p1, p2, ident);
+ if (auto_kill)
+ table->remove(p1, p2, ident);
+@@ -491,7 +496,8 @@
+ /* we already did this. but it doesn't work. i dunno why.
+ * i am messing up somwhere. dunno where. but we will do it again.
+ * and it will work. so there!! */
+- chmod(MDIDENTD_SOCK_PATH, 0777);
++ chmod(MDIDENTD_SOCK_PATH, 0770);
++ chown(MDIDENTD_SOCK_PATH, uid, gid);
+ #ifndef NOFORK
+ if (!foreground)
+ {
diff --git a/net-misc/mdidentd/files/digest-mdidentd-1.04a b/net-misc/mdidentd/files/digest-mdidentd-1.04a
new file mode 100644
index 000000000000..f1fdd329d49c
--- /dev/null
+++ b/net-misc/mdidentd/files/digest-mdidentd-1.04a
@@ -0,0 +1 @@
+MD5 f214fbd8ec1d95981639c9e1087436cb ezbounce-1.04a.tar.gz 189147
diff --git a/net-misc/mdidentd/files/mdidentd.conf.d b/net-misc/mdidentd/files/mdidentd.conf.d
new file mode 100644
index 000000000000..b6fbdb9a1439
--- /dev/null
+++ b/net-misc/mdidentd/files/mdidentd.conf.d
@@ -0,0 +1,7 @@
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/mdidentd/files/mdidentd.conf.d,v 1.1 2003/11/04 00:32:16 vapier Exp $
+
+# Config file for /etc/init.d/mdidentd
+
+MDIDENTD_UID=mdidentd
diff --git a/net-misc/mdidentd/files/mdidentd.init.d b/net-misc/mdidentd/files/mdidentd.init.d
new file mode 100644
index 000000000000..090f4e470025
--- /dev/null
+++ b/net-misc/mdidentd/files/mdidentd.init.d
@@ -0,0 +1,22 @@
+#!/sbin/runscript
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Header: /var/cvsroot/gentoo-x86/net-misc/mdidentd/files/mdidentd.init.d,v 1.1 2003/11/04 00:32:16 vapier Exp $
+
+opts="depend start stop"
+
+depend() {
+ need net
+}
+
+start() {
+ ebegin "Starting mdidentd"
+ /usr/sbin/mdidentd -u ${MDIDENTD_UID} -kr /usr/sbin/mdidentd
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping mdidentd"
+ kill $(</var/run/mdidentd.pid)
+ eend $?
+}