From owner-freebsd-questions@FreeBSD.ORG Tue Mar 9 11:44:29 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1139A16A4CE for ; Tue, 9 Mar 2004 11:44:29 -0800 (PST) Received: from spock.ste-land.com (spock.ste-land.com [64.32.179.40]) by mx1.FreeBSD.org (Postfix) with ESMTP id C2B1143D39 for ; Tue, 9 Mar 2004 11:44:28 -0800 (PST) (envelope-from ste@ste-land.com) Received: from ste-land.com (bgp377940bgs.plnfld01.nj.comcast.net [68.36.5.198]) by spock.ste-land.com (Postfix) with ESMTP id 6462C2D24C; Tue, 9 Mar 2004 14:44:27 -0500 (EST) Message-ID: <404E1E9A.7030101@ste-land.com> Date: Tue, 09 Mar 2004 14:44:26 -0500 From: "Shaun T. Erickson" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4b) Gecko/20030507 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Alexander Haderer References: <5.2.0.9.1.20040309192650.01ad49f0@postamt1.charite.de> <404DFE56.6030204@ste-land.com> <404DFE56.6030204@ste-land.com> <5.2.0.9.1.20040309192650.01ad49f0@postamt1.charite.de> <5.2.0.9.1.20040309195409.01a90d80@postamt1.charite.de> In-Reply-To: <5.2.0.9.1.20040309195409.01a90d80@postamt1.charite.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-questions@freebsd.org Subject: Re: How do I add a local patch to a port? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Mar 2004 19:44:29 -0000 Alexander Haderer wrote: > Just another guess: Probably it makes a difference if the patchfile > patches ./dir/tobepatched and dir/tobepatched. A brief look into other > ports shows me that the latter is used. I don't know if it have to be > this way or not. Ok. I'm trying to patch "/usr/ports/security/cyrus-sasl2-saslauthd/work/cyrus-sasl-2.1.17/saslauthd/auth_pam.c". The patchfile is named "patch-aa" and is located in "/usr/ports/security/cyrus-sasl2-saslauthd/files". Here is the contents of the patchfile that works manually, when I cd to "/usr/ports/security/cyrus-sasl2-saslauthd/work/cyrus-sasl-2.1.17" and run "patch < /usr/ports/security/cyrus-sasl2-saslauthd/files/patch-aa": Index: saslauthd/auth_pam.c diff -u saslauthd/auth_pam.c.orig saslauthd/auth_pam.c --- saslauthd/auth_pam.c.orig Sat May 31 13:00:24 2003 +++ saslauthd/auth_pam.c Tue Mar 9 11:53:44 2004 @@ -178,7 +178,7 @@ const char *login, /* I: plaintext authenticator */ const char *password, /* I: plaintext password */ const char *service, /* I: service name */ - const char *realm __attribute__((unused)) + const char *realm /* END PARAMETERS */ ) { @@ -186,17 +186,25 @@ pam_appdata my_appdata; /* application specific data */ struct pam_conv my_conv; /* pam conversion data */ pam_handle_t *pamh; /* pointer to PAM handle */ + char user[256]; int rc; /* return code holder */ /* END VARIABLES */ - my_appdata.login = login; + strlcpy(user, login, 256); + + if (realm) { + strlcat(user, "@", 256); + strlcat(user, realm, 256); + } + + my_appdata.login = user; my_appdata.password = password; my_appdata.pamh = NULL; my_conv.conv = saslauthd_pam_conv; my_conv.appdata_ptr = &my_appdata; - rc = pam_start(service, login, &my_conv, &pamh); + rc = pam_start(service, user, &my_conv, &pamh); if (rc != PAM_SUCCESS) { syslog(LOG_DEBUG, "DEBUG: auth_pam: pam_start failed: %s", pam_strerror(pamh, rc)); It all looks right to me, but when I do a "make clean" follwed by a make, the file does not get patched. What am I doing wrong? -ste