summaryrefslogtreecommitdiff
path: root/security/pidentd/files/patch-ac
blob: 77a420d8962138a57a5fcbd255d70cd4f47e73be (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
*** src/kernel/freebsd.c.orig	Fri Oct 21 01:07:37 1994
--- src/kernel/freebsd.c	Sun Apr 16 21:21:02 1995
***************
*** 53,58 ****
--- 53,61 ----
  #include "identd.h"
  #include "error.h"
  
+ #ifdef INPLOOKUP_SETLOCAL
+ #define	_HAVE_OLD_INPCB
+ #endif
  
  extern void *calloc();
  extern void *malloc();
***************
*** 76,82 ****
--- 79,89 ----
  
  static int nfile;
  
+ #ifdef _HAVE_OLD_INPCB
  static struct inpcb tcb;
+ #else
+ static struct inpcbhead tcb;
+ #endif
  
  int k_open()
  {
***************
*** 127,148 ****
  ** 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;
    do 
    {
      if ( pcbp->inp_faddr.s_addr == faddr->s_addr &&
  	 pcbp->inp_laddr.s_addr == laddr->s_addr &&
  	 pcbp->inp_fport        == fport &&
--- 134,173 ----
  ** Returns NULL if no match.
  */
  static struct socket *
+ #ifdef _HAVE_OLD_INPCB
      getlist(pcbp, faddr, fport, laddr, lport)
    struct inpcb *pcbp;
+ #else
+     getlist(pcbhead, faddr, fport, laddr, lport)
+   struct inpcbhead *pcbhead;
+ #endif
    struct in_addr *faddr;
    int fport;
    struct in_addr *laddr;
    int lport;
  {
+ #ifdef _HAVE_OLD_INPCB
    struct inpcb *head;
+ #else
+   struct inpcb *head, pcbp;
+ #endif
  
+ #ifdef _HAVE_OLD_INPCB
    if (!pcbp)
      return NULL;
+ #else
+   head = pcbhead->lh_first;
+   if (!head)
+     return NULL;
+ #endif
+  
  
! #ifdef _HAVE_OLD_INPCB
    head = pcbp->inp_prev;
+ #endif
    do 
    {
+ #ifdef _HAVE_OLD_INPCB
      if ( pcbp->inp_faddr.s_addr == faddr->s_addr &&
  	 pcbp->inp_laddr.s_addr == laddr->s_addr &&
  	 pcbp->inp_fport        == fport &&
***************
*** 153,158 ****
--- 178,193 ----
  		  pcbp,
  		  sizeof(struct inpcb),
  		  "tcblist"));
+ #else
+     if (!getbuf((long) head, &pcbp, sizeof(struct inpcb), "tcblist"))
+        break;
+     if (pcbp.inp_faddr.s_addr == faddr->s_addr &&
+ 	pcbp.inp_fport        == fport &&
+ 	pcbp.inp_lport        == lport )
+ 	return(pcbp.inp_socket);
+     head = pcbp.inp_list.le_next;
+   } while (head != NULL);
+ #endif
  
    return NULL;
  }
***************
*** 186,192 ****
--- 221,229 ----
    if (!getbuf(nl[N_TCB].n_value, &tcb, sizeof(tcb), "tcb"))
      return -1;
    
+ #ifdef _HAVE_OLD_INPCB
    tcb.inp_prev = (struct inpcb *) nl[N_TCB].n_value;
+ #endif
    sockp = getlist(&tcb, faddr, fport, laddr, lport);
   
    if (!sockp)