summaryrefslogtreecommitdiffstats
path: root/testing/afpfs-ng/02-afpfs-ng-0.8.1-pointer.patch
blob: 80507b5725d861ace8f2d27875f28359398f2f29 (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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
diff -up afpfs-ng-0.8.1/cmdline/getstatus.c.pointer afpfs-ng-0.8.1/cmdline/getstatus.c
--- afpfs-ng-0.8.1/cmdline/getstatus.c.pointer	2011-06-14 17:06:35.000000000 +0200
+++ afpfs-ng-0.8.1/cmdline/getstatus.c	2011-06-14 17:07:25.000000000 +0200
@@ -1,4 +1,5 @@
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <pthread.h>
 
diff -up afpfs-ng-0.8.1/fuse/client.c.pointer afpfs-ng-0.8.1/fuse/client.c
--- afpfs-ng-0.8.1/fuse/client.c.pointer	2008-03-08 03:44:16.000000000 +0100
+++ afpfs-ng-0.8.1/fuse/client.c	2011-06-14 17:02:15.000000000 +0200
@@ -61,8 +61,9 @@ static int start_afpfsd(void)
 			snprintf(filename, PATH_MAX,
 				"/usr/local/bin/%s",AFPFSD_FILENAME);
 			if (access(filename,X_OK)) {
-				snprintf(filename, "/usr/bin/%s",
+				snprintf(filename, sizeof(filename), "/usr/bin/%s",
 					AFPFSD_FILENAME);
+				filename[sizeof(filename) - 1] = 0;
 				if (access(filename,X_OK)) {
 					printf("Could not find server (%s)\n",
 						filename);
diff -up afpfs-ng-0.8.1/fuse/fuse_int.c.pointer afpfs-ng-0.8.1/fuse/fuse_int.c
--- afpfs-ng-0.8.1/fuse/fuse_int.c.pointer	2008-03-02 06:06:24.000000000 +0100
+++ afpfs-ng-0.8.1/fuse/fuse_int.c	2011-06-14 17:02:15.000000000 +0200
@@ -197,7 +197,7 @@ static int fuse_open(const char *path, s
 	ret = ml_open(volume,path,flags,&fp);
 
 	if (ret==0) 
-		fi->fh=(void *) fp;
+		fi->fh=(unsigned long) fp;
 
 	return ret;
 }
diff -up afpfs-ng-0.8.1/include/afpfs-ng/afp.h.pointer afpfs-ng-0.8.1/include/afp.h
--- afpfs-ng-0.8.1/include/afpfs-ng/afp.h.pointer	2008-03-08 17:08:18.000000000 +0100
+++ afpfs-ng-0.8.1/include/afpfs-ng/afp.h	2011-06-14 17:02:15.000000000 +0200
@@ -370,7 +370,7 @@ int afp_unmount_all_volumes(struct afp_s
 
 int afp_opendt(struct afp_volume *volume, unsigned short * refnum);
 
-int afp_closedt(struct afp_server * server, unsigned short * refnum);
+int afp_closedt(struct afp_server * server, unsigned short refnum);
 
 int afp_getcomment(struct afp_volume *volume, unsigned int did,
         const char * pathname, struct afp_comment * comment);
diff -up afpfs-ng-0.8.1/include/afpfs-gn/utils.h.pointer afpfs-ng-0.8.1/include/utils.h
--- afpfs-ng-0.8.1/include/afpfs-ng/utils.h.pointer	2008-02-18 04:33:58.000000000 +0100
+++ afpfs-ng-0.8.1/include/afpfs-ng/utils.h	2011-06-14 17:02:15.000000000 +0200
@@ -8,8 +8,8 @@
 #define hton64(x)       (x)
 #define ntoh64(x)       (x)
 #else /* BYTE_ORDER == BIG_ENDIAN */
-#define hton64(x)       ((u_int64_t) (htonl(((x) >> 32) & 0xffffffffLL)) | \
-                         (u_int64_t) ((htonl(x) & 0xffffffffLL) << 32))
+#define hton64(x)       ((u_int64_t) (htonl((((unsigned long long)(x)) >> 32) & 0xffffffffLL)) | \
+                         (u_int64_t) ((htonl((unsigned long long)(x)) & 0xffffffffLL) << 32))
 #define ntoh64(x)       (hton64(x))
 #endif /* BYTE_ORDER == BIG_ENDIAN */
 
diff -up afpfs-ng-0.8.1/lib/afp_url.c.pointer afpfs-ng-0.8.1/lib/afp_url.c
--- afpfs-ng-0.8.1/lib/afp_url.c.pointer	2008-03-04 21:16:49.000000000 +0100
+++ afpfs-ng-0.8.1/lib/afp_url.c	2011-06-14 17:02:15.000000000 +0200
@@ -33,7 +33,7 @@ static int check_port(char * port) 
 static int check_uamname(const char * uam) 
 {
 	char * p;
-	for (p=uam;*p;p++) {
+	for (p=(char *)uam;*p;p++) {
 		if (*p==' ') continue;
 		if ((*p<'A') || (*p>'z')) return -1;
 	}
@@ -188,7 +188,7 @@ int afp_parse_url(struct afp_url * url, 
 		return -1;
 
 	}
-	if (p==NULL) p=toparse;
+	if (p==NULL) p=(char *)toparse;
 
 	/* Now split on the first / */
 	if (sscanf(p,"%[^/]/%[^$]",
diff -up afpfs-ng-0.8.1/lib/did.c.pointer afpfs-ng-0.8.1/lib/did.c
--- afpfs-ng-0.8.1/lib/did.c.pointer	2008-02-18 04:39:17.000000000 +0100
+++ afpfs-ng-0.8.1/lib/did.c	2011-06-14 17:02:15.000000000 +0200
@@ -226,7 +226,7 @@ int get_dirid(struct afp_volume * volume
 
 
 	/* Go to the end of last known entry */
-	p=path+(p-copy);
+	p=(char *)path+(p-copy);
 	p2=p;
 
 	while ((p=strchr(p+1,'/'))) {
diff -up afpfs-ng-0.8.1/lib/dsi.c.pointer afpfs-ng-0.8.1/lib/dsi.c
--- afpfs-ng-0.8.1/lib/dsi.c.pointer	2008-02-18 04:53:03.000000000 +0100
+++ afpfs-ng-0.8.1/lib/dsi.c	2011-06-14 17:02:15.000000000 +0200
@@ -474,7 +474,7 @@ void dsi_getstatus_reply(struct afp_serv
 	}
 	server->flags=ntohs(reply1->flags);
 
-	p=(void *)((unsigned int) server->incoming_buffer + sizeof(*reply1));
+	p=(void *)((unsigned long) server->incoming_buffer + sizeof(*reply1));
 	p+=copy_from_pascal(server->server_name,p,AFP_SERVER_NAME_LEN)+1;
 
 	/* Now work our way through the variable bits */
@@ -757,7 +757,7 @@ gotenough:
 		printf("<<< read() of rest of AFP, %d bytes\n",amount_to_read);
 		#endif
 		ret = read(server->fd, (void *)
-		(((unsigned int) server->incoming_buffer)+server->data_read),
+		(((unsigned long) server->incoming_buffer)+server->data_read),
 			amount_to_read);
 		if (ret<0) return -1;
 		if (ret==0) {
diff -up afpfs-ng-0.8.1/lib/loop.c.pointer afpfs-ng-0.8.1/lib/loop.c
--- afpfs-ng-0.8.1/lib/loop.c.pointer	2008-02-18 04:40:11.000000000 +0100
+++ afpfs-ng-0.8.1/lib/loop.c	2011-06-14 17:02:15.000000000 +0200
@@ -25,7 +25,7 @@
 static unsigned char exit_program=0;
 
 static pthread_t ending_thread;
-static pthread_t main_thread = NULL;
+static pthread_t main_thread = (pthread_t)NULL;
 
 static int loop_started=0;
 static pthread_cond_t loop_started_condition;
diff -up afpfs-ng-0.8.1/lib/lowlevel.c.pointer afpfs-ng-0.8.1/lib/lowlevel.c
--- afpfs-ng-0.8.1/lib/lowlevel.c.pointer	2008-02-20 02:33:17.000000000 +0100
+++ afpfs-ng-0.8.1/lib/lowlevel.c	2011-06-14 17:02:15.000000000 +0200
@@ -582,7 +582,7 @@ int ll_getattr(struct afp_volume * volum
 	if (volume->server->using_version->av_number>=30)
 		stbuf->st_mode |= fp.unixprivs.permissions;
 	else
-		set_nonunix_perms(stbuf,&fp);
+		set_nonunix_perms(&stbuf->st_mode,&fp);
 
 	stbuf->st_uid=fp.unixprivs.uid;
 	stbuf->st_gid=fp.unixprivs.gid;
diff -up afpfs-ng-0.8.1/lib/midlevel.c.pointer afpfs-ng-0.8.1/lib/midlevel.c
--- afpfs-ng-0.8.1/lib/midlevel.c.pointer	2008-03-08 17:08:18.000000000 +0100
+++ afpfs-ng-0.8.1/lib/midlevel.c	2011-06-14 17:02:15.000000000 +0200
@@ -713,7 +713,7 @@ int ml_write(struct afp_volume * volume,
 {
 
 	int ret,err=0;
-	int totalwritten = 0;
+	size_t totalwritten = 0;
 	uint64_t sizetowrite, ignored;
 	unsigned char flags = 0;
 	unsigned int max_packet_size=volume->server->tx_quantum;
diff -up afpfs-ng-0.8.1/lib/proto_attr.c.pointer afpfs-ng-0.8.1/lib/proto_attr.c
--- afpfs-ng-0.8.1/lib/proto_attr.c.pointer	2008-01-30 05:37:58.000000000 +0100
+++ afpfs-ng-0.8.1/lib/proto_attr.c	2011-06-14 17:02:15.000000000 +0200
@@ -166,7 +166,7 @@ int afp_getextattr(struct afp_volume * v
 	copy_path(server,p,pathname,strlen(pathname));
 	unixpath_to_afppath(server,p);
 	p2=p+sizeof_path_header(server)+strlen(pathname);
-	if (((unsigned int ) p2) & 0x1) p2++;
+	if (((unsigned long) p2) & 0x1) p2++;
 	req2=(void *) p2;
 
 	req2->len=htons(namelen);
diff -up afpfs-ng-0.8.1/lib/proto_desktop.c.pointer afpfs-ng-0.8.1/lib/proto_desktop.c
--- afpfs-ng-0.8.1/lib/proto_desktop.c.pointer	2008-02-18 04:44:11.000000000 +0100
+++ afpfs-ng-0.8.1/lib/proto_desktop.c	2011-06-14 17:02:15.000000000 +0200
@@ -168,7 +168,7 @@ int afp_getcomment_reply(struct afp_serv
 	return 0;
 }
 
-int afp_closedt(struct afp_server * server, unsigned short * refnum) 
+int afp_closedt(struct afp_server * server, unsigned short refnum) 
 {
 	struct {
 		struct dsi_header dsi_header __attribute__((__packed__));
diff -up afpfs-ng-0.8.1/lib/proto_directory.c.pointer afpfs-ng-0.8.1/lib/proto_directory.c
--- afpfs-ng-0.8.1/lib/proto_directory.c.pointer	2008-02-19 03:39:29.000000000 +0100
+++ afpfs-ng-0.8.1/lib/proto_directory.c	2011-06-14 17:02:15.000000000 +0200
@@ -248,6 +248,7 @@ int afp_enumerate_reply(struct afp_serve
 
 	return 0;
 }
+
 int afp_enumerateext2_reply(struct afp_server *server, char * buf, unsigned int size, void * other) 
 {
 
@@ -266,8 +267,7 @@ int afp_enumerateext2_reply(struct afp_s
 	char * p = buf + sizeof(*reply);
 	int i;
 	char  *max=buf+size;
-	struct afp_file_info * filebase = NULL, *filecur=NULL, *new_file=NULL;
-	void ** x = other;
+	struct afp_file_info * filebase = NULL, *filecur = NULL, *new_file = NULL, **x = (struct afp_file_info **) other;
 
 	if (reply->dsi_header.return_code.error_code) {
 		return reply->dsi_header.return_code.error_code;
diff -up afpfs-ng-0.8.1/lib/proto_map.c.pointer afpfs-ng-0.8.1/lib/proto_map.c
--- afpfs-ng-0.8.1/lib/proto_map.c.pointer	2008-01-30 05:37:59.000000000 +0100
+++ afpfs-ng-0.8.1/lib/proto_map.c	2011-06-14 17:02:15.000000000 +0200
@@ -122,7 +122,7 @@ int afp_mapid_reply(struct afp_server *s
 
 	if (reply->header.return_code.error_code!=kFPNoErr) return -1;
 
-	copy_from_pascal_two(name,&reply->name,255);
+	copy_from_pascal_two(name,reply->name,255);
 
 	return 0;
 }
diff -up afpfs-ng-0.8.1/lib/proto_session.c.pointer afpfs-ng-0.8.1/lib/proto_session.c
--- afpfs-ng-0.8.1/lib/proto_session.c.pointer	2008-02-18 04:46:19.000000000 +0100
+++ afpfs-ng-0.8.1/lib/proto_session.c	2011-06-14 17:02:15.000000000 +0200
@@ -39,7 +39,7 @@ int afp_getsessiontoken(struct afp_serve
 	switch (type) {
 	case kLoginWithTimeAndID:
 	case kReconnWithTimeAndID: {
-		uint32_t *p = (void *) (((unsigned int) request)+
+		uint32_t *p = (void *) (((unsigned long) request)+
 			sizeof(*request));
 
 		offset=sizeof(timestamp);
@@ -63,7 +63,7 @@ int afp_getsessiontoken(struct afp_serve
 		goto error;
 	}
 
-	data=(void *) (((unsigned int) request)+sizeof(*request)+offset);
+	data=(void *) (((unsigned long) request)+sizeof(*request)+offset);
 	request->idlength=htonl(datalen);
 	request->pad=0;
 	request->type=htons(type);
@@ -127,7 +127,7 @@ int afp_disconnectoldsession(struct afp_
 	if ((request=malloc(sizeof(*request) + AFP_TOKEN_MAX_LEN))==NULL)
 		return -1;
 
-	token_data  = request + sizeof(*request);
+	token_data  = (char *)request + sizeof(*request);
 
 	request->type=htons(type);
 
diff -up afpfs-ng-0.8.1/lib/uams.c.pointer afpfs-ng-0.8.1/lib/uams.c
--- afpfs-ng-0.8.1/lib/uams.c.pointer	2008-01-04 04:52:44.000000000 +0100
+++ afpfs-ng-0.8.1/lib/uams.c	2011-06-14 17:02:15.000000000 +0200
@@ -180,7 +180,7 @@ static int cleartxt_login(struct afp_ser
 		goto cleartxt_fail;
 
 	p += copy_to_pascal(p, username) + 1;
-	if ((int)p & 0x1)
+	if ((long)p & 0x1)
 		len--;
 	else
 		p++;
@@ -230,7 +230,7 @@ static int cleartxt_passwd(struct afp_se
 		goto cleartxt_fail;
 
 	p += copy_to_pascal(p, username) + 1;
-	if ((int)p & 0x1)
+	if ((long)p & 0x1)
 		len--;
 	else
 		p++;
@@ -580,7 +580,7 @@ static int dhx_login(struct afp_server *
 	if (ai == NULL)
 		goto dhx_noctx_fail;
 	d += copy_to_pascal(ai, username) + 1;
-	if (((int)d) % 2)
+	if (((long)d) % 2)
 		d++;
 	else
 		ai_len--;
diff -up afpfs-ng-0.8.1/lib/utils.c.pointer afpfs-ng-0.8.1/lib/utils.c
--- afpfs-ng-0.8.1/lib/utils.c.pointer	2008-02-18 04:53:37.000000000 +0100
+++ afpfs-ng-0.8.1/lib/utils.c	2011-06-14 17:02:15.000000000 +0200
@@ -196,7 +196,7 @@ int invalid_filename(struct afp_server *
 			maxlen=255;
 
 
-	p=filename+1;
+	p=(char *)filename+1;
 	while ((q=strchr(p,'/'))) {
 		if (q>p+maxlen)
 			return 1;