Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 182046 | Differences between
and this patch

Collapse All | Expand All

(-)afpfs-ng-0.8.1/cmdline/getstatus.c.pointer (+1 lines)
Lines 1-4 Link Here
1
#include <stdio.h>
1
#include <stdio.h>
2
#include <stdlib.h>
2
#include <string.h>
3
#include <string.h>
3
#include <pthread.h>
4
#include <pthread.h>
4
5
(-)afpfs-ng-0.8.1/fuse/client.c.pointer (-1 / +2 lines)
Lines 61-68 static int start_afpfsd(void) Link Here
61
			snprintf(filename, PATH_MAX,
61
			snprintf(filename, PATH_MAX,
62
				"/usr/local/bin/%s",AFPFSD_FILENAME);
62
				"/usr/local/bin/%s",AFPFSD_FILENAME);
63
			if (access(filename,X_OK)) {
63
			if (access(filename,X_OK)) {
64
				snprintf(filename, "/usr/bin/%s",
64
				snprintf(filename, sizeof(filename), "/usr/bin/%s",
65
					AFPFSD_FILENAME);
65
					AFPFSD_FILENAME);
66
				filename[sizeof(filename) - 1] = 0;
66
				if (access(filename,X_OK)) {
67
				if (access(filename,X_OK)) {
67
					printf("Could not find server (%s)\n",
68
					printf("Could not find server (%s)\n",
68
						filename);
69
						filename);
(-)afpfs-ng-0.8.1/fuse/fuse_int.c.pointer (-1 / +1 lines)
Lines 197-203 static int fuse_open(const char *path, s Link Here
197
	ret = ml_open(volume,path,flags,&fp);
197
	ret = ml_open(volume,path,flags,&fp);
198
198
199
	if (ret==0) 
199
	if (ret==0) 
200
		fi->fh=(void *) fp;
200
		fi->fh=(unsigned long) fp;
201
201
202
	return ret;
202
	return ret;
203
}
203
}
(-)afpfs-ng-0.8.1/include/afpfs-ng/afp.h.pointer (-1 / +1 lines)
Lines 370-376 int afp_unmount_all_volumes(struct afp_s Link Here
370
370
371
int afp_opendt(struct afp_volume *volume, unsigned short * refnum);
371
int afp_opendt(struct afp_volume *volume, unsigned short * refnum);
372
372
373
int afp_closedt(struct afp_server * server, unsigned short * refnum);
373
int afp_closedt(struct afp_server * server, unsigned short refnum);
374
374
375
int afp_getcomment(struct afp_volume *volume, unsigned int did,
375
int afp_getcomment(struct afp_volume *volume, unsigned int did,
376
        const char * pathname, struct afp_comment * comment);
376
        const char * pathname, struct afp_comment * comment);
(-)afpfs-ng-0.8.1/include/afpfs-ng/utils.h.pointer (-2 / +2 lines)
Lines 8-15 Link Here
8
#define hton64(x)       (x)
8
#define hton64(x)       (x)
9
#define ntoh64(x)       (x)
9
#define ntoh64(x)       (x)
10
#else /* BYTE_ORDER == BIG_ENDIAN */
10
#else /* BYTE_ORDER == BIG_ENDIAN */
11
#define hton64(x)       ((u_int64_t) (htonl(((x) >> 32) & 0xffffffffLL)) | \
11
#define hton64(x)       ((u_int64_t) (htonl((((unsigned long long)(x)) >> 32) & 0xffffffffLL)) | \
12
                         (u_int64_t) ((htonl(x) & 0xffffffffLL) << 32))
12
                         (u_int64_t) ((htonl((unsigned long long)(x)) & 0xffffffffLL) << 32))
13
#define ntoh64(x)       (hton64(x))
13
#define ntoh64(x)       (hton64(x))
14
#endif /* BYTE_ORDER == BIG_ENDIAN */
14
#endif /* BYTE_ORDER == BIG_ENDIAN */
15
15
(-)afpfs-ng-0.8.1/lib/afp_url.c.pointer (-2 / +2 lines)
Lines 33-39 static int check_port(char * port) Link Here
33
static int check_uamname(const char * uam) 
33
static int check_uamname(const char * uam) 
34
{
34
{
35
	char * p;
35
	char * p;
36
	for (p=uam;*p;p++) {
36
	for (p=(char *)uam;*p;p++) {
37
		if (*p==' ') continue;
37
		if (*p==' ') continue;
38
		if ((*p<'A') || (*p>'z')) return -1;
38
		if ((*p<'A') || (*p>'z')) return -1;
39
	}
39
	}
Lines 188-194 int afp_parse_url(struct afp_url * url, Link Here
188
		return -1;
188
		return -1;
189
189
190
	}
190
	}
191
	if (p==NULL) p=toparse;
191
	if (p==NULL) p=(char *)toparse;
192
192
193
	/* Now split on the first / */
193
	/* Now split on the first / */
194
	if (sscanf(p,"%[^/]/%[^$]",
194
	if (sscanf(p,"%[^/]/%[^$]",
(-)afpfs-ng-0.8.1/lib/did.c.pointer (-1 / +1 lines)
Lines 226-232 int get_dirid(struct afp_volume * volume Link Here
226
226
227
227
228
	/* Go to the end of last known entry */
228
	/* Go to the end of last known entry */
229
	p=path+(p-copy);
229
	p=(char *)path+(p-copy);
230
	p2=p;
230
	p2=p;
231
231
232
	while ((p=strchr(p+1,'/'))) {
232
	while ((p=strchr(p+1,'/'))) {
(-)afpfs-ng-0.8.1/lib/dsi.c.pointer (-2 / +2 lines)
Lines 474-480 void dsi_getstatus_reply(struct afp_serv Link Here
474
	}
474
	}
475
	server->flags=ntohs(reply1->flags);
475
	server->flags=ntohs(reply1->flags);
476
476
477
	p=(void *)((unsigned int) server->incoming_buffer + sizeof(*reply1));
477
	p=(void *)((unsigned long) server->incoming_buffer + sizeof(*reply1));
478
	p+=copy_from_pascal(server->server_name,p,AFP_SERVER_NAME_LEN)+1;
478
	p+=copy_from_pascal(server->server_name,p,AFP_SERVER_NAME_LEN)+1;
479
479
480
	/* Now work our way through the variable bits */
480
	/* Now work our way through the variable bits */
Lines 757-763 gotenough: Link Here
757
		printf("<<< read() of rest of AFP, %d bytes\n",amount_to_read);
757
		printf("<<< read() of rest of AFP, %d bytes\n",amount_to_read);
758
		#endif
758
		#endif
759
		ret = read(server->fd, (void *)
759
		ret = read(server->fd, (void *)
760
		(((unsigned int) server->incoming_buffer)+server->data_read),
760
		(((unsigned long) server->incoming_buffer)+server->data_read),
761
			amount_to_read);
761
			amount_to_read);
762
		if (ret<0) return -1;
762
		if (ret<0) return -1;
763
		if (ret==0) {
763
		if (ret==0) {
(-)afpfs-ng-0.8.1/lib/loop.c.pointer (-1 / +1 lines)
Lines 25-31 Link Here
25
static unsigned char exit_program=0;
25
static unsigned char exit_program=0;
26
26
27
static pthread_t ending_thread;
27
static pthread_t ending_thread;
28
static pthread_t main_thread = NULL;
28
static pthread_t main_thread = (pthread_t)NULL;
29
29
30
static int loop_started=0;
30
static int loop_started=0;
31
static pthread_cond_t loop_started_condition;
31
static pthread_cond_t loop_started_condition;
(-)afpfs-ng-0.8.1/lib/lowlevel.c.pointer (-1 / +1 lines)
Lines 582-588 int ll_getattr(struct afp_volume * volum Link Here
582
	if (volume->server->using_version->av_number>=30)
582
	if (volume->server->using_version->av_number>=30)
583
		stbuf->st_mode |= fp.unixprivs.permissions;
583
		stbuf->st_mode |= fp.unixprivs.permissions;
584
	else
584
	else
585
		set_nonunix_perms(stbuf,&fp);
585
		set_nonunix_perms(&stbuf->st_mode,&fp);
586
586
587
	stbuf->st_uid=fp.unixprivs.uid;
587
	stbuf->st_uid=fp.unixprivs.uid;
588
	stbuf->st_gid=fp.unixprivs.gid;
588
	stbuf->st_gid=fp.unixprivs.gid;
(-)afpfs-ng-0.8.1/lib/midlevel.c.pointer (-1 / +1 lines)
Lines 713-719 int ml_write(struct afp_volume * volume, Link Here
713
{
713
{
714
714
715
	int ret,err=0;
715
	int ret,err=0;
716
	int totalwritten = 0;
716
	size_t totalwritten = 0;
717
	uint64_t sizetowrite, ignored;
717
	uint64_t sizetowrite, ignored;
718
	unsigned char flags = 0;
718
	unsigned char flags = 0;
719
	unsigned int max_packet_size=volume->server->tx_quantum;
719
	unsigned int max_packet_size=volume->server->tx_quantum;
(-)afpfs-ng-0.8.1/lib/proto_attr.c.pointer (-1 / +1 lines)
Lines 166-172 int afp_getextattr(struct afp_volume * v Link Here
166
	copy_path(server,p,pathname,strlen(pathname));
166
	copy_path(server,p,pathname,strlen(pathname));
167
	unixpath_to_afppath(server,p);
167
	unixpath_to_afppath(server,p);
168
	p2=p+sizeof_path_header(server)+strlen(pathname);
168
	p2=p+sizeof_path_header(server)+strlen(pathname);
169
	if (((unsigned int ) p2) & 0x1) p2++;
169
	if (((unsigned long) p2) & 0x1) p2++;
170
	req2=(void *) p2;
170
	req2=(void *) p2;
171
171
172
	req2->len=htons(namelen);
172
	req2->len=htons(namelen);
(-)afpfs-ng-0.8.1/lib/proto_desktop.c.pointer (-1 / +1 lines)
Lines 168-174 int afp_getcomment_reply(struct afp_serv Link Here
168
	return 0;
168
	return 0;
169
}
169
}
170
170
171
int afp_closedt(struct afp_server * server, unsigned short * refnum) 
171
int afp_closedt(struct afp_server * server, unsigned short refnum) 
172
{
172
{
173
	struct {
173
	struct {
174
		struct dsi_header dsi_header __attribute__((__packed__));
174
		struct dsi_header dsi_header __attribute__((__packed__));
(-)afpfs-ng-0.8.1/lib/proto_directory.c.pointer (-2 / +2 lines)
Lines 248-253 int afp_enumerate_reply(struct afp_serve Link Here
248
248
249
	return 0;
249
	return 0;
250
}
250
}
251
251
int afp_enumerateext2_reply(struct afp_server *server, char * buf, unsigned int size, void * other) 
252
int afp_enumerateext2_reply(struct afp_server *server, char * buf, unsigned int size, void * other) 
252
{
253
{
253
254
Lines 266-273 int afp_enumerateext2_reply(struct afp_s Link Here
266
	char * p = buf + sizeof(*reply);
267
	char * p = buf + sizeof(*reply);
267
	int i;
268
	int i;
268
	char  *max=buf+size;
269
	char  *max=buf+size;
269
	struct afp_file_info * filebase = NULL, *filecur=NULL, *new_file=NULL;
270
	struct afp_file_info * filebase = NULL, *filecur = NULL, *new_file = NULL, **x = (struct afp_file_info **) other;
270
	void ** x = other;
271
271
272
	if (reply->dsi_header.return_code.error_code) {
272
	if (reply->dsi_header.return_code.error_code) {
273
		return reply->dsi_header.return_code.error_code;
273
		return reply->dsi_header.return_code.error_code;
(-)afpfs-ng-0.8.1/lib/proto_map.c.pointer (-1 / +1 lines)
Lines 122-128 int afp_mapid_reply(struct afp_server *s Link Here
122
122
123
	if (reply->header.return_code.error_code!=kFPNoErr) return -1;
123
	if (reply->header.return_code.error_code!=kFPNoErr) return -1;
124
124
125
	copy_from_pascal_two(name,&reply->name,255);
125
	copy_from_pascal_two(name,reply->name,255);
126
126
127
	return 0;
127
	return 0;
128
}
128
}
(-)afpfs-ng-0.8.1/lib/proto_session.c.pointer (-3 / +3 lines)
Lines 39-45 int afp_getsessiontoken(struct afp_serve Link Here
39
	switch (type) {
39
	switch (type) {
40
	case kLoginWithTimeAndID:
40
	case kLoginWithTimeAndID:
41
	case kReconnWithTimeAndID: {
41
	case kReconnWithTimeAndID: {
42
		uint32_t *p = (void *) (((unsigned int) request)+
42
		uint32_t *p = (void *) (((unsigned long) request)+
43
			sizeof(*request));
43
			sizeof(*request));
44
44
45
		offset=sizeof(timestamp);
45
		offset=sizeof(timestamp);
Lines 63-69 int afp_getsessiontoken(struct afp_serve Link Here
63
		goto error;
63
		goto error;
64
	}
64
	}
65
65
66
	data=(void *) (((unsigned int) request)+sizeof(*request)+offset);
66
	data=(void *) (((unsigned long) request)+sizeof(*request)+offset);
67
	request->idlength=htonl(datalen);
67
	request->idlength=htonl(datalen);
68
	request->pad=0;
68
	request->pad=0;
69
	request->type=htons(type);
69
	request->type=htons(type);
Lines 127-133 int afp_disconnectoldsession(struct afp_ Link Here
127
	if ((request=malloc(sizeof(*request) + AFP_TOKEN_MAX_LEN))==NULL)
127
	if ((request=malloc(sizeof(*request) + AFP_TOKEN_MAX_LEN))==NULL)
128
		return -1;
128
		return -1;
129
129
130
	token_data  = request + sizeof(*request);
130
	token_data  = (char *)request + sizeof(*request);
131
131
132
	request->type=htons(type);
132
	request->type=htons(type);
133
133
(-)afpfs-ng-0.8.1/lib/uams.c.pointer (-3 / +3 lines)
Lines 180-186 static int cleartxt_login(struct afp_ser Link Here
180
		goto cleartxt_fail;
180
		goto cleartxt_fail;
181
181
182
	p += copy_to_pascal(p, username) + 1;
182
	p += copy_to_pascal(p, username) + 1;
183
	if ((int)p & 0x1)
183
	if ((long)p & 0x1)
184
		len--;
184
		len--;
185
	else
185
	else
186
		p++;
186
		p++;
Lines 230-236 static int cleartxt_passwd(struct afp_se Link Here
230
		goto cleartxt_fail;
230
		goto cleartxt_fail;
231
231
232
	p += copy_to_pascal(p, username) + 1;
232
	p += copy_to_pascal(p, username) + 1;
233
	if ((int)p & 0x1)
233
	if ((long)p & 0x1)
234
		len--;
234
		len--;
235
	else
235
	else
236
		p++;
236
		p++;
Lines 580-586 static int dhx_login(struct afp_server * Link Here
580
	if (ai == NULL)
580
	if (ai == NULL)
581
		goto dhx_noctx_fail;
581
		goto dhx_noctx_fail;
582
	d += copy_to_pascal(ai, username) + 1;
582
	d += copy_to_pascal(ai, username) + 1;
583
	if (((int)d) % 2)
583
	if (((long)d) % 2)
584
		d++;
584
		d++;
585
	else
585
	else
586
		ai_len--;
586
		ai_len--;
(-)afpfs-ng-0.8.1/lib/utils.c.pointer (-1 / +1 lines)
Lines 196-202 int invalid_filename(struct afp_server * Link Here
196
			maxlen=255;
196
			maxlen=255;
197
197
198
198
199
	p=filename+1;
199
	p=(char *)filename+1;
200
	while ((q=strchr(p,'/'))) {
200
	while ((q=strchr(p,'/'))) {
201
		if (q>p+maxlen)
201
		if (q>p+maxlen)
202
			return 1;
202
			return 1;

Return to bug 182046