Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Oct 2012 08:25:18 GMT
From:      Manuel Creach <manuel.creach@icloud.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/172780: New port: net/afpfs-ng an Apple Filing Protocol client library
Message-ID:  <201210160825.q9G8PIEr093243@red.freebsd.org>
Resent-Message-ID: <201210160830.q9G8U147033032@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         172780
>Category:       ports
>Synopsis:       New port: net/afpfs-ng an Apple Filing Protocol client library
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 16 08:30:00 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Manuel Creach
>Release:        9.1-RC2
>Organization:
>Environment:
FreeBSD j1 9.1-RC2 FreeBSD 9.1-RC2 #1 r241574: Mon Oct 15 10:52:07 CEST 2012     root@hpjm-bsd:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
New port Makefile for afpfs-ng. The afpfs-ng is an Apple Filing Protocol client library
>How-To-Repeat:

>Fix:
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	afpfs-ng
#	afpfs-ng/Makefile
#	afpfs-ng/pkg-descr
#	afpfs-ng/distinfo
#	afpfs-ng/files
#	afpfs-ng/files/patch-Makefile.am
#	afpfs-ng/files/patch-cmdline__cmdline_afp.c
#	afpfs-ng/files/patch-cmdline__cmdline_testafp.c
#	afpfs-ng/files/patch-cmdline__getstatus.c
#	afpfs-ng/files/patch-configure.ac
#	afpfs-ng/files/patch-fuse__client.c
#	afpfs-ng/files/patch-fuse__commands.c
#	afpfs-ng/files/patch-fuse__daemon.c
#	afpfs-ng/files/patch-fuse__fuse_error.c
#	afpfs-ng/files/patch-fuse__fuse_int.c
#	afpfs-ng/files/patch-include__Makefile.am
#	afpfs-ng/files/patch-include__afp.h
#	afpfs-ng/files/patch-include__afp_protocol.h
#	afpfs-ng/files/patch-include__afpfs-ng__Makefile.am
#	afpfs-ng/files/patch-include__afpfs-ng__afp.h
#	afpfs-ng/files/patch-include__afpfs-ng__afp_protocol.h
#	afpfs-ng/files/patch-include__afpfs-ng__codepage.h
#	afpfs-ng/files/patch-include__afpfs-ng__dsi.h
#	afpfs-ng/files/patch-include__afpfs-ng__libafpclient.h
#	afpfs-ng/files/patch-include__afpfs-ng__map_def.h
#	afpfs-ng/files/patch-include__afpfs-ng__midlevel.h
#	afpfs-ng/files/patch-include__afpfs-ng__uams_def.h
#	afpfs-ng/files/patch-include__afpfs-ng__utils.h
#	afpfs-ng/files/patch-include__codepage.h
#	afpfs-ng/files/patch-include__dsi.h
#	afpfs-ng/files/patch-include__libafpclient.h
#	afpfs-ng/files/patch-include__map_def.h
#	afpfs-ng/files/patch-include__midlevel.h
#	afpfs-ng/files/patch-include__uams_def.h
#	afpfs-ng/files/patch-include__utils.h
#	afpfs-ng/files/patch-lib__Makefile.am
#	afpfs-ng/files/patch-lib__afp.c
#	afpfs-ng/files/patch-lib__afp_internal.h
#	afpfs-ng/files/patch-lib__afp_url.c
#	afpfs-ng/files/patch-lib__client.c
#	afpfs-ng/files/patch-lib__codepage.c
#	afpfs-ng/files/patch-lib__connect.c
#	afpfs-ng/files/patch-lib__did.c
#	afpfs-ng/files/patch-lib__dsi.c
#	afpfs-ng/files/patch-lib__forklist.c
#	afpfs-ng/files/patch-lib__identify.c
#	afpfs-ng/files/patch-lib__log.c
#	afpfs-ng/files/patch-lib__loop.c
#	afpfs-ng/files/patch-lib__lowlevel.c
#	afpfs-ng/files/patch-lib__map_def.c
#	afpfs-ng/files/patch-lib__meta.c
#	afpfs-ng/files/patch-lib__midlevel.c
#	afpfs-ng/files/patch-lib__proto_attr.c
#	afpfs-ng/files/patch-lib__proto_desktop.c
#	afpfs-ng/files/patch-lib__proto_directory.c
#	afpfs-ng/files/patch-lib__proto_files.c
#	afpfs-ng/files/patch-lib__proto_fork.c
#	afpfs-ng/files/patch-lib__proto_login.c
#	afpfs-ng/files/patch-lib__proto_map.c
#	afpfs-ng/files/patch-lib__proto_replyblock.c
#	afpfs-ng/files/patch-lib__proto_server.c
#	afpfs-ng/files/patch-lib__proto_session.c
#	afpfs-ng/files/patch-lib__proto_volume.c
#	afpfs-ng/files/patch-lib__resource.c
#	afpfs-ng/files/patch-lib__server.c
#	afpfs-ng/files/patch-lib__status.c
#	afpfs-ng/files/patch-lib__uams.c
#	afpfs-ng/files/patch-lib__users.c
#	afpfs-ng/files/patch-lib__utils.c
#	afpfs-ng/pkg-plist
#
echo c - afpfs-ng
mkdir -p afpfs-ng > /dev/null 2>&1
echo x - afpfs-ng/Makefile
sed 's/^X//' >afpfs-ng/Makefile << '50371300fdce6e8e4b112e5ed04a93f2'
X# New ports collection makefile for:    afpfs-ng
X# Date created:                         2012.10.16
X# Whom:                                 Manuel Creach <manuel.creach@icloud.com>
X#
X# $FreeBSD$
X#
X
XPORTNAME=	afpfs-ng
XPORTVERSION=	0.8.1
XCATEGORIES=	net
XMASTER_SITES=	http://sourceforge.net/projects/afpfs-ng/files/afpfs-ng/${PORTVERSION}/
X
XMAINTAINER=	manuel.creach@icloud.com
XCOMMENT=	The afpfs-ng is an Apple Filing Protocol client library
X
XLICENSE=	GPLv2
XLICENSE_FILE=	${WRKSRC}/COPYING
X
XOPTIONS_DEFINE=	FUSE GCRYPT
X
XFUSE_DESC=	build with FUSE support
XGCRYPT_DESC=	build with GCRYPT support
X
XPORT_REVISION=	1
XFETCH_ARGS=
XUSE_BZIP2=	yes
XUSE_GMAKE=      yes
XUSE_AUTORECONF=	yes
XUSE_AUTOTOOLS=	aclocal autoheader automake autoconf libtoolize
XACLOCAL_ARGS=	-I.
XAUTOMAKE_ARGS=	--add-missing
XUSE_LDCONFIG=	yes
X
XCFLAGS+=	-D_FILE_OFFSET_BITS=64 -I${LOCALBASE}/include
XLDFLAGS+=	-L${LOCALBASE}/lib
X
X.include <bsd.port.options.mk>
X
XCONFIGURE_ARGS+=--prefix="${PREFIX}"
XMAN1+=		afpcmd.1 afpgetstatus.1
X
X.if ${PORT_OPTIONS:MFUSE}
XLIB_DEPENDS+=	 fuse:${PORTSDIR}/sysutils/fusefs-libs
XCONFIGURE_ARGS+=--enable-fuse
X.else
XCONFIGURE_ARGS+=--disable-fuse
X.endif
X
X.if ${PORT_OPTIONS:MGCRYPT}
XLIB_DEPENDS+=	gcrypt:${PORTSDIR}/security/libgcrypt
XCONFIGURE_ARGS+=--enable-gcrypt
X.else
XCONFIGURE_ARGS+=--disable-gcrypt
X.endif
X
X.include <bsd.port.pre.mk>
X
Xpost-patch:	.SILENT
X	${REINPLACE_CMD} 's|$$(libdir)/\(pkgconfig\)|$$(prefix)/libdata/\1|' \
X		${WRKSRC}/Makefile.am
X
Xpost-configure: .SILENT
X	${REINPLACE_CMD} 's|LIBS = |LIBS = -liconv |' \
X		${WRKSRC}/cmdline/Makefile
X
X.include <bsd.port.post.mk>
50371300fdce6e8e4b112e5ed04a93f2
echo x - afpfs-ng/pkg-descr
sed 's/^X//' >afpfs-ng/pkg-descr << '0a239ffec9eb8efb58f492a30f01061d'
Xafpfs-ng is an Apple Filing Protocol client that will allow BSD,
XLinux and Mac OS X systems to access files exported from a
XMac OS system with AFP over TCP.
X
XWWW: http://sourceforge.net/projects/afpfs-ng/
0a239ffec9eb8efb58f492a30f01061d
echo x - afpfs-ng/distinfo
sed 's/^X//' >afpfs-ng/distinfo << '6e1372041f65394c081643a73511a928'
XSHA256 (afpfs-ng-0.8.1.tar.bz2) = 688560de1cde57ab8d9e0ef7dc6436dbf0267fe8884f9014e50ff92b297b01a8
XSIZE (afpfs-ng-0.8.1.tar.bz2) = 344014
6e1372041f65394c081643a73511a928
echo c - afpfs-ng/files
mkdir -p afpfs-ng/files > /dev/null 2>&1
echo x - afpfs-ng/files/patch-Makefile.am
sed 's/^X//' >afpfs-ng/files/patch-Makefile.am << 'c0d8ec3e06c77e919b3f9afc256e347e'
X--- Makefile.am.orig	2008-02-18 03:24:14.000000000 +0000
X+++ Makefile.am	2012-10-14 13:11:34.000000000 +0000
X@@ -1,5 +1,5 @@
X if HAVE_LIBFUSE
X-SUBDIRS = lib fuse cmdline docs
X+SUBDIRS = lib fuse cmdline include docs
X else
X-SUBDIRS = lib cmdline docs
X+SUBDIRS = lib cmdline include docs
X endif
Xdiff -Naur afpfs-ng-0.8.1.orig/cmdline/cmdline_afp.c afpfs-ng-0.8.1/cmdline/cmdline_afp.c
c0d8ec3e06c77e919b3f9afc256e347e
echo x - afpfs-ng/files/patch-cmdline__cmdline_afp.c
sed 's/^X//' >afpfs-ng/files/patch-cmdline__cmdline_afp.c << '53957824e411aa41ee04922a9e03752a'
X--- cmdline/cmdline_afp.c.orig	2008-02-19 01:54:19.000000000 +0000
X+++ cmdline/cmdline_afp.c	2012-10-14 13:11:33.000000000 +0000
X@@ -3,9 +3,9 @@
X 	
X */
X 
X-#include "afp.h"
X-#include "midlevel.h"
X-#include "map_def.h"
X+#include "afpfs-ng/afp.h"
X+#include "afpfs-ng/midlevel.h"
X+#include "afpfs-ng/map_def.h"
X 
X #include <string.h>
X #include <stdio.h>
Xdiff -Naur afpfs-ng-0.8.1.orig/cmdline/cmdline_testafp.c afpfs-ng-0.8.1/cmdline/cmdline_testafp.c
53957824e411aa41ee04922a9e03752a
echo x - afpfs-ng/files/patch-cmdline__cmdline_testafp.c
sed 's/^X//' >afpfs-ng/files/patch-cmdline__cmdline_testafp.c << 'f44bdc6904157dcc5701c8c9d91c593f'
X--- cmdline/cmdline_testafp.c.orig	2008-03-04 20:16:50.000000000 +0000
X+++ cmdline/cmdline_testafp.c	2012-10-14 13:11:33.000000000 +0000
X@@ -3,8 +3,8 @@
X 	
X */
X 
X-#include "afp.h"
X-#include "midlevel.h"
X+#include "afpfs-ng/afp.h"
X+#include "afpfs-ng/midlevel.h"
X 
X #include "cmdline_main.h"
X 
Xdiff -Naur afpfs-ng-0.8.1.orig/cmdline/getstatus.c afpfs-ng-0.8.1/cmdline/getstatus.c
f44bdc6904157dcc5701c8c9d91c593f
echo x - afpfs-ng/files/patch-cmdline__getstatus.c
sed 's/^X//' >afpfs-ng/files/patch-cmdline__getstatus.c << '330ebf4aa4669c7141e59cf168494d39'
X--- cmdline/getstatus.c.orig	2008-02-18 03:28:09.000000000 +0000
X+++ cmdline/getstatus.c	2012-10-14 13:11:43.000000000 +0000
X@@ -1,8 +1,9 @@
X #include <stdio.h>
X+#include <stdlib.h>
X #include <string.h>
X #include <pthread.h>
X 
X-#include "afp.h"
X+#include "afpfs-ng/afp.h"
X 
X static int getstatus(char * address_string, unsigned int port)
X {
Xdiff -Naur afpfs-ng-0.8.1.orig/configure.ac afpfs-ng-0.8.1/configure.ac
330ebf4aa4669c7141e59cf168494d39
echo x - afpfs-ng/files/patch-configure.ac
sed 's/^X//' >afpfs-ng/files/patch-configure.ac << 'a4c9361e12820e00e0dee011c75246c9'
X--- configure.ac.orig	2008-03-08 16:23:12.000000000 +0000
X+++ configure.ac	2012-10-14 13:11:39.000000000 +0000
X@@ -11,6 +11,7 @@
X AC_PROG_CC
X AC_PROG_INSTALL
X AC_PROG_LIBTOOL
X+AM_PROG_CC_C_O
X 
X # Checks for libraries.
X # FIXME: Replace `main' with a function in `-lncurses':
X@@ -50,21 +51,6 @@
X 	case $host in
X 		*-*-darwin*) 
X 		AC_MSG_CHECKING([for correct gcrypt version])
X-		AC_RUN_IFELSE(
X-			[AC_LANG_PROGRAM([
X-				#include <gcrypt.h>
X-				#include <stdio.h>],[
X-				char*p= GCRYPT_VERSION;
X-				unsigned int vers;
X-				vers=atoi(p)*10000;
X-				p=strchr(p,'.')+1;
X-				vers+=atoi(p)*100;
X-				p=strchr(p,'.')+1;
X-				vers+=atoi(p);
X-				if (vers<10400) return 1;
X-			])],
X-			[AC_MSG_RESULT([yes])],
X-			[AC_MSG_ERROR([version is < 1.4.0])])
X 		AM_CONDITIONAL(HAVE_LIBGCRYPT, true)
X 		AC_DEFINE([HAVE_LIBGCRYPT], [1] )
X 		;;
X@@ -105,7 +91,7 @@
X 
X 
X 
X-AC_CONFIG_FILES([lib/Makefile fuse/Makefile cmdline/Makefile Makefile docs/Makefile])
X+AC_CONFIG_FILES([lib/Makefile fuse/Makefile cmdline/Makefile Makefile include/Makefile include/afpfs-ng/Makefile docs/Makefile])
X 
X AC_OUTPUT
X 
Xdiff -Naur afpfs-ng-0.8.1.orig/fuse/client.c afpfs-ng-0.8.1/fuse/client.c
a4c9361e12820e00e0dee011c75246c9
echo x - afpfs-ng/files/patch-fuse__client.c
sed 's/^X//' >afpfs-ng/files/patch-fuse__client.c << '4832232d1fef15ce0d54755c1de5c5f1'
X--- fuse/client.c.orig	2008-03-08 02:44:16.000000000 +0000
X+++ fuse/client.c	2012-10-14 13:11:44.000000000 +0000
X@@ -12,11 +12,11 @@
X #include <grp.h>
X 
X #include "config.h"
X-#include <afp.h>
X+#include <afpfs-ng/afp.h>
X #include "afp_server.h"
X-#include "uams_def.h"
X-#include "map_def.h"
X-#include "libafpclient.h"
X+#include "afpfs-ng/uams_def.h"
X+#include "afpfs-ng/map_def.h"
X+#include "afpfs-ng/libafpclient.h"
X 
X #define default_uam "Cleartxt Passwrd"
X 
X@@ -61,8 +61,9 @@
X 			snprintf(filename, PATH_MAX,
X 				"/usr/local/bin/%s",AFPFSD_FILENAME);
X 			if (access(filename,X_OK)) {
X-				snprintf(filename, "/usr/bin/%s",
X+				snprintf(filename, sizeof(filename), "/usr/bin/%s",
X 					AFPFSD_FILENAME);
X+				filename[sizeof(filename) - 1] = 0;
X 				if (access(filename,X_OK)) {
X 					printf("Could not find server (%s)\n",
X 						filename);
Xdiff -Naur afpfs-ng-0.8.1.orig/fuse/commands.c afpfs-ng-0.8.1/fuse/commands.c
4832232d1fef15ce0d54755c1de5c5f1
echo x - afpfs-ng/files/patch-fuse__commands.c
sed 's/^X//' >afpfs-ng/files/patch-fuse__commands.c << '9a81c0b54aaa987380c8c175d2a8b027'
X--- fuse/commands.c.orig	2008-03-08 16:06:25.000000000 +0000
X+++ fuse/commands.c	2012-10-14 13:11:33.000000000 +0000
X@@ -19,15 +19,15 @@
X #include <getopt.h>
X #include <signal.h>
X 
X-#include "afp.h"
X-#include "dsi.h"
X+#include "afpfs-ng/afp.h"
X+#include "afpfs-ng/dsi.h"
X #include "afp_server.h"
X-#include "utils.h"
X+#include "afpfs-ng/utils.h"
X #include "daemon.h"
X-#include "uams_def.h"
X-#include "codepage.h"
X-#include "libafpclient.h"
X-#include "map_def.h"
X+#include "afpfs-ng/uams_def.h"
X+#include "afpfs-ng/codepage.h"
X+#include "afpfs-ng/libafpclient.h"
X+#include "afpfs-ng/map_def.h"
X #include "fuse_int.h"
X #include "fuse_error.h"
X #include "fuse_internal.h"
Xdiff -Naur afpfs-ng-0.8.1.orig/fuse/daemon.c afpfs-ng-0.8.1/fuse/daemon.c
9a81c0b54aaa987380c8c175d2a8b027
echo x - afpfs-ng/files/patch-fuse__daemon.c
sed 's/^X//' >afpfs-ng/files/patch-fuse__daemon.c << '7fe106c2c50520b97a045058ef1afcd9'
X--- fuse/daemon.c.orig	2008-03-04 17:26:05.000000000 +0000
X+++ fuse/daemon.c	2012-10-14 13:11:33.000000000 +0000
X@@ -23,11 +23,11 @@
X #include <signal.h>
X #include <sys/socket.h>
X 
X-#include "afp.h"
X+#include "afpfs-ng/afp.h"
X 
X-#include "dsi.h"
X+#include "afpfs-ng/dsi.h"
X #include "afp_server.h"
X-#include "utils.h"
X+#include "afpfs-ng/utils.h"
X #include "daemon.h"
X #include "commands.h"
X 
Xdiff -Naur afpfs-ng-0.8.1.orig/fuse/fuse_error.c afpfs-ng-0.8.1/fuse/fuse_error.c
7fe106c2c50520b97a045058ef1afcd9
echo x - afpfs-ng/files/patch-fuse__fuse_error.c
sed 's/^X//' >afpfs-ng/files/patch-fuse__fuse_error.c << '584d0a3a2edb3f09fc177a21d6de2745'
X--- fuse/fuse_error.c.orig	2008-01-18 04:40:10.000000000 +0000
X+++ fuse/fuse_error.c	2012-10-14 13:11:33.000000000 +0000
X@@ -4,7 +4,7 @@
X #include <unistd.h>
X #include <string.h>
X #include <stdio.h>
X-#include "libafpclient.h"
X+#include "afpfs-ng/libafpclient.h"
X #include "fuse_internal.h"
X 
X #define TMP_FILE "/tmp/fuse_stderr"
Xdiff -Naur afpfs-ng-0.8.1.orig/fuse/fuse_int.c afpfs-ng-0.8.1/fuse/fuse_int.c
584d0a3a2edb3f09fc177a21d6de2745
echo x - afpfs-ng/files/patch-fuse__fuse_int.c
sed 's/^X//' >afpfs-ng/files/patch-fuse__fuse_int.c << '5764dd1b7bdddef809f7cfce7211107f'
X--- fuse/fuse_int.c.orig	2008-03-02 05:06:24.000000000 +0000
X+++ fuse/fuse_int.c	2012-10-14 13:11:44.000000000 +0000
X@@ -18,7 +18,7 @@
X #define FUSE_USE_VERSION 25
X 
X 
X-#include "afp.h"
X+#include "afpfs-ng/afp.h"
X 
X #include <fuse.h>
X #include <stdio.h>
X@@ -39,10 +39,10 @@
X #include <pwd.h>
X #include <stdarg.h>
X 
X-#include "dsi.h"
X-#include "afp_protocol.h"
X-#include "codepage.h"
X-#include "midlevel.h"
X+#include "afpfs-ng/dsi.h"
X+#include "afpfs-ng/afp_protocol.h"
X+#include "afpfs-ng/codepage.h"
X+#include "afpfs-ng/midlevel.h"
X #include "fuse_error.h"
X 
X /* Uncomment the following line to enable full debugging: */
X@@ -197,7 +197,7 @@
X 	ret = ml_open(volume,path,flags,&fp);
X 
X 	if (ret==0) 
X-		fi->fh=(void *) fp;
X+		fi->fh=(unsigned long) fp;
X 
X 	return ret;
X }
Xdiff -Naur afpfs-ng-0.8.1.orig/include/Makefile.am afpfs-ng-0.8.1/include/Makefile.am
5764dd1b7bdddef809f7cfce7211107f
echo x - afpfs-ng/files/patch-include__Makefile.am
sed 's/^X//' >afpfs-ng/files/patch-include__Makefile.am << 'f8637c34e16fea575a3ce4c75c26732a'
X--- include/Makefile.am.orig	1970-01-01 00:00:00.000000000 +0000
X+++ include/Makefile.am	2012-10-14 13:11:34.000000000 +0000
X@@ -0,0 +1,3 @@
X+## Process this file with automake to produce Makefile.in
X+
X+SUBDIRS = afpfs-ng
Xdiff -Naur afpfs-ng-0.8.1.orig/include/afp.h afpfs-ng-0.8.1/include/afp.h
f8637c34e16fea575a3ce4c75c26732a
echo x - afpfs-ng/files/patch-include__afp.h
sed 's/^X//' >afpfs-ng/files/patch-include__afp.h << '5b7edd06b22d93383f005efe20694b85'
X--- include/afp.h.orig	2008-03-08 16:08:18.000000000 +0000
X+++ include/afp.h	2012-10-14 13:11:34.000000000 +0000
X@@ -1,533 +0,0 @@
X-
X-#ifndef _AFP_H_
X-#define _AFP_H_
X-
X-#include <arpa/inet.h>
X-#include <pthread.h>
X-#include <netdb.h>
X-#include <sys/statvfs.h>
X-#include <pwd.h>
X-#include <afp_protocol.h>
X-#include <libafpclient.h>
X-#include <sys/types.h>
X-#include <sys/stat.h>
X-#include <unistd.h>
X-#include <netinet/in.h>
X-
X-
X-#define AFPFS_VERSION "0.8.1"
X-
X-/* This is the maximum AFP version this library supports */
X-#define AFP_MAX_SUPPORTED_VERSION 32
X-
X-/* afp_url is used to pass locations around */
X-struct afp_url {
X-	enum {TCPIP,AT} protocol;
X-	char username[AFP_MAX_USERNAME_LEN];
X-	char uamname[50];
X-	char password[AFP_MAX_PASSWORD_LEN];
X-	char servername[AFP_SERVER_NAME_UTF8_LEN];
X-	int port;
X-	char volumename[AFP_VOLUME_NAME_UTF8_LEN];
X-	char path[AFP_MAX_PATH];
X-
X-	int requested_version;
X-	char zone[AFP_ZONE_LEN]; /* Only used for Appletalk */
X-	char volpassword[9];;
X-};
X-
X-struct afp_token {
X-	unsigned int length;
X-	char data[AFP_TOKEN_MAX_LEN];
X-};
X-
X-#define SERVER_MAX_VERSIONS 10
X-#define SERVER_MAX_UAMS 10
X-
X-struct afp_rx_buffer {
X-	unsigned int size;
X-	unsigned int maxsize;
X-	char * data;
X-	int errorcode;
X-};
X-
X-
X-struct afp_file_info {
X-	unsigned short attributes;
X-	unsigned int did;
X-	unsigned int creation_date;
X-	unsigned int modification_date;
X-	unsigned int backup_date;
X-	unsigned int fileid;
X-	unsigned short offspring;
X-	char sync;
X-	char finderinfo[32];
X-	char name[AFP_MAX_PATH];
X-	char basename[AFP_MAX_PATH];
X-	char translated_name[AFP_MAX_PATH];
X-	struct afp_unixprivs unixprivs;
X-	unsigned int accessrights;
X-	struct afp_file_info * next;
X-	struct afp_file_info * largelist_next;
X-	unsigned char isdir;
X-	unsigned long long size;
X-	unsigned short resourcesize;
X-	unsigned int resource;
X-	unsigned short forkid;
X-	struct afp_icon * icon;
X-	int eof;
X-};
X-
X-
X-#define VOLUME_EXTRA_FLAGS_VOL_CHMOD_KNOWN 0x1
X-#define VOLUME_EXTRA_FLAGS_VOL_CHMOD_BROKEN 0x2
X-#define VOLUME_EXTRA_FLAGS_SHOW_APPLEDOUBLE 0x4
X-#define VOLUME_EXTRA_FLAGS_VOL_SUPPORTS_UNIX 0x8
X-#define VOLUME_EXTRA_FLAGS_NO_LOCKING 0x10
X-#define VOLUME_EXTRA_FLAGS_IGNORE_UNIXPRIVS 0x20
X-#define VOLUME_EXTRA_FLAGS_READONLY 0x40
X-
X-#define AFP_VOLUME_UNMOUNTED 0
X-#define AFP_VOLUME_MOUNTED 1
X-#define AFP_VOLUME_UNMOUNTING 2
X-
X-struct afp_volume {
X-	unsigned short volid;
X-	char flags;  /* This is from afpGetSrvrParms */
X-	unsigned short attributes; /* This is from VolOpen */
X-	unsigned short signature;  /* This is fixed or variable */
X-	unsigned int creation_date;
X-	unsigned int modification_date;
X-	unsigned int backup_date;
X-	struct statvfs stat;
X-	unsigned char mounted;
X-	char mountpoint[255];
X-	struct afp_server * server;
X-	char volume_name[AFP_VOLUME_NAME_LEN];
X-	char volume_name_printable[AFP_VOLUME_NAME_UTF8_LEN];
X-	unsigned short dtrefnum;
X-	char volpassword[AFP_VOLPASS_LEN];
X-	unsigned int extra_flags; /* This is an afpfs-ng specific field */
X-
X-	/* Our directory ID cache */
X-	struct did_cache_entry * did_cache_base;
X-	pthread_mutex_t did_cache_mutex;
X-
X-	/* Our journal of open forks */
X-	struct afp_file_info * open_forks;
X-	pthread_mutex_t open_forks_mutex;
X-
X-	/* Used to trigger startup */
X-        pthread_cond_t  startup_condition_cond;
X-
X-	struct {
X-		uint64_t hits;
X-		uint64_t misses;
X-		uint64_t expired;
X-		uint64_t force_removed;
X-	} did_cache_stats;
X-
X-	void * priv;  /* This is a private structure for fuse/cmdline, etc */
X-	pthread_t thread; /* This is the per-volume thread */
X-
X-	int mapping;
X-
X-};
X-
X-#define SERVER_STATE_CONNECTED 1
X-#define SERVER_STATE_DISCONNECTED 2
X-
X-enum server_type{
X-	AFPFS_SERVER_TYPE_UNKNOWN,
X-	AFPFS_SERVER_TYPE_NETATALK,
X-	AFPFS_SERVER_TYPE_AIRPORT,
X-	AFPFS_SERVER_TYPE_MACINTOSH,
X-};
X-
X-#define is_netatalk(x) ( (x)->machine_type == AFPFS_SERVER_TYPE_NETATALK )
X-#define is_airport(x) ( (x)->machine_type == AFPFS_SERVER_TYPE_AIRPORT )
X-#define is_macintosh(x) ( (x)->machine_type == AFPFS_SERVER_TYPE_MACINTOSH )
X-
X-
X-
X-struct afp_versions {
X-        char        *av_name;
X-        int         av_number;
X-};
X-extern struct afp_versions afp_versions[];
X-
X-struct afp_server {
X-
X-	/* Our buffer sizes */
X-	unsigned int tx_quantum;
X-	unsigned int rx_quantum;
X-
X-	unsigned int tx_delay;
X-
X-	/* Connection information */
X-	struct sockaddr_in address;
X-	int fd;
X-
X-	/* Some stats, for information only */
X-	struct {
X-		uint64_t runt_packets;
X-		uint64_t incoming_dsi;
X-		uint64_t rx_bytes;
X-		uint64_t tx_bytes;
X-		uint64_t requests_pending;
X-	} stats;
X-
X-	/* General information */
X-	char server_name[AFP_SERVER_NAME_LEN];
X-	char server_name_utf8[AFP_SERVER_NAME_UTF8_LEN];
X-        char server_name_printable[AFP_SERVER_NAME_UTF8_LEN];
X-
X-	char machine_type[17];
X-	char icon[256];
X-	char signature[16];
X-	unsigned short flags;
X-	int connect_state;
X-	enum server_type server_type;
X-
X-	/* This is the time we connected */
X-	time_t connect_time;
X-
X-	/* UAMs */
X-	unsigned int supported_uams;
X-	unsigned int using_uam;
X-
X-	/* Authentication */
X-	char username[AFP_MAX_USERNAME_LEN];
X-	char password[AFP_MAX_PASSWORD_LEN];
X-
X-	/* Session */
X-	struct afp_token token;
X-	char need_resume;
X-
X-	/* Versions */
X-	unsigned char requested_version;
X-	unsigned char versions[SERVER_MAX_VERSIONS];
X-	struct afp_versions *using_version;
X-
X-	/* Volumes */
X-	unsigned char num_volumes;
X-	struct afp_volume * volumes;
X-
X-	void * dsi;
X-	unsigned int exit_flag;
X-
X-	/* Our DSI request queue */
X-	pthread_mutex_t requestid_mutex;
X-	pthread_mutex_t request_queue_mutex;
X-	unsigned short lastrequestid;
X-	unsigned short expectedrequestid;
X-	struct dsi_request * command_requests;
X-
X-
X-	char loginmesg[200];
X-	char servermesg[200];
X-	char path_encoding;
X-
X-	/* This is the data for the incoming buffer */
X-	char * incoming_buffer;
X-	int data_read;
X-	int bufsize;
X-
X-	/* And this is for the outgoing queue */
X-	pthread_mutex_t send_mutex;
X-
X-	/* This is for user mapping */
X-	struct passwd passwd;
X-	unsigned int server_uid, server_gid;
X-	int server_gid_valid;
X-
X-	struct afp_server *next;
X-
X-	/* These are for DSI attention packets */
X-	unsigned int attention_quantum;
X-	unsigned int attention_len;
X-	char * attention_buffer;
X-
X-};
X-
X-struct afp_extattr_info {
X-	unsigned int maxsize;
X-	unsigned int size;
X-	char data[1024];
X-};
X-struct afp_comment {
X-	unsigned int maxsize;
X-	unsigned int size;
X-	char *data;
X-};
X-
X-struct afp_icon {
X-	unsigned int maxsize;
X-	unsigned int size;
X-	char *data;
X-};
X-
X-#define AFP_DEFAULT_ATTENTION_QUANTUM 1024
X-
X-void afp_unixpriv_to_stat(struct afp_file_info *fp,
X-	struct stat *stat);
X-
X-int init_uams(void) ;
X-
X-unsigned int find_uam_by_name(const char * name);
X-char * uam_bitmap_to_string(unsigned int bitmap);
X-
X-
X-char * get_uam_names_list(void);
X-
X-unsigned int default_uams_mask(void);
X-
X-struct afp_volume * find_volume_by_name(struct afp_server * server,
X-        const char * volname);
X-
X-struct afp_connection_request {
X-        unsigned int uam_mask;
X-	struct afp_url url;
X-};
X-
X-void afp_default_url(struct afp_url *url);
X-int afp_parse_url(struct afp_url * url, const char * toparse, int verbose);
X-void afp_print_url(struct afp_url * url);
X-int afp_url_validate(char * url_string, struct afp_url * valid_url);
X-
X-int afp_list_volnames(struct afp_server * server, char * names, int max);
X-
X-/* User mapping */
X-int afp_detect_mapping(struct afp_volume * volume);
X-
X-/* These are some functions that help with simple status text generation */
X-
X-int afp_status_header(char * text, int * len);
X-int afp_status_server(struct afp_server * s,char * text, int * len);
X-
X-
X-struct afp_server * afp_server_full_connect(void * priv, struct afp_connection_request * req);
X-
X-void * just_end_it_now(void *other);
X-void add_fd_and_signal(int fd);
X-void loop_disconnect(struct afp_server *s);
X-void afp_wait_for_started_loop(void);
X-
X-
X-struct afp_versions * pick_version(unsigned char *versions,
X-	unsigned char requested) ;
X-int pick_uam(unsigned int u1, unsigned int u2);
X-
X-int afp_server_login(struct afp_server *server,
X-        char * mesg, unsigned int *l, unsigned int max);
X-
X-
X-int afp_dologin(struct afp_server *server,
X-	unsigned int uam, char * username, char * passwd);
X-
X-void afp_free_server(struct afp_server **server);
X-
X-struct afp_server * afp_server_init(struct sockaddr_in * address);
X-int afp_get_address(void * priv, const char * hostname, unsigned int port,
X-	struct sockaddr_in * address);
X-
X-
X-int afp_main_loop(int command_fd);
X-int afp_main_quick_startup(pthread_t * thread);
X-
X-int afp_server_destroy(struct afp_server *s) ;
X-int afp_server_reconnect(struct afp_server * s, char * mesg,
X-        unsigned int *l, unsigned int max);
X-int afp_server_connect(struct afp_server *s, int full);
X-
X-struct afp_server * afp_server_complete_connection(
X-	void * priv,
X-	struct afp_server * server,
X-	struct sockaddr_in * address, unsigned char * versions,
X-	unsigned int uams, char * username, char * password,
X-	unsigned int requested_version, unsigned int uam_mask);
X-
X-int afp_connect_volume(struct afp_volume * volume, struct afp_server * server,
X-	char * mesg, unsigned int * l, unsigned int max);
X-int something_is_mounted(struct afp_server * server);
X-
X-int add_cache_entry(struct afp_file_info * file) ;
X-struct afp_file_info * get_cache_by_name(char * name);
X-struct afp_server * find_server_by_address(struct sockaddr_in * address);
X-struct afp_server * find_server_by_signature(char * signature);
X-struct afp_server * find_server_by_name(char * name);
X-int server_still_valid(struct afp_server * server);
X-
X-
X-struct afp_server * get_server_base(void);
X-int afp_server_remove(struct afp_server * server);
X-
X-int afp_unmount_volume(struct afp_volume * volume);
X-int afp_unmount_all_volumes(struct afp_server * server);
X-
X-#define volume_is_readonly(x) (((x)->attributes&kReadOnly) || \
X-	((x)->extra_flags & VOLUME_EXTRA_FLAGS_READONLY))
X-
X-int afp_opendt(struct afp_volume *volume, unsigned short * refnum);
X-
X-int afp_closedt(struct afp_server * server, unsigned short * refnum);
X-
X-int afp_getcomment(struct afp_volume *volume, unsigned int did,
X-        const char * pathname, struct afp_comment * comment);
X-
X-int afp_addcomment(struct afp_volume *volume, unsigned int did,
X-        const char * pathname, char * comment,uint64_t *size);
X-
X-int afp_geticon(struct afp_volume * volume, unsigned int filecreator,
X-        unsigned int filetype, unsigned char icontype, 
X-	unsigned short length, struct afp_icon * icon);
X-
X-/* Things you want to do to a server */
X-
X-int afp_getsrvrmsg(struct afp_server *server, unsigned short messagetype,unsigned char utf8, unsigned char block, char * mesg);
X-
X-int afp_login(struct afp_server *server, char * uaname,
X-        char * userauthinfo, unsigned int userauthinfo_len,
X-	struct afp_rx_buffer *rx);
X-
X-int afp_changepassword(struct afp_server *server, char * uaname,
X-        char * userauthinfo, unsigned int userauthinfo_len,
X-	struct afp_rx_buffer *rx);
X-
X-int afp_logincont(struct afp_server *server, unsigned short id,
X-        char * userauthinfo, unsigned int userauthinfo_len,
X-	struct afp_rx_buffer *rx);
X-
X-int afp_getsessiontoken(struct afp_server * server, int type,
X-        unsigned int timestamp, struct afp_token *outgoing_token,
X-        struct afp_token * incoming_token);
X-
X-int afp_getsrvrparms(struct afp_server *server);
X-
X-int afp_logout(struct afp_server *server,unsigned char wait);
X-
X-int afp_mapname(struct afp_server * server, unsigned char subfunction,
X-        char * name, unsigned int * id);
X-
X-int afp_mapid(struct afp_server * server, unsigned char subfunction,
X-	unsigned int id, char *name);
X-
X-int afp_getuserinfo(struct afp_server * server, int thisuser,
X-	unsigned int userid, unsigned short bitmap, 
X-	unsigned int *newuid, unsigned int *newgid);
X-
X-int afp_zzzzz(struct afp_server *server);
X-
X-int afp_volopen(struct afp_volume * volume, 
X-		unsigned short bitmap, char * password);
X-
X-int afp_flush(struct afp_volume * volume);
X-
X-int afp_getfiledirparms(struct afp_volume *volume, unsigned int did, 
X-	unsigned int filebitmap, unsigned int dirbitmap, const char * pathname,
X-	struct afp_file_info *fp);
X-
X-int afp_enumerate(struct afp_volume * volume, 
X-	unsigned int dirid, 
X-	unsigned int filebitmap, unsigned int dirbitmap, 
X-        unsigned short reqcount,
X-        unsigned short startindex,
X-        char * path,
X-	struct afp_file_info ** file_p);
X-
X-int afp_enumerateext2(struct afp_volume * volume, 
X-	unsigned int dirid, 
X-	unsigned int filebitmap, unsigned int dirbitmap, 
X-        unsigned short reqcount,
X-        unsigned long startindex,
X-        char * path,
X-	struct afp_file_info ** file_p);
X-
X-int afp_openfork(struct afp_volume * volume,
X-        unsigned char forktype,
X-        unsigned int dirid,
X-        unsigned short accessmode,
X-        char * filename, 
X-	struct afp_file_info *fp);
X-
X-int afp_read(struct afp_volume * volume, unsigned short forkid,
X-                uint32_t offset,
X-                uint32_t count, struct afp_rx_buffer * rx);
X-
X-int afp_readext(struct afp_volume * volume, unsigned short forkid,
X-                uint64_t offset,
X-                uint64_t count, struct afp_rx_buffer * rx);
X-
X-int afp_getvolparms(struct afp_volume * volume, unsigned short bitmap);
X-
X-
X-int afp_createdir(struct afp_volume * volume, unsigned int dirid, const char * pathname, unsigned int *did_p);
X-
X-int afp_delete(struct afp_volume * volume,
X-        unsigned int dirid, char * pathname);
X-
X-
X-int afp_createfile(struct afp_volume * volume, unsigned char flag,
X-        unsigned int did, char * pathname);
X-
X-int afp_write(struct afp_volume * volume, unsigned short forkid,
X-        uint32_t offset, uint32_t reqcount,
X-        char * data, uint32_t * written);
X-
X-int afp_writeext(struct afp_volume * volume, unsigned short forkid,
X-        uint64_t offset, uint64_t reqcount,
X-        char * data, uint64_t * written);
X-
X-int afp_flushfork(struct afp_volume * volume, unsigned short forkid);
X-
X-int afp_closefork(struct afp_volume * volume, unsigned short forkid);
X-int afp_setfileparms(struct afp_volume * volume,
X-        unsigned int dirid, const char * pathname, unsigned short bitmap,
X-        struct afp_file_info *fp);
X-int afp_setfiledirparms(struct afp_volume * volume, 
X-        unsigned int dirid, const char * pathname, unsigned short bitmap,
X-        struct afp_file_info *fp);
X-
X-int afp_setdirparms(struct afp_volume * volume,
X-        unsigned int dirid, const char * pathname, unsigned short bitmap,
X-        struct afp_file_info *fp);
X-
X-int afp_volclose(struct afp_volume * volume);
X-
X-
X-int afp_setforkparms(struct afp_volume *volume,
X-        unsigned short forkid, unsigned short bitmap, unsigned long len);
X-
X-int afp_byterangelock(struct afp_volume * volume,
X-        unsigned char flag,
X-        unsigned short forkid,
X-        uint32_t offset,
X-        uint32_t len, uint32_t *generated_offset);
X-
X-int afp_byterangelockext(struct afp_volume * volume,
X-        unsigned char flag,
X-        unsigned short forkid,
X-        uint64_t offset,
X-        uint64_t len, uint64_t *generated_offset);
X-
X-int afp_moveandrename(struct afp_volume *volume,
X-	unsigned int src_did,
X-	unsigned int dst_did,
X-	char * src_path, char * dst_path, char *new_name);
X-
X-int afp_rename(struct afp_volume * volume,
X-        unsigned int dirid,
X-        char * path_from, char * path_to);
X-
X-int afp_listextattr(struct afp_volume * volume,
X-        unsigned int dirid, unsigned short bitmap,
X-        char * pathname, struct afp_extattr_info * info);
X-
X-/* This is a currently undocumented command */
X-int afp_newcommand76(struct afp_volume * volume, unsigned int dlen, char * data);
X-
X-/* For debugging */
X-char * afp_get_command_name(char code);
X-
X-
X-#endif
Xdiff -Naur afpfs-ng-0.8.1.orig/include/afp_protocol.h afpfs-ng-0.8.1/include/afp_protocol.h
5b7edd06b22d93383f005efe20694b85
echo x - afpfs-ng/files/patch-include__afp_protocol.h
sed 's/^X//' >afpfs-ng/files/patch-include__afp_protocol.h << '0cb9456b10fa5502aca3bfefd49bf1de'
X--- include/afp_protocol.h.orig	2008-02-18 03:33:43.000000000 +0000
X+++ include/afp_protocol.h	2012-10-14 13:11:34.000000000 +0000
X@@ -1,361 +0,0 @@
X-
X-#ifndef _AFP_PROTOCOL_H_
X-#define _AFP_PROTOCOL_H_
X-
X-#include <sys/types.h>
X-#include <stddef.h>
X-#include <unistd.h>
X-#include <stdint.h>
X-
X-/* This file defines constants for the Apple File Protocol.
X-   All page references are from "Apple Filing Protocol Programming" version 3.2.
X-   except where noted.
X-*/
X-
X-#define AFP_SERVER_NAME_LEN 33
X-#define AFP_SERVER_NAME_UTF8_LEN 255
X-#define AFP_VOLUME_NAME_LEN 33
X-#define AFP_VOLUME_NAME_UTF8_LEN 33
X-#define AFP_SIGNATURE_LEN 16
X-#define AFP_MACHINETYPE_LEN 33
X-#define AFP_LOGINMESG_LEN 200
X-#define AFP_VOLPASS_LEN 8
X-#define AFP_HOSTNAME_LEN 255
X-/* This is actually just a guess, and only used for appletalk */
X-#define AFP_ZONE_LEN 255
X-
X-#define AFP_SERVER_ICON_LEN 256
X-
X-
X-#define AFP_MAX_USERNAME_LEN 127
X-#define AFP_MAX_PASSWORD_LEN 127
X-
X-
X-/* This is the maximum length of any UAM string */
X-#define AFP_UAM_LENGTH 24
X-
X-/* This is the maximum length of any path description */
X-#define AFP_MAX_PATH 768
X-
X-#define AFP_VOL_FLAT 1
X-#define AFP_VOL_FIXED 2
X-#define AFP_VOL_VARIABLE 3
X-
X-/* The root directory ID, p.26 */
X-
X-#define AFP_ROOT_DID 2
X-
X-/* Path type constants, p.249 */
X-
X-enum {
X-kFPShortName = 1,
X-kFPLongName = 2,
X-kFPUTF8Name = 3
X-};
X-
X-/* fork types */
X-
X-#define AFP_FORKTYPE_DATA 0x0
X-#define AFP_FORKTYPE_RESOURCE 0x80
X-
X-/* openfork access modes, from p.196 */
X-
X-#define AFP_OPENFORK_ALLOWREAD 1
X-#define AFP_OPENFORK_ALLOWWRITE 2
X-#define AFP_OPENFORK_DENYREAD 0x10
X-#define AFP_OPENFORK_DENYWRITE 0x20
X-
X-/* Message type for getsrvmesg, p. 169*/
X-
X-typedef enum {
X-  AFPMESG_LOGIN = 0,
X-  AFPMESG_SERVER = 1
X-} afpmessage_t;
X-
X-/* Message bitmap for getsrvrmsg */
X-
X-#define AFP_GETSRVRMSG_UTF8 0x2
X-#define AFP_GETSRVRMSG_GETMSG 0x1
X-
X-
X-/* Maximum Version length, p.17 */
X-#define AFP_MAX_VERSION_LENGTH 16
X-
X-/* Maximum length of a token, this is undocumented */
X-#define AFP_TOKEN_MAX_LEN 256
X-
X-/* The maximum size of a file for AFP 2 */
X-#define AFP_MAX_AFP2_FILESIZE (4294967296)
X-
X-/* Unix privs, p.240 */
X-
X-struct afp_unixprivs {
X-	uint32_t uid __attribute__((__packed__));
X-	uint32_t gid __attribute__((__packed__));
X-	uint32_t permissions __attribute__((__packed__));
X-	uint32_t ua_permissions __attribute__((__packed__));
X-
X-};
X-
X-
X-/* AFP Volume attributes bitmap, p.241 */
X-
X-enum {
X-    kReadOnly = 0x01,
X-    kHasVolumePassword = 0x02,
X-    kSupportsFileIDs = 0x04,
X-    kSupportsCatSearch = 0x08,
X-    kSupportsBlankAccessPrivs = 0x10,
X-    kSupportsUnixPrivs = 0x20,
X-    kSupportsUTF8Names = 0x40,
X-    kNoNetworkUserIDs = 0x80,
X-    kDefaultPrivsFromParent = 0x100,
X-    kNoExchangeFiles = 0x200,
X-    kSupportsExtAttrs = 0x400,
X-    kSupportsACLs=0x800
X-};
X-
X-/* AFP file creation constantes, p.250 */
X-enum {
X-kFPSoftCreate = 0,
X-kFPHardCreate = 0x80
X-};
X-
X-/* AFP Directory attributes, taken from the protocol guide p.236 */
X-
X-enum {
X-    kFPAttributeBit = 0x1,
X-    kFPParentDirIDBit = 0x2,
X-    kFPCreateDateBit = 0x4,
X-    kFPModDateBit = 0x8,
X-    kFPBackupDateBit = 0x10,
X-    kFPFinderInfoBit = 0x20,
X-    kFPLongNameBit = 0x40,
X-    kFPShortNameBit = 0x80,
X-    kFPNodeIDBit = 0x100,
X-    kFPOffspringCountBit = 0x0200,
X-    kFPOwnerIDBit = 0x0400,
X-    kFPGroupIDBit = 0x0800,
X-    kFPAccessRightsBit = 0x1000,
X-    kFPProDOSInfoBit = 0x2000, // AFP version 2.2 and earlier
X-    kFPUTF8NameBit = 0x2000, // AFP version 3.0 and later
X-    kFPUnixPrivsBit = 0x8000 // AFP version 3.0 and later
X-};
X-
X-/* AFP File bitmap, p.238.  These are the ones not in the AFP Directory
X-   attributes map. */
X-
X-enum {
X-	kFPDataForkLenBit = 0x0200,
X-	kFPRsrcForkLenBit = 0x0400,
X-	kFPExtDataForkLenBit = 0x0800, // AFP version 3.0 and later
X-	kFPLaunchLimitBit = 0x1000,
X-	kFPExtRsrcForkLenBit = 0x4000, // AFP version 3.0 and later
X-};
X-
X-/* AFP Extended Attributes Bitmap, p.238  */
X-
X-enum {
X-	kXAttrNoFollow = 0x1,
X-	kXAttrCreate = 0x2,
X-	kXAttrREplace=0x4
X-};
X-
X-
X-/* AFP function codes */
X-enum AFPFunction
X-{
X-        afpByteRangeLock = 1, afpCloseVol, afpCloseDir, afpCloseFork,
X-        afpCopyFile, afpCreateDir, afpCreateFile,
X-        afpDelete, afpEnumerate, afpFlush, afpFlushFork,
X-        afpGetForkParms = 14, afpGetSrvrInfo, afpGetSrvrParms,
X-        afpGetVolParms, afpLogin, afpLoginCont, afpLogout, afpMapID,
X-        afpMapName, afpMoveAndRename, afpOpenVol, afpOpenDir, afpOpenFork,
X-        afpRead, afpRename, afpSetDirParms, afpSetFileParms,
X-        afpSetForkParms, afpSetVolParms, afpWrite, afpGetFileDirParms,
X-	afpSetFileDirParms, afpChangePassword,
X-        afpGetUserInfo=37,afpGetSrvrMsg = 38,
X-	afpOpenDT=48,
X-	afpCloseDT=49,
X-	afpGetIcon=51, afpGetIconInfo=52,
X-	afpAddComment=56, afpRemoveComment=57, afpGetComment=58,
X-	afpByteRangeLockExt=59, afpReadExt, afpWriteExt,
X-	afpGetAuthMethods=62,
X-	afp_LoginExt=63,
X-	afpGetSessionToken=64,
X-	afpDisconnectOldSession=65,
X-	afpEnumerateExt=66,
X-	afpCatSearchExt = 67,
X-	afpEnumerateExt2 = 68, afpGetExtAttr, afpSetExtAttr, 
X-	afpRemoveExtAttr , afpListExtAttrs,
X-	afpZzzzz = 122,
X-	afpAddIcon=192,
X-};
X-
X-/* AFP Volume bitmap.  Take from 242 of the protocol guide. */
X-enum {
X-	kFPBadVolPre222Bitmap = 0xFe00,
X-	kFPBadVolBitmap = 0xF000,
X-	kFPVolAttributeBit = 0x1,
X-	kFPVolSignatureBit = 0x2,
X-	kFPVolCreateDateBit = 0x4,
X-	kFPVolModDateBit = 0x8,
X-	kFPVolBackupDateBit = 0x10,
X-	kFPVolIDBit = 0x20,
X-	kFPVolBytesFreeBit = 0x40,
X-	kFPVolBytesTotalBit = 0x80,
X-	kFPVolNameBit = 0x100,
X-	kFPVolExtBytesFreeBit = 0x200,
X-	kFPVolExtBytesTotalBit = 0x400,
X-	kFPVolBlockSizeBit = 0x800
X-};
X-
X-/* AFP Attention Codes -- 4 bits */
X-#define AFPATTN_SHUTDOWN     (1 << 15)            /* shutdown/disconnect */
X-#define AFPATTN_CRASH        (1 << 14)            /* server crashed */
X-#define AFPATTN_MESG         (1 << 13)            /* server has message */
X-#define AFPATTN_NORECONNECT  (1 << 12)            /* don't reconnect */
X-/* server notification */
X-#define AFPATTN_NOTIFY       (AFPATTN_MESG | AFPATTN_NORECONNECT) 
X-
X-/* extended bitmap -- 12 bits. volchanged is only useful w/ a server
X- * notification, and time is only useful for shutdown. */
X-#define AFPATTN_VOLCHANGED   (1 << 0)             /* volume has changed */
X-#define AFPATTN_TIME(x)      ((x) & 0xfff)        /* time in minutes */
X-
X-#define kFPNoErr 0
X-
X-/* AFP result codes, p252 */
X-#define kASPSessClosed -1072
X-#define kFPAccessDenied -5000
X-#define kFPAuthContinue -5001
X-#define kFPBadUAM -5002
X-#define kFPBadVersNum -5003
X-#define kFPBitmapErr -5004
X-#define kFPCantMove -5005
X-#define kFPDenyConflict -5006
X-#define kFPDirNotEmpty -5007
X-#define kFPDiskFull -5008
X-#define kFPEOFErr -5009
X-#define kFPFileBusy -5010
X-#define kFPFlatVol -5011
X-#define kFPItemNotFound -5012
X-#define kFPLockErr -5013
X-#define kFPMiscErr -5014
X-#define kFPNoMoreLocks -5015
X-#define kFPNoServer -5016
X-#define kFPObjectExists -5017
X-#define kFPObjectNotFound -5018
X-#define kFPParamErr -5019
X-#define kFPRangeNotLocked -5020
X-#define kFPRangeOverlap -5021
X-#define kFPSessClosed -5022
X-#define kFPUserNotAuth -5023
X-#define kFPCallNotSupported -5024
X-#define kFPObjectTypeErr -5025
X-#define kFPTooManyFilesOpen -5026
X-#define kFPServerGoingDown -5027
X-#define kFPCantRename -5028
X-#define kFPDirNotFound -5029
X-#define kFPIconTypeError -5030
X-#define kFPVolLocked -5031
X-#define kFPObjectLocked -5032
X-#define kFPContainsSharedErr -5033
X-#define kFPIDNotFound -5034
X-#define kFPIDExists -5035
X-#define kFPDiffVolErr  -5036
X-#define kFPCatalogChanged -5037
X-#define kFPSameObjectErr -5038
X-#define kFPBadIDErr -5039
X-#define kFPPwdSameErr -5040
X-#define kFPPwdTooShortErr -5041
X-#define kFPPwdExpiredErr -5042
X-#define kFPInsideSharedErr -5043
X-#define kFPInsideTrashErr -5044
X-#define kFPPwdNeedsChangeErr -5045
X-#define kFPPwdPolicyErr -5046
X-#define kFPDiskQuotaExceeded –5047 
X-
X-
X-
X-/* These flags determine to lock or unlock in ByteRangeLock(Ext) */
X-
X-enum {
X-ByteRangeLock_Lock = 0,
X-ByteRangeLock_Unlock = 1
X-};
X-
X-/* These flags are used in volopen and getsrvrparm replies, p.171 */
X-
X-#define HasConfigInfo 0x1
X-#define HasPassword 0x80
X-
X-/* These are the subfunction for kFPMapID, as per p.248 */
X-
X-enum {
X-kUserIDToName = 1,
X-kGroupIDToName = 2,
X-kUserIDToUTF8Name = 3,
X-kGroupIDToUTF8Name = 4,
X-kUserUUIDToUTF8Name = 5,
X-kGroupUUIDToUTF8Name = 6
X-};
X-
X-
X-/* These are the subfunction flags described in the FPMapName command, p.286.
X-   Note that this is different than what's described on p. 186. */
X-
X-enum {
X-kNameToUserID = 1,
X-kNameToGroupID = 2,
X-kUTF8NameToUserID = 3,
X-kUTF8NameToGroupID = 4,
X-kUTF8NameToUserUUID = 5,
X-kUTF8NameToGroupUUID = 6
X-};
X-
X-/* These are bits for FPGetUserInfo, p.173. */
X-#define kFPGetUserInfo_USER_ID 1
X-#define kFPGetUserInfo_PRI_GROUPID 2
X-
X-/* Flags for the replies of GetSrvrInfo and DSI GetStatus, p.240 */
X-
X-enum {
X-	kSupportsCopyfile = 0x01,
X-	kSupportsChgPwd = 0x02,
X-	kDontAllowSavePwd = 0x04,
X-	kSupportsSrvrMsg = 0x08,
X-	kSrvrSig = 0x10,
X-	kSupportsTCP = 0x20,
X-	kSupportsSrvrNotify = 0x40,
X-	kSupportsReconnect = 0x80,
X-	kSupportsDirServices = 0x100,
X-	kSupportsUTF8SrvrName = 0x200,
X-	kSupportsUUIDs = 0x400,
X-	kSupportsSuperClient = 0x8000
X-};
X-
X-
X-/* p.247 */
X-
X-enum {
X-	kLoginWithoutID = 0,
X-	kLoginWithID = 1,
X-	kReconnWithID = 2,
X-	kLoginWithTimeAndID = 3,
X-	kReconnWithTimeAndID = 4,
X-	kRecon1Login = 5,
X-	kRecon1ReconnectLogin = 6,
X-	kRecon1Refresh = 7, kGetKerberosSessionKey = 8
X-};
X-
X-
X-#define AFP_CHMOD_ALLOWED_BITS_22 \
X-	(S_IRUSR |S_IWUSR | S_IRGRP | S_IWGRP |S_IROTH | S_IWOTH | S_IFREG )
X-
X-
X-#endif
X-
X-
X-
X-
Xdiff -Naur afpfs-ng-0.8.1.orig/include/afpfs-ng/Makefile.am afpfs-ng-0.8.1/include/afpfs-ng/Makefile.am
0cb9456b10fa5502aca3bfefd49bf1de
echo x - afpfs-ng/files/patch-include__afpfs-ng__Makefile.am
sed 's/^X//' >afpfs-ng/files/patch-include__afpfs-ng__Makefile.am << '8a8303a92c23d4a5090a9f077d3b6122'
X--- include/afpfs-ng/Makefile.am.orig	1970-01-01 00:00:00.000000000 +0000
X+++ include/afpfs-ng/Makefile.am	2012-10-14 13:11:34.000000000 +0000
X@@ -0,0 +1,6 @@
X+## Process this file with automake to produce Makefile.in
X+
X+afpfsincludedir = $(includedir)/afpfs-ng
X+
X+afpfsinclude_HEADERS = afp.h afp_protocol.h libafpclient.h
X+nodist_afpfsinclude_HEADERS =  codepage.h dsi.h  map_def.h midlevel.h uams_def.h utils.h
Xdiff -Naur afpfs-ng-0.8.1.orig/include/afpfs-ng/afp.h afpfs-ng-0.8.1/include/afpfs-ng/afp.h
8a8303a92c23d4a5090a9f077d3b6122
echo x - afpfs-ng/files/patch-include__afpfs-ng__afp.h
sed 's/^X//' >afpfs-ng/files/patch-include__afpfs-ng__afp.h << 'e42ad8c25b168548ba2ed0f4a284dccd'
X--- include/afpfs-ng/afp.h.orig	1970-01-01 00:00:00.000000000 +0000
X+++ include/afpfs-ng/afp.h	2012-10-14 13:11:44.000000000 +0000
X@@ -0,0 +1,533 @@
X+
X+#ifndef _AFP_H_
X+#define _AFP_H_
X+
X+#include <arpa/inet.h>
X+#include <pthread.h>
X+#include <netdb.h>
X+#include <sys/statvfs.h>
X+#include <pwd.h>
X+#include <afpfs-ng/afp_protocol.h>
X+#include <afpfs-ng/libafpclient.h>
X+#include <sys/types.h>
X+#include <sys/stat.h>
X+#include <unistd.h>
X+#include <netinet/in.h>
X+
X+
X+#define AFPFS_VERSION "0.8.1"
X+
X+/* This is the maximum AFP version this library supports */
X+#define AFP_MAX_SUPPORTED_VERSION 32
X+
X+/* afp_url is used to pass locations around */
X+struct afp_url {
X+	enum {TCPIP,AT} protocol;
X+	char username[AFP_MAX_USERNAME_LEN];
X+	char uamname[50];
X+	char password[AFP_MAX_PASSWORD_LEN];
X+	char servername[AFP_SERVER_NAME_UTF8_LEN];
X+	int port;
X+	char volumename[AFP_VOLUME_NAME_UTF8_LEN];
X+	char path[AFP_MAX_PATH];
X+
X+	int requested_version;
X+	char zone[AFP_ZONE_LEN]; /* Only used for Appletalk */
X+	char volpassword[9];;
X+};
X+
X+struct afp_token {
X+	unsigned int length;
X+	char data[AFP_TOKEN_MAX_LEN];
X+};
X+
X+#define SERVER_MAX_VERSIONS 10
X+#define SERVER_MAX_UAMS 10
X+
X+struct afp_rx_buffer {
X+	unsigned int size;
X+	unsigned int maxsize;
X+	char * data;
X+	int errorcode;
X+};
X+
X+
X+struct afp_file_info {
X+	unsigned short attributes;
X+	unsigned int did;
X+	unsigned int creation_date;
X+	unsigned int modification_date;
X+	unsigned int backup_date;
X+	unsigned int fileid;
X+	unsigned short offspring;
X+	char sync;
X+	char finderinfo[32];
X+	char name[AFP_MAX_PATH];
X+	char basename[AFP_MAX_PATH];
X+	char translated_name[AFP_MAX_PATH];
X+	struct afp_unixprivs unixprivs;
X+	unsigned int accessrights;
X+	struct afp_file_info * next;
X+	struct afp_file_info * largelist_next;
X+	unsigned char isdir;
X+	unsigned long long size;
X+	unsigned short resourcesize;
X+	unsigned int resource;
X+	unsigned short forkid;
X+	struct afp_icon * icon;
X+	int eof;
X+};
X+
X+
X+#define VOLUME_EXTRA_FLAGS_VOL_CHMOD_KNOWN 0x1
X+#define VOLUME_EXTRA_FLAGS_VOL_CHMOD_BROKEN 0x2
X+#define VOLUME_EXTRA_FLAGS_SHOW_APPLEDOUBLE 0x4
X+#define VOLUME_EXTRA_FLAGS_VOL_SUPPORTS_UNIX 0x8
X+#define VOLUME_EXTRA_FLAGS_NO_LOCKING 0x10
X+#define VOLUME_EXTRA_FLAGS_IGNORE_UNIXPRIVS 0x20
X+#define VOLUME_EXTRA_FLAGS_READONLY 0x40
X+
X+#define AFP_VOLUME_UNMOUNTED 0
X+#define AFP_VOLUME_MOUNTED 1
X+#define AFP_VOLUME_UNMOUNTING 2
X+
X+struct afp_volume {
X+	unsigned short volid;
X+	char flags;  /* This is from afpGetSrvrParms */
X+	unsigned short attributes; /* This is from VolOpen */
X+	unsigned short signature;  /* This is fixed or variable */
X+	unsigned int creation_date;
X+	unsigned int modification_date;
X+	unsigned int backup_date;
X+	struct statvfs stat;
X+	unsigned char mounted;
X+	char mountpoint[255];
X+	struct afp_server * server;
X+	char volume_name[AFP_VOLUME_NAME_LEN];
X+	char volume_name_printable[AFP_VOLUME_NAME_UTF8_LEN];
X+	unsigned short dtrefnum;
X+	char volpassword[AFP_VOLPASS_LEN];
X+	unsigned int extra_flags; /* This is an afpfs-ng specific field */
X+
X+	/* Our directory ID cache */
X+	struct did_cache_entry * did_cache_base;
X+	pthread_mutex_t did_cache_mutex;
X+
X+	/* Our journal of open forks */
X+	struct afp_file_info * open_forks;
X+	pthread_mutex_t open_forks_mutex;
X+
X+	/* Used to trigger startup */
X+        pthread_cond_t  startup_condition_cond;
X+
X+	struct {
X+		uint64_t hits;
X+		uint64_t misses;
X+		uint64_t expired;
X+		uint64_t force_removed;
X+	} did_cache_stats;
X+
X+	void * priv;  /* This is a private structure for fuse/cmdline, etc */
X+	pthread_t thread; /* This is the per-volume thread */
X+
X+	int mapping;
X+
X+};
X+
X+#define SERVER_STATE_CONNECTED 1
X+#define SERVER_STATE_DISCONNECTED 2
X+
X+enum server_type{
X+	AFPFS_SERVER_TYPE_UNKNOWN,
X+	AFPFS_SERVER_TYPE_NETATALK,
X+	AFPFS_SERVER_TYPE_AIRPORT,
X+	AFPFS_SERVER_TYPE_MACINTOSH,
X+};
X+
X+#define is_netatalk(x) ( (x)->machine_type == AFPFS_SERVER_TYPE_NETATALK )
X+#define is_airport(x) ( (x)->machine_type == AFPFS_SERVER_TYPE_AIRPORT )
X+#define is_macintosh(x) ( (x)->machine_type == AFPFS_SERVER_TYPE_MACINTOSH )
X+
X+
X+
X+struct afp_versions {
X+        char        *av_name;
X+        int         av_number;
X+};
X+extern struct afp_versions afp_versions[];
X+
X+struct afp_server {
X+
X+	/* Our buffer sizes */
X+	unsigned int tx_quantum;
X+	unsigned int rx_quantum;
X+
X+	unsigned int tx_delay;
X+
X+	/* Connection information */
X+	struct sockaddr_in address;
X+	int fd;
X+
X+	/* Some stats, for information only */
X+	struct {
X+		uint64_t runt_packets;
X+		uint64_t incoming_dsi;
X+		uint64_t rx_bytes;
X+		uint64_t tx_bytes;
X+		uint64_t requests_pending;
X+	} stats;
X+
X+	/* General information */
X+	char server_name[AFP_SERVER_NAME_LEN];
X+	char server_name_utf8[AFP_SERVER_NAME_UTF8_LEN];
X+        char server_name_printable[AFP_SERVER_NAME_UTF8_LEN];
X+
X+	char machine_type[17];
X+	char icon[256];
X+	char signature[16];
X+	unsigned short flags;
X+	int connect_state;
X+	enum server_type server_type;
X+
X+	/* This is the time we connected */
X+	time_t connect_time;
X+
X+	/* UAMs */
X+	unsigned int supported_uams;
X+	unsigned int using_uam;
X+
X+	/* Authentication */
X+	char username[AFP_MAX_USERNAME_LEN];
X+	char password[AFP_MAX_PASSWORD_LEN];
X+
X+	/* Session */
X+	struct afp_token token;
X+	char need_resume;
X+
X+	/* Versions */
X+	unsigned char requested_version;
X+	unsigned char versions[SERVER_MAX_VERSIONS];
X+	struct afp_versions *using_version;
X+
X+	/* Volumes */
X+	unsigned char num_volumes;
X+	struct afp_volume * volumes;
X+
X+	void * dsi;
X+	unsigned int exit_flag;
X+
X+	/* Our DSI request queue */
X+	pthread_mutex_t requestid_mutex;
X+	pthread_mutex_t request_queue_mutex;
X+	unsigned short lastrequestid;
X+	unsigned short expectedrequestid;
X+	struct dsi_request * command_requests;
X+
X+
X+	char loginmesg[200];
X+	char servermesg[200];
X+	char path_encoding;
X+
X+	/* This is the data for the incoming buffer */
X+	char * incoming_buffer;
X+	int data_read;
X+	int bufsize;
X+
X+	/* And this is for the outgoing queue */
X+	pthread_mutex_t send_mutex;
X+
X+	/* This is for user mapping */
X+	struct passwd passwd;
X+	unsigned int server_uid, server_gid;
X+	int server_gid_valid;
X+
X+	struct afp_server *next;
X+
X+	/* These are for DSI attention packets */
X+	unsigned int attention_quantum;
X+	unsigned int attention_len;
X+	char * attention_buffer;
X+
X+};
X+
X+struct afp_extattr_info {
X+	unsigned int maxsize;
X+	unsigned int size;
X+	char data[1024];
X+};
X+struct afp_comment {
X+	unsigned int maxsize;
X+	unsigned int size;
X+	char *data;
X+};
X+
X+struct afp_icon {
X+	unsigned int maxsize;
X+	unsigned int size;
X+	char *data;
X+};
X+
X+#define AFP_DEFAULT_ATTENTION_QUANTUM 1024
X+
X+void afp_unixpriv_to_stat(struct afp_file_info *fp,
X+	struct stat *stat);
X+
X+int init_uams(void) ;
X+
X+unsigned int find_uam_by_name(const char * name);
X+char * uam_bitmap_to_string(unsigned int bitmap);
X+
X+
X+char * get_uam_names_list(void);
X+
X+unsigned int default_uams_mask(void);
X+
X+struct afp_volume * find_volume_by_name(struct afp_server * server,
X+        const char * volname);
X+
X+struct afp_connection_request {
X+        unsigned int uam_mask;
X+	struct afp_url url;
X+};
X+
X+void afp_default_url(struct afp_url *url);
X+int afp_parse_url(struct afp_url * url, const char * toparse, int verbose);
X+void afp_print_url(struct afp_url * url);
X+int afp_url_validate(char * url_string, struct afp_url * valid_url);
X+
X+int afp_list_volnames(struct afp_server * server, char * names, int max);
X+
X+/* User mapping */
X+int afp_detect_mapping(struct afp_volume * volume);
X+
X+/* These are some functions that help with simple status text generation */
X+
X+int afp_status_header(char * text, int * len);
X+int afp_status_server(struct afp_server * s,char * text, int * len);
X+
X+
X+struct afp_server * afp_server_full_connect(void * priv, struct afp_connection_request * req);
X+
X+void * just_end_it_now(void *other);
X+void add_fd_and_signal(int fd);
X+void loop_disconnect(struct afp_server *s);
X+void afp_wait_for_started_loop(void);
X+
X+
X+struct afp_versions * pick_version(unsigned char *versions,
X+	unsigned char requested) ;
X+int pick_uam(unsigned int u1, unsigned int u2);
X+
X+int afp_server_login(struct afp_server *server,
X+        char * mesg, unsigned int *l, unsigned int max);
X+
X+
X+int afp_dologin(struct afp_server *server,
X+	unsigned int uam, char * username, char * passwd);
X+
X+void afp_free_server(struct afp_server **server);
X+
X+struct afp_server * afp_server_init(struct sockaddr_in * address);
X+int afp_get_address(void * priv, const char * hostname, unsigned int port,
X+	struct sockaddr_in * address);
X+
X+
X+int afp_main_loop(int command_fd);
X+int afp_main_quick_startup(pthread_t * thread);
X+
X+int afp_server_destroy(struct afp_server *s) ;
X+int afp_server_reconnect(struct afp_server * s, char * mesg,
X+        unsigned int *l, unsigned int max);
X+int afp_server_connect(struct afp_server *s, int full);
X+
X+struct afp_server * afp_server_complete_connection(
X+	void * priv,
X+	struct afp_server * server,
X+	struct sockaddr_in * address, unsigned char * versions,
X+	unsigned int uams, char * username, char * password,
X+	unsigned int requested_version, unsigned int uam_mask);
X+
X+int afp_connect_volume(struct afp_volume * volume, struct afp_server * server,
X+	char * mesg, unsigned int * l, unsigned int max);
X+int something_is_mounted(struct afp_server * server);
X+
X+int add_cache_entry(struct afp_file_info * file) ;
X+struct afp_file_info * get_cache_by_name(char * name);
X+struct afp_server * find_server_by_address(struct sockaddr_in * address);
X+struct afp_server * find_server_by_signature(char * signature);
X+struct afp_server * find_server_by_name(char * name);
X+int server_still_valid(struct afp_server * server);
X+
X+
X+struct afp_server * get_server_base(void);
X+int afp_server_remove(struct afp_server * server);
X+
X+int afp_unmount_volume(struct afp_volume * volume);
X+int afp_unmount_all_volumes(struct afp_server * server);
X+
X+#define volume_is_readonly(x) (((x)->attributes&kReadOnly) || \
X+	((x)->extra_flags & VOLUME_EXTRA_FLAGS_READONLY))
X+
X+int afp_opendt(struct afp_volume *volume, unsigned short * refnum);
X+
X+int afp_closedt(struct afp_server * server, unsigned short refnum);
X+
X+int afp_getcomment(struct afp_volume *volume, unsigned int did,
X+        const char * pathname, struct afp_comment * comment);
X+
X+int afp_addcomment(struct afp_volume *volume, unsigned int did,
X+        const char * pathname, char * comment,uint64_t *size);
X+
X+int afp_geticon(struct afp_volume * volume, unsigned int filecreator,
X+        unsigned int filetype, unsigned char icontype, 
X+	unsigned short length, struct afp_icon * icon);
X+
X+/* Things you want to do to a server */
X+
X+int afp_getsrvrmsg(struct afp_server *server, unsigned short messagetype,unsigned char utf8, unsigned char block, char * mesg);
X+
X+int afp_login(struct afp_server *server, char * uaname,
X+        char * userauthinfo, unsigned int userauthinfo_len,
X+	struct afp_rx_buffer *rx);
X+
X+int afp_changepassword(struct afp_server *server, char * uaname,
X+        char * userauthinfo, unsigned int userauthinfo_len,
X+	struct afp_rx_buffer *rx);
X+
X+int afp_logincont(struct afp_server *server, unsigned short id,
X+        char * userauthinfo, unsigned int userauthinfo_len,
X+	struct afp_rx_buffer *rx);
X+
X+int afp_getsessiontoken(struct afp_server * server, int type,
X+        unsigned int timestamp, struct afp_token *outgoing_token,
X+        struct afp_token * incoming_token);
X+
X+int afp_getsrvrparms(struct afp_server *server);
X+
X+int afp_logout(struct afp_server *server,unsigned char wait);
X+
X+int afp_mapname(struct afp_server * server, unsigned char subfunction,
X+        char * name, unsigned int * id);
X+
X+int afp_mapid(struct afp_server * server, unsigned char subfunction,
X+	unsigned int id, char *name);
X+
X+int afp_getuserinfo(struct afp_server * server, int thisuser,
X+	unsigned int userid, unsigned short bitmap, 
X+	unsigned int *newuid, unsigned int *newgid);
X+
X+int afp_zzzzz(struct afp_server *server);
X+
X+int afp_volopen(struct afp_volume * volume, 
X+		unsigned short bitmap, char * password);
X+
X+int afp_flush(struct afp_volume * volume);
X+
X+int afp_getfiledirparms(struct afp_volume *volume, unsigned int did, 
X+	unsigned int filebitmap, unsigned int dirbitmap, const char * pathname,
X+	struct afp_file_info *fp);
X+
X+int afp_enumerate(struct afp_volume * volume, 
X+	unsigned int dirid, 
X+	unsigned int filebitmap, unsigned int dirbitmap, 
X+        unsigned short reqcount,
X+        unsigned short startindex,
X+        char * path,
X+	struct afp_file_info ** file_p);
X+
X+int afp_enumerateext2(struct afp_volume * volume, 
X+	unsigned int dirid, 
X+	unsigned int filebitmap, unsigned int dirbitmap, 
X+        unsigned short reqcount,
X+        unsigned long startindex,
X+        char * path,
X+	struct afp_file_info ** file_p);
X+
X+int afp_openfork(struct afp_volume * volume,
X+        unsigned char forktype,
X+        unsigned int dirid,
X+        unsigned short accessmode,
X+        char * filename, 
X+	struct afp_file_info *fp);
X+
X+int afp_read(struct afp_volume * volume, unsigned short forkid,
X+                uint32_t offset,
X+                uint32_t count, struct afp_rx_buffer * rx);
X+
X+int afp_readext(struct afp_volume * volume, unsigned short forkid,
X+                uint64_t offset,
X+                uint64_t count, struct afp_rx_buffer * rx);
X+
X+int afp_getvolparms(struct afp_volume * volume, unsigned short bitmap);
X+
X+
X+int afp_createdir(struct afp_volume * volume, unsigned int dirid, const char * pathname, unsigned int *did_p);
X+
X+int afp_delete(struct afp_volume * volume,
X+        unsigned int dirid, char * pathname);
X+
X+
X+int afp_createfile(struct afp_volume * volume, unsigned char flag,
X+        unsigned int did, char * pathname);
X+
X+int afp_write(struct afp_volume * volume, unsigned short forkid,
X+        uint32_t offset, uint32_t reqcount,
X+        char * data, uint32_t * written);
X+
X+int afp_writeext(struct afp_volume * volume, unsigned short forkid,
X+        uint64_t offset, uint64_t reqcount,
X+        char * data, uint64_t * written);
X+
X+int afp_flushfork(struct afp_volume * volume, unsigned short forkid);
X+
X+int afp_closefork(struct afp_volume * volume, unsigned short forkid);
X+int afp_setfileparms(struct afp_volume * volume,
X+        unsigned int dirid, const char * pathname, unsigned short bitmap,
X+        struct afp_file_info *fp);
X+int afp_setfiledirparms(struct afp_volume * volume, 
X+        unsigned int dirid, const char * pathname, unsigned short bitmap,
X+        struct afp_file_info *fp);
X+
X+int afp_setdirparms(struct afp_volume * volume,
X+        unsigned int dirid, const char * pathname, unsigned short bitmap,
X+        struct afp_file_info *fp);
X+
X+int afp_volclose(struct afp_volume * volume);
X+
X+
X+int afp_setforkparms(struct afp_volume *volume,
X+        unsigned short forkid, unsigned short bitmap, unsigned long len);
X+
X+int afp_byterangelock(struct afp_volume * volume,
X+        unsigned char flag,
X+        unsigned short forkid,
X+        uint32_t offset,
X+        uint32_t len, uint32_t *generated_offset);
X+
X+int afp_byterangelockext(struct afp_volume * volume,
X+        unsigned char flag,
X+        unsigned short forkid,
X+        uint64_t offset,
X+        uint64_t len, uint64_t *generated_offset);
X+
X+int afp_moveandrename(struct afp_volume *volume,
X+	unsigned int src_did,
X+	unsigned int dst_did,
X+	char * src_path, char * dst_path, char *new_name);
X+
X+int afp_rename(struct afp_volume * volume,
X+        unsigned int dirid,
X+        char * path_from, char * path_to);
X+
X+int afp_listextattr(struct afp_volume * volume,
X+        unsigned int dirid, unsigned short bitmap,
X+        char * pathname, struct afp_extattr_info * info);
X+
X+/* This is a currently undocumented command */
X+int afp_newcommand76(struct afp_volume * volume, unsigned int dlen, char * data);
X+
X+/* For debugging */
X+char * afp_get_command_name(char code);
X+
X+
X+#endif
Xdiff -Naur afpfs-ng-0.8.1.orig/include/afpfs-ng/afp_protocol.h afpfs-ng-0.8.1/include/afpfs-ng/afp_protocol.h
e42ad8c25b168548ba2ed0f4a284dccd
echo x - afpfs-ng/files/patch-include__afpfs-ng__afp_protocol.h
sed 's/^X//' >afpfs-ng/files/patch-include__afpfs-ng__afp_protocol.h << 'e813ca916112d8889691920c3088b8d9'
X--- include/afpfs-ng/afp_protocol.h.orig	1970-01-01 00:00:00.000000000 +0000
X+++ include/afpfs-ng/afp_protocol.h	2012-10-14 13:11:33.000000000 +0000
X@@ -0,0 +1,361 @@
X+
X+#ifndef _AFP_PROTOCOL_H_
X+#define _AFP_PROTOCOL_H_
X+
X+#include <sys/types.h>
X+#include <stddef.h>
X+#include <unistd.h>
X+#include <stdint.h>
X+
X+/* This file defines constants for the Apple File Protocol.
X+   All page references are from "Apple Filing Protocol Programming" version 3.2.
X+   except where noted.
X+*/
X+
X+#define AFP_SERVER_NAME_LEN 33
X+#define AFP_SERVER_NAME_UTF8_LEN 255
X+#define AFP_VOLUME_NAME_LEN 33
X+#define AFP_VOLUME_NAME_UTF8_LEN 33
X+#define AFP_SIGNATURE_LEN 16
X+#define AFP_MACHINETYPE_LEN 33
X+#define AFP_LOGINMESG_LEN 200
X+#define AFP_VOLPASS_LEN 8
X+#define AFP_HOSTNAME_LEN 255
X+/* This is actually just a guess, and only used for appletalk */
X+#define AFP_ZONE_LEN 255
X+
X+#define AFP_SERVER_ICON_LEN 256
X+
X+
X+#define AFP_MAX_USERNAME_LEN 127
X+#define AFP_MAX_PASSWORD_LEN 127
X+
X+
X+/* This is the maximum length of any UAM string */
X+#define AFP_UAM_LENGTH 24
X+
X+/* This is the maximum length of any path description */
X+#define AFP_MAX_PATH 768
X+
X+#define AFP_VOL_FLAT 1
X+#define AFP_VOL_FIXED 2
X+#define AFP_VOL_VARIABLE 3
X+
X+/* The root directory ID, p.26 */
X+
X+#define AFP_ROOT_DID 2
X+
X+/* Path type constants, p.249 */
X+
X+enum {
X+kFPShortName = 1,
X+kFPLongName = 2,
X+kFPUTF8Name = 3
X+};
X+
X+/* fork types */
X+
X+#define AFP_FORKTYPE_DATA 0x0
X+#define AFP_FORKTYPE_RESOURCE 0x80
X+
X+/* openfork access modes, from p.196 */
X+
X+#define AFP_OPENFORK_ALLOWREAD 1
X+#define AFP_OPENFORK_ALLOWWRITE 2
X+#define AFP_OPENFORK_DENYREAD 0x10
X+#define AFP_OPENFORK_DENYWRITE 0x20
X+
X+/* Message type for getsrvmesg, p. 169*/
X+
X+typedef enum {
X+  AFPMESG_LOGIN = 0,
X+  AFPMESG_SERVER = 1
X+} afpmessage_t;
X+
X+/* Message bitmap for getsrvrmsg */
X+
X+#define AFP_GETSRVRMSG_UTF8 0x2
X+#define AFP_GETSRVRMSG_GETMSG 0x1
X+
X+
X+/* Maximum Version length, p.17 */
X+#define AFP_MAX_VERSION_LENGTH 16
X+
X+/* Maximum length of a token, this is undocumented */
X+#define AFP_TOKEN_MAX_LEN 256
X+
X+/* The maximum size of a file for AFP 2 */
X+#define AFP_MAX_AFP2_FILESIZE (4294967296)
X+
X+/* Unix privs, p.240 */
X+
X+struct afp_unixprivs {
X+	uint32_t uid __attribute__((__packed__));
X+	uint32_t gid __attribute__((__packed__));
X+	uint32_t permissions __attribute__((__packed__));
X+	uint32_t ua_permissions __attribute__((__packed__));
X+
X+};
X+
X+
X+/* AFP Volume attributes bitmap, p.241 */
X+
X+enum {
X+    kReadOnly = 0x01,
X+    kHasVolumePassword = 0x02,
X+    kSupportsFileIDs = 0x04,
X+    kSupportsCatSearch = 0x08,
X+    kSupportsBlankAccessPrivs = 0x10,
X+    kSupportsUnixPrivs = 0x20,
X+    kSupportsUTF8Names = 0x40,
X+    kNoNetworkUserIDs = 0x80,
X+    kDefaultPrivsFromParent = 0x100,
X+    kNoExchangeFiles = 0x200,
X+    kSupportsExtAttrs = 0x400,
X+    kSupportsACLs=0x800
X+};
X+
X+/* AFP file creation constantes, p.250 */
X+enum {
X+kFPSoftCreate = 0,
X+kFPHardCreate = 0x80
X+};
X+
X+/* AFP Directory attributes, taken from the protocol guide p.236 */
X+
X+enum {
X+    kFPAttributeBit = 0x1,
X+    kFPParentDirIDBit = 0x2,
X+    kFPCreateDateBit = 0x4,
X+    kFPModDateBit = 0x8,
X+    kFPBackupDateBit = 0x10,
X+    kFPFinderInfoBit = 0x20,
X+    kFPLongNameBit = 0x40,
X+    kFPShortNameBit = 0x80,
X+    kFPNodeIDBit = 0x100,
X+    kFPOffspringCountBit = 0x0200,
X+    kFPOwnerIDBit = 0x0400,
X+    kFPGroupIDBit = 0x0800,
X+    kFPAccessRightsBit = 0x1000,
X+    kFPProDOSInfoBit = 0x2000, // AFP version 2.2 and earlier
X+    kFPUTF8NameBit = 0x2000, // AFP version 3.0 and later
X+    kFPUnixPrivsBit = 0x8000 // AFP version 3.0 and later
X+};
X+
X+/* AFP File bitmap, p.238.  These are the ones not in the AFP Directory
X+   attributes map. */
X+
X+enum {
X+	kFPDataForkLenBit = 0x0200,
X+	kFPRsrcForkLenBit = 0x0400,
X+	kFPExtDataForkLenBit = 0x0800, // AFP version 3.0 and later
X+	kFPLaunchLimitBit = 0x1000,
X+	kFPExtRsrcForkLenBit = 0x4000, // AFP version 3.0 and later
X+};
X+
X+/* AFP Extended Attributes Bitmap, p.238  */
X+
X+enum {
X+	kXAttrNoFollow = 0x1,
X+	kXAttrCreate = 0x2,
X+	kXAttrREplace=0x4
X+};
X+
X+
X+/* AFP function codes */
X+enum AFPFunction
X+{
X+        afpByteRangeLock = 1, afpCloseVol, afpCloseDir, afpCloseFork,
X+        afpCopyFile, afpCreateDir, afpCreateFile,
X+        afpDelete, afpEnumerate, afpFlush, afpFlushFork,
X+        afpGetForkParms = 14, afpGetSrvrInfo, afpGetSrvrParms,
X+        afpGetVolParms, afpLogin, afpLoginCont, afpLogout, afpMapID,
X+        afpMapName, afpMoveAndRename, afpOpenVol, afpOpenDir, afpOpenFork,
X+        afpRead, afpRename, afpSetDirParms, afpSetFileParms,
X+        afpSetForkParms, afpSetVolParms, afpWrite, afpGetFileDirParms,
X+	afpSetFileDirParms, afpChangePassword,
X+        afpGetUserInfo=37,afpGetSrvrMsg = 38,
X+	afpOpenDT=48,
X+	afpCloseDT=49,
X+	afpGetIcon=51, afpGetIconInfo=52,
X+	afpAddComment=56, afpRemoveComment=57, afpGetComment=58,
X+	afpByteRangeLockExt=59, afpReadExt, afpWriteExt,
X+	afpGetAuthMethods=62,
X+	afp_LoginExt=63,
X+	afpGetSessionToken=64,
X+	afpDisconnectOldSession=65,
X+	afpEnumerateExt=66,
X+	afpCatSearchExt = 67,
X+	afpEnumerateExt2 = 68, afpGetExtAttr, afpSetExtAttr, 
X+	afpRemoveExtAttr , afpListExtAttrs,
X+	afpZzzzz = 122,
X+	afpAddIcon=192,
X+};
X+
X+/* AFP Volume bitmap.  Take from 242 of the protocol guide. */
X+enum {
X+	kFPBadVolPre222Bitmap = 0xFe00,
X+	kFPBadVolBitmap = 0xF000,
X+	kFPVolAttributeBit = 0x1,
X+	kFPVolSignatureBit = 0x2,
X+	kFPVolCreateDateBit = 0x4,
X+	kFPVolModDateBit = 0x8,
X+	kFPVolBackupDateBit = 0x10,
X+	kFPVolIDBit = 0x20,
X+	kFPVolBytesFreeBit = 0x40,
X+	kFPVolBytesTotalBit = 0x80,
X+	kFPVolNameBit = 0x100,
X+	kFPVolExtBytesFreeBit = 0x200,
X+	kFPVolExtBytesTotalBit = 0x400,
X+	kFPVolBlockSizeBit = 0x800
X+};
X+
X+/* AFP Attention Codes -- 4 bits */
X+#define AFPATTN_SHUTDOWN     (1 << 15)            /* shutdown/disconnect */
X+#define AFPATTN_CRASH        (1 << 14)            /* server crashed */
X+#define AFPATTN_MESG         (1 << 13)            /* server has message */
X+#define AFPATTN_NORECONNECT  (1 << 12)            /* don't reconnect */
X+/* server notification */
X+#define AFPATTN_NOTIFY       (AFPATTN_MESG | AFPATTN_NORECONNECT) 
X+
X+/* extended bitmap -- 12 bits. volchanged is only useful w/ a server
X+ * notification, and time is only useful for shutdown. */
X+#define AFPATTN_VOLCHANGED   (1 << 0)             /* volume has changed */
X+#define AFPATTN_TIME(x)      ((x) & 0xfff)        /* time in minutes */
X+
X+#define kFPNoErr 0
X+
X+/* AFP result codes, p252 */
X+#define kASPSessClosed -1072
X+#define kFPAccessDenied -5000
X+#define kFPAuthContinue -5001
X+#define kFPBadUAM -5002
X+#define kFPBadVersNum -5003
X+#define kFPBitmapErr -5004
X+#define kFPCantMove -5005
X+#define kFPDenyConflict -5006
X+#define kFPDirNotEmpty -5007
X+#define kFPDiskFull -5008
X+#define kFPEOFErr -5009
X+#define kFPFileBusy -5010
X+#define kFPFlatVol -5011
X+#define kFPItemNotFound -5012
X+#define kFPLockErr -5013
X+#define kFPMiscErr -5014
X+#define kFPNoMoreLocks -5015
X+#define kFPNoServer -5016
X+#define kFPObjectExists -5017
X+#define kFPObjectNotFound -5018
X+#define kFPParamErr -5019
X+#define kFPRangeNotLocked -5020
X+#define kFPRangeOverlap -5021
X+#define kFPSessClosed -5022
X+#define kFPUserNotAuth -5023
X+#define kFPCallNotSupported -5024
X+#define kFPObjectTypeErr -5025
X+#define kFPTooManyFilesOpen -5026
X+#define kFPServerGoingDown -5027
X+#define kFPCantRename -5028
X+#define kFPDirNotFound -5029
X+#define kFPIconTypeError -5030
X+#define kFPVolLocked -5031
X+#define kFPObjectLocked -5032
X+#define kFPContainsSharedErr -5033
X+#define kFPIDNotFound -5034
X+#define kFPIDExists -5035
X+#define kFPDiffVolErr  -5036
X+#define kFPCatalogChanged -5037
X+#define kFPSameObjectErr -5038
X+#define kFPBadIDErr -5039
X+#define kFPPwdSameErr -5040
X+#define kFPPwdTooShortErr -5041
X+#define kFPPwdExpiredErr -5042
X+#define kFPInsideSharedErr -5043
X+#define kFPInsideTrashErr -5044
X+#define kFPPwdNeedsChangeErr -5045
X+#define kFPPwdPolicyErr -5046
X+#define kFPDiskQuotaExceeded –5047 
X+
X+
X+
X+/* These flags determine to lock or unlock in ByteRangeLock(Ext) */
X+
X+enum {
X+ByteRangeLock_Lock = 0,
X+ByteRangeLock_Unlock = 1
X+};
X+
X+/* These flags are used in volopen and getsrvrparm replies, p.171 */
X+
X+#define HasConfigInfo 0x1
X+#define HasPassword 0x80
X+
X+/* These are the subfunction for kFPMapID, as per p.248 */
X+
X+enum {
X+kUserIDToName = 1,
X+kGroupIDToName = 2,
X+kUserIDToUTF8Name = 3,
X+kGroupIDToUTF8Name = 4,
X+kUserUUIDToUTF8Name = 5,
X+kGroupUUIDToUTF8Name = 6
X+};
X+
X+
X+/* These are the subfunction flags described in the FPMapName command, p.286.
X+   Note that this is different than what's described on p. 186. */
X+
X+enum {
X+kNameToUserID = 1,
X+kNameToGroupID = 2,
X+kUTF8NameToUserID = 3,
X+kUTF8NameToGroupID = 4,
X+kUTF8NameToUserUUID = 5,
X+kUTF8NameToGroupUUID = 6
X+};
X+
X+/* These are bits for FPGetUserInfo, p.173. */
X+#define kFPGetUserInfo_USER_ID 1
X+#define kFPGetUserInfo_PRI_GROUPID 2
X+
X+/* Flags for the replies of GetSrvrInfo and DSI GetStatus, p.240 */
X+
X+enum {
X+	kSupportsCopyfile = 0x01,
X+	kSupportsChgPwd = 0x02,
X+	kDontAllowSavePwd = 0x04,
X+	kSupportsSrvrMsg = 0x08,
X+	kSrvrSig = 0x10,
X+	kSupportsTCP = 0x20,
X+	kSupportsSrvrNotify = 0x40,
X+	kSupportsReconnect = 0x80,
X+	kSupportsDirServices = 0x100,
X+	kSupportsUTF8SrvrName = 0x200,
X+	kSupportsUUIDs = 0x400,
X+	kSupportsSuperClient = 0x8000
X+};
X+
X+
X+/* p.247 */
X+
X+enum {
X+	kLoginWithoutID = 0,
X+	kLoginWithID = 1,
X+	kReconnWithID = 2,
X+	kLoginWithTimeAndID = 3,
X+	kReconnWithTimeAndID = 4,
X+	kRecon1Login = 5,
X+	kRecon1ReconnectLogin = 6,
X+	kRecon1Refresh = 7, kGetKerberosSessionKey = 8
X+};
X+
X+
X+#define AFP_CHMOD_ALLOWED_BITS_22 \
X+	(S_IRUSR |S_IWUSR | S_IRGRP | S_IWGRP |S_IROTH | S_IWOTH | S_IFREG )
X+
X+
X+#endif
X+
X+
X+
X+
Xdiff -Naur afpfs-ng-0.8.1.orig/include/afpfs-ng/codepage.h afpfs-ng-0.8.1/include/afpfs-ng/codepage.h
e813ca916112d8889691920c3088b8d9
echo x - afpfs-ng/files/patch-include__afpfs-ng__codepage.h
sed 's/^X//' >afpfs-ng/files/patch-include__afpfs-ng__codepage.h << '6638febf1b7a175fca960e308d9da04d'
X--- include/afpfs-ng/codepage.h.orig	1970-01-01 00:00:00.000000000 +0000
X+++ include/afpfs-ng/codepage.h	2012-10-14 13:11:33.000000000 +0000
X@@ -0,0 +1,11 @@
X+#ifndef __CODE_PAGE_H_
X+#define __CODE_PAGE_H_
X+int convert_utf8dec_to_utf8pre(const char *src, int src_len,
X+	char * dest, int dest_len);
X+int convert_utf8pre_to_utf8dec(const char * src, int src_len, 
X+	char * dest, int dest_len);
X+int convert_path_to_unix(char encoding, char * dest, 
X+	char * src, int dest_len);
X+int convert_path_to_afp(char encoding, char * dest, 
X+	char * src, int dest_len);
X+#endif
Xdiff -Naur afpfs-ng-0.8.1.orig/include/afpfs-ng/dsi.h afpfs-ng-0.8.1/include/afpfs-ng/dsi.h
6638febf1b7a175fca960e308d9da04d
echo x - afpfs-ng/files/patch-include__afpfs-ng__dsi.h
sed 's/^X//' >afpfs-ng/files/patch-include__afpfs-ng__dsi.h << '7dd404fe08dc108eaf9653af385b1f1a'
X--- include/afpfs-ng/dsi.h.orig	1970-01-01 00:00:00.000000000 +0000
X+++ include/afpfs-ng/dsi.h	2012-10-14 13:11:47.000000000 +0000
X@@ -0,0 +1,35 @@
X+
X+#ifndef __DSI_H_
X+#define __DSI_H_
X+
X+#include "afpfs-ng/afp.h"
X+
X+struct dsi_request
X+{
X+        unsigned short requestid;
X+        unsigned char subcommand;
X+        void * other;
X+        int wait;
X+        int done_waiting;
X+        pthread_cond_t  waiting_cond;
X+        pthread_mutex_t waiting_mutex;
X+        struct dsi_request * next;
X+        int return_code;
X+};
X+
X+int dsi_receive(struct afp_server * server, void * data, int size);
X+int dsi_getstatus(struct afp_server * server);
X+
X+int dsi_opensession(struct afp_server *server);
X+
X+int dsi_send(struct afp_server *server, char * msg, int size,int wait,unsigned char subcommand, void ** other);
X+struct dsi_session * dsi_create(struct afp_server *server);
X+int dsi_restart(struct afp_server *server);
X+int dsi_recv(struct afp_server * server);
X+
X+#define DSI_BLOCK_TIMEOUT -1
X+#define DSI_DONT_WAIT 0
X+#define DSI_DEFAULT_TIMEOUT 5
X+
X+
X+#endif
Xdiff -Naur afpfs-ng-0.8.1.orig/include/afpfs-ng/libafpclient.h afpfs-ng-0.8.1/include/afpfs-ng/libafpclient.h
7dd404fe08dc108eaf9653af385b1f1a
echo x - afpfs-ng/files/patch-include__afpfs-ng__libafpclient.h
sed 's/^X//' >afpfs-ng/files/patch-include__afpfs-ng__libafpclient.h << '6494a8cc98c13784329dac084857c66e'
X--- include/afpfs-ng/libafpclient.h.orig	1970-01-01 00:00:00.000000000 +0000
X+++ include/afpfs-ng/libafpclient.h	2012-10-14 13:11:34.000000000 +0000
X@@ -0,0 +1,50 @@
X+
X+#ifndef __CLIENT_H_
X+#define __CLIENT_H_
X+
X+#include <unistd.h>
X+#include <syslog.h>
X+
X+#define MAX_CLIENT_RESPONSE 2048
X+
X+
X+enum loglevels {
X+        AFPFSD,
X+};
X+
X+struct afp_server;
X+struct afp_volume;
X+
X+struct libafpclient {
X+        int (*unmount_volume) (struct afp_volume * volume);
X+	void (*log_for_client)(void * priv,
X+        	enum loglevels loglevel, int logtype, const char *message);
X+	void (*forced_ending_hook)(void);
X+	int (*scan_extra_fds)(int command_fd,fd_set *set, int * max_fd);
X+	void (*loop_started)(void);
X+} ;
X+
X+extern struct libafpclient * libafpclient;
X+
X+void libafpclient_register(struct libafpclient * tmpclient);
X+
X+
X+void signal_main_thread(void);
X+
X+/* These are logging functions */
X+
X+#define MAXLOGSIZE 2048
X+
X+#define LOG_METHOD_SYSLOG 1
X+#define LOG_METHOD_STDOUT 2
X+
X+void set_log_method(int m);
X+
X+
X+void log_for_client(void * priv,
X+        enum loglevels loglevel, int logtype, char * message,...);
X+
X+void stdout_log_for_client(void * priv,
X+	enum loglevels loglevel, int logtype, const char *message);
X+
X+#endif
Xdiff -Naur afpfs-ng-0.8.1.orig/include/afpfs-ng/map_def.h afpfs-ng-0.8.1/include/afpfs-ng/map_def.h
6494a8cc98c13784329dac084857c66e
echo x - afpfs-ng/files/patch-include__afpfs-ng__map_def.h
sed 's/^X//' >afpfs-ng/files/patch-include__afpfs-ng__map_def.h << 'a1e8b5daf8d3694917a69ca7e8d73e88'
X--- include/afpfs-ng/map_def.h.orig	1970-01-01 00:00:00.000000000 +0000
X+++ include/afpfs-ng/map_def.h	2012-10-14 13:11:34.000000000 +0000
X@@ -0,0 +1,15 @@
X+#ifndef __MAP_H_
X+#define __MAP_H_
X+
X+#include "afpfs-ng/afp.h"
X+
X+#define AFP_MAPPING_UNKNOWN 0
X+#define AFP_MAPPING_COMMON 1
X+#define AFP_MAPPING_LOGINIDS 2
X+#define AFP_MAPPING_NAME 3
X+
X+unsigned int map_string_to_num(char * name);
X+char * get_mapping_name(struct afp_volume * volume);
X+
X+
X+#endif
Xdiff -Naur afpfs-ng-0.8.1.orig/include/afpfs-ng/midlevel.h afpfs-ng-0.8.1/include/afpfs-ng/midlevel.h
a1e8b5daf8d3694917a69ca7e8d73e88
echo x - afpfs-ng/files/patch-include__afpfs-ng__midlevel.h
sed 's/^X//' >afpfs-ng/files/patch-include__afpfs-ng__midlevel.h << 'cdae91570d85624b1611a4f96caf3ee5'
X--- include/afpfs-ng/midlevel.h.orig	1970-01-01 00:00:00.000000000 +0000
X+++ include/afpfs-ng/midlevel.h	2012-10-14 13:11:34.000000000 +0000
X@@ -0,0 +1,64 @@
X+#ifndef __MIDLEVEL_H_
X+#define __MIDLEVEL_H_ 
X+
X+#include <utime.h>
X+#include "afpfs-ng/afp.h"
X+
X+int ml_open(struct afp_volume * volume, const char *path, int flags, 
X+        struct afp_file_info **newfp);
X+
X+int ml_creat(struct afp_volume * volume, const char *path,mode_t mode);
X+
X+int ml_readdir(struct afp_volume * volume, 
X+	const char *path, 
X+	struct afp_file_info **base);
X+
X+int ml_read(struct afp_volume * volume, const char *path,
X+	char *buf, size_t size, off_t offset,
X+	struct afp_file_info *fp, int * eof);
X+
X+int ml_chmod(struct afp_volume * vol, const char * path, mode_t mode);
X+
X+int ml_unlink(struct afp_volume * vol, const char *path);
X+
X+int ml_mkdir(struct afp_volume * vol, const char * path, mode_t mode);
X+
X+int ml_close(struct afp_volume * volume, const char * path,
X+        struct afp_file_info * fp);
X+
X+int ml_getattr(struct afp_volume * volume, const char *path, 
X+	struct stat *stbuf);
X+
X+int ml_write(struct afp_volume * volume, const char * path, 
X+	const char *data, size_t size, off_t offset,
X+	struct afp_file_info * fp, uid_t uid,
X+	gid_t gid);
X+
X+int ml_readlink(struct afp_volume * vol, const char * path,
X+        char *buf, size_t size);
X+
X+int ml_rmdir(struct afp_volume * vol, const char *path);
X+
X+int ml_chown(struct afp_volume * vol, const char * path,   
X+        uid_t uid, gid_t gid);
X+
X+int ml_truncate(struct afp_volume * vol, const char * path, off_t offset);
X+
X+int ml_utime(struct afp_volume * vol, const char * path,
X+	struct utimbuf * timebuf);
X+
X+int ml_symlink(struct afp_volume *vol, const char * path1, const char * path2);
X+
X+int ml_rename(struct afp_volume * vol,
X+	const char * path_from, const char * path_to);
X+
X+int ml_statfs(struct afp_volume * vol, const char *path, struct statvfs *stat);
X+
X+void afp_ml_filebase_free(struct afp_file_info **filebase);
X+
X+int ml_passwd(struct afp_server *server,
X+                char * username, char * oldpasswd, char * newpasswd);
X+
X+
X+
X+#endif
Xdiff -Naur afpfs-ng-0.8.1.orig/include/afpfs-ng/uams_def.h afpfs-ng-0.8.1/include/afpfs-ng/uams_def.h
cdae91570d85624b1611a4f96caf3ee5
echo x - afpfs-ng/files/patch-include__afpfs-ng__uams_def.h
sed 's/^X//' >afpfs-ng/files/patch-include__afpfs-ng__uams_def.h << '1a34082d72e814534528de3e4be7c359'
X--- include/afpfs-ng/uams_def.h.orig	1970-01-01 00:00:00.000000000 +0000
X+++ include/afpfs-ng/uams_def.h	2012-10-14 13:11:34.000000000 +0000
X@@ -0,0 +1,16 @@
X+#ifndef __UAM_DEFS_H_
X+#define __UAM_DEFS_H_
X+
X+#define UAM_NOUSERAUTHENT 0x1
X+#define UAM_CLEARTXTPASSWRD 0x2
X+#define UAM_RANDNUMEXCHANGE 0x4
X+#define UAM_2WAYRANDNUM 0x8
X+#define UAM_DHCAST128 0x10
X+#define UAM_CLIENTKRB 0x20
X+#define UAM_DHX2 0x40
X+#define UAM_RECON1 0x80
X+
X+int uam_string_to_bitmap(char * name);
X+char * uam_bitmap_to_string(unsigned int bitmap);
X+
X+#endif
Xdiff -Naur afpfs-ng-0.8.1.orig/include/afpfs-ng/utils.h afpfs-ng-0.8.1/include/afpfs-ng/utils.h
1a34082d72e814534528de3e4be7c359
echo x - afpfs-ng/files/patch-include__afpfs-ng__utils.h
sed 's/^X//' >afpfs-ng/files/patch-include__afpfs-ng__utils.h << '8068a35ff653767b7df4751e57bb7796'
X--- include/afpfs-ng/utils.h.orig	1970-01-01 00:00:00.000000000 +0000
X+++ include/afpfs-ng/utils.h	2012-10-14 13:11:44.000000000 +0000
X@@ -0,0 +1,43 @@
X+#ifndef __UTILS_H_
X+#define __UTILS_H_
X+#include <stdio.h>
X+
X+#include "afpfs-ng/afp.h"
X+
X+#if BYTE_ORDER == BIG_ENDIAN
X+#define hton64(x)       (x)
X+#define ntoh64(x)       (x)
X+#else /* BYTE_ORDER == BIG_ENDIAN */
X+#define hton64(x)       ((u_int64_t) (htonl((((unsigned long long)(x)) >> 32) & 0xffffffffLL)) | \
X+                         (u_int64_t) ((htonl((unsigned long long)(x)) & 0xffffffffLL) << 32))
X+#define ntoh64(x)       (hton64(x))
X+#endif /* BYTE_ORDER == BIG_ENDIAN */
X+
X+#define min(a,b) (((a)<(b)) ? (a) : (b))
X+#define max(a,b) (((a)>(b)) ? (a) : (b))
X+
X+
X+
X+unsigned char unixpath_to_afppath(
X+        struct afp_server * server,
X+        char * buf);
X+
X+unsigned char sizeof_path_header(struct afp_server * server);
X+
X+
X+
X+unsigned char copy_from_pascal(char *dest, char *pascal,unsigned int max_len) ;
X+unsigned short copy_from_pascal_two(char *dest, char *pascal,unsigned int max_len);
X+
X+unsigned char copy_to_pascal(char *dest, const char *src);
X+unsigned short copy_to_pascal_two(char *dest, const char *src);
X+
X+void copy_path(struct afp_server * server, char * dest, const char * pathname, unsigned char len);
X+
X+
X+char * create_path(struct afp_server * server, char * pathname, unsigned short * len);
X+
X+
X+int invalid_filename(struct afp_server * server, const char * filename);
X+
X+#endif
Xdiff -Naur afpfs-ng-0.8.1.orig/include/codepage.h afpfs-ng-0.8.1/include/codepage.h
8068a35ff653767b7df4751e57bb7796
echo x - afpfs-ng/files/patch-include__codepage.h
sed 's/^X//' >afpfs-ng/files/patch-include__codepage.h << '1cebb324e38cb2a19ffe30d40ff8e493'
X--- include/codepage.h.orig	2007-09-23 14:21:30.000000000 +0000
X+++ include/codepage.h	2012-10-14 13:11:34.000000000 +0000
X@@ -1,11 +0,0 @@
X-#ifndef __CODE_PAGE_H_
X-#define __CODE_PAGE_H_
X-int convert_utf8dec_to_utf8pre(const char *src, int src_len,
X-	char * dest, int dest_len);
X-int convert_utf8pre_to_utf8dec(const char * src, int src_len, 
X-	char * dest, int dest_len);
X-int convert_path_to_unix(char encoding, char * dest, 
X-	char * src, int dest_len);
X-int convert_path_to_afp(char encoding, char * dest, 
X-	char * src, int dest_len);
X-#endif
Xdiff -Naur afpfs-ng-0.8.1.orig/include/dsi.h afpfs-ng-0.8.1/include/dsi.h
1cebb324e38cb2a19ffe30d40ff8e493
echo x - afpfs-ng/files/patch-include__dsi.h
sed 's/^X//' >afpfs-ng/files/patch-include__dsi.h << 'ed0771241ebe5643e9ef549d7e6a35a0'
X--- include/dsi.h.orig	2008-02-18 03:33:24.000000000 +0000
X+++ include/dsi.h	2012-10-14 13:11:34.000000000 +0000
X@@ -1,33 +0,0 @@
X-
X-#ifndef __DSI_H_
X-#define __DSI_H_
X-
X-#include "afp.h"
X-
X-struct dsi_request
X-{
X-	unsigned short requestid;
X-	unsigned char subcommand;
X-	void * other;
X-	unsigned char wait;
X-	pthread_cond_t  condition_cond;
X-	struct dsi_request * next;
X-	int return_code;
X-};
X-
X-int dsi_receive(struct afp_server * server, void * data, int size);
X-int dsi_getstatus(struct afp_server * server);
X-
X-int dsi_opensession(struct afp_server *server);
X-
X-int dsi_send(struct afp_server *server, char * msg, int size,int wait,unsigned char subcommand, void ** other);
X-struct dsi_session * dsi_create(struct afp_server *server);
X-int dsi_restart(struct afp_server *server);
X-int dsi_recv(struct afp_server * server);
X-
X-#define DSI_BLOCK_TIMEOUT -1
X-#define DSI_DONT_WAIT 0
X-#define DSI_DEFAULT_TIMEOUT 5
X-
X-
X-#endif
Xdiff -Naur afpfs-ng-0.8.1.orig/include/libafpclient.h afpfs-ng-0.8.1/include/libafpclient.h
ed0771241ebe5643e9ef549d7e6a35a0
echo x - afpfs-ng/files/patch-include__libafpclient.h
sed 's/^X//' >afpfs-ng/files/patch-include__libafpclient.h << '2de9c5d0a27d675df4723e3467312fca'
X--- include/libafpclient.h.orig	2008-01-30 04:37:59.000000000 +0000
X+++ include/libafpclient.h	2012-10-14 13:11:34.000000000 +0000
X@@ -1,50 +0,0 @@
X-
X-#ifndef __CLIENT_H_
X-#define __CLIENT_H_
X-
X-#include <unistd.h>
X-#include <syslog.h>
X-
X-#define MAX_CLIENT_RESPONSE 2048
X-
X-
X-enum loglevels {
X-        AFPFSD,
X-};
X-
X-struct afp_server;
X-struct afp_volume;
X-
X-struct libafpclient {
X-        int (*unmount_volume) (struct afp_volume * volume);
X-	void (*log_for_client)(void * priv,
X-        	enum loglevels loglevel, int logtype, const char *message);
X-	void (*forced_ending_hook)(void);
X-	int (*scan_extra_fds)(int command_fd,fd_set *set, int * max_fd);
X-	void (*loop_started)(void);
X-} ;
X-
X-extern struct libafpclient * libafpclient;
X-
X-void libafpclient_register(struct libafpclient * tmpclient);
X-
X-
X-void signal_main_thread(void);
X-
X-/* These are logging functions */
X-
X-#define MAXLOGSIZE 2048
X-
X-#define LOG_METHOD_SYSLOG 1
X-#define LOG_METHOD_STDOUT 2
X-
X-void set_log_method(int m);
X-
X-
X-void log_for_client(void * priv,
X-        enum loglevels loglevel, int logtype, char * message,...);
X-
X-void stdout_log_for_client(void * priv,
X-	enum loglevels loglevel, int logtype, const char *message);
X-
X-#endif
Xdiff -Naur afpfs-ng-0.8.1.orig/include/map_def.h afpfs-ng-0.8.1/include/map_def.h
2de9c5d0a27d675df4723e3467312fca
echo x - afpfs-ng/files/patch-include__map_def.h
sed 's/^X//' >afpfs-ng/files/patch-include__map_def.h << '123ffbad37cc06bd019989f007d75297'
X--- include/map_def.h.orig	2008-01-17 04:55:46.000000000 +0000
X+++ include/map_def.h	2012-10-14 13:11:34.000000000 +0000
X@@ -1,15 +0,0 @@
X-#ifndef __MAP_H_
X-#define __MAP_H_
X-
X-#include "afp.h"
X-
X-#define AFP_MAPPING_UNKNOWN 0
X-#define AFP_MAPPING_COMMON 1
X-#define AFP_MAPPING_LOGINIDS 2
X-#define AFP_MAPPING_NAME 3
X-
X-unsigned int map_string_to_num(char * name);
X-char * get_mapping_name(struct afp_volume * volume);
X-
X-
X-#endif
Xdiff -Naur afpfs-ng-0.8.1.orig/include/midlevel.h afpfs-ng-0.8.1/include/midlevel.h
123ffbad37cc06bd019989f007d75297
echo x - afpfs-ng/files/patch-include__midlevel.h
sed 's/^X//' >afpfs-ng/files/patch-include__midlevel.h << '0408b120b2400c84ddb36bc0101a760e'
X--- include/midlevel.h.orig	2007-12-24 19:39:25.000000000 +0000
X+++ include/midlevel.h	2012-10-14 13:11:34.000000000 +0000
X@@ -1,64 +0,0 @@
X-#ifndef __MIDLEVEL_H_
X-#define __MIDLEVEL_H_ 
X-
X-#include <utime.h>
X-#include "afp.h"
X-
X-int ml_open(struct afp_volume * volume, const char *path, int flags, 
X-        struct afp_file_info **newfp);
X-
X-int ml_creat(struct afp_volume * volume, const char *path,mode_t mode);
X-
X-int ml_readdir(struct afp_volume * volume, 
X-	const char *path, 
X-	struct afp_file_info **base);
X-
X-int ml_read(struct afp_volume * volume, const char *path,
X-	char *buf, size_t size, off_t offset,
X-	struct afp_file_info *fp, int * eof);
X-
X-int ml_chmod(struct afp_volume * vol, const char * path, mode_t mode);
X-
X-int ml_unlink(struct afp_volume * vol, const char *path);
X-
X-int ml_mkdir(struct afp_volume * vol, const char * path, mode_t mode);
X-
X-int ml_close(struct afp_volume * volume, const char * path,
X-        struct afp_file_info * fp);
X-
X-int ml_getattr(struct afp_volume * volume, const char *path, 
X-	struct stat *stbuf);
X-
X-int ml_write(struct afp_volume * volume, const char * path, 
X-	const char *data, size_t size, off_t offset,
X-	struct afp_file_info * fp, uid_t uid,
X-	gid_t gid);
X-
X-int ml_readlink(struct afp_volume * vol, const char * path,
X-        char *buf, size_t size);
X-
X-int ml_rmdir(struct afp_volume * vol, const char *path);
X-
X-int ml_chown(struct afp_volume * vol, const char * path,   
X-        uid_t uid, gid_t gid);
X-
X-int ml_truncate(struct afp_volume * vol, const char * path, off_t offset);
X-
X-int ml_utime(struct afp_volume * vol, const char * path,
X-	struct utimbuf * timebuf);
X-
X-int ml_symlink(struct afp_volume *vol, const char * path1, const char * path2);
X-
X-int ml_rename(struct afp_volume * vol,
X-	const char * path_from, const char * path_to);
X-
X-int ml_statfs(struct afp_volume * vol, const char *path, struct statvfs *stat);
X-
X-void afp_ml_filebase_free(struct afp_file_info **filebase);
X-
X-int ml_passwd(struct afp_server *server,
X-                char * username, char * oldpasswd, char * newpasswd);
X-
X-
X-
X-#endif
Xdiff -Naur afpfs-ng-0.8.1.orig/include/uams_def.h afpfs-ng-0.8.1/include/uams_def.h
0408b120b2400c84ddb36bc0101a760e
echo x - afpfs-ng/files/patch-include__uams_def.h
sed 's/^X//' >afpfs-ng/files/patch-include__uams_def.h << '341b7cab72cfa0b1491635bb4d9da6b3'
X--- include/uams_def.h.orig	2007-09-07 13:10:51.000000000 +0000
X+++ include/uams_def.h	2012-10-14 13:11:34.000000000 +0000
X@@ -1,16 +0,0 @@
X-#ifndef __UAM_DEFS_H_
X-#define __UAM_DEFS_H_
X-
X-#define UAM_NOUSERAUTHENT 0x1
X-#define UAM_CLEARTXTPASSWRD 0x2
X-#define UAM_RANDNUMEXCHANGE 0x4
X-#define UAM_2WAYRANDNUM 0x8
X-#define UAM_DHCAST128 0x10
X-#define UAM_CLIENTKRB 0x20
X-#define UAM_DHX2 0x40
X-#define UAM_RECON1 0x80
X-
X-int uam_string_to_bitmap(char * name);
X-char * uam_bitmap_to_string(unsigned int bitmap);
X-
X-#endif
Xdiff -Naur afpfs-ng-0.8.1.orig/include/utils.h afpfs-ng-0.8.1/include/utils.h
341b7cab72cfa0b1491635bb4d9da6b3
echo x - afpfs-ng/files/patch-include__utils.h
sed 's/^X//' >afpfs-ng/files/patch-include__utils.h << 'b182bde23be20d0a04717deb1c635ff8'
X--- include/utils.h.orig	2008-02-18 03:33:58.000000000 +0000
X+++ include/utils.h	2012-10-14 13:11:34.000000000 +0000
X@@ -1,43 +0,0 @@
X-#ifndef __UTILS_H_
X-#define __UTILS_H_
X-#include <stdio.h>
X-
X-#include "afp.h"
X-
X-#if BYTE_ORDER == BIG_ENDIAN
X-#define hton64(x)       (x)
X-#define ntoh64(x)       (x)
X-#else /* BYTE_ORDER == BIG_ENDIAN */
X-#define hton64(x)       ((u_int64_t) (htonl(((x) >> 32) & 0xffffffffLL)) | \
X-                         (u_int64_t) ((htonl(x) & 0xffffffffLL) << 32))
X-#define ntoh64(x)       (hton64(x))
X-#endif /* BYTE_ORDER == BIG_ENDIAN */
X-
X-#define min(a,b) (((a)<(b)) ? (a) : (b))
X-#define max(a,b) (((a)>(b)) ? (a) : (b))
X-
X-
X-
X-unsigned char unixpath_to_afppath(
X-        struct afp_server * server,
X-        char * buf);
X-
X-unsigned char sizeof_path_header(struct afp_server * server);
X-
X-
X-
X-unsigned char copy_from_pascal(char *dest, char *pascal,unsigned int max_len) ;
X-unsigned short copy_from_pascal_two(char *dest, char *pascal,unsigned int max_len);
X-
X-unsigned char copy_to_pascal(char *dest, const char *src);
X-unsigned short copy_to_pascal_two(char *dest, const char *src);
X-
X-void copy_path(struct afp_server * server, char * dest, const char * pathname, unsigned char len);
X-
X-
X-char * create_path(struct afp_server * server, char * pathname, unsigned short * len);
X-
X-
X-int invalid_filename(struct afp_server * server, const char * filename);
X-
X-#endif
Xdiff -Naur afpfs-ng-0.8.1.orig/lib/Makefile.am afpfs-ng-0.8.1/lib/Makefile.am
b182bde23be20d0a04717deb1c635ff8
echo x - afpfs-ng/files/patch-lib__Makefile.am
sed 's/^X//' >afpfs-ng/files/patch-lib__Makefile.am << '12d337743d02c0c258e442d0a4bc94f4'
X--- lib/Makefile.am.orig	2008-02-18 03:34:32.000000000 +0000
X+++ lib/Makefile.am	2012-10-14 13:13:01.000000000 +0000
X@@ -4,7 +4,7 @@
X 
X lib_LTLIBRARIES = libafpclient.la
X 
X-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
X+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
X 
X # libafpclient_la_LDFLAGS = -module -avoid-version
X 
Xdiff -Naur afpfs-ng-0.8.1.orig/lib/afp.c afpfs-ng-0.8.1/lib/afp.c
12d337743d02c0c258e442d0a4bc94f4
echo x - afpfs-ng/files/patch-lib__afp.c
sed 's/^X//' >afpfs-ng/files/patch-lib__afp.c << '89b74bc4f841753ef5f116621e33b01c'
X--- lib/afp.c.orig	2008-03-08 02:44:16.000000000 +0000
X+++ lib/afp.c	2012-10-14 13:13:06.000000000 +0000
X@@ -9,7 +9,7 @@
X 
X 
X 
X-#include "afp.h"
X+#include "afpfs-ng/afp.h"
X #include <config.h>
X 
X #include <stdio.h>
X@@ -19,19 +19,18 @@
X #include <sys/time.h>
X #include <sys/types.h>
X #include <sys/socket.h>
X-#include <errno.h>
X 
X-#include "afp_protocol.h"
X-#include "libafpclient.h"
X+#include "afpfs-ng/afp_protocol.h"
X+#include "afpfs-ng/libafpclient.h"
X #include "server.h"
X-#include "dsi.h"
X+#include "afpfs-ng/dsi.h"
X #include "dsi_protocol.h"
X-#include "utils.h"
X+#include "afpfs-ng/utils.h"
X #include "afp_replies.h"
X #include "afp_internal.h"
X #include "did.h"
X #include "forklist.h"
X-#include "codepage.h"
X+#include "afpfs-ng/codepage.h"
X 
X struct afp_versions      afp_versions[] = {
X             { "AFPVersion 1.1", 11 },
X@@ -68,7 +67,7 @@
X 	afp_getsessiontoken_reply,afp_blank_reply, NULL, NULL,
X 	afp_enumerateext2_reply, NULL, NULL, NULL,    /*64 - 71 */
X 	afp_listextattrs_reply, NULL, NULL, NULL,
X-	afp_blank_reply, NULL, NULL, NULL,                       /*72 - 79 */
X+	afp_blank_reply, NULL, afp_blank_reply, afp_blank_reply,                       /*72 - 79 */
X 
X 	NULL, NULL, NULL, NULL,
X 	NULL, NULL, NULL, NULL,
X@@ -320,8 +319,16 @@
X 	
X 	struct dsi_request * p;
X 	struct afp_server *s2;
X+
X+
X+	if (s==NULL) 
X+		goto out;
X+
X 	for (p=s->command_requests;p;p=p->next) {
X-		pthread_cond_signal(&p->condition_cond);
X+		pthread_mutex_lock(&p->waiting_mutex);
X+		p->done_waiting=1;
X+		pthread_cond_signal(&p->waiting_cond);
X+		pthread_mutex_unlock(&p->waiting_mutex);
X 	}
X 
X 	if (s==server_base) {
X@@ -354,7 +361,7 @@
X 	s->exit_flag = 0;
X 	s->path_encoding=kFPUTF8Name;  /* This is a default */
X 	s->next=NULL;
X-	s->bufsize=2048;
X+	s->bufsize=4096;
X 	s->incoming_buffer=malloc(s->bufsize);
X 
X 	s->attention_quantum=AFP_DEFAULT_ATTENTION_QUANTUM;
X@@ -524,13 +531,14 @@
X 			kFPVolCreateDateBit|kFPVolIDBit |
X 			kFPVolNameBit;
X 	char new_encoding;
X+     	int ret;
X 
X 	if (server->using_version->av_number>=30) 
X 		bitmap|= kFPVolNameBit|kFPVolBlockSizeBit;
X 
X-	switch (afp_volopen(volume,bitmap,
X-		(strlen(volume->volpassword)>0) ? volume->volpassword : NULL)) 
X-	{
X+	ret = afp_volopen(volume,bitmap,
X+		(strlen(volume->volpassword)>0) ? volume->volpassword : NULL);
X+	switch(ret){
X 	case kFPAccessDenied:
X 		*l+=snprintf(mesg,max-*l,
X 			"Incorrect volume password\n");
X@@ -544,6 +552,10 @@
X 		*l+=snprintf(mesg,max-*l,
X 			"Could not open volume\n");
X 		goto error;
X+	case ETIMEDOUT:
X+		*l+=snprintf(mesg,max-*l,
X+			"Timed out waiting to open volume\n");
X+		goto error;
X 	}
X 
X 	/* It is said that if a volume's encoding will be the same 
X@@ -641,7 +653,6 @@
X 	add_server(server);
X 
X 	add_fd_and_signal(server->fd);
X-
X 	if (!full) {
X 		return 0;
X 	}
X@@ -649,10 +660,13 @@
X 	/* Get the status, and calculate the transmit time.  We use this to
X 	* calculate our rx quantum. */
X 	gettimeofday(&t1,NULL);
X+
X 	if ((error=dsi_getstatus(server))!=0) 
X 		goto error;
X 	gettimeofday(&t2,NULL);
X 
X+        afp_server_identify(server);
X+
X 	if ((t2.tv_sec - t1.tv_sec) > 0)
X 		server->tx_delay= (t2.tv_sec - t1.tv_sec) * 1000;
X 	else
Xdiff -Naur afpfs-ng-0.8.1.orig/lib/afp_internal.h afpfs-ng-0.8.1/lib/afp_internal.h
89b74bc4f841753ef5f116621e33b01c
echo x - afpfs-ng/files/patch-lib__afp_internal.h
sed 's/^X//' >afpfs-ng/files/patch-lib__afp_internal.h << 'f7f9981da79ed3c264fc8ed402a4f3db'
X--- lib/afp_internal.h.orig	2007-11-09 04:27:20.000000000 +0000
X+++ lib/afp_internal.h	2012-10-14 13:11:34.000000000 +0000
X@@ -1,7 +1,7 @@
X #ifndef _AFP_INTERNAL_H_
X #define _AFP_INTERNAL_H_
X 
X-#include "afp.h"
X+#include "afpfs-ng/afp.h"
X 
X extern struct afp_versions afp_versions[];
X 
Xdiff -Naur afpfs-ng-0.8.1.orig/lib/afp_url.c afpfs-ng-0.8.1/lib/afp_url.c
f7f9981da79ed3c264fc8ed402a4f3db
echo x - afpfs-ng/files/patch-lib__afp_url.c
sed 's/^X//' >afpfs-ng/files/patch-lib__afp_url.c << '8d34ed31098b3e9b839f61e6a9ea6cc3'
X--- lib/afp_url.c.orig	2008-03-04 20:16:49.000000000 +0000
X+++ lib/afp_url.c	2012-10-14 13:13:06.000000000 +0000
X@@ -3,7 +3,7 @@
X #include <stdio.h>
X #include <stdlib.h>
X #include <errno.h>
X-#include "afp.h"
X+#include "afpfs-ng/afp.h"
X 
X void afp_default_url(struct afp_url *url)
X {
X@@ -21,7 +21,9 @@
X 
X static int check_port(char * port) 
X {
X-	long long ret = strtol(port,NULL,10);
X+	long long ret = 0;
X+	errno = 0;
X+	ret = strtol(port,NULL,10);
X 	if ((ret<0) || (ret>32767)) return -1;
X 	if (errno) {
X 		printf("port error\n");
X@@ -33,7 +35,7 @@
X static int check_uamname(const char * uam) 
X {
X 	char * p;
X-	for (p=uam;*p;p++) {
X+	for (p=(char *)uam;*p;p++) {
X 		if (*p==' ') continue;
X 		if ((*p<'A') || (*p>'z')) return -1;
X 	}
X@@ -188,7 +190,7 @@
X 		return -1;
X 
X 	}
X-	if (p==NULL) p=toparse;
X+	if (p==NULL) p=(char *)toparse;
X 
X 	/* Now split on the first / */
X 	if (sscanf(p,"%[^/]/%[^$]",
Xdiff -Naur afpfs-ng-0.8.1.orig/lib/client.c afpfs-ng-0.8.1/lib/client.c
8d34ed31098b3e9b839f61e6a9ea6cc3
echo x - afpfs-ng/files/patch-lib__client.c
sed 's/^X//' >afpfs-ng/files/patch-lib__client.c << 'bb240d6de7efcbea316de2de4900a425'
X--- lib/client.c.orig	2008-02-18 03:36:30.000000000 +0000
X+++ lib/client.c	2012-10-14 13:11:34.000000000 +0000
X@@ -1,5 +1,5 @@
X-#include <afp.h>
X-#include <libafpclient.h>
X+#include <afpfs-ng/afp.h>
X+#include <afpfs-ng/libafpclient.h>
X 
X 
X struct libafpclient * libafpclient = NULL;
Xdiff -Naur afpfs-ng-0.8.1.orig/lib/codepage.c afpfs-ng-0.8.1/lib/codepage.c
bb240d6de7efcbea316de2de4900a425
echo x - afpfs-ng/files/patch-lib__codepage.c
sed 's/^X//' >afpfs-ng/files/patch-lib__codepage.c << 'b446d8c16ab0167ef3cc5dfa16a98883'
X--- lib/codepage.c.orig	2008-02-18 03:36:54.000000000 +0000
X+++ lib/codepage.c	2012-10-14 13:11:34.000000000 +0000
X@@ -14,8 +14,8 @@
X 
X #include <string.h>
X #include <stdlib.h>
X-#include "afp_protocol.h"
X-#include "utils.h"
X+#include "afpfs-ng/afp_protocol.h"
X+#include "afpfs-ng/utils.h"
X #include "unicode.h"
X 
X int convert_utf8dec_to_utf8pre(const char *src, int src_len,
Xdiff -Naur afpfs-ng-0.8.1.orig/lib/connect.c afpfs-ng-0.8.1/lib/connect.c
b446d8c16ab0167ef3cc5dfa16a98883
echo x - afpfs-ng/files/patch-lib__connect.c
sed 's/^X//' >afpfs-ng/files/patch-lib__connect.c << 'c73db44c40b00c5441ac0a67987241a8'
X--- lib/connect.c.orig	2008-02-18 03:38:59.000000000 +0000
X+++ lib/connect.c	2012-10-14 13:11:34.000000000 +0000
X@@ -10,13 +10,13 @@
X #include <string.h>
X #include <sys/socket.h>
X 
X-#include "afp.h"
X-#include "dsi.h"
X-#include "utils.h"
X-#include "uams_def.h"
X-#include "codepage.h"
X+#include "afpfs-ng/afp.h"
X+#include "afpfs-ng/dsi.h"
X+#include "afpfs-ng/utils.h"
X+#include "afpfs-ng/uams_def.h"
X+#include "afpfs-ng/codepage.h"
X #include "users.h"
X-#include "libafpclient.h"
X+#include "afpfs-ng/libafpclient.h"
X #include "server.h"
X 
X 
Xdiff -Naur afpfs-ng-0.8.1.orig/lib/did.c afpfs-ng-0.8.1/lib/did.c
c73db44c40b00c5441ac0a67987241a8
echo x - afpfs-ng/files/patch-lib__did.c
sed 's/^X//' >afpfs-ng/files/patch-lib__did.c << '426c862fe77c77134d70fc8b06e66547'
X--- lib/did.c.orig	2008-02-18 03:39:17.000000000 +0000
X+++ lib/did.c	2012-10-14 13:11:44.000000000 +0000
X@@ -9,8 +9,8 @@
X #include <string.h>
X #include <stdio.h>
X 
X-#include "afp.h"
X-#include "afp_protocol.h"
X+#include "afpfs-ng/afp.h"
X+#include "afpfs-ng/afp_protocol.h"
X 
X #undef DID_CACHE_DISABLE
X 
X@@ -226,7 +226,7 @@
X 
X 
X 	/* Go to the end of last known entry */
X-	p=path+(p-copy);
X+	p=(char *)path+(p-copy);
X 	p2=p;
X 
X 	while ((p=strchr(p+1,'/'))) {
Xdiff -Naur afpfs-ng-0.8.1.orig/lib/dsi.c afpfs-ng-0.8.1/lib/dsi.c
426c862fe77c77134d70fc8b06e66547
echo x - afpfs-ng/files/patch-lib__dsi.c
sed 's/^X//' >afpfs-ng/files/patch-lib__dsi.c << '0ab6dbe6f4dc71f4250747e089f0150e'
X--- lib/dsi.c.orig	2008-02-18 03:53:03.000000000 +0000
X+++ lib/dsi.c	2012-10-14 13:12:03.000000000 +0000
X@@ -19,12 +19,12 @@
X #include <signal.h>
X #include <iconv.h>
X 
X-#include "utils.h"
X-#include "dsi.h"
X-#include "afp.h"
X-#include "uams_def.h"
X+#include "afpfs-ng/utils.h"
X+#include "afpfs-ng/dsi.h"
X+#include "afpfs-ng/afp.h"
X+#include "afpfs-ng/uams_def.h"
X #include "dsi_protocol.h"
X-#include "libafpclient.h"
X+#include "afpfs-ng/libafpclient.h"
X #include "afp_internal.h"
X #include "afp_replies.h"
X 
X@@ -64,7 +64,7 @@
X 	rx.size=0;
X 	dsi_setup_header(server,&header,DSI_DSIGetStatus);
X 	/* We're intentionally ignoring the results */
X-	ret=dsi_send(server,(char *) &header,sizeof(struct dsi_header),20,
X+	ret=dsi_send(server,(char *) &header,sizeof(struct dsi_header),60,
X 		0,(void *) &rx);
X 
X 	free(rx.data);
X@@ -197,6 +197,7 @@
X 	new_request->other=other;
X 	new_request->wait=wait;
X 	new_request->next=NULL;
X+      	new_request->done_waiting=0;
X 
X 	pthread_mutex_lock(&server->request_queue_mutex);
X 	if (server->command_requests==NULL) {
X@@ -208,7 +209,8 @@
X 	server->stats.requests_pending++;
X 	pthread_mutex_unlock(&server->request_queue_mutex);
X 
X-	pthread_cond_init(&new_request->condition_cond,NULL);
X+	pthread_cond_init(&new_request->waiting_cond,NULL);
X+	pthread_mutex_init(&new_request->waiting_mutex,NULL);
X 
X 	if (server->connect_state==SERVER_STATE_DISCONNECTED) {
X 		char mesg[1024];
X@@ -240,16 +242,12 @@
X 	server->stats.tx_bytes+=size;
X 	pthread_mutex_unlock(&server->send_mutex);
X 
X-	int tmpwait=new_request->wait;
X 	#ifdef DEBUG_DSI
X 	printf("=== Waiting for response for %d %s\n",
X 		new_request->requestid,
X 		afp_get_command_name(new_request->subcommand));
X 	#endif
X-	if (tmpwait<0) {
X-
X-		pthread_mutex_t     mutex = PTHREAD_MUTEX_INITIALIZER;
X-		pthread_mutex_lock(&mutex);
X+	if (new_request->wait<0) {
X 
X 		/* Wait forever */
X 		#ifdef DEBUG_DSI
X@@ -258,14 +256,17 @@
X 			afp_get_command_name(new_request->subcommand));
X 		#endif
X 
X-		rc=pthread_cond_wait( 
X-			&new_request->condition_cond, 
X-				&mutex );
X-		pthread_mutex_unlock(&mutex);
X-
X-	} else if (tmpwait>0) {
X-		pthread_mutex_t     mutex = PTHREAD_MUTEX_INITIALIZER;
X-		pthread_mutex_lock(&mutex);
X+		pthread_mutex_lock(&new_request->waiting_mutex);
X+
X+		if (new_request->done_waiting==0)
X+			rc=pthread_cond_wait( 
X+				&new_request->waiting_cond, 
X+					&new_request->waiting_mutex );
X+
X+		pthread_mutex_unlock(&new_request->waiting_mutex);
X+
X+	} else if (new_request->wait>0) {
X+		/* wait for new_request->wait seconds */
X 
X 		#ifdef DEBUG_DSI
X 		printf("=== Waiting for %d %s, for %ds\n",
X@@ -283,13 +284,15 @@
X 			printf("=== Changing my mind, no longer waiting for %d\n",
X 				new_request->requestid);
X 			#endif
X-			pthread_mutex_unlock(&mutex);
X 			goto skip;
X 		}
X-		rc=pthread_cond_timedwait( 
X-			&new_request->condition_cond, 
X-			&mutex,&ts);
X-		pthread_mutex_unlock(&mutex);
X+		pthread_mutex_lock(&new_request->waiting_mutex);
X+		if (new_request->done_waiting==0) 
X+			rc=pthread_cond_timedwait( 
X+				&new_request->waiting_cond, 
X+				&new_request->waiting_mutex,&ts);
X+		pthread_mutex_unlock(&new_request->waiting_mutex);
X+
X 		if (rc==ETIMEDOUT) {
X /* FIXME: should handle this case properly */
X 			#ifdef DEBUG_DSI
X@@ -299,6 +302,7 @@
X 			goto out;
X 		}
X 	} else {
X+                /* Don't wait */
X 		#ifdef DEBUG_DSI
X 		printf("=== Skipping wait altogether for %d\n",new_request->requestid);
X 		#endif
X@@ -577,6 +581,7 @@
X 	unsigned char mins=0;
X 	unsigned char checkmessage=0;
X 
X+	memset(mesg,0,AFP_LOGINMESG_LEN);
X 
X 	/* The logic here's undocumented.  If we get an attention packet and
X 	   there's no flag, then go check the message.  Also, go check the
X@@ -862,8 +867,11 @@
X 			#ifdef DEBUG_DSI
X 			printf("<<< Signalling %d, returning %d or %d\n",request->requestid,request->return_code,rc);
X 			#endif
X+			pthread_mutex_lock(&request->waiting_mutex);
X 			request->wait=0;
X-			pthread_cond_signal(&request->condition_cond);
X+			request->done_waiting=1;
X+			pthread_cond_signal(&request->waiting_cond);
X+			pthread_mutex_unlock(&request->waiting_mutex);
X 		} else {
X 			dsi_remove_from_request_queue(server,request);
X 		}
Xdiff -Naur afpfs-ng-0.8.1.orig/lib/forklist.c afpfs-ng-0.8.1/lib/forklist.c
0ab6dbe6f4dc71f4250747e089f0150e
echo x - afpfs-ng/files/patch-lib__forklist.c
sed 's/^X//' >afpfs-ng/files/patch-lib__forklist.c << '62538df766ca6c71f0bc69ebd264f433'
X--- lib/forklist.c.orig	2008-01-17 04:49:16.000000000 +0000
X+++ lib/forklist.c	2012-10-14 13:11:34.000000000 +0000
X@@ -10,7 +10,7 @@
X */
X 
X 
X-#include "afp.h"
X+#include "afpfs-ng/afp.h"
X 
X #include <stdlib.h>
X #include <pthread.h>
Xdiff -Naur afpfs-ng-0.8.1.orig/lib/identify.c afpfs-ng-0.8.1/lib/identify.c
62538df766ca6c71f0bc69ebd264f433
echo x - afpfs-ng/files/patch-lib__identify.c
sed 's/^X//' >afpfs-ng/files/patch-lib__identify.c << '5aedca6bddd82db6c59495ae6885f7c9'
X--- lib/identify.c.orig	1970-01-01 00:00:00.000000000 +0000
X+++ lib/identify.c	2012-10-14 13:12:57.000000000 +0000
X@@ -0,0 +1,24 @@
X+#include <string.h>
X+#include <afpfs-ng/afp.h>
X+
X+
X+/* 
X+ * afp_server_identify()
X+ *
X+ * Identifies a server
X+ *
X+ * Right now, this only does identification using the machine_type
X+ * given in getsrvrinfo, but this could later use mDNS to get 
X+ * more details.
X+ */
X+void afp_server_identify(struct afp_server * s)
X+{
X+	if (strcmp(s->machine_type,"Netatalk")==0)
X+		s->server_type=AFPFS_SERVER_TYPE_NETATALK;
X+	else if (strcmp(s->machine_type,"AirPort")==0)
X+		s->server_type=AFPFS_SERVER_TYPE_AIRPORT;
X+	else if (strcmp(s->machine_type,"Macintosh")==0)
X+		s->server_type=AFPFS_SERVER_TYPE_MACINTOSH;
X+	else
X+		s->server_type=AFPFS_SERVER_TYPE_UNKNOWN;
X+}
Xdiff -Naur afpfs-ng-0.8.1.orig/lib/log.c afpfs-ng-0.8.1/lib/log.c
5aedca6bddd82db6c59495ae6885f7c9
echo x - afpfs-ng/files/patch-lib__log.c
sed 's/^X//' >afpfs-ng/files/patch-lib__log.c << '50765f34c36dab98fbe346c495521dff'
X--- lib/log.c.orig	2008-01-30 04:37:58.000000000 +0000
X+++ lib/log.c	2012-10-14 13:11:34.000000000 +0000
X@@ -3,7 +3,7 @@
X #include <stdarg.h>
X #include <string.h>
X #include <stdlib.h>
X-#include "libafpclient.h"
X+#include "afpfs-ng/libafpclient.h"
X 
X void log_for_client(void * priv,
X 	enum loglevels loglevel, int logtype, char *format, ...) {
Xdiff -Naur afpfs-ng-0.8.1.orig/lib/loop.c afpfs-ng-0.8.1/lib/loop.c
50765f34c36dab98fbe346c495521dff
echo x - afpfs-ng/files/patch-lib__loop.c
sed 's/^X//' >afpfs-ng/files/patch-lib__loop.c << '9567e625623ee701bfdce1c45b970514'
X--- lib/loop.c.orig	2008-02-18 03:40:11.000000000 +0000
X+++ lib/loop.c	2012-10-14 13:11:44.000000000 +0000
X@@ -16,16 +16,16 @@
X #include <sys/time.h>
X #include <signal.h>
X 
X-#include "afp.h"
X-#include "dsi.h"
X-#include "utils.h"
X+#include "afpfs-ng/afp.h"
X+#include "afpfs-ng/dsi.h"
X+#include "afpfs-ng/utils.h"
X 
X #define SIGNAL_TO_USE SIGUSR2
X 
X static unsigned char exit_program=0;
X 
X static pthread_t ending_thread;
X-static pthread_t main_thread = NULL;
X+static pthread_t main_thread = (pthread_t)NULL;
X 
X static int loop_started=0;
X static pthread_cond_t loop_started_condition;
Xdiff -Naur afpfs-ng-0.8.1.orig/lib/lowlevel.c afpfs-ng-0.8.1/lib/lowlevel.c
9567e625623ee701bfdce1c45b970514
echo x - afpfs-ng/files/patch-lib__lowlevel.c
sed 's/^X//' >afpfs-ng/files/patch-lib__lowlevel.c << '4cf98e81de19e7a3147d06c8d43e2bb5'
X--- lib/lowlevel.c.orig	2008-02-20 01:33:17.000000000 +0000
X+++ lib/lowlevel.c	2012-10-14 13:11:44.000000000 +0000
X@@ -19,10 +19,10 @@
X #else
X #include <fcntl.h>
X #endif
X-#include "afp.h"
X-#include "afp_protocol.h"
X-#include "codepage.h"
X-#include "utils.h"
X+#include "afpfs-ng/afp.h"
X+#include "afpfs-ng/afp_protocol.h"
X+#include "afpfs-ng/codepage.h"
X+#include "afpfs-ng/utils.h"
X #include "did.h"
X #include "users.h"
X 
X@@ -582,7 +582,7 @@
X 	if (volume->server->using_version->av_number>=30)
X 		stbuf->st_mode |= fp.unixprivs.permissions;
X 	else
X-		set_nonunix_perms(stbuf,&fp);
X+		set_nonunix_perms(&stbuf->st_mode,&fp);
X 
X 	stbuf->st_uid=fp.unixprivs.uid;
X 	stbuf->st_gid=fp.unixprivs.gid;
Xdiff -Naur afpfs-ng-0.8.1.orig/lib/map_def.c afpfs-ng-0.8.1/lib/map_def.c
4cf98e81de19e7a3147d06c8d43e2bb5
echo x - afpfs-ng/files/patch-lib__map_def.c
sed 's/^X//' >afpfs-ng/files/patch-lib__map_def.c << 'b94bdb88547ca38df5196ceab3ab7459'
X--- lib/map_def.c.orig	2007-09-07 13:10:59.000000000 +0000
X+++ lib/map_def.c	2012-10-14 13:11:34.000000000 +0000
X@@ -1,6 +1,6 @@
X #include <string.h>
X-#include "afp.h"
X-#include "map_def.h"
X+#include "afpfs-ng/afp.h"
X+#include "afpfs-ng/map_def.h"
X 
X static char *afp_map_strings[] = {
X 	"Unknown",
Xdiff -Naur afpfs-ng-0.8.1.orig/lib/meta.c afpfs-ng-0.8.1/lib/meta.c
b94bdb88547ca38df5196ceab3ab7459
echo x - afpfs-ng/files/patch-lib__meta.c
sed 's/^X//' >afpfs-ng/files/patch-lib__meta.c << '6371bf3af9609bbf58c711d28792bd5b'
X--- lib/meta.c.orig	2008-01-04 03:52:44.000000000 +0000
X+++ lib/meta.c	2012-10-14 13:11:34.000000000 +0000
X@@ -17,10 +17,10 @@
X #include <unistd.h>
X #include <sys/time.h>
X 
X-#include "afp.h"
X-#include "dsi.h"
X-#include "afp_protocol.h"
X-#include "utils.h"
X+#include "afpfs-ng/afp.h"
X+#include "afpfs-ng/dsi.h"
X+#include "afpfs-ng/afp_protocol.h"
X+#include "afpfs-ng/utils.h"
X 
X 
X int afp_meta_getattr(const char *path, struct stat *stbuf)
Xdiff -Naur afpfs-ng-0.8.1.orig/lib/midlevel.c afpfs-ng-0.8.1/lib/midlevel.c
6371bf3af9609bbf58c711d28792bd5b
echo x - afpfs-ng/files/patch-lib__midlevel.c
sed 's/^X//' >afpfs-ng/files/patch-lib__midlevel.c << 'ab286c21a2f68b4df195129440e8b810'
X--- lib/midlevel.c.orig	2008-03-08 16:08:18.000000000 +0000
X+++ lib/midlevel.c	2012-10-14 13:11:44.000000000 +0000
X@@ -10,7 +10,7 @@
X */
X 
X 
X-#include "afp.h"
X+#include "afpfs-ng/afp.h"
X 
X #include <sys/stat.h>
X #include <string.h>
X@@ -28,9 +28,9 @@
X #include "users.h"
X #include "did.h"
X #include "resource.h"
X-#include "utils.h"
X-#include "codepage.h"
X-#include "midlevel.h"
X+#include "afpfs-ng/utils.h"
X+#include "afpfs-ng/codepage.h"
X+#include "afpfs-ng/midlevel.h"
X #include "afp_internal.h"
X #include "forklist.h"
X #include "uams.h"
X@@ -713,7 +713,7 @@
X {
X 
X 	int ret,err=0;
X-	int totalwritten = 0;
X+	size_t totalwritten = 0;
X 	uint64_t sizetowrite, ignored;
X 	unsigned char flags = 0;
X 	unsigned int max_packet_size=volume->server->tx_quantum;
Xdiff -Naur afpfs-ng-0.8.1.orig/lib/proto_attr.c afpfs-ng-0.8.1/lib/proto_attr.c
ab286c21a2f68b4df195129440e8b810
echo x - afpfs-ng/files/patch-lib__proto_attr.c
sed 's/^X//' >afpfs-ng/files/patch-lib__proto_attr.c << '0997ad9e02409d65b675e09a9be7cafe'
X--- lib/proto_attr.c.orig	2008-01-30 04:37:58.000000000 +0000
X+++ lib/proto_attr.c	2012-10-14 13:11:44.000000000 +0000
X@@ -7,10 +7,10 @@
X 
X #include <string.h>
X #include <stdlib.h>
X-#include "dsi.h"
X-#include "afp.h"
X-#include "utils.h"
X-#include "afp_protocol.h"
X+#include "afpfs-ng/dsi.h"
X+#include "afpfs-ng/afp.h"
X+#include "afpfs-ng/utils.h"
X+#include "afpfs-ng/afp_protocol.h"
X #include "dsi_protocol.h"
X 
X /* This is a new command, function 76.  There are currently no docs, so this 
X@@ -166,7 +166,7 @@
X 	copy_path(server,p,pathname,strlen(pathname));
X 	unixpath_to_afppath(server,p);
X 	p2=p+sizeof_path_header(server)+strlen(pathname);
X-	if (((unsigned int ) p2) & 0x1) p2++;
X+	if (((unsigned long) p2) & 0x1) p2++;
X 	req2=(void *) p2;
X 
X 	req2->len=htons(namelen);
Xdiff -Naur afpfs-ng-0.8.1.orig/lib/proto_desktop.c afpfs-ng-0.8.1/lib/proto_desktop.c
0997ad9e02409d65b675e09a9be7cafe
echo x - afpfs-ng/files/patch-lib__proto_desktop.c
sed 's/^X//' >afpfs-ng/files/patch-lib__proto_desktop.c << 'b3d7ec35bf07232ba748ba41f796763f'
X--- lib/proto_desktop.c.orig	2008-02-18 03:44:11.000000000 +0000
X+++ lib/proto_desktop.c	2012-10-14 13:11:44.000000000 +0000
X@@ -9,10 +9,10 @@
X #include <string.h>
X #include <stdlib.h>
X 
X-#include "dsi.h"
X-#include "afp.h"
X-#include "utils.h"
X-#include "afp_protocol.h"
X+#include "afpfs-ng/dsi.h"
X+#include "afpfs-ng/afp.h"
X+#include "afpfs-ng/utils.h"
X+#include "afpfs-ng/afp_protocol.h"
X #include "dsi_protocol.h"
X 
X /* closedt, addicon, geticoninfo, addappl, removeappl */
X@@ -168,7 +168,7 @@
X 	return 0;
X }
X 
X-int afp_closedt(struct afp_server * server, unsigned short * refnum) 
X+int afp_closedt(struct afp_server * server, unsigned short refnum) 
X {
X 	struct {
X 		struct dsi_header dsi_header __attribute__((__packed__));
Xdiff -Naur afpfs-ng-0.8.1.orig/lib/proto_directory.c afpfs-ng-0.8.1/lib/proto_directory.c
b3d7ec35bf07232ba748ba41f796763f
echo x - afpfs-ng/files/patch-lib__proto_directory.c
sed 's/^X//' >afpfs-ng/files/patch-lib__proto_directory.c << '69f6d1fc017be02703f6b19087ec4346'
X--- lib/proto_directory.c.orig	2008-02-19 02:39:29.000000000 +0000
X+++ lib/proto_directory.c	2012-10-14 13:11:44.000000000 +0000
X@@ -9,10 +9,10 @@
X #include <string.h>
X #include <stdlib.h>
X 
X-#include "dsi.h"
X-#include "afp.h"
X-#include "utils.h"
X-#include "afp_protocol.h"
X+#include "afpfs-ng/dsi.h"
X+#include "afpfs-ng/afp.h"
X+#include "afpfs-ng/utils.h"
X+#include "afpfs-ng/afp_protocol.h"
X #include "dsi_protocol.h"
X #include "afp_replies.h"
X 
X@@ -248,6 +248,7 @@
X 
X 	return 0;
X }
X+
X int afp_enumerateext2_reply(struct afp_server *server, char * buf, unsigned int size, void * other) 
X {
X 
X@@ -266,8 +267,7 @@
X 	char * p = buf + sizeof(*reply);
X 	int i;
X 	char  *max=buf+size;
X-	struct afp_file_info * filebase = NULL, *filecur=NULL, *new_file=NULL;
X-	void ** x = other;
X+	struct afp_file_info * filebase = NULL, *filecur = NULL, *new_file = NULL, **x = (struct afp_file_info **) other;
X 
X 	if (reply->dsi_header.return_code.error_code) {
X 		return reply->dsi_header.return_code.error_code;
Xdiff -Naur afpfs-ng-0.8.1.orig/lib/proto_files.c afpfs-ng-0.8.1/lib/proto_files.c
69f6d1fc017be02703f6b19087ec4346
echo x - afpfs-ng/files/patch-lib__proto_files.c
sed 's/^X//' >afpfs-ng/files/patch-lib__proto_files.c << '92d05df7cacf9ee12571675dc5e8a026'
X--- lib/proto_files.c.orig	2008-02-18 03:46:18.000000000 +0000
X+++ lib/proto_files.c	2012-10-14 13:11:34.000000000 +0000
X@@ -8,11 +8,11 @@
X 
X #include <stdlib.h>
X #include <string.h>
X-#include "dsi.h"
X-#include "afp.h"
X-#include "utils.h"
X+#include "afpfs-ng/dsi.h"
X+#include "afpfs-ng/afp.h"
X+#include "afpfs-ng/utils.h"
X #include "dsi_protocol.h"
X-#include "afp_protocol.h"
X+#include "afpfs-ng/afp_protocol.h"
X #include "afp_internal.h"
X 
X /* afp_setfileparms, afp_setdirparms and afpsetfiledirparms are all remarkably
Xdiff -Naur afpfs-ng-0.8.1.orig/lib/proto_fork.c afpfs-ng-0.8.1/lib/proto_fork.c
92d05df7cacf9ee12571675dc5e8a026
echo x - afpfs-ng/files/patch-lib__proto_fork.c
sed 's/^X//' >afpfs-ng/files/patch-lib__proto_fork.c << '3c7ec9cf9c7785d4c1d794a683f74429'
X--- lib/proto_fork.c.orig	2008-01-30 04:37:58.000000000 +0000
X+++ lib/proto_fork.c	2012-10-14 13:11:34.000000000 +0000
X@@ -9,11 +9,11 @@
X #include <stdlib.h>
X #include <string.h>
X 
X-#include "dsi.h"
X-#include "afp.h"
X-#include "utils.h"
X+#include "afpfs-ng/dsi.h"
X+#include "afpfs-ng/afp.h"
X+#include "afpfs-ng/utils.h"
X #include "dsi_protocol.h"
X-#include "afp_protocol.h"
X+#include "afpfs-ng/afp_protocol.h"
X 
X int afp_setforkparms(struct afp_volume * volume,
X 	unsigned short forkid, unsigned short bitmap, unsigned long len)
Xdiff -Naur afpfs-ng-0.8.1.orig/lib/proto_login.c afpfs-ng-0.8.1/lib/proto_login.c
3c7ec9cf9c7785d4c1d794a683f74429
echo x - afpfs-ng/files/patch-lib__proto_login.c
sed 's/^X//' >afpfs-ng/files/patch-lib__proto_login.c << '4a21a7b770b5262e46496df2a83d98bf'
X--- lib/proto_login.c.orig	2008-01-30 04:37:59.000000000 +0000
X+++ lib/proto_login.c	2012-10-14 13:11:34.000000000 +0000
X@@ -10,10 +10,10 @@
X 
X #include <stdlib.h>
X #include <string.h>
X-#include "dsi.h"
X+#include "afpfs-ng/dsi.h"
X #include "dsi_protocol.h"
X-#include "afp.h"
X-#include "utils.h"
X+#include "afpfs-ng/afp.h"
X+#include "afpfs-ng/utils.h"
X #include "afp_internal.h"
X 
X 
Xdiff -Naur afpfs-ng-0.8.1.orig/lib/proto_map.c afpfs-ng-0.8.1/lib/proto_map.c
4a21a7b770b5262e46496df2a83d98bf
echo x - afpfs-ng/files/patch-lib__proto_map.c
sed 's/^X//' >afpfs-ng/files/patch-lib__proto_map.c << 'a87f7844bc11bcc7a74a13d09ab76b42'
X--- lib/proto_map.c.orig	2008-01-30 04:37:59.000000000 +0000
X+++ lib/proto_map.c	2012-10-14 13:11:44.000000000 +0000
X@@ -9,11 +9,11 @@
X #include <stdlib.h>
X #include <string.h>
X 
X-#include "dsi.h"
X-#include "afp.h"
X-#include "utils.h"
X+#include "afpfs-ng/dsi.h"
X+#include "afpfs-ng/afp.h"
X+#include "afpfs-ng/utils.h"
X #include "dsi_protocol.h"
X-#include "afp_protocol.h"
X+#include "afpfs-ng/afp_protocol.h"
X 
X /* This is used to pass the return values back from afp_getuserinfo_reply() */
X struct uidgid {
X@@ -122,7 +122,7 @@
X 
X 	if (reply->header.return_code.error_code!=kFPNoErr) return -1;
X 
X-	copy_from_pascal_two(name,&reply->name,255);
X+	copy_from_pascal_two(name,reply->name,255);
X 
X 	return 0;
X }
Xdiff -Naur afpfs-ng-0.8.1.orig/lib/proto_replyblock.c afpfs-ng-0.8.1/lib/proto_replyblock.c
a87f7844bc11bcc7a74a13d09ab76b42
echo x - afpfs-ng/files/patch-lib__proto_replyblock.c
sed 's/^X//' >afpfs-ng/files/patch-lib__proto_replyblock.c << '0344b2b1d1cc7de95e2004310494813a'
X--- lib/proto_replyblock.c.orig	2008-02-18 03:46:19.000000000 +0000
X+++ lib/proto_replyblock.c	2012-10-14 13:11:34.000000000 +0000
X@@ -6,9 +6,9 @@
X  */
X 
X #include <string.h>
X-#include "dsi.h"
X-#include "afp.h"
X-#include "utils.h"
X+#include "afpfs-ng/dsi.h"
X+#include "afpfs-ng/afp.h"
X+#include "afpfs-ng/utils.h"
X #include "afp_internal.h"
X 
X 
Xdiff -Naur afpfs-ng-0.8.1.orig/lib/proto_server.c afpfs-ng-0.8.1/lib/proto_server.c
0344b2b1d1cc7de95e2004310494813a
echo x - afpfs-ng/files/patch-lib__proto_server.c
sed 's/^X//' >afpfs-ng/files/patch-lib__proto_server.c << '94fd78d81c3a5ee6a9a66915f700ab38'
X--- lib/proto_server.c.orig	2008-02-19 01:56:21.000000000 +0000
X+++ lib/proto_server.c	2012-10-14 13:11:34.000000000 +0000
X@@ -7,12 +7,12 @@
X  */
X #include <stdlib.h>
X #include <string.h>
X-#include "dsi.h"
X-#include "afp.h"
X-#include "utils.h"
X+#include "afpfs-ng/dsi.h"
X+#include "afpfs-ng/afp.h"
X+#include "afpfs-ng/utils.h"
X #include "dsi_protocol.h"
X-#include "afp_protocol.h"
X-#include "codepage.h"
X+#include "afpfs-ng/afp_protocol.h"
X+#include "afpfs-ng/codepage.h"
X #include "afp_internal.h"
X 
X int afp_getsrvrparms(struct afp_server *server)
Xdiff -Naur afpfs-ng-0.8.1.orig/lib/proto_session.c afpfs-ng-0.8.1/lib/proto_session.c
94fd78d81c3a5ee6a9a66915f700ab38
echo x - afpfs-ng/files/patch-lib__proto_session.c
sed 's/^X//' >afpfs-ng/files/patch-lib__proto_session.c << 'cc0b0ad5f4cc52d34b26bb11a0a51ed1'
X--- lib/proto_session.c.orig	2008-02-18 03:46:19.000000000 +0000
X+++ lib/proto_session.c	2012-10-14 13:11:44.000000000 +0000
X@@ -8,10 +8,10 @@
X  */
X #include <stdlib.h>
X #include <string.h>
X-#include "dsi.h"
X+#include "afpfs-ng/dsi.h"
X #include "dsi_protocol.h"
X-#include "afp.h"
X-#include "utils.h"
X+#include "afpfs-ng/afp.h"
X+#include "afpfs-ng/utils.h"
X 
X int afp_getsessiontoken(struct afp_server * server, int type, 
X 	unsigned int timestamp, struct afp_token *outgoing_token, 
X@@ -39,7 +39,7 @@
X 	switch (type) {
X 	case kLoginWithTimeAndID:
X 	case kReconnWithTimeAndID: {
X-		uint32_t *p = (void *) (((unsigned int) request)+
X+		uint32_t *p = (void *) (((unsigned long) request)+
X 			sizeof(*request));
X 
X 		offset=sizeof(timestamp);
X@@ -63,7 +63,7 @@
X 		goto error;
X 	}
X 
X-	data=(void *) (((unsigned int) request)+sizeof(*request)+offset);
X+	data=(void *) (((unsigned long) request)+sizeof(*request)+offset);
X 	request->idlength=htonl(datalen);
X 	request->pad=0;
X 	request->type=htons(type);
X@@ -127,7 +127,7 @@
X 	if ((request=malloc(sizeof(*request) + AFP_TOKEN_MAX_LEN))==NULL)
X 		return -1;
X 
X-	token_data  = request + sizeof(*request);
X+	token_data  = (char *)request + sizeof(*request);
X 
X 	request->type=htons(type);
X 
Xdiff -Naur afpfs-ng-0.8.1.orig/lib/proto_volume.c afpfs-ng-0.8.1/lib/proto_volume.c
cc0b0ad5f4cc52d34b26bb11a0a51ed1
echo x - afpfs-ng/files/patch-lib__proto_volume.c
sed 's/^X//' >afpfs-ng/files/patch-lib__proto_volume.c << '934eafb9c7c6f1e5b4c80fcd03c125d5'
X--- lib/proto_volume.c.orig	2008-02-18 03:47:48.000000000 +0000
X+++ lib/proto_volume.c	2012-10-14 13:11:34.000000000 +0000
X@@ -8,13 +8,13 @@
X 
X #include <string.h>
X #include <stdlib.h>
X-#include "dsi.h"
X-#include "afp.h"
X-#include "utils.h"
X+#include "afpfs-ng/dsi.h"
X+#include "afpfs-ng/afp.h"
X+#include "afpfs-ng/utils.h"
X #include "dsi_protocol.h"
X-#include "afp_protocol.h"
X+#include "afpfs-ng/afp_protocol.h"
X #include "afp_internal.h"
X-#include "codepage.h"
X+#include "afpfs-ng/codepage.h"
X 
X static int parse_volbitmap_reply(struct afp_server * server, 
X 		struct afp_volume * tmpvol, 
Xdiff -Naur afpfs-ng-0.8.1.orig/lib/resource.c afpfs-ng-0.8.1/lib/resource.c
934eafb9c7c6f1e5b4c80fcd03c125d5
echo x - afpfs-ng/files/patch-lib__resource.c
sed 's/^X//' >afpfs-ng/files/patch-lib__resource.c << 'fd842e1aa2a3befe8a81834f1e4f6c6d'
X--- lib/resource.c.orig	2008-02-18 03:46:56.000000000 +0000
X+++ lib/resource.c	2012-10-14 13:11:34.000000000 +0000
X@@ -3,11 +3,11 @@
X #include <string.h>
X #include <errno.h>
X #include <fcntl.h>
X-#include "afp.h"
X+#include "afpfs-ng/afp.h"
X #include "resource.h"
X #include "lowlevel.h"
X #include "did.h"
X-#include "midlevel.h"
X+#include "afpfs-ng/midlevel.h"
X 
X #define appledouble ".AppleDouble"
X #define finderinfo_string ".finderinfo"
Xdiff -Naur afpfs-ng-0.8.1.orig/lib/server.c afpfs-ng-0.8.1/lib/server.c
fd842e1aa2a3befe8a81834f1e4f6c6d
echo x - afpfs-ng/files/patch-lib__server.c
sed 's/^X//' >afpfs-ng/files/patch-lib__server.c << 'a6970515dbfb6bdca3fd438f85e2027b'
X--- lib/server.c.orig	2008-02-19 01:56:21.000000000 +0000
X+++ lib/server.c	2012-10-14 13:11:34.000000000 +0000
X@@ -8,15 +8,15 @@
X #include <string.h>
X #include <time.h>
X 
X-#include "afp.h"
X-#include "dsi.h"
X-#include "utils.h"
X-#include "uams_def.h"
X-#include "codepage.h"
X+#include "afpfs-ng/afp.h"
X+#include "afpfs-ng/dsi.h"
X+#include "afpfs-ng/utils.h"
X+#include "afpfs-ng/uams_def.h"
X+#include "afpfs-ng/codepage.h"
X #include "users.h"
X-#include "libafpclient.h"
X+#include "afpfs-ng/libafpclient.h"
X #include "afp_internal.h"
X-#include "dsi.h"
X+#include "afpfs-ng/dsi.h"
X 
X 
X struct afp_server * afp_server_complete_connection(
Xdiff -Naur afpfs-ng-0.8.1.orig/lib/status.c afpfs-ng-0.8.1/lib/status.c
a6970515dbfb6bdca3fd438f85e2027b
echo x - afpfs-ng/files/patch-lib__status.c
sed 's/^X//' >afpfs-ng/files/patch-lib__status.c << 'c652604229aaf6f192c21fdf36ab6d32'
X--- lib/status.c.orig	2008-03-08 16:08:38.000000000 +0000
X+++ lib/status.c	2012-10-14 13:11:34.000000000 +0000
X@@ -1,8 +1,8 @@
X #include <string.h>
X #include <stdio.h>
X-#include "map_def.h"
X-#include "dsi.h"
X-#include "afp.h"
X+#include "afpfs-ng/map_def.h"
X+#include "afpfs-ng/dsi.h"
X+#include "afpfs-ng/afp.h"
X 
X int afp_status_header(char * text, int * len) 
X {
Xdiff -Naur afpfs-ng-0.8.1.orig/lib/uams.c afpfs-ng-0.8.1/lib/uams.c
c652604229aaf6f192c21fdf36ab6d32
echo x - afpfs-ng/files/patch-lib__uams.c
sed 's/^X//' >afpfs-ng/files/patch-lib__uams.c << 'e5ac22c8cb306ba94e74cfe9ae415a95'
X--- lib/uams.c.orig	2008-01-04 03:52:44.000000000 +0000
X+++ lib/uams.c	2012-10-14 13:11:44.000000000 +0000
X@@ -8,10 +8,10 @@
X 
X #include <string.h>
X #include <stdlib.h>
X-#include "dsi.h"
X-#include "afp.h"
X-#include "utils.h"
X-#include "uams_def.h"
X+#include "afpfs-ng/dsi.h"
X+#include "afpfs-ng/afp.h"
X+#include "afpfs-ng/utils.h"
X+#include "afpfs-ng/uams_def.h"
X #include "config.h"
X 
X #ifdef HAVE_LIBGCRYPT
X@@ -180,7 +180,7 @@
X 		goto cleartxt_fail;
X 
X 	p += copy_to_pascal(p, username) + 1;
X-	if ((int)p & 0x1)
X+	if ((long)p & 0x1)
X 		len--;
X 	else
X 		p++;
X@@ -230,7 +230,7 @@
X 		goto cleartxt_fail;
X 
X 	p += copy_to_pascal(p, username) + 1;
X-	if ((int)p & 0x1)
X+	if ((long)p & 0x1)
X 		len--;
X 	else
X 		p++;
X@@ -580,7 +580,7 @@
X 	if (ai == NULL)
X 		goto dhx_noctx_fail;
X 	d += copy_to_pascal(ai, username) + 1;
X-	if (((int)d) % 2)
X+	if (((long)d) % 2)
X 		d++;
X 	else
X 		ai_len--;
Xdiff -Naur afpfs-ng-0.8.1.orig/lib/users.c afpfs-ng-0.8.1/lib/users.c
e5ac22c8cb306ba94e74cfe9ae415a95
echo x - afpfs-ng/files/patch-lib__users.c
sed 's/^X//' >afpfs-ng/files/patch-lib__users.c << '695326bfa7194bf988da5c7bc12901ec'
X--- lib/users.c.orig	2008-02-18 03:48:56.000000000 +0000
X+++ lib/users.c	2012-10-14 13:11:34.000000000 +0000
X@@ -3,8 +3,8 @@
X #include <grp.h>
X #include <string.h>
X 
X-#include "afp.h"
X-#include "map_def.h"
X+#include "afpfs-ng/afp.h"
X+#include "afpfs-ng/map_def.h"
X 
X /* How mapping works
X  *
Xdiff -Naur afpfs-ng-0.8.1.orig/lib/utils.c afpfs-ng-0.8.1/lib/utils.c
695326bfa7194bf988da5c7bc12901ec
echo x - afpfs-ng/files/patch-lib__utils.c
sed 's/^X//' >afpfs-ng/files/patch-lib__utils.c << '2a4a743a2e85921509ca77229aa6c47a'
X--- lib/utils.c.orig	2008-02-18 03:53:37.000000000 +0000
X+++ lib/utils.c	2012-10-14 13:11:44.000000000 +0000
X@@ -8,10 +8,10 @@
X #include <stdio.h>
X #include <string.h>
X #include <stdlib.h>
X-#include "afp.h"
X-#include "utils.h"
X+#include "afpfs-ng/afp.h"
X+#include "afpfs-ng/utils.h"
X #include "afp_internal.h"
X-#include "afp_protocol.h"
X+#include "afpfs-ng/afp_protocol.h"
X 
X struct afp_path_header_long {
X 	unsigned char type;
X@@ -196,7 +196,7 @@
X 			maxlen=255;
X 
X 
X-	p=filename+1;
X+	p=(char *)filename+1;
X 	while ((q=strchr(p,'/'))) {
X 		if (q>p+maxlen)
X 			return 1;
2a4a743a2e85921509ca77229aa6c47a
echo x - afpfs-ng/pkg-plist
sed 's/^X//' >afpfs-ng/pkg-plist << '6a53e2d151b3f664521280d16e117f95'
Xlib/libafpclient.la
Xlib/libafpclient.so
Xlib/libafpclient.so.0
Xlib/libafpclient.a
Xbin/afpcmd
Xbin/afpgetstatus
Xinclude/afpfs-ng/dsi.h
Xinclude/afpfs-ng/afp_protocol.h
Xinclude/afpfs-ng/map_def.h
Xinclude/afpfs-ng/codepage.h
Xinclude/afpfs-ng/midlevel.h
Xinclude/afpfs-ng/libafpclient.h
Xinclude/afpfs-ng/uams_def.h
Xinclude/afpfs-ng/afp.h
Xinclude/afpfs-ng/utils.h
X@dirrm include/afpfs-ng
6a53e2d151b3f664521280d16e117f95
exit



>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210160825.q9G8PIEr093243>