summaryrefslogtreecommitdiff
path: root/net/yale-tftpd/patches/patch-ae
blob: 475e21ec6f36bd6b8530bfca9dbc85cc97a48d4b (plain)
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
125
126
127
128
129
130
131
132
133
134
135
136
$NetBSD: patch-ae,v 1.3 2012/01/25 09:56:08 he Exp $

A number of changes to make this build with no warnings under -Wall.

--- classes/access.c.orig	1994-10-05 05:20:44.000000000 +0000
+++ classes/access.c
@@ -1,4 +1,6 @@
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 #include <ctype.h>
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -39,7 +41,7 @@ typedef struct ACCESSLISTHEAD {
 
 #if defined (__STDC__)
 
-	int	accessGroup_printOn (
+	void	accessGroup_printOn (
 			AccessGroup self,
 			FILE* file
 		);
@@ -51,13 +53,14 @@ typedef struct ACCESSLISTHEAD {
 			listhead_t* alp,
 			condition_t* condition
 		);
+/*
 	static int accessList_validateAddress (
 			listhead_t* alp,
 			unsigned long source,
 			int type
 		);
-
-	static int	accessListPrintOn (
+*/
+	static void	accessListPrintOn (
 			listhead_t* alp,
 			FILE* file
 		);
@@ -69,6 +72,9 @@ typedef struct ACCESSLISTHEAD {
 			condition_t* ptr
 		);
 	static int accessListVerifyAddress ();
+
+void accessGroup_addCondition(AccessGroup, int, condition_t*);
+
 #else
 	static int	accessList_dispose ();
 	static int	accessList_addCondition ();
@@ -92,7 +98,6 @@ AccessGroup
 accessGroup_new ()
 {
 	AccessGroup self;
-	extern char* calloc();
 
 	self = (AccessGroup)calloc (1, sizeof (*self));
 	return self;
@@ -123,9 +128,9 @@ AccessGroup self;
  */
 int
 accessGroup_add (self, argc, argv)
-AccessGroup self;
-int	argc;
-char	**argv;
+	AccessGroup self;
+	int	argc;
+	char	**argv;
 {
 	condition_t condition;
 	int list;
@@ -137,14 +142,13 @@ char	**argv;
 }
 
 
-int
+void
 accessGroup_addCondition (self, list, condition)
-AccessGroup self;
-condition_t* condition;
-int list;
+	AccessGroup self;
+	int list;
+	condition_t* condition;
 {
-	condition_t* cp, * lp;
-	listhead_t* hp;
+	condition_t* cp;
 	char *tcp;
 
 	/* get enough space for the condition */
@@ -218,9 +222,10 @@ int type;
 
 
 /* Debugging function */
+void
 accessGroup_printOn(self, file)
-AccessGroup self;
-FILE*	file;
+     AccessGroup self;
+     FILE*	file;
 {
 	register int i;
 
@@ -365,9 +370,10 @@ static char* permNames[] ={ "deny", "rea
 				? "<unknown>" : permNames[N])
 
 
+void
 accessListPrintOn (alp, file)
-listhead_t* alp;
-FILE*	file;
+     listhead_t* alp;
+     FILE*	file;
 {
 	char* permission;
 	char addrbuf[32], maskbuf[32];
@@ -426,7 +432,7 @@ condition_t* ptr;
 	}
 	av++; ac--;
 
-	if (ac == 1 && **av == '-' || **av == '+') {
+	if ((ac == 1 && **av == '-') || **av == '+') {
 		int addlist;
 		listhead_t* hp;
 		condition_t* cp;
@@ -435,7 +441,9 @@ condition_t* ptr;
 			self->accessError = "-<list> not implemented yet";
 			return 0;
 		}
-		if (!isdigit (av[0][1]) || (addlist = atoi (&av[0][1])) < 0) {
+		if (!isdigit ((unsigned char)av[0][1]) ||
+		    (addlist = atoi (&av[0][1])) < 0)
+		{
 			self->accessError =
 				"+<list> requires positive integer argument";
 			return 0;