ports/54733: PATCH
micko
micko at verio.net
Tue Jul 22 00:00:21 UTC 2003
>Number: 54733
>Category: ports
>Synopsis: PATCH
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: update
>Submitter-Id: current-users
>Arrival-Date: Mon Jul 21 17:00:19 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator: micko
>Release: FreeBSD 4.8-STABLE i386
>Organization:
>Environment:
System: FreeBSD micko.boca.verio.net 4.8-STABLE FreeBSD 4.8-STABLE #2: Wed Jun 4 21:45:39 GMT 2003 micko at mobilepunk.boca.verio.net:/usr/src/sys/compile/KILLER i386
>Description:
Adds additional option for pam-mysql (stripuserdomain). When trying to smtp auth using Postfix + SASL + MySQL,
@domain.com (hostname of the server) is appended to the username passed by the user. If stripuserdomain is
defined, it will strip the domain part.
>How-To-Repeat:
>Fix:
--- pam_mysql.c.ORIG Mon Jul 21 15:16:07 2003
+++ pam_mysql.c Mon Jul 21 15:23:08 2003
@@ -115,6 +115,7 @@
int crypt;
int md5;
int sqllog;
+ int stripuserdomain;
char logtable[17];
char logmsgcolumn[17];
char logpidcolumn[17];
@@ -139,6 +140,7 @@
0,
-1,
-1,
+ 0,
"",
"",
"",
@@ -377,6 +379,13 @@
#ifdef DEBUG
syslog(LOG_ERR, "sqllog changed.");
#endif
+ } else if (!strcasecmp("stripuserdomain", mybuf)) {
+ if ((!strcmp(myval, "1")) || (!strcasecmp(myval, "Y"))) {
+ options.stripuserdomain = 1;
+ }
+#ifdef DEBUG
+ syslog(LOG_ERR, "stripuserdomain selected.");
+#endif
} else if (!strcasecmp("logtable", mybuf)) {
strncpy(options.logtable, myval, 16);
#ifdef DEBUG
@@ -520,6 +529,13 @@
if (sql == NULL)
return PAM_BUF_ERR;
+
+ if (options.stripuserdomain == 1) {
+ char * t = strchr(escapeUser,'@');
+ if (t) {
+ *t = '\0';
+ }
+ }
snprintf(sql, querysize, "SELECT %s FROM %s WHERE %s='%s'",
options.passwdcolumn, options.table,
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list