aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMemphiz <memphis@machzwo.de>2012-10-30 23:07:29 +0100
committerMemphiz <memphis@machzwo.de>2012-10-30 23:11:07 +0100
commit28ca9a4f137d4399a389f58996425dfef0cd57cd (patch)
treefbd7b0abf9f79547a81b611d80f20a7247114120 /lib
parent817365efb2ad1635386e5b37e4e1ba08b99f60b5 (diff)
[afpfs-ng] - add patch for fixing some more spaghetti pointer arithmetic - fixes afp on 64bit builds - also sync patches to lib/afpfs-ng (for building on linux)
Diffstat (limited to 'lib')
-rw-r--r--lib/afpfs-ng/11-fix-stat.patch11
-rw-r--r--lib/afpfs-ng/12-fix-even-more-pointers.patch83
-rw-r--r--lib/afpfs-ng/Makefile2
3 files changed, 96 insertions, 0 deletions
diff --git a/lib/afpfs-ng/11-fix-stat.patch b/lib/afpfs-ng/11-fix-stat.patch
new file mode 100644
index 0000000000..09e9a35231
--- /dev/null
+++ b/lib/afpfs-ng/11-fix-stat.patch
@@ -0,0 +1,11 @@
+--- afpfs-ng-0.8.1/lib/lowlevel.c 2011-10-01 20:36:55.000000000 +0200
++++ afpfs-ng-0.8.1/lib/lowlevel.c 2011-10-01 20:46:00.000000000 +0200
+@@ -579,7 +579,7 @@
+ return -EIO;
+ }
+
+- if (volume->server->using_version->av_number>=30)
++ if (volume->server->using_version->av_number>=30 && fp.unixprivs.permissions != 0)
+ stbuf->st_mode |= fp.unixprivs.permissions;
+ else
+ set_nonunix_perms(&stbuf->st_mode,&fp);
diff --git a/lib/afpfs-ng/12-fix-even-more-pointers.patch b/lib/afpfs-ng/12-fix-even-more-pointers.patch
new file mode 100644
index 0000000000..b5926bceed
--- /dev/null
+++ b/lib/afpfs-ng/12-fix-even-more-pointers.patch
@@ -0,0 +1,83 @@
+diff -uPr afpfs-ng-0.8.1/include/afpfs-ng/afp.h afpfs-ng-0.8.1/include/afpfs-ng/afp.h
+--- afpfs-ng-0.8.1/include/afpfs-ng/afp.h 2012-10-30 22:30:29.000000000 +0100
++++ afpfs-ng-0.8.1/include/afpfs-ng/afp.h 2012-10-30 22:26:15.000000000 +0100
+@@ -71,7 +71,7 @@
+ struct afp_file_info * largelist_next;
+ unsigned char isdir;
+ unsigned long long size;
+- unsigned short resourcesize;
++ unsigned long long resourcesize;
+ unsigned int resource;
+ unsigned short forkid;
+ struct afp_icon * icon;
+--- afpfs-ng-0.8.1/lib/loop.c 2012-10-30 22:48:19.000000000 +0100
++++ afpfs-ng-0.8.1/lib/loop.c 2012-10-30 22:48:47.000000000 +0100
+@@ -87,12 +87,13 @@
+ static int ending=0;
+ void * just_end_it_now(void * ignore)
+ {
+- if (ending) return;
++ if (ending) return NULL;
+ ending=1;
+ if (libafpclient->forced_ending_hook)
+ libafpclient->forced_ending_hook();
+ exit_program=2;
+ signal_main_thread();
++ return NULL;
+ }
+
+ /*This is a hack to handle a problem where the first pthread_kill doesnt' work*/
+diff -uPr afpfs-ng-0.8.1/lib/dsi.c afpfs-ng-0.8.1/lib/dsi.c
+--- afpfs-ng-0.8.1/lib/dsi.c 2012-10-30 22:30:29.000000000 +0100
++++ afpfs-ng-0.8.1/lib/dsi.c 2012-10-30 22:11:09.000000000 +0100
+@@ -478,7 +478,7 @@
+ }
+ 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 */
+@@ -762,7 +762,7 @@
+ 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 -uPr afpfs-ng-0.8.1/lib/lowlevel.c afpfs-ng-0.8.1/lib/lowlevel.c
+--- afpfs-ng-0.8.1/lib/lowlevel.c 2012-10-30 22:30:29.000000000 +0100
++++ afpfs-ng-0.8.1/lib/lowlevel.c 2012-10-30 22:29:57.000000000 +0100
+@@ -582,7 +582,7 @@
+ if (volume->server->using_version->av_number>=30 && fp.unixprivs.permissions != 0)
+ stbuf->st_mode |= fp.unixprivs.permissions;
+ else
+- set_nonunix_perms(&stbuf->st_mode,&fp);
++ set_nonunix_perms((mode_t *)&stbuf->st_mode,&fp);
+
+ stbuf->st_uid=fp.unixprivs.uid;
+ stbuf->st_gid=fp.unixprivs.gid;
+diff -uPr afpfs-ng-0.8.1/lib/proto_directory.c afpfs-ng-0.8.1/lib/proto_directory.c
+--- afpfs-ng-0.8.1/lib/proto_directory.c 2012-10-30 22:30:29.000000000 +0100
++++ afpfs-ng-0.8.1/lib/proto_directory.c 2012-10-30 22:15:28.000000000 +0100
+@@ -259,7 +259,7 @@
+ uint16_t reqcount;
+ } __attribute__((__packed__)) * reply = (void *) buf;
+
+- struct {
++ struct sEntry{
+ uint16_t size;
+ uint8_t isdir;
+ uint8_t pad;
+@@ -293,7 +293,7 @@
+ filecur=new_file;
+ }
+
+- entry = p;
++ entry = (struct sEntry *)p;
+
+ parse_reply_block(server,p+sizeof(*entry),
+ ntohs(entry->size),entry->isdir,
diff --git a/lib/afpfs-ng/Makefile b/lib/afpfs-ng/Makefile
index 1e4d39f6a5..67ccdc2b95 100644
--- a/lib/afpfs-ng/Makefile
+++ b/lib/afpfs-ng/Makefile
@@ -50,6 +50,8 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(SOURCE); patch -p1 <../07-boxee4.patch
cd $(SOURCE); patch -p1 <../08-boxee5.patch
cd $(SOURCE); patch -p1 <../10-fix-errno.patch
+ cd $(SOURCE); patch -p1 <../11-fix-stat.patch
+ cd $(SOURCE); patch -p1 <../12-fix-even-more-pointers.patch
cd $(SOURCE); autoreconf -vif
cd $(SOURCE); $(CONFIGURE)