mirror of
https://git.FreeBSD.org/ports.git
synced 2025-02-05 11:35:01 +00:00
- add pam_cleanup from CURRENT
- Fix build problems < 4.0 PR: 40576
This commit is contained in:
parent
a329649f1a
commit
9d5e8cafdc
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=63497
@ -7,7 +7,7 @@
|
||||
|
||||
PORTNAME= openssh
|
||||
PORTVERSION= 3.4p1
|
||||
PORTREVISION= 5
|
||||
PORTREVISION= 6
|
||||
CATEGORIES= security ipv6
|
||||
MASTER_SITES= ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/ \
|
||||
ftp://ftp.op.net/pub/OpenBSD/OpenSSH/portable/ \
|
||||
|
@ -33,7 +33,7 @@
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
RCSID("$FreeBSD: /tmp/pcvs/ports/security/hpn-ssh/files/Attic/auth2-pam-freebsd.c,v 1.2 2002-07-07 18:55:26 dinoex Exp $");
|
||||
RCSID("$FreeBSD: /tmp/pcvs/ports/security/hpn-ssh/files/Attic/auth2-pam-freebsd.c,v 1.3 2002-07-24 20:47:22 dinoex Exp $");
|
||||
|
||||
#ifdef USE_PAM
|
||||
#include <security/pam_appl.h>
|
||||
@ -156,6 +156,17 @@ pam_child(struct pam_ctxt *ctxt)
|
||||
exit(0);
|
||||
}
|
||||
|
||||
static void
|
||||
pam_cleanup(void *ctxtp)
|
||||
{
|
||||
struct pam_ctxt *ctxt = ctxtp;
|
||||
int status;
|
||||
|
||||
close(ctxt->pam_sock);
|
||||
kill(ctxt->pam_pid, SIGHUP);
|
||||
waitpid(ctxt->pam_pid, &status, 0);
|
||||
}
|
||||
|
||||
static void *
|
||||
pam_init_ctx(Authctxt *authctxt)
|
||||
{
|
||||
@ -192,6 +203,7 @@ pam_init_ctx(Authctxt *authctxt)
|
||||
}
|
||||
ctxt->pam_sock = socks[0];
|
||||
close(socks[1]);
|
||||
fatal_add_cleanup(pam_cleanup, ctxt);
|
||||
return (ctxt);
|
||||
}
|
||||
|
||||
@ -297,6 +309,7 @@ pam_free_ctx(void *ctxtp)
|
||||
struct pam_ctxt *ctxt = ctxtp;
|
||||
int status;
|
||||
|
||||
fatal_remove_cleanup(pam_cleanup, ctxt);
|
||||
close(ctxt->pam_sock);
|
||||
kill(ctxt->pam_pid, SIGHUP);
|
||||
waitpid(ctxt->pam_pid, &status, 0);
|
||||
|
@ -1,12 +1,23 @@
|
||||
--- loginrec.c.orig Tue Apr 23 15:09:19 2002
|
||||
+++ loginrec.c Mon Jul 15 21:29:20 2002
|
||||
@@ -654,7 +655,8 @@
|
||||
+++ loginrec.c Wed Jul 24 08:13:44 2002
|
||||
@@ -171,6 +171,7 @@
|
||||
|
||||
#ifdef HAVE_LIBUTIL_H
|
||||
# include <libutil.h>
|
||||
+# include <osreldate.h>
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -654,7 +655,12 @@
|
||||
/* Use strncpy because we don't necessarily want null termination */
|
||||
strncpy(ut->ut_name, li->username, MIN_SIZEOF(ut->ut_name, li->username));
|
||||
# ifdef HAVE_HOST_IN_UTMP
|
||||
- strncpy(ut->ut_host, li->hostname, MIN_SIZEOF(ut->ut_host, li->hostname));
|
||||
+# if defined(__FreeBSD__) && __FreeBSD_version <= 400000
|
||||
strncpy(ut->ut_host, li->hostname, MIN_SIZEOF(ut->ut_host, li->hostname));
|
||||
+# else
|
||||
+ realhostname_sa(ut->ut_host, sizeof ut->ut_host,
|
||||
+ &li->hostaddr.sa, li->hostaddr.sa.sa_len);
|
||||
+# endif
|
||||
# endif
|
||||
# ifdef HAVE_ADDR_IN_UTMP
|
||||
/* this is just a 32-bit IP address */
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
PORTNAME= openssh
|
||||
PORTVERSION= 3.4p1
|
||||
PORTREVISION= 5
|
||||
PORTREVISION= 6
|
||||
CATEGORIES= security ipv6
|
||||
MASTER_SITES= ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/ \
|
||||
ftp://ftp.op.net/pub/OpenBSD/OpenSSH/portable/ \
|
||||
|
@ -33,7 +33,7 @@
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
RCSID("$FreeBSD: /tmp/pcvs/ports/security/openssh-portable/files/Attic/auth2-pam-freebsd.c,v 1.2 2002-07-07 18:55:26 dinoex Exp $");
|
||||
RCSID("$FreeBSD: /tmp/pcvs/ports/security/openssh-portable/files/Attic/auth2-pam-freebsd.c,v 1.3 2002-07-24 20:47:22 dinoex Exp $");
|
||||
|
||||
#ifdef USE_PAM
|
||||
#include <security/pam_appl.h>
|
||||
@ -156,6 +156,17 @@ pam_child(struct pam_ctxt *ctxt)
|
||||
exit(0);
|
||||
}
|
||||
|
||||
static void
|
||||
pam_cleanup(void *ctxtp)
|
||||
{
|
||||
struct pam_ctxt *ctxt = ctxtp;
|
||||
int status;
|
||||
|
||||
close(ctxt->pam_sock);
|
||||
kill(ctxt->pam_pid, SIGHUP);
|
||||
waitpid(ctxt->pam_pid, &status, 0);
|
||||
}
|
||||
|
||||
static void *
|
||||
pam_init_ctx(Authctxt *authctxt)
|
||||
{
|
||||
@ -192,6 +203,7 @@ pam_init_ctx(Authctxt *authctxt)
|
||||
}
|
||||
ctxt->pam_sock = socks[0];
|
||||
close(socks[1]);
|
||||
fatal_add_cleanup(pam_cleanup, ctxt);
|
||||
return (ctxt);
|
||||
}
|
||||
|
||||
@ -297,6 +309,7 @@ pam_free_ctx(void *ctxtp)
|
||||
struct pam_ctxt *ctxt = ctxtp;
|
||||
int status;
|
||||
|
||||
fatal_remove_cleanup(pam_cleanup, ctxt);
|
||||
close(ctxt->pam_sock);
|
||||
kill(ctxt->pam_pid, SIGHUP);
|
||||
waitpid(ctxt->pam_pid, &status, 0);
|
||||
|
@ -1,12 +1,23 @@
|
||||
--- loginrec.c.orig Tue Apr 23 15:09:19 2002
|
||||
+++ loginrec.c Mon Jul 15 21:29:20 2002
|
||||
@@ -654,7 +655,8 @@
|
||||
+++ loginrec.c Wed Jul 24 08:13:44 2002
|
||||
@@ -171,6 +171,7 @@
|
||||
|
||||
#ifdef HAVE_LIBUTIL_H
|
||||
# include <libutil.h>
|
||||
+# include <osreldate.h>
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -654,7 +655,12 @@
|
||||
/* Use strncpy because we don't necessarily want null termination */
|
||||
strncpy(ut->ut_name, li->username, MIN_SIZEOF(ut->ut_name, li->username));
|
||||
# ifdef HAVE_HOST_IN_UTMP
|
||||
- strncpy(ut->ut_host, li->hostname, MIN_SIZEOF(ut->ut_host, li->hostname));
|
||||
+# if defined(__FreeBSD__) && __FreeBSD_version <= 400000
|
||||
strncpy(ut->ut_host, li->hostname, MIN_SIZEOF(ut->ut_host, li->hostname));
|
||||
+# else
|
||||
+ realhostname_sa(ut->ut_host, sizeof ut->ut_host,
|
||||
+ &li->hostaddr.sa, li->hostaddr.sa.sa_len);
|
||||
+# endif
|
||||
# endif
|
||||
# ifdef HAVE_ADDR_IN_UTMP
|
||||
/* this is just a 32-bit IP address */
|
||||
|
Loading…
x
Reference in New Issue
Block a user