Bug 176264 - [PATCH] security/pam_ssh_agent_auth breaks PAM
Summary: [PATCH] security/pam_ssh_agent_auth breaks PAM
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Martin Wilke
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-19 14:40 UTC by cstef
Modified: 2013-02-19 16:10 UTC (History)
0 users

See Also:


Attachments
file.diff (2.50 KB, patch)
2013-02-19 14:40 UTC, cstef
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description cstef 2013-02-19 14:40:00 UTC
After upgrading to pam_ssh_agent_auth-0.9.4 (security/pam_ssh_agent_auth) any program using it as PAM module (sudo in my case) fails to initialize PAM. The cause is that pam_ssh_user_agent.so want some external symbols which are not defined anywhere. These symbols like pamsshagentauth___b64_ntop should be defined and reference correct variant, but that does not happen.

The attached patch (which should be placed into /usr/ports/security/pam_ssh_agent_auth/files fixes the problem, defining necessary functions.

Fix: Patch attached with submission follows:
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-02-19 14:40:08 UTC
Responsible Changed
From-To: freebsd-ports-bugs->miwi

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Martin Wilke freebsd_committer freebsd_triage 2013-02-19 16:05:27 UTC
State Changed
From-To: open->closed

Committed. Thanks!
Comment 3 dfilter service freebsd_committer freebsd_triage 2013-02-19 16:05:32 UTC
Author: miwi
Date: Tue Feb 19 16:05:18 2013
New Revision: 312579
URL: http://svnweb.freebsd.org/changeset/ports/312579

Log:
  - Unbreak PAM initialize
  - While here trim header
  
  PR:		176264
  Submitted by:	Constantin Stefanov <cstef@parallel.ru>

Added:
  head/security/pam_ssh_agent_auth/files/patch-openbsd   (contents, props changed)
Modified:
  head/security/pam_ssh_agent_auth/Makefile

Modified: head/security/pam_ssh_agent_auth/Makefile
==============================================================================
--- head/security/pam_ssh_agent_auth/Makefile	Tue Feb 19 15:48:36 2013	(r312578)
+++ head/security/pam_ssh_agent_auth/Makefile	Tue Feb 19 16:05:18 2013	(r312579)
@@ -7,6 +7,7 @@
 
 PORTNAME=	pam_ssh_agent_auth
 PORTVERSION=	0.9.4
+PORTREVISION=	1
 CATEGORIES=	security
 MASTER_SITES=	SF/pamsshagentauth/${PORTNAME}/v${PORTVERSION}/
 

Added: head/security/pam_ssh_agent_auth/files/patch-openbsd
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/security/pam_ssh_agent_auth/files/patch-openbsd	Tue Feb 19 16:05:18 2013	(r312579)
@@ -0,0 +1,85 @@
+diff -ur openbsd-compat/base64.h openbsd-compat/base64.h
+--- openbsd-compat/base64.h	2013-02-19 17:52:53.000000000 +0400
++++ openbsd-compat/base64.h	2013-02-19 17:49:44.000000000 +0400
+@@ -54,6 +54,7 @@
+ # endif /* !HAVE_B64_NTOP */
+ # define pamsshagentauth___b64_ntop(a,b,c,d) b64_ntop(a,b,c,d)
+ #endif /* HAVE___B64_NTOP */
++#define pamsshagentauth___b64_ntop(a,b,c,d) __b64_ntop(a,b,c,d)
+ 
+ #ifndef HAVE___B64_PTON
+ # ifndef HAVE_B64_PTON
+@@ -61,5 +62,6 @@
+ # endif /* !HAVE_B64_PTON */
+ # define pamsshagentauth___b64_pton(a,b,c) b64_pton(a,b,c)
+ #endif /* HAVE___B64_PTON */
++#define pamsshagentauth___b64_pton(a,b,c) __b64_pton(a,b,c)
+ 
+ #endif /* _BSD_BASE64_H */
+diff -ur openbsd-compat/bsd-arc4random.c openbsd-compat/bsd-arc4random.c
+--- openbsd-compat/bsd-arc4random.c	2012-06-28 05:47:49.000000000 +0400
++++ openbsd-compat/bsd-arc4random.c	2013-02-19 18:02:38.000000000 +0400
+@@ -82,4 +82,17 @@
+ 
+ 	rc4_ready = REKEY_BYTES;
+ }
++#else /* HAVE_ARC4RANDOM */
++
++unsigned int
++pamsshagentauth_arc4random(void)
++{
++        return arc4random();
++}
++
++void
++pamsshagentauth_arc4random_stir(void)
++{
++        arc4random_stir();
++}
+ #endif /* !HAVE_ARC4RANDOM */
+diff -ur openbsd-compat/strlcat.c openbsd-compat/strlcat.c
+--- openbsd-compat/strlcat.c	2012-06-28 05:47:49.000000000 +0400
++++ openbsd-compat/strlcat.c	2013-02-19 18:03:34.000000000 +0400
+@@ -59,4 +59,10 @@
+ 	return(dlen + (s - src));	/* count does not include NUL */
+ }
+ 
++#else /* HAVE_STRLCAT */
++size_t
++pamsshagentauth_strlcat(char *dst, const char *src, size_t siz)
++{
++        return strlcat(dst, src, siz);
++}
+ #endif /* !HAVE_STRLCAT */
+diff -ur openbsd-compat/strlcpy.c openbsd-compat/strlcpy.c
+--- openbsd-compat/strlcpy.c	2012-06-28 05:47:49.000000000 +0400
++++ openbsd-compat/strlcpy.c	2013-02-19 18:04:18.000000000 +0400
+@@ -55,4 +55,10 @@
+ 	return(s - src - 1);	/* count does not include NUL */
+ }
+ 
++#else /* HAVE_STRLCPY */
++size_t
++pamsshagentauth_strlcpy(char *dst, const char *src, size_t siz)
++{
++        return strlcpy(dst, src, siz);
++}
+ #endif /* !HAVE_STRLCPY */
+diff -ur openbsd-compat/strtonum.c openbsd-compat/strtonum.c
+--- openbsd-compat/strtonum.c	2012-06-28 05:47:49.000000000 +0400
++++ openbsd-compat/strtonum.c	2013-02-19 18:05:16.000000000 +0400
+@@ -69,4 +69,11 @@
+ 	return (ll);
+ }
+ 
+-#endif /* HAVE_STRTONUM */
++#else /* HAVE_STRTONUM */
++long long
++pamsshagentauth_strtonum(const char *numstr, long long minval, long long maxval,
++    const char **errstrp)
++{
++        return strtonum(numstr, minval, maxval, errstrp);
++}
++#endif /* i!HAVE_STRTONUM */
+
+
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"