summaryrefslogtreecommitdiff
path: root/databases/gnats/files/patch-gnats::gnatsd.c
diff options
context:
space:
mode:
authorMartin Wilke <miwi@FreeBSD.org>2011-11-01 07:35:46 +0000
committerMartin Wilke <miwi@FreeBSD.org>2011-11-01 07:35:46 +0000
commitc993547647ade192de588d835170899ea69750fa (patch)
tree1066049488d0de8086aaf3e233ead12bf19d5d4e /databases/gnats/files/patch-gnats::gnatsd.c
parent- Update to 0.12.17 (diff)
2011-11-01 games/phpua-ut2003: depends on phpua-engine
2011-11-01 games/phpua-engine: apache13 is deprecated, migrate to 2.2.x+ now 2011-11-01 games/phpua-hl: depends on phpua-engine 2011-11-01 games/phpua-ut: depends on phpua-engine 2011-11-01 games/phpua-cod: depends on phpua-engine 2011-11-01 games/uox3: No more public distfiles 2011-11-01 games/phpua-q3: depends on phpua-engine 2011-11-01 games/phpua-bf: depends on phpua-engine 2011-10-30 graphics/kallery: does not build; last release 20010511 2011-10-28 graphics/gtksee: depends on unfetchable port archivers/bzip; last release 2004 2011-11-01 mail/mailscanner-mrtg: apache13 is deprecated, migrate to 2.2.x+ now 2011-10-31 net-p2p/qbittorrent-28-nox11: Please migrate to net-p2p/qbittorrent-29 2011-10-31 net-p2p/qbittorrent-28: Please migrate to net-p2p/qbittorrent-29 2011-10-31 net-p2p/dctc-gui-qt No more public distfiles 2011-10-31 net-p2p/dctc-gui No more public distfiles 2011-09-01 net-p2p/dctc: No more public distfiles 2011-11-01 www/slash: apache13 is deprecated, migrate to 2.2.x+ now 2011-11-01 databases/maatkit: Upstream support dropped. Please consider using databases/percona-toolkit 2011-11-01 databases/mysqlman: apache13 is deprecated, migrate to 2.2.x+ now 2011-11-01 databases/mysql-editor: apache13 is deprecated, migrate to 2.2.x+ now 2011-09-30 databases/gnats: Security issues
Notes
Notes: svn path=/head/; revision=284829
Diffstat (limited to 'databases/gnats/files/patch-gnats::gnatsd.c')
-rw-r--r--databases/gnats/files/patch-gnats::gnatsd.c130
1 files changed, 0 insertions, 130 deletions
diff --git a/databases/gnats/files/patch-gnats::gnatsd.c b/databases/gnats/files/patch-gnats::gnatsd.c
deleted file mode 100644
index a979f42d8815..000000000000
--- a/databases/gnats/files/patch-gnats::gnatsd.c
+++ /dev/null
@@ -1,130 +0,0 @@
---- gnats/gnatsd.c.orig Wed Sep 22 02:18:39 1999
-+++ gnats/gnatsd.c Tue Aug 20 21:11:28 2002
-@@ -24,6 +24,15 @@
- #include "query.h"
- #include "db_conf.h"
-
-+#ifdef HAVE_PAM
-+#include <security/pam_appl.h>
-+#ifdef _OPENPAM
-+#include <security/openpam.h>
-+#endif
-+
-+static int issetuidroot;
-+#endif /* HAVE_PAM */
-+
- char myname[MAXHOSTNAMELEN];
-
- char *program_name;
-@@ -387,9 +396,9 @@
- return found;
- }
-
--/* Get the access lever for this user. */
--int
--get_user_access (database, filename, user, passwd)
-+/* Get the access level for this user using the file backend. */
-+static int
-+get_user_access_file (database, filename, user, passwd)
- char *database;
- char *filename;
- char *user;
-@@ -489,6 +498,86 @@
- return access;
- }
-
-+#ifdef HAVE_PAM
-+#ifndef _OPENPAM
-+int
-+pam_conv (n, msg, resp, data)
-+ int n;
-+ const struct pam_message **msg;
-+ struct pam_response **resp;
-+ void *data;
-+{
-+
-+ if (n != 1 || msg[0]->msg_style != PAM_PROMPT_ECHO_OFF)
-+ return(PAM_CONV_ERR);
-+ if ((*resp = malloc(sizeof(struct pam_response))) == NULL)
-+ return(PAM_CONV_ERR);
-+ (*resp)[0].resp = strdup((const char *)data);
-+ (*resp)[0].resp_retcode = 0;
-+
-+ return ((*resp)[0].resp != NULL ? PAM_SUCCESS : PAM_CONV_ERR);
-+}
-+#endif /* _OPENPAM */
-+
-+/* Get the access level for this user using the PAM backend. */
-+static int
-+get_user_access_pam (user, passwd)
-+ char *user;
-+ char *passwd;
-+{
-+ int access;
-+ pam_handle_t *pamh;
-+ struct pam_conv pamc = {
-+#ifdef _OPENPAM
-+ &openpam_nullconv, NULL
-+#else
-+ &pam_conv, passwd
-+#endif
-+ };
-+
-+ access = -1;
-+
-+ /* PAM chain may require super-user. */
-+ if (issetuidroot)
-+ seteuid(0);
-+
-+ if (pam_start("gnatsd", user, &pamc, &pamh) == PAM_SUCCESS &&
-+#ifdef _OPENPAM
-+ pam_set_item(pamh, PAM_AUTHTOK, passwd) == PAM_SUCCESS &&
-+#endif
-+ pam_authenticate(pamh, 0) == PAM_SUCCESS)
-+ {
-+ access = ACCESS_EDIT;
-+ }
-+
-+ /* Revert back to real UID. */
-+ if (issetuidroot)
-+ seteuid(getuid());
-+
-+ return access;
-+}
-+#endif /* HAVE_PAM */
-+
-+/* Get the access level for this user. */
-+int
-+get_user_access (database, filename, user, passwd)
-+ char *database;
-+ char *filename;
-+ char *user;
-+ char *passwd;
-+{
-+ int access;
-+
-+ access = -1;
-+
-+#ifdef HAVE_PAM
-+ if ((access = get_user_access_pam(user, passwd)) == -1)
-+#endif /* HAVE_PAM */
-+ access = get_user_access_file(database, filename, user, passwd);
-+
-+ return access;
-+}
-+
- void
- start_connection ()
- {
-@@ -680,6 +769,11 @@
- int optc;
- int not_inetd = 0;
- int access, access_required;
-+
-+#ifdef HAVE_PAM
-+ if ((issetuidroot = geteuid() == 0 && getuid() != 0))
-+ seteuid(getuid());
-+#endif /* HAVE_PAM */
-
- outfile = stdout;
-