mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-24 11:16:51 +00:00
remove package: afpfs-ng
This commit is contained in:
parent
900c233be2
commit
e89e2dd1f1
@ -1,45 +0,0 @@
|
||||
################################################################################
|
||||
# This file is part of OpenELEC - http://www.openelec.tv
|
||||
# Copyright (C) 2009-2014 Stephan Raue (stephan@openelec.tv)
|
||||
#
|
||||
# OpenELEC is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# OpenELEC is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenELEC. If not, see <http://www.gnu.org/licenses/>.
|
||||
################################################################################
|
||||
|
||||
PKG_NAME="afpfs-ng"
|
||||
PKG_VERSION="0.8.1"
|
||||
PKG_REV="1"
|
||||
PKG_ARCH="any"
|
||||
PKG_LICENSE="GPL"
|
||||
PKG_SITE="http://sourceforge.net/projects/afpfs-ng/"
|
||||
PKG_URL="$SOURCEFORGE_SRC/$PKG_NAME/$PKG_NAME/$PKG_VERSION/$PKG_NAME-$PKG_VERSION.tar.bz2"
|
||||
PKG_DEPENDS_TARGET="toolchain libgpg-error libgcrypt ncurses"
|
||||
PKG_PRIORITY="optional"
|
||||
PKG_SECTION="network"
|
||||
PKG_SHORTDESC="afpfs-ng: an Apple Filing Protocol client"
|
||||
PKG_LONGDESC="afpfs-ng is an Apple Filing Protocol client that will allow BSD, Linux and Mac OS X systems to access files exported from a Mac OS system with AFP over TCP."
|
||||
|
||||
PKG_IS_ADDON="no"
|
||||
PKG_AUTORECONF="yes"
|
||||
|
||||
PKG_CONFIGURE_OPTS_TARGET="ac_cv_func_malloc_0_nonnull=yes \
|
||||
--enable-gcrypt \
|
||||
--disable-fuse"
|
||||
|
||||
PKG_MAKE_OPTS_TARGET="-C lib"
|
||||
|
||||
makeinstall_target() {
|
||||
$MAKEINSTALL -C lib
|
||||
$MAKEINSTALL -C include
|
||||
make -C lib DESTDIR=$INSTALL install
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -1,25 +0,0 @@
|
||||
diff -Naur afpfs-ng-0.8.1/configure.ac afpfs-ng-0.8.1.patch/configure.ac
|
||||
--- afpfs-ng-0.8.1/configure.ac 2011-09-10 12:14:34.164716403 +0200
|
||||
+++ afpfs-ng-0.8.1.patch/configure.ac 2011-09-10 12:15:13.266241771 +0200
|
||||
@@ -51,21 +51,6 @@
|
||||
case $host in
|
||||
*-*-darwin*)
|
||||
AC_MSG_CHECKING([for correct gcrypt version])
|
||||
- AC_RUN_IFELSE(
|
||||
- [AC_LANG_PROGRAM([
|
||||
- #include <gcrypt.h>
|
||||
- #include <stdio.h>],[
|
||||
- char*p= GCRYPT_VERSION;
|
||||
- unsigned int vers;
|
||||
- vers=atoi(p)*10000;
|
||||
- p=strchr(p,'.')+1;
|
||||
- vers+=atoi(p)*100;
|
||||
- p=strchr(p,'.')+1;
|
||||
- vers+=atoi(p);
|
||||
- if (vers<10400) return 1;
|
||||
- ])],
|
||||
- [AC_MSG_RESULT([yes])],
|
||||
- [AC_MSG_ERROR([version is < 1.4.0])])
|
||||
AM_CONDITIONAL(HAVE_LIBGCRYPT, true)
|
||||
AC_DEFINE([HAVE_LIBGCRYPT], [1] )
|
||||
;;
|
@ -1,280 +0,0 @@
|
||||
diff -Naur afpfs-ng-0.8.1/cmdline/getstatus.c afpfs-ng-0.8.1.patch/cmdline/getstatus.c
|
||||
--- afpfs-ng-0.8.1/cmdline/getstatus.c 2011-09-10 12:14:34.164716403 +0200
|
||||
+++ afpfs-ng-0.8.1.patch/cmdline/getstatus.c 2011-09-10 12:16:23.717188342 +0200
|
||||
@@ -1,4 +1,5 @@
|
||||
#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <pthread.h>
|
||||
|
||||
diff -Naur afpfs-ng-0.8.1/fuse/client.c afpfs-ng-0.8.1.patch/fuse/client.c
|
||||
--- afpfs-ng-0.8.1/fuse/client.c 2011-09-10 12:14:34.165716416 +0200
|
||||
+++ afpfs-ng-0.8.1.patch/fuse/client.c 2011-09-10 12:16:23.737188610 +0200
|
||||
@@ -61,8 +61,9 @@
|
||||
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 -Naur afpfs-ng-0.8.1/fuse/fuse_int.c afpfs-ng-0.8.1.patch/fuse/fuse_int.c
|
||||
--- afpfs-ng-0.8.1/fuse/fuse_int.c 2011-09-10 12:14:34.167716442 +0200
|
||||
+++ afpfs-ng-0.8.1.patch/fuse/fuse_int.c 2011-09-10 12:16:23.745188717 +0200
|
||||
@@ -197,7 +197,7 @@
|
||||
ret = ml_open(volume,path,flags,&fp);
|
||||
|
||||
if (ret==0)
|
||||
- fi->fh=(void *) fp;
|
||||
+ fi->fh=(unsigned long) fp;
|
||||
|
||||
return ret;
|
||||
}
|
||||
diff -Naur afpfs-ng-0.8.1/include/afpfs-ng/afp.h afpfs-ng-0.8.1.patch/include/afpfs-ng/afp.h
|
||||
--- afpfs-ng-0.8.1/include/afpfs-ng/afp.h 2011-09-10 12:14:34.168716455 +0200
|
||||
+++ afpfs-ng-0.8.1.patch/include/afpfs-ng/afp.h 2011-09-10 12:16:37.588374712 +0200
|
||||
@@ -370,7 +370,7 @@
|
||||
|
||||
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 -Naur afpfs-ng-0.8.1/include/afpfs-ng/utils.h afpfs-ng-0.8.1.patch/include/afpfs-ng/utils.h
|
||||
--- afpfs-ng-0.8.1/include/afpfs-ng/utils.h 2011-09-10 12:14:34.173716523 +0200
|
||||
+++ afpfs-ng-0.8.1.patch/include/afpfs-ng/utils.h 2011-09-10 12:16:47.234504316 +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 -Naur afpfs-ng-0.8.1/lib/afp_url.c afpfs-ng-0.8.1.patch/lib/afp_url.c
|
||||
--- afpfs-ng-0.8.1/lib/afp_url.c 2011-09-10 12:14:34.182716644 +0200
|
||||
+++ afpfs-ng-0.8.1.patch/lib/afp_url.c 2011-09-10 12:16:47.235504329 +0200
|
||||
@@ -33,7 +33,7 @@
|
||||
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 @@
|
||||
return -1;
|
||||
|
||||
}
|
||||
- if (p==NULL) p=toparse;
|
||||
+ if (p==NULL) p=(char *)toparse;
|
||||
|
||||
/* Now split on the first / */
|
||||
if (sscanf(p,"%[^/]/%[^$]",
|
||||
diff -Naur afpfs-ng-0.8.1/lib/did.c afpfs-ng-0.8.1.patch/lib/did.c
|
||||
--- afpfs-ng-0.8.1/lib/did.c 2011-09-10 12:14:34.184716670 +0200
|
||||
+++ afpfs-ng-0.8.1.patch/lib/did.c 2011-09-10 12:16:47.235504329 +0200
|
||||
@@ -226,7 +226,7 @@
|
||||
|
||||
|
||||
/* 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 -Naur afpfs-ng-0.8.1/lib/dsi.c afpfs-ng-0.8.1.patch/lib/dsi.c
|
||||
--- afpfs-ng-0.8.1/lib/dsi.c 2011-09-10 12:14:34.185716683 +0200
|
||||
+++ afpfs-ng-0.8.1.patch/lib/dsi.c 2011-09-10 12:16:47.236504342 +0200
|
||||
@@ -474,7 +474,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 */
|
||||
@@ -757,7 +757,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 -Naur afpfs-ng-0.8.1/lib/loop.c afpfs-ng-0.8.1.patch/lib/loop.c
|
||||
--- afpfs-ng-0.8.1/lib/loop.c 2011-09-10 12:14:34.186716697 +0200
|
||||
+++ afpfs-ng-0.8.1.patch/lib/loop.c 2011-09-10 12:16:47.257504624 +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 -Naur afpfs-ng-0.8.1/lib/lowlevel.c afpfs-ng-0.8.1.patch/lib/lowlevel.c
|
||||
--- afpfs-ng-0.8.1/lib/lowlevel.c 2011-09-10 12:14:34.186716697 +0200
|
||||
+++ afpfs-ng-0.8.1.patch/lib/lowlevel.c 2011-09-10 12:16:47.288505041 +0200
|
||||
@@ -582,7 +582,7 @@
|
||||
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 -Naur afpfs-ng-0.8.1/lib/midlevel.c afpfs-ng-0.8.1.patch/lib/midlevel.c
|
||||
--- afpfs-ng-0.8.1/lib/midlevel.c 2011-09-10 12:14:34.189716738 +0200
|
||||
+++ afpfs-ng-0.8.1.patch/lib/midlevel.c 2011-09-10 12:16:47.316505416 +0200
|
||||
@@ -713,7 +713,7 @@
|
||||
{
|
||||
|
||||
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 -Naur afpfs-ng-0.8.1/lib/proto_attr.c afpfs-ng-0.8.1.patch/lib/proto_attr.c
|
||||
--- afpfs-ng-0.8.1/lib/proto_attr.c 2011-09-10 12:14:34.189716738 +0200
|
||||
+++ afpfs-ng-0.8.1.patch/lib/proto_attr.c 2011-09-10 12:16:47.317505429 +0200
|
||||
@@ -166,7 +166,7 @@
|
||||
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 -Naur afpfs-ng-0.8.1/lib/proto_desktop.c afpfs-ng-0.8.1.patch/lib/proto_desktop.c
|
||||
--- afpfs-ng-0.8.1/lib/proto_desktop.c 2011-09-10 12:14:34.197716845 +0200
|
||||
+++ afpfs-ng-0.8.1.patch/lib/proto_desktop.c 2011-09-10 12:16:47.317505429 +0200
|
||||
@@ -168,7 +168,7 @@
|
||||
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 -Naur afpfs-ng-0.8.1/lib/proto_directory.c afpfs-ng-0.8.1.patch/lib/proto_directory.c
|
||||
--- afpfs-ng-0.8.1/lib/proto_directory.c 2011-09-10 12:14:34.205716953 +0200
|
||||
+++ afpfs-ng-0.8.1.patch/lib/proto_directory.c 2011-09-10 12:16:47.317505429 +0200
|
||||
@@ -248,6 +248,7 @@
|
||||
|
||||
return 0;
|
||||
}
|
||||
+
|
||||
int afp_enumerateext2_reply(struct afp_server *server, char * buf, unsigned int size, void * other)
|
||||
{
|
||||
|
||||
@@ -266,8 +267,7 @@
|
||||
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 -Naur afpfs-ng-0.8.1/lib/proto_map.c afpfs-ng-0.8.1.patch/lib/proto_map.c
|
||||
--- afpfs-ng-0.8.1/lib/proto_map.c 2011-09-10 12:14:34.207716979 +0200
|
||||
+++ afpfs-ng-0.8.1.patch/lib/proto_map.c 2011-09-10 12:16:47.318505443 +0200
|
||||
@@ -122,7 +122,7 @@
|
||||
|
||||
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 -Naur afpfs-ng-0.8.1/lib/proto_session.c afpfs-ng-0.8.1.patch/lib/proto_session.c
|
||||
--- afpfs-ng-0.8.1/lib/proto_session.c 2011-09-10 12:14:34.208716992 +0200
|
||||
+++ afpfs-ng-0.8.1.patch/lib/proto_session.c 2011-09-10 12:16:47.318505443 +0200
|
||||
@@ -39,7 +39,7 @@
|
||||
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 @@
|
||||
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 @@
|
||||
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 -Naur afpfs-ng-0.8.1/lib/uams.c afpfs-ng-0.8.1.patch/lib/uams.c
|
||||
--- afpfs-ng-0.8.1/lib/uams.c 2011-09-10 12:14:34.212717047 +0200
|
||||
+++ afpfs-ng-0.8.1.patch/lib/uams.c 2011-09-10 12:16:47.319505457 +0200
|
||||
@@ -180,7 +180,7 @@
|
||||
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 @@
|
||||
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 @@
|
||||
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 -Naur afpfs-ng-0.8.1/lib/utils.c afpfs-ng-0.8.1.patch/lib/utils.c
|
||||
--- afpfs-ng-0.8.1/lib/utils.c 2011-09-10 12:14:34.213717060 +0200
|
||||
+++ afpfs-ng-0.8.1.patch/lib/utils.c 2011-09-10 12:16:47.319505457 +0200
|
||||
@@ -196,7 +196,7 @@
|
||||
maxlen=255;
|
||||
|
||||
|
||||
- p=filename+1;
|
||||
+ p=(char *)filename+1;
|
||||
while ((q=strchr(p,'/'))) {
|
||||
if (q>p+maxlen)
|
||||
return 1;
|
@ -1,26 +0,0 @@
|
||||
diff -Naur afpfs-ng-0.8.1/include/afpfs-ng/dsi.h afpfs-ng-0.8.1.patch/include/afpfs-ng/dsi.h
|
||||
--- afpfs-ng-0.8.1/include/afpfs-ng/dsi.h 2011-09-10 12:14:34.170716482 +0200
|
||||
+++ afpfs-ng-0.8.1.patch/include/afpfs-ng/dsi.h 2011-09-10 12:22:28.790093211 +0200
|
||||
@@ -6,13 +6,15 @@
|
||||
|
||||
struct dsi_request
|
||||
{
|
||||
- unsigned short requestid;
|
||||
- unsigned char subcommand;
|
||||
- void * other;
|
||||
- unsigned char wait;
|
||||
- pthread_cond_t condition_cond;
|
||||
- struct dsi_request * next;
|
||||
- int return_code;
|
||||
+ unsigned short requestid;
|
||||
+ unsigned char subcommand;
|
||||
+ void * other;
|
||||
+ int wait;
|
||||
+ int done_waiting;
|
||||
+ pthread_cond_t waiting_cond;
|
||||
+ pthread_mutex_t waiting_mutex;
|
||||
+ struct dsi_request * next;
|
||||
+ int return_code;
|
||||
};
|
||||
|
||||
int dsi_receive(struct afp_server * server, void * data, int size);
|
@ -1,90 +0,0 @@
|
||||
diff -Naur afpfs-ng-0.8.1/lib/afp.c afpfs-ng-0.8.1.patch/lib/afp.c
|
||||
--- afpfs-ng-0.8.1/lib/afp.c 2011-09-10 12:14:34.181716631 +0200
|
||||
+++ afpfs-ng-0.8.1.patch/lib/afp.c 2011-09-10 12:23:15.935726602 +0200
|
||||
@@ -68,7 +68,7 @@
|
||||
afp_getsessiontoken_reply,afp_blank_reply, NULL, NULL,
|
||||
afp_enumerateext2_reply, NULL, NULL, NULL, /*64 - 71 */
|
||||
afp_listextattrs_reply, NULL, NULL, NULL,
|
||||
- afp_blank_reply, NULL, NULL, NULL, /*72 - 79 */
|
||||
+ afp_blank_reply, NULL, afp_blank_reply, afp_blank_reply, /*72 - 79 */
|
||||
|
||||
NULL, NULL, NULL, NULL,
|
||||
NULL, NULL, NULL, NULL,
|
||||
@@ -320,8 +320,16 @@
|
||||
|
||||
struct dsi_request * p;
|
||||
struct afp_server *s2;
|
||||
+
|
||||
+
|
||||
+ if (s==NULL)
|
||||
+ goto out;
|
||||
+
|
||||
for (p=s->command_requests;p;p=p->next) {
|
||||
- pthread_cond_signal(&p->condition_cond);
|
||||
+ pthread_mutex_lock(&p->waiting_mutex);
|
||||
+ p->done_waiting=1;
|
||||
+ pthread_cond_signal(&p->waiting_cond);
|
||||
+ pthread_mutex_unlock(&p->waiting_mutex);
|
||||
}
|
||||
|
||||
if (s==server_base) {
|
||||
@@ -354,7 +362,7 @@
|
||||
s->exit_flag = 0;
|
||||
s->path_encoding=kFPUTF8Name; /* This is a default */
|
||||
s->next=NULL;
|
||||
- s->bufsize=2048;
|
||||
+ s->bufsize=4096;
|
||||
s->incoming_buffer=malloc(s->bufsize);
|
||||
|
||||
s->attention_quantum=AFP_DEFAULT_ATTENTION_QUANTUM;
|
||||
@@ -524,13 +532,14 @@
|
||||
kFPVolCreateDateBit|kFPVolIDBit |
|
||||
kFPVolNameBit;
|
||||
char new_encoding;
|
||||
+ int ret;
|
||||
|
||||
if (server->using_version->av_number>=30)
|
||||
bitmap|= kFPVolNameBit|kFPVolBlockSizeBit;
|
||||
|
||||
- switch (afp_volopen(volume,bitmap,
|
||||
- (strlen(volume->volpassword)>0) ? volume->volpassword : NULL))
|
||||
- {
|
||||
+ ret = afp_volopen(volume,bitmap,
|
||||
+ (strlen(volume->volpassword)>0) ? volume->volpassword : NULL);
|
||||
+ switch(ret){
|
||||
case kFPAccessDenied:
|
||||
*l+=snprintf(mesg,max-*l,
|
||||
"Incorrect volume password\n");
|
||||
@@ -544,6 +553,10 @@
|
||||
*l+=snprintf(mesg,max-*l,
|
||||
"Could not open volume\n");
|
||||
goto error;
|
||||
+ case ETIMEDOUT:
|
||||
+ *l+=snprintf(mesg,max-*l,
|
||||
+ "Timed out waiting to open volume\n");
|
||||
+ goto error;
|
||||
}
|
||||
|
||||
/* It is said that if a volume's encoding will be the same
|
||||
@@ -641,7 +654,6 @@
|
||||
add_server(server);
|
||||
|
||||
add_fd_and_signal(server->fd);
|
||||
-
|
||||
if (!full) {
|
||||
return 0;
|
||||
}
|
||||
@@ -649,10 +661,13 @@
|
||||
/* Get the status, and calculate the transmit time. We use this to
|
||||
* calculate our rx quantum. */
|
||||
gettimeofday(&t1,NULL);
|
||||
+
|
||||
if ((error=dsi_getstatus(server))!=0)
|
||||
goto error;
|
||||
gettimeofday(&t2,NULL);
|
||||
|
||||
+ afp_server_identify(server);
|
||||
+
|
||||
if ((t2.tv_sec - t1.tv_sec) > 0)
|
||||
server->tx_delay= (t2.tv_sec - t1.tv_sec) * 1000;
|
||||
else
|
@ -1,142 +0,0 @@
|
||||
diff -Naur afpfs-ng-0.8.1/lib/dsi.c afpfs-ng-0.8.1.patch/lib/dsi.c
|
||||
--- afpfs-ng-0.8.1/lib/dsi.c 2011-09-10 12:21:39.948437027 +0200
|
||||
+++ afpfs-ng-0.8.1.patch/lib/dsi.c 2011-09-10 12:25:57.688903825 +0200
|
||||
@@ -64,7 +64,7 @@
|
||||
rx.size=0;
|
||||
dsi_setup_header(server,&header,DSI_DSIGetStatus);
|
||||
/* We're intentionally ignoring the results */
|
||||
- ret=dsi_send(server,(char *) &header,sizeof(struct dsi_header),20,
|
||||
+ ret=dsi_send(server,(char *) &header,sizeof(struct dsi_header),60,
|
||||
0,(void *) &rx);
|
||||
|
||||
free(rx.data);
|
||||
@@ -197,6 +197,7 @@
|
||||
new_request->other=other;
|
||||
new_request->wait=wait;
|
||||
new_request->next=NULL;
|
||||
+ new_request->done_waiting=0;
|
||||
|
||||
pthread_mutex_lock(&server->request_queue_mutex);
|
||||
if (server->command_requests==NULL) {
|
||||
@@ -208,7 +209,8 @@
|
||||
server->stats.requests_pending++;
|
||||
pthread_mutex_unlock(&server->request_queue_mutex);
|
||||
|
||||
- pthread_cond_init(&new_request->condition_cond,NULL);
|
||||
+ pthread_cond_init(&new_request->waiting_cond,NULL);
|
||||
+ pthread_mutex_init(&new_request->waiting_mutex,NULL);
|
||||
|
||||
if (server->connect_state==SERVER_STATE_DISCONNECTED) {
|
||||
char mesg[1024];
|
||||
@@ -240,16 +242,12 @@
|
||||
server->stats.tx_bytes+=size;
|
||||
pthread_mutex_unlock(&server->send_mutex);
|
||||
|
||||
- int tmpwait=new_request->wait;
|
||||
#ifdef DEBUG_DSI
|
||||
printf("=== Waiting for response for %d %s\n",
|
||||
new_request->requestid,
|
||||
afp_get_command_name(new_request->subcommand));
|
||||
#endif
|
||||
- if (tmpwait<0) {
|
||||
-
|
||||
- pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
- pthread_mutex_lock(&mutex);
|
||||
+ if (new_request->wait<0) {
|
||||
|
||||
/* Wait forever */
|
||||
#ifdef DEBUG_DSI
|
||||
@@ -258,14 +256,17 @@
|
||||
afp_get_command_name(new_request->subcommand));
|
||||
#endif
|
||||
|
||||
- rc=pthread_cond_wait(
|
||||
- &new_request->condition_cond,
|
||||
- &mutex );
|
||||
- pthread_mutex_unlock(&mutex);
|
||||
-
|
||||
- } else if (tmpwait>0) {
|
||||
- pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
- pthread_mutex_lock(&mutex);
|
||||
+ pthread_mutex_lock(&new_request->waiting_mutex);
|
||||
+
|
||||
+ if (new_request->done_waiting==0)
|
||||
+ rc=pthread_cond_wait(
|
||||
+ &new_request->waiting_cond,
|
||||
+ &new_request->waiting_mutex );
|
||||
+
|
||||
+ pthread_mutex_unlock(&new_request->waiting_mutex);
|
||||
+
|
||||
+ } else if (new_request->wait>0) {
|
||||
+ /* wait for new_request->wait seconds */
|
||||
|
||||
#ifdef DEBUG_DSI
|
||||
printf("=== Waiting for %d %s, for %ds\n",
|
||||
@@ -283,13 +284,15 @@
|
||||
printf("=== Changing my mind, no longer waiting for %d\n",
|
||||
new_request->requestid);
|
||||
#endif
|
||||
- pthread_mutex_unlock(&mutex);
|
||||
goto skip;
|
||||
}
|
||||
- rc=pthread_cond_timedwait(
|
||||
- &new_request->condition_cond,
|
||||
- &mutex,&ts);
|
||||
- pthread_mutex_unlock(&mutex);
|
||||
+ pthread_mutex_lock(&new_request->waiting_mutex);
|
||||
+ if (new_request->done_waiting==0)
|
||||
+ rc=pthread_cond_timedwait(
|
||||
+ &new_request->waiting_cond,
|
||||
+ &new_request->waiting_mutex,&ts);
|
||||
+ pthread_mutex_unlock(&new_request->waiting_mutex);
|
||||
+
|
||||
if (rc==ETIMEDOUT) {
|
||||
/* FIXME: should handle this case properly */
|
||||
#ifdef DEBUG_DSI
|
||||
@@ -299,6 +302,7 @@
|
||||
goto out;
|
||||
}
|
||||
} else {
|
||||
+ /* Don't wait */
|
||||
#ifdef DEBUG_DSI
|
||||
printf("=== Skipping wait altogether for %d\n",new_request->requestid);
|
||||
#endif
|
||||
@@ -474,7 +478,7 @@
|
||||
}
|
||||
server->flags=ntohs(reply1->flags);
|
||||
|
||||
- p=(void *)((unsigned long) server->incoming_buffer + sizeof(*reply1));
|
||||
+ p=(void *)((unsigned int) 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 */
|
||||
@@ -577,6 +581,7 @@
|
||||
unsigned char mins=0;
|
||||
unsigned char checkmessage=0;
|
||||
|
||||
+ memset(mesg,0,AFP_LOGINMESG_LEN);
|
||||
|
||||
/* The logic here's undocumented. If we get an attention packet and
|
||||
there's no flag, then go check the message. Also, go check the
|
||||
@@ -757,7 +762,7 @@
|
||||
printf("<<< read() of rest of AFP, %d bytes\n",amount_to_read);
|
||||
#endif
|
||||
ret = read(server->fd, (void *)
|
||||
- (((unsigned long) server->incoming_buffer)+server->data_read),
|
||||
+ (((unsigned int) server->incoming_buffer)+server->data_read),
|
||||
amount_to_read);
|
||||
if (ret<0) return -1;
|
||||
if (ret==0) {
|
||||
@@ -862,8 +867,11 @@
|
||||
#ifdef DEBUG_DSI
|
||||
printf("<<< Signalling %d, returning %d or %d\n",request->requestid,request->return_code,rc);
|
||||
#endif
|
||||
+ pthread_mutex_lock(&request->waiting_mutex);
|
||||
request->wait=0;
|
||||
- pthread_cond_signal(&request->condition_cond);
|
||||
+ request->done_waiting=1;
|
||||
+ pthread_cond_signal(&request->waiting_cond);
|
||||
+ pthread_mutex_unlock(&request->waiting_mutex);
|
||||
} else {
|
||||
dsi_remove_from_request_queue(server,request);
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
diff -Naur afpfs-ng-0.8.1/lib/identify.c afpfs-ng-0.8.1.patch/lib/identify.c
|
||||
--- afpfs-ng-0.8.1/lib/identify.c 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ afpfs-ng-0.8.1.patch/lib/identify.c 2011-09-10 12:26:30.257389169 +0200
|
||||
@@ -0,0 +1,24 @@
|
||||
+#include <string.h>
|
||||
+#include "afpfs-ng/afp.h"
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * afp_server_identify()
|
||||
+ *
|
||||
+ * Identifies a server
|
||||
+ *
|
||||
+ * Right now, this only does identification using the machine_type
|
||||
+ * given in getsrvrinfo, but this could later use mDNS to get
|
||||
+ * more details.
|
||||
+ */
|
||||
+void afp_server_identify(struct afp_server * s)
|
||||
+{
|
||||
+ if (strcmp(s->machine_type,"Netatalk")==0)
|
||||
+ s->server_type=AFPFS_SERVER_TYPE_NETATALK;
|
||||
+ else if (strcmp(s->machine_type,"AirPort")==0)
|
||||
+ s->server_type=AFPFS_SERVER_TYPE_AIRPORT;
|
||||
+ else if (strcmp(s->machine_type,"Macintosh")==0)
|
||||
+ s->server_type=AFPFS_SERVER_TYPE_MACINTOSH;
|
||||
+ else
|
||||
+ s->server_type=AFPFS_SERVER_TYPE_UNKNOWN;
|
||||
+}
|
@ -1,12 +0,0 @@
|
||||
diff -Naur afpfs-ng-0.8.1/lib/Makefile.am afpfs-ng-0.8.1.patch/lib/Makefile.am
|
||||
--- afpfs-ng-0.8.1/lib/Makefile.am 2008-02-18 04:34:32.000000000 +0100
|
||||
+++ afpfs-ng-0.8.1.patch/lib/Makefile.am 2011-09-10 12:27:09.833978612 +0200
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
lib_LTLIBRARIES = libafpclient.la
|
||||
|
||||
-libafpclient_la_SOURCES = afp.c codepage.c did.c dsi.c map_def.c uams.c uams_def.c unicode.c users.c utils.c resource.c log.c client.c server.c connect.c loop.c midlevel.c proto_attr.c proto_desktop.c proto_directory.c proto_files.c proto_fork.c proto_login.c proto_map.c proto_replyblock.c proto_server.c proto_volume.c proto_session.c afp_url.c status.c forklist.c debug.c lowlevel.c
|
||||
+libafpclient_la_SOURCES = afp.c codepage.c did.c dsi.c map_def.c uams.c uams_def.c unicode.c users.c utils.c resource.c log.c client.c server.c connect.c loop.c midlevel.c proto_attr.c proto_desktop.c proto_directory.c proto_files.c proto_fork.c proto_login.c proto_map.c proto_replyblock.c proto_server.c proto_volume.c proto_session.c afp_url.c status.c forklist.c debug.c lowlevel.c identify.c
|
||||
|
||||
# libafpclient_la_LDFLAGS = -module -avoid-version
|
||||
|
@ -1,25 +0,0 @@
|
||||
diff -Naur afpfs-ng-0.8.1/lib/afp.c afpfs-ng-0.8.1.patch/lib/afp.c
|
||||
--- afpfs-ng-0.8.1/lib/afp.c 2011-09-10 12:23:38.207025811 +0200
|
||||
+++ afpfs-ng-0.8.1.patch/lib/afp.c 2011-09-10 12:30:20.305810381 +0200
|
||||
@@ -19,7 +19,6 @@
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
-#include <errno.h>
|
||||
|
||||
#include "afpfs-ng/afp_protocol.h"
|
||||
#include "afpfs-ng/libafpclient.h"
|
||||
diff -Naur afpfs-ng-0.8.1/lib/afp_url.c afpfs-ng-0.8.1.patch/lib/afp_url.c
|
||||
--- afpfs-ng-0.8.1/lib/afp_url.c 2011-09-10 12:21:39.946437001 +0200
|
||||
+++ afpfs-ng-0.8.1.patch/lib/afp_url.c 2011-09-10 12:30:20.306810396 +0200
|
||||
@@ -21,7 +21,9 @@
|
||||
|
||||
static int check_port(char * port)
|
||||
{
|
||||
- long long ret = strtol(port,NULL,10);
|
||||
+ long long ret = 0;
|
||||
+ errno = 0;
|
||||
+ ret = strtol(port,NULL,10);
|
||||
if ((ret<0) || (ret>32767)) return -1;
|
||||
if (errno) {
|
||||
printf("port error\n");
|
@ -1,11 +0,0 @@
|
||||
--- 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);
|
@ -1,83 +0,0 @@
|
||||
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,
|
Loading…
x
Reference in New Issue
Block a user