aboutsummaryrefslogtreecommitdiffstats
path: root/security/pidentd
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1995-04-11 23:42:06 +0800
committerache <ache@FreeBSD.org>1995-04-11 23:42:06 +0800
commit0eb9b6899ea727c44ae9f2997e139ce7c42fb9a8 (patch)
treefebb07bb2a6175fab14fecd175a5f4189be2682d /security/pidentd
parent428dc17f4f0aa92c4afc00be7a523e682d256e9e (diff)
downloadfreebsd-ports-gnome-0eb9b6899ea727c44ae9f2997e139ce7c42fb9a8.tar.gz
freebsd-ports-gnome-0eb9b6899ea727c44ae9f2997e139ce7c42fb9a8.tar.zst
freebsd-ports-gnome-0eb9b6899ea727c44ae9f2997e139ce7c42fb9a8.zip
Fix inpcb handling
Diffstat (limited to 'security/pidentd')
-rw-r--r--security/pidentd/files/patch-ac119
1 files changed, 75 insertions, 44 deletions
diff --git a/security/pidentd/files/patch-ac b/security/pidentd/files/patch-ac
index a00d4a47009e..4626f04860ea 100644
--- a/security/pidentd/files/patch-ac
+++ b/security/pidentd/files/patch-ac
@@ -1,5 +1,5 @@
-*** src/kernel/freebsd.c.orig Fri Oct 21 03:07:37 1994
---- src/kernel/freebsd.c Tue Apr 11 18:17:25 1995
+*** freebsd.c.orig Fri Oct 21 03:07:37 1994
+--- src/kernel/freebsd.c Tue Apr 11 19:30:45 1995
***************
*** 1,5 ****
/*
@@ -14,67 +14,98 @@
** This program is in the public domain and may be used freely by anyone
** who wants to.
***************
-*** 77,82 ****
---- 77,83 ----
+*** 76,82 ****
+
+ static int nfile;
+
+! static struct inpcb tcb;
+
+ int k_open()
+ {
+--- 76,82 ----
+
static int nfile;
- static struct inpcb tcb;
-+ static struct inpcb *dummy_tcb;
+! static struct inpcbhead tcb;
int k_open()
{
***************
-*** 140,146 ****
+*** 127,158 ****
+ ** Returns NULL if no match.
+ */
+ static struct socket *
+! getlist(pcbp, faddr, fport, laddr, lport)
+! struct inpcb *pcbp;
+ struct in_addr *faddr;
+ int fport;
+ struct in_addr *laddr;
+ int lport;
+ {
+! struct inpcb *head;
+
+! if (!pcbp)
return NULL;
-
-! head = pcbp->inp_prev;
+-
+- head = pcbp->inp_prev;
do
{
- if ( pcbp->inp_faddr.s_addr == faddr->s_addr &&
---- 141,147 ----
+! if ( pcbp->inp_faddr.s_addr == faddr->s_addr &&
+! pcbp->inp_laddr.s_addr == laddr->s_addr &&
+! pcbp->inp_fport == fport &&
+! pcbp->inp_lport == lport )
+! return pcbp->inp_socket;
+! } while (pcbp->inp_next != head &&
+! getbuf((long) pcbp->inp_next,
+! pcbp,
+! sizeof(struct inpcb),
+! "tcblist"));
+
+ return NULL;
+ }
+--- 127,159 ----
+ ** Returns NULL if no match.
+ */
+ static struct socket *
+! getlist(pcbphead, faddr, fport, laddr, lport)
+! struct inpcbhead *pcbphead;
+ struct in_addr *faddr;
+ int fport;
+ struct in_addr *laddr;
+ int lport;
+ {
+! struct inpcb *head, pcbp;
+
+! head = pcbphead->lh_first;
+! if (!head)
return NULL;
-
-! head = *(pcbp->inp_list.le_prev);
do
{
- if ( pcbp->inp_faddr.s_addr == faddr->s_addr &&
-***************
-*** 148,155 ****
- pcbp->inp_fport == fport &&
- pcbp->inp_lport == lport )
- return pcbp->inp_socket;
-! } while (pcbp->inp_next != head &&
-! getbuf((long) pcbp->inp_next,
- pcbp,
- sizeof(struct inpcb),
- "tcblist"));
---- 149,156 ----
- pcbp->inp_fport == fport &&
- pcbp->inp_lport == lport )
- return pcbp->inp_socket;
-! } while (pcbp->inp_list.le_next != head &&
-! getbuf((long) pcbp->inp_list.le_next,
- pcbp,
- sizeof(struct inpcb),
- "tcblist"));
+! if (!getbuf((long) head,
+! &pcbp,
+! sizeof(struct inpcb),
+! "tcblist"))
+! break;
+! if ( pcbp.inp_faddr.s_addr == faddr->s_addr &&
+! pcbp.inp_laddr.s_addr == laddr->s_addr &&
+! pcbp.inp_fport == fport &&
+! pcbp.inp_lport == lport )
+! return pcbp.inp_socket;
+! head = pcbp.inp_list.le_next;
+! } while (head != NULL);
+
+ return NULL;
+ }
***************
*** 185,192 ****
/* -------------------- TCP PCB LIST -------------------- */
if (!getbuf(nl[N_TCB].n_value, &tcb, sizeof(tcb), "tcb"))
return -1;
-!
-! tcb.inp_prev = (struct inpcb *) nl[N_TCB].n_value;
- sockp = getlist(&tcb, faddr, fport, laddr, lport);
-
- if (!sockp)
---- 186,193 ----
- /* -------------------- TCP PCB LIST -------------------- */
- if (!getbuf(nl[N_TCB].n_value, &tcb, sizeof(tcb), "tcb"))
- return -1;
-! dummy_tcb = ((struct inpcb *) nl[N_TCB].n_value);
-! tcb.inp_list.le_prev = &dummy_tcb;
+-
+- tcb.inp_prev = (struct inpcb *) nl[N_TCB].n_value;
sockp = getlist(&tcb, faddr, fport, laddr, lport);
if (!sockp)
+--- 186,191 ----