From d51e0d1b12f41658f68f0960057b9a1027a569cc Mon Sep 17 00:00:00 2001 From: Daniel Markstedt Date: Sun, 28 Jan 2024 17:36:22 +0900 Subject: [PATCH] Remove obsoleted daemon subdir --- daemon/Makefile | 688 -------------------- daemon/Makefile.am | 36 -- daemon/Makefile.in | 688 -------------------- daemon/afp_client.1 | 98 --- daemon/afpfs | 3 - daemon/afpfsd.1 | 22 - daemon/client.c | 437 ------------- daemon/commands.c | 1359 ---------------------------------------- daemon/commands.h | 19 - daemon/daemon.c | 330 ---------- daemon/daemon.h | 18 - daemon/daemon_client.c | 307 --------- daemon/daemon_client.h | 43 -- daemon/daemon_fuse.c | 332 ---------- daemon/extra.c | 408 ------------ daemon/fuse_error.c | 41 -- daemon/fuse_error.h | 8 - daemon/fuse_int.c | 532 ---------------- daemon/fuse_int.h | 8 - daemon/mount_afp.1 | 173 ----- daemon/stateless.c | 893 -------------------------- 21 files changed, 6443 deletions(-) delete mode 100644 daemon/Makefile delete mode 100644 daemon/Makefile.am delete mode 100644 daemon/Makefile.in delete mode 100644 daemon/afp_client.1 delete mode 100755 daemon/afpfs delete mode 100644 daemon/afpfsd.1 delete mode 100644 daemon/client.c delete mode 100644 daemon/commands.c delete mode 100644 daemon/commands.h delete mode 100644 daemon/daemon.c delete mode 100644 daemon/daemon.h delete mode 100644 daemon/daemon_client.c delete mode 100644 daemon/daemon_client.h delete mode 100644 daemon/daemon_fuse.c delete mode 100644 daemon/extra.c delete mode 100644 daemon/fuse_error.c delete mode 100644 daemon/fuse_error.h delete mode 100644 daemon/fuse_int.c delete mode 100644 daemon/fuse_int.h delete mode 100644 daemon/mount_afp.1 delete mode 100644 daemon/stateless.c diff --git a/daemon/Makefile b/daemon/Makefile deleted file mode 100644 index c358681..0000000 --- a/daemon/Makefile +++ /dev/null @@ -1,688 +0,0 @@ -# Makefile.in generated by automake 1.10 from Makefile.am. -# daemon/Makefile. Generated from Makefile.in by configure. - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - - - - - -pkgdatadir = $(datadir)/afpfs-ng -pkglibdir = $(libdir)/afpfs-ng -pkgincludedir = $(includedir)/afpfs-ng -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = i686-pc-linux-gnu -host_triplet = i686-pc-linux-gnu -bin_PROGRAMS = afpfsd$(EXEEXT) afp_extra$(EXEEXT) mount_afp$(EXEEXT) -subdir = daemon -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; -am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" -libLTLIBRARIES_INSTALL = $(INSTALL) -LTLIBRARIES = $(lib_LTLIBRARIES) -libafpsl_la_LIBADD = -am_libafpsl_la_OBJECTS = libafpsl_la-stateless.lo -libafpsl_la_OBJECTS = $(am_libafpsl_la_OBJECTS) -libafpsl_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libafpsl_la_CFLAGS) \ - $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) -PROGRAMS = $(bin_PROGRAMS) -am_afp_extra_OBJECTS = afp_extra-extra.$(OBJEXT) -afp_extra_OBJECTS = $(am_afp_extra_OBJECTS) -afp_extra_DEPENDENCIES = $(top_builddir)/lib/libafpclient.la \ - $(top_builddir)/daemon/libafpsl.la -afp_extra_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(afp_extra_CFLAGS) \ - $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -am_afpfsd_OBJECTS = afpfsd-commands.$(OBJEXT) afpfsd-daemon.$(OBJEXT) \ - afpfsd-fuse_int.$(OBJEXT) afpfsd-fuse_error.$(OBJEXT) \ - afpfsd-daemon_client.$(OBJEXT) afpfsd-daemon_fuse.$(OBJEXT) -afpfsd_OBJECTS = $(am_afpfsd_OBJECTS) -afpfsd_DEPENDENCIES = $(top_builddir)/lib/libafpclient.la -afpfsd_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(afpfsd_CFLAGS) $(CFLAGS) \ - $(afpfsd_LDFLAGS) $(LDFLAGS) -o $@ -am_mount_afp_OBJECTS = mount_afp-client.$(OBJEXT) -mount_afp_OBJECTS = $(am_mount_afp_OBJECTS) -mount_afp_DEPENDENCIES = $(top_builddir)/lib/libafpclient.la \ - $(top_builddir)/daemon/libafpsl.la -mount_afp_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(mount_afp_CFLAGS) \ - $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DEFAULT_INCLUDES = -I. -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ -SOURCES = $(libafpsl_la_SOURCES) $(afp_extra_SOURCES) \ - $(afpfsd_SOURCES) $(mount_afp_SOURCES) -DIST_SOURCES = $(libafpsl_la_SOURCES) $(afp_extra_SOURCES) \ - $(afpfsd_SOURCES) $(mount_afp_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = ${SHELL} /home/adevries/personal/r/cvs/afpfs-ng/afpfs-ng-0.9/missing --run aclocal-1.10 -AMTAR = ${SHELL} /home/adevries/personal/r/cvs/afpfs-ng/afpfs-ng-0.9/missing --run tar -AR = ar -AUTOCONF = ${SHELL} /home/adevries/personal/r/cvs/afpfs-ng/afpfs-ng-0.9/missing --run autoconf -AUTOHEADER = ${SHELL} /home/adevries/personal/r/cvs/afpfs-ng/afpfs-ng-0.9/missing --run autoheader -AUTOMAKE = ${SHELL} /home/adevries/personal/r/cvs/afpfs-ng/afpfs-ng-0.9/missing --run automake-1.10 -AWK = gawk -CC = gcc -CCDEPMODE = depmode=gcc3 -CFLAGS = -ggdb -CPP = gcc -E -CPPFLAGS = -CXX = g++ -CXXCPP = g++ -E -CXXDEPMODE = depmode=gcc3 -CXXFLAGS = -g -O2 -CYCLE_OBJ = -CYGPATH_W = echo -DEFS = -DHAVE_CONFIG_H -DEPDIR = .deps -ECHO = echo -ECHO_C = -ECHO_N = -n -ECHO_T = -EGREP = /bin/grep -E -EXEEXT = -F77 = gfortran -FFLAGS = -g -O2 -GREP = /bin/grep -INSTALL = /usr/bin/install -c -INSTALL_DATA = ${INSTALL} -m 644 -INSTALL_PROGRAM = ${INSTALL} -INSTALL_SCRIPT = ${INSTALL} -INSTALL_STRIP_PROGRAM = $(install_sh) -c -s -LDFLAGS = -LIBFUSE_LDFLAGS = -lfuse -LIBOBJS = -LIBS = -lgmp -lfuse -lgcrypt -lpthread -lreadline -lncurses -LIBTOOL = $(SHELL) $(top_builddir)/libtool -LN_S = ln -s -LTLIBOBJS = -MAKEINFO = ${SHELL} /home/adevries/personal/r/cvs/afpfs-ng/afpfs-ng-0.9/missing --run makeinfo -MKDIR_P = /bin/mkdir -p -OBJEXT = o -PACKAGE = afpfs-ng -PACKAGE_BUGREPORT = -PACKAGE_NAME = afpfs-ng -PACKAGE_STRING = afpfs-ng 0.8.1 -PACKAGE_TARNAME = afpfs-ng -PACKAGE_VERSION = 0.8.1 -PATH_SEPARATOR = : -RANLIB = ranlib -SED = /bin/sed -SET_MAKE = -SHELL = /bin/sh -STRIP = strip -VERSION = 0.8.1 -abs_builddir = /home/adevries/personal/r/cvs/afpfs-ng/afpfs-ng-0.9/daemon -abs_srcdir = /home/adevries/personal/r/cvs/afpfs-ng/afpfs-ng-0.9/daemon -abs_top_builddir = /home/adevries/personal/r/cvs/afpfs-ng/afpfs-ng-0.9 -abs_top_srcdir = /home/adevries/personal/r/cvs/afpfs-ng/afpfs-ng-0.9 -ac_ct_CC = gcc -ac_ct_CXX = g++ -ac_ct_F77 = gfortran -am__include = include -am__leading_dot = . -am__quote = -am__tar = ${AMTAR} chof - "$$tardir" -am__untar = ${AMTAR} xf - -bindir = ${exec_prefix}/bin -build = i686-pc-linux-gnu -build_alias = -build_cpu = i686 -build_os = linux-gnu -build_vendor = pc -builddir = . -datadir = ${datarootdir} -datarootdir = ${prefix}/share -docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} -dvidir = ${docdir} -exec_prefix = ${prefix} -host = i686-pc-linux-gnu -host_alias = -host_cpu = i686 -host_os = linux-gnu -host_vendor = pc -htmldir = ${docdir} -includedir = ${prefix}/include -infodir = ${datarootdir}/info -install_sh = $(SHELL) /home/adevries/personal/r/cvs/afpfs-ng/afpfs-ng-0.9/install-sh -libdir = ${exec_prefix}/lib -libexecdir = ${exec_prefix}/libexec -localedir = ${datarootdir}/locale -localstatedir = ${prefix}/var -mandir = ${datarootdir}/man -mkdir_p = /bin/mkdir -p -oldincludedir = /usr/include -pdfdir = ${docdir} -prefix = /usr -program_transform_name = s,x,x, -psdir = ${docdir} -sbindir = ${exec_prefix}/sbin -sharedstatedir = ${prefix}/com -srcdir = . -sysconfdir = ${prefix}/etc -target_alias = -top_builddir = .. -top_srcdir = .. -afp_extra_SOURCES = extra.c -afp_extra_CFLAGS = -I$(top_builddir)/include -afp_extra_LDADD = $(top_builddir)/lib/libafpclient.la $(top_builddir)/daemon/libafpsl.la -afpfsd_SOURCES = commands.c daemon.c fuse_int.c fuse_error.c daemon_client.c daemon_fuse.c -afpfsd_LDADD = $(top_builddir)/lib/libafpclient.la -lfuse -afpfsd_LDFLAGS = -export-dynamic -lfuse -afpfsd_CFLAGS = -I$(top_srcdir)/include -D_FILE_OFFSET_BITS=64 -ggdb -mount_afp_SOURCES = client.c -mount_afp_CFLAGS = -I$(top_srcdir)/include -D_FILE_OFFSET_BITS=64 -ggdb -mount_afp_LDADD = $(top_builddir)/lib/libafpclient.la $(top_builddir)/daemon/libafpsl.la -lib_LTLIBRARIES = libafpsl.la -libafpsl_la_CFLAGS = -I$(top_srcdir)/include -ggdb -libafpsl_la_SOURCES = stateless.c -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu daemon/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu daemon/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -install-libLTLIBRARIES: $(lib_LTLIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - if test -f $$p; then \ - f=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ - else :; fi; \ - done - -uninstall-libLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - p=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ - $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ - done - -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -libafpsl.la: $(libafpsl_la_OBJECTS) $(libafpsl_la_DEPENDENCIES) - $(libafpsl_la_LINK) -rpath $(libdir) $(libafpsl_la_OBJECTS) $(libafpsl_la_LIBADD) $(LIBS) -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - if test -f $$p \ - || test -f $$p1 \ - ; then \ - f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ - else :; fi; \ - done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ - rm -f "$(DESTDIR)$(bindir)/$$f"; \ - done - -clean-binPROGRAMS: - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f $$p $$f"; \ - rm -f $$p $$f ; \ - done -afp_extra$(EXEEXT): $(afp_extra_OBJECTS) $(afp_extra_DEPENDENCIES) - @rm -f afp_extra$(EXEEXT) - $(afp_extra_LINK) $(afp_extra_OBJECTS) $(afp_extra_LDADD) $(LIBS) -afpfsd$(EXEEXT): $(afpfsd_OBJECTS) $(afpfsd_DEPENDENCIES) - @rm -f afpfsd$(EXEEXT) - $(afpfsd_LINK) $(afpfsd_OBJECTS) $(afpfsd_LDADD) $(LIBS) -mount_afp$(EXEEXT): $(mount_afp_OBJECTS) $(mount_afp_DEPENDENCIES) - @rm -f mount_afp$(EXEEXT) - $(mount_afp_LINK) $(mount_afp_OBJECTS) $(mount_afp_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -include ./$(DEPDIR)/afp_extra-extra.Po -include ./$(DEPDIR)/afpfsd-commands.Po -include ./$(DEPDIR)/afpfsd-daemon.Po -include ./$(DEPDIR)/afpfsd-daemon_client.Po -include ./$(DEPDIR)/afpfsd-daemon_fuse.Po -include ./$(DEPDIR)/afpfsd-fuse_error.Po -include ./$(DEPDIR)/afpfsd-fuse_int.Po -include ./$(DEPDIR)/libafpsl_la-stateless.Plo -include ./$(DEPDIR)/mount_afp-client.Po - -.c.o: - $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< - mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -# source='$<' object='$@' libtool=no \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(COMPILE) -c $< - -.c.obj: - $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` - mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -# source='$<' object='$@' libtool=no \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: - $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< - mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -# source='$<' object='$@' libtool=yes \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(LTCOMPILE) -c -o $@ $< - -libafpsl_la-stateless.lo: stateless.c - $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libafpsl_la_CFLAGS) $(CFLAGS) -MT libafpsl_la-stateless.lo -MD -MP -MF $(DEPDIR)/libafpsl_la-stateless.Tpo -c -o libafpsl_la-stateless.lo `test -f 'stateless.c' || echo '$(srcdir)/'`stateless.c - mv -f $(DEPDIR)/libafpsl_la-stateless.Tpo $(DEPDIR)/libafpsl_la-stateless.Plo -# source='stateless.c' object='libafpsl_la-stateless.lo' libtool=yes \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libafpsl_la_CFLAGS) $(CFLAGS) -c -o libafpsl_la-stateless.lo `test -f 'stateless.c' || echo '$(srcdir)/'`stateless.c - -afp_extra-extra.o: extra.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afp_extra_CFLAGS) $(CFLAGS) -MT afp_extra-extra.o -MD -MP -MF $(DEPDIR)/afp_extra-extra.Tpo -c -o afp_extra-extra.o `test -f 'extra.c' || echo '$(srcdir)/'`extra.c - mv -f $(DEPDIR)/afp_extra-extra.Tpo $(DEPDIR)/afp_extra-extra.Po -# source='extra.c' object='afp_extra-extra.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afp_extra_CFLAGS) $(CFLAGS) -c -o afp_extra-extra.o `test -f 'extra.c' || echo '$(srcdir)/'`extra.c - -afp_extra-extra.obj: extra.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afp_extra_CFLAGS) $(CFLAGS) -MT afp_extra-extra.obj -MD -MP -MF $(DEPDIR)/afp_extra-extra.Tpo -c -o afp_extra-extra.obj `if test -f 'extra.c'; then $(CYGPATH_W) 'extra.c'; else $(CYGPATH_W) '$(srcdir)/extra.c'; fi` - mv -f $(DEPDIR)/afp_extra-extra.Tpo $(DEPDIR)/afp_extra-extra.Po -# source='extra.c' object='afp_extra-extra.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afp_extra_CFLAGS) $(CFLAGS) -c -o afp_extra-extra.obj `if test -f 'extra.c'; then $(CYGPATH_W) 'extra.c'; else $(CYGPATH_W) '$(srcdir)/extra.c'; fi` - -afpfsd-commands.o: commands.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -MT afpfsd-commands.o -MD -MP -MF $(DEPDIR)/afpfsd-commands.Tpo -c -o afpfsd-commands.o `test -f 'commands.c' || echo '$(srcdir)/'`commands.c - mv -f $(DEPDIR)/afpfsd-commands.Tpo $(DEPDIR)/afpfsd-commands.Po -# source='commands.c' object='afpfsd-commands.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -c -o afpfsd-commands.o `test -f 'commands.c' || echo '$(srcdir)/'`commands.c - -afpfsd-commands.obj: commands.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -MT afpfsd-commands.obj -MD -MP -MF $(DEPDIR)/afpfsd-commands.Tpo -c -o afpfsd-commands.obj `if test -f 'commands.c'; then $(CYGPATH_W) 'commands.c'; else $(CYGPATH_W) '$(srcdir)/commands.c'; fi` - mv -f $(DEPDIR)/afpfsd-commands.Tpo $(DEPDIR)/afpfsd-commands.Po -# source='commands.c' object='afpfsd-commands.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -c -o afpfsd-commands.obj `if test -f 'commands.c'; then $(CYGPATH_W) 'commands.c'; else $(CYGPATH_W) '$(srcdir)/commands.c'; fi` - -afpfsd-daemon.o: daemon.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -MT afpfsd-daemon.o -MD -MP -MF $(DEPDIR)/afpfsd-daemon.Tpo -c -o afpfsd-daemon.o `test -f 'daemon.c' || echo '$(srcdir)/'`daemon.c - mv -f $(DEPDIR)/afpfsd-daemon.Tpo $(DEPDIR)/afpfsd-daemon.Po -# source='daemon.c' object='afpfsd-daemon.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -c -o afpfsd-daemon.o `test -f 'daemon.c' || echo '$(srcdir)/'`daemon.c - -afpfsd-daemon.obj: daemon.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -MT afpfsd-daemon.obj -MD -MP -MF $(DEPDIR)/afpfsd-daemon.Tpo -c -o afpfsd-daemon.obj `if test -f 'daemon.c'; then $(CYGPATH_W) 'daemon.c'; else $(CYGPATH_W) '$(srcdir)/daemon.c'; fi` - mv -f $(DEPDIR)/afpfsd-daemon.Tpo $(DEPDIR)/afpfsd-daemon.Po -# source='daemon.c' object='afpfsd-daemon.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -c -o afpfsd-daemon.obj `if test -f 'daemon.c'; then $(CYGPATH_W) 'daemon.c'; else $(CYGPATH_W) '$(srcdir)/daemon.c'; fi` - -afpfsd-fuse_int.o: fuse_int.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -MT afpfsd-fuse_int.o -MD -MP -MF $(DEPDIR)/afpfsd-fuse_int.Tpo -c -o afpfsd-fuse_int.o `test -f 'fuse_int.c' || echo '$(srcdir)/'`fuse_int.c - mv -f $(DEPDIR)/afpfsd-fuse_int.Tpo $(DEPDIR)/afpfsd-fuse_int.Po -# source='fuse_int.c' object='afpfsd-fuse_int.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -c -o afpfsd-fuse_int.o `test -f 'fuse_int.c' || echo '$(srcdir)/'`fuse_int.c - -afpfsd-fuse_int.obj: fuse_int.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -MT afpfsd-fuse_int.obj -MD -MP -MF $(DEPDIR)/afpfsd-fuse_int.Tpo -c -o afpfsd-fuse_int.obj `if test -f 'fuse_int.c'; then $(CYGPATH_W) 'fuse_int.c'; else $(CYGPATH_W) '$(srcdir)/fuse_int.c'; fi` - mv -f $(DEPDIR)/afpfsd-fuse_int.Tpo $(DEPDIR)/afpfsd-fuse_int.Po -# source='fuse_int.c' object='afpfsd-fuse_int.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -c -o afpfsd-fuse_int.obj `if test -f 'fuse_int.c'; then $(CYGPATH_W) 'fuse_int.c'; else $(CYGPATH_W) '$(srcdir)/fuse_int.c'; fi` - -afpfsd-fuse_error.o: fuse_error.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -MT afpfsd-fuse_error.o -MD -MP -MF $(DEPDIR)/afpfsd-fuse_error.Tpo -c -o afpfsd-fuse_error.o `test -f 'fuse_error.c' || echo '$(srcdir)/'`fuse_error.c - mv -f $(DEPDIR)/afpfsd-fuse_error.Tpo $(DEPDIR)/afpfsd-fuse_error.Po -# source='fuse_error.c' object='afpfsd-fuse_error.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -c -o afpfsd-fuse_error.o `test -f 'fuse_error.c' || echo '$(srcdir)/'`fuse_error.c - -afpfsd-fuse_error.obj: fuse_error.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -MT afpfsd-fuse_error.obj -MD -MP -MF $(DEPDIR)/afpfsd-fuse_error.Tpo -c -o afpfsd-fuse_error.obj `if test -f 'fuse_error.c'; then $(CYGPATH_W) 'fuse_error.c'; else $(CYGPATH_W) '$(srcdir)/fuse_error.c'; fi` - mv -f $(DEPDIR)/afpfsd-fuse_error.Tpo $(DEPDIR)/afpfsd-fuse_error.Po -# source='fuse_error.c' object='afpfsd-fuse_error.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -c -o afpfsd-fuse_error.obj `if test -f 'fuse_error.c'; then $(CYGPATH_W) 'fuse_error.c'; else $(CYGPATH_W) '$(srcdir)/fuse_error.c'; fi` - -afpfsd-daemon_client.o: daemon_client.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -MT afpfsd-daemon_client.o -MD -MP -MF $(DEPDIR)/afpfsd-daemon_client.Tpo -c -o afpfsd-daemon_client.o `test -f 'daemon_client.c' || echo '$(srcdir)/'`daemon_client.c - mv -f $(DEPDIR)/afpfsd-daemon_client.Tpo $(DEPDIR)/afpfsd-daemon_client.Po -# source='daemon_client.c' object='afpfsd-daemon_client.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -c -o afpfsd-daemon_client.o `test -f 'daemon_client.c' || echo '$(srcdir)/'`daemon_client.c - -afpfsd-daemon_client.obj: daemon_client.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -MT afpfsd-daemon_client.obj -MD -MP -MF $(DEPDIR)/afpfsd-daemon_client.Tpo -c -o afpfsd-daemon_client.obj `if test -f 'daemon_client.c'; then $(CYGPATH_W) 'daemon_client.c'; else $(CYGPATH_W) '$(srcdir)/daemon_client.c'; fi` - mv -f $(DEPDIR)/afpfsd-daemon_client.Tpo $(DEPDIR)/afpfsd-daemon_client.Po -# source='daemon_client.c' object='afpfsd-daemon_client.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -c -o afpfsd-daemon_client.obj `if test -f 'daemon_client.c'; then $(CYGPATH_W) 'daemon_client.c'; else $(CYGPATH_W) '$(srcdir)/daemon_client.c'; fi` - -afpfsd-daemon_fuse.o: daemon_fuse.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -MT afpfsd-daemon_fuse.o -MD -MP -MF $(DEPDIR)/afpfsd-daemon_fuse.Tpo -c -o afpfsd-daemon_fuse.o `test -f 'daemon_fuse.c' || echo '$(srcdir)/'`daemon_fuse.c - mv -f $(DEPDIR)/afpfsd-daemon_fuse.Tpo $(DEPDIR)/afpfsd-daemon_fuse.Po -# source='daemon_fuse.c' object='afpfsd-daemon_fuse.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -c -o afpfsd-daemon_fuse.o `test -f 'daemon_fuse.c' || echo '$(srcdir)/'`daemon_fuse.c - -afpfsd-daemon_fuse.obj: daemon_fuse.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -MT afpfsd-daemon_fuse.obj -MD -MP -MF $(DEPDIR)/afpfsd-daemon_fuse.Tpo -c -o afpfsd-daemon_fuse.obj `if test -f 'daemon_fuse.c'; then $(CYGPATH_W) 'daemon_fuse.c'; else $(CYGPATH_W) '$(srcdir)/daemon_fuse.c'; fi` - mv -f $(DEPDIR)/afpfsd-daemon_fuse.Tpo $(DEPDIR)/afpfsd-daemon_fuse.Po -# source='daemon_fuse.c' object='afpfsd-daemon_fuse.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -c -o afpfsd-daemon_fuse.obj `if test -f 'daemon_fuse.c'; then $(CYGPATH_W) 'daemon_fuse.c'; else $(CYGPATH_W) '$(srcdir)/daemon_fuse.c'; fi` - -mount_afp-client.o: client.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mount_afp_CFLAGS) $(CFLAGS) -MT mount_afp-client.o -MD -MP -MF $(DEPDIR)/mount_afp-client.Tpo -c -o mount_afp-client.o `test -f 'client.c' || echo '$(srcdir)/'`client.c - mv -f $(DEPDIR)/mount_afp-client.Tpo $(DEPDIR)/mount_afp-client.Po -# source='client.c' object='mount_afp-client.o' libtool=no \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mount_afp_CFLAGS) $(CFLAGS) -c -o mount_afp-client.o `test -f 'client.c' || echo '$(srcdir)/'`client.c - -mount_afp-client.obj: client.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mount_afp_CFLAGS) $(CFLAGS) -MT mount_afp-client.obj -MD -MP -MF $(DEPDIR)/mount_afp-client.Tpo -c -o mount_afp-client.obj `if test -f 'client.c'; then $(CYGPATH_W) 'client.c'; else $(CYGPATH_W) '$(srcdir)/client.c'; fi` - mv -f $(DEPDIR)/mount_afp-client.Tpo $(DEPDIR)/mount_afp-client.Po -# source='client.c' object='mount_afp-client.obj' libtool=no \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mount_afp_CFLAGS) $(CFLAGS) -c -o mount_afp-client.obj `if test -f 'client.c'; then $(CYGPATH_W) 'client.c'; else $(CYGPATH_W) '$(srcdir)/client.c'; fi` - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) -install-binPROGRAMS: install-libLTLIBRARIES - -installdirs: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ - clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) install-data-hook - -install-dvi: install-dvi-am - -install-exec-am: install-binPROGRAMS install-libLTLIBRARIES - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) install-exec-hook - -install-html: install-html-am - -install-info: install-info-am - -install-man: - -install-pdf: install-pdf-am - -install-ps: install-ps-am - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-binPROGRAMS uninstall-libLTLIBRARIES - -.MAKE: install-am install-data-am install-exec-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ - clean-generic clean-libLTLIBRARIES clean-libtool ctags \ - distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-binPROGRAMS \ - install-data install-data-am install-data-hook install-dvi \ - install-dvi-am install-exec install-exec-am install-exec-hook \ - install-html install-html-am install-info install-info-am \ - install-libLTLIBRARIES install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-binPROGRAMS \ - uninstall-libLTLIBRARIES - - -install-data-hook: - mkdir -p $(DESTDIR)/$(mandir)/man1 - cp afpfsd.1 $(DESTDIR)/$(mandir)/man1 - cp mount_afp.1 $(DESTDIR)/$(mandir)/man1 - cp afp_client.1 $(DESTDIR)/$(mandir)/man1 - -install-exec-hook: - rm -f $(DESTDIR)$(bindir)/afp_client - $(LN_S) mount_afp $(DESTDIR)$(bindir)/afp_client - cp afpfs $(DESTDIR)$(bindir)/afpfs -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/daemon/Makefile.am b/daemon/Makefile.am deleted file mode 100644 index 553df23..0000000 --- a/daemon/Makefile.am +++ /dev/null @@ -1,36 +0,0 @@ -bin_PROGRAMS = afpfsd afp_extra mount_afp - -afp_extra_SOURCES = extra.c -afp_extra_CFLAGS = -I$(top_builddir)/include -afp_extra_LDADD = $(top_builddir)/lib/libafpclient.la $(top_builddir)/daemon/libafpsl.la - - -afpfsd_SOURCES = commands.c daemon.c fuse_int.c fuse_error.c daemon_client.c daemon_fuse.c -afpfsd_LDADD = $(top_builddir)/lib/libafpclient.la -lfuse -afpfsd_LDFLAGS = -export-dynamic -lfuse -afpfsd_CFLAGS = -I$(top_srcdir)/include -D_FILE_OFFSET_BITS=64 @CFLAGS@ - -mount_afp_SOURCES = client.c -mount_afp_CFLAGS = -I$(top_srcdir)/include -D_FILE_OFFSET_BITS=64 @CFLAGS@ -mount_afp_LDADD = $(top_builddir)/lib/libafpclient.la $(top_builddir)/daemon/libafpsl.la - - - -lib_LTLIBRARIES = libafpsl.la -libafpsl_la_CFLAGS = -I$(top_srcdir)/include @CFLAGS@ -libafpsl_la_SOURCES = stateless.c - - -install-data-hook: - mkdir -p $(DESTDIR)/$(mandir)/man1 - cp afpfsd.1 $(DESTDIR)/$(mandir)/man1 - cp mount_afp.1 $(DESTDIR)/$(mandir)/man1 - cp afp_client.1 $(DESTDIR)/$(mandir)/man1 - -install-exec-hook: - rm -f $(DESTDIR)$(bindir)/afp_client - $(LN_S) mount_afp $(DESTDIR)$(bindir)/afp_client - cp afpfs $(DESTDIR)$(bindir)/afpfs - - - diff --git a/daemon/Makefile.in b/daemon/Makefile.in deleted file mode 100644 index 35b3e91..0000000 --- a/daemon/Makefile.in +++ /dev/null @@ -1,688 +0,0 @@ -# Makefile.in generated by automake 1.10 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -bin_PROGRAMS = afpfsd$(EXEEXT) afp_extra$(EXEEXT) mount_afp$(EXEEXT) -subdir = daemon -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; -am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" -libLTLIBRARIES_INSTALL = $(INSTALL) -LTLIBRARIES = $(lib_LTLIBRARIES) -libafpsl_la_LIBADD = -am_libafpsl_la_OBJECTS = libafpsl_la-stateless.lo -libafpsl_la_OBJECTS = $(am_libafpsl_la_OBJECTS) -libafpsl_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libafpsl_la_CFLAGS) \ - $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) -PROGRAMS = $(bin_PROGRAMS) -am_afp_extra_OBJECTS = afp_extra-extra.$(OBJEXT) -afp_extra_OBJECTS = $(am_afp_extra_OBJECTS) -afp_extra_DEPENDENCIES = $(top_builddir)/lib/libafpclient.la \ - $(top_builddir)/daemon/libafpsl.la -afp_extra_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(afp_extra_CFLAGS) \ - $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -am_afpfsd_OBJECTS = afpfsd-commands.$(OBJEXT) afpfsd-daemon.$(OBJEXT) \ - afpfsd-fuse_int.$(OBJEXT) afpfsd-fuse_error.$(OBJEXT) \ - afpfsd-daemon_client.$(OBJEXT) afpfsd-daemon_fuse.$(OBJEXT) -afpfsd_OBJECTS = $(am_afpfsd_OBJECTS) -afpfsd_DEPENDENCIES = $(top_builddir)/lib/libafpclient.la -afpfsd_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(afpfsd_CFLAGS) $(CFLAGS) \ - $(afpfsd_LDFLAGS) $(LDFLAGS) -o $@ -am_mount_afp_OBJECTS = mount_afp-client.$(OBJEXT) -mount_afp_OBJECTS = $(am_mount_afp_OBJECTS) -mount_afp_DEPENDENCIES = $(top_builddir)/lib/libafpclient.la \ - $(top_builddir)/daemon/libafpsl.la -mount_afp_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(mount_afp_CFLAGS) \ - $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ -SOURCES = $(libafpsl_la_SOURCES) $(afp_extra_SOURCES) \ - $(afpfsd_SOURCES) $(mount_afp_SOURCES) -DIST_SOURCES = $(libafpsl_la_SOURCES) $(afp_extra_SOURCES) \ - $(afpfsd_SOURCES) $(mount_afp_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYCLE_OBJ = @CYCLE_OBJ@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBFUSE_LDFLAGS = @LIBFUSE_LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -afp_extra_SOURCES = extra.c -afp_extra_CFLAGS = -I$(top_builddir)/include -afp_extra_LDADD = $(top_builddir)/lib/libafpclient.la $(top_builddir)/daemon/libafpsl.la -afpfsd_SOURCES = commands.c daemon.c fuse_int.c fuse_error.c daemon_client.c daemon_fuse.c -afpfsd_LDADD = $(top_builddir)/lib/libafpclient.la -lfuse -afpfsd_LDFLAGS = -export-dynamic -lfuse -afpfsd_CFLAGS = -I$(top_srcdir)/include -D_FILE_OFFSET_BITS=64 @CFLAGS@ -mount_afp_SOURCES = client.c -mount_afp_CFLAGS = -I$(top_srcdir)/include -D_FILE_OFFSET_BITS=64 @CFLAGS@ -mount_afp_LDADD = $(top_builddir)/lib/libafpclient.la $(top_builddir)/daemon/libafpsl.la -lib_LTLIBRARIES = libafpsl.la -libafpsl_la_CFLAGS = -I$(top_srcdir)/include @CFLAGS@ -libafpsl_la_SOURCES = stateless.c -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu daemon/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu daemon/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -install-libLTLIBRARIES: $(lib_LTLIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - if test -f $$p; then \ - f=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ - else :; fi; \ - done - -uninstall-libLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - p=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ - $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ - done - -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -libafpsl.la: $(libafpsl_la_OBJECTS) $(libafpsl_la_DEPENDENCIES) - $(libafpsl_la_LINK) -rpath $(libdir) $(libafpsl_la_OBJECTS) $(libafpsl_la_LIBADD) $(LIBS) -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - if test -f $$p \ - || test -f $$p1 \ - ; then \ - f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ - else :; fi; \ - done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ - rm -f "$(DESTDIR)$(bindir)/$$f"; \ - done - -clean-binPROGRAMS: - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f $$p $$f"; \ - rm -f $$p $$f ; \ - done -afp_extra$(EXEEXT): $(afp_extra_OBJECTS) $(afp_extra_DEPENDENCIES) - @rm -f afp_extra$(EXEEXT) - $(afp_extra_LINK) $(afp_extra_OBJECTS) $(afp_extra_LDADD) $(LIBS) -afpfsd$(EXEEXT): $(afpfsd_OBJECTS) $(afpfsd_DEPENDENCIES) - @rm -f afpfsd$(EXEEXT) - $(afpfsd_LINK) $(afpfsd_OBJECTS) $(afpfsd_LDADD) $(LIBS) -mount_afp$(EXEEXT): $(mount_afp_OBJECTS) $(mount_afp_DEPENDENCIES) - @rm -f mount_afp$(EXEEXT) - $(mount_afp_LINK) $(mount_afp_OBJECTS) $(mount_afp_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afp_extra-extra.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpfsd-commands.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpfsd-daemon.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpfsd-daemon_client.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpfsd-daemon_fuse.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpfsd-fuse_error.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/afpfsd-fuse_int.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libafpsl_la-stateless.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mount_afp-client.Po@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< - -libafpsl_la-stateless.lo: stateless.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libafpsl_la_CFLAGS) $(CFLAGS) -MT libafpsl_la-stateless.lo -MD -MP -MF $(DEPDIR)/libafpsl_la-stateless.Tpo -c -o libafpsl_la-stateless.lo `test -f 'stateless.c' || echo '$(srcdir)/'`stateless.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libafpsl_la-stateless.Tpo $(DEPDIR)/libafpsl_la-stateless.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='stateless.c' object='libafpsl_la-stateless.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libafpsl_la_CFLAGS) $(CFLAGS) -c -o libafpsl_la-stateless.lo `test -f 'stateless.c' || echo '$(srcdir)/'`stateless.c - -afp_extra-extra.o: extra.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afp_extra_CFLAGS) $(CFLAGS) -MT afp_extra-extra.o -MD -MP -MF $(DEPDIR)/afp_extra-extra.Tpo -c -o afp_extra-extra.o `test -f 'extra.c' || echo '$(srcdir)/'`extra.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afp_extra-extra.Tpo $(DEPDIR)/afp_extra-extra.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='extra.c' object='afp_extra-extra.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afp_extra_CFLAGS) $(CFLAGS) -c -o afp_extra-extra.o `test -f 'extra.c' || echo '$(srcdir)/'`extra.c - -afp_extra-extra.obj: extra.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afp_extra_CFLAGS) $(CFLAGS) -MT afp_extra-extra.obj -MD -MP -MF $(DEPDIR)/afp_extra-extra.Tpo -c -o afp_extra-extra.obj `if test -f 'extra.c'; then $(CYGPATH_W) 'extra.c'; else $(CYGPATH_W) '$(srcdir)/extra.c'; fi` -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afp_extra-extra.Tpo $(DEPDIR)/afp_extra-extra.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='extra.c' object='afp_extra-extra.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afp_extra_CFLAGS) $(CFLAGS) -c -o afp_extra-extra.obj `if test -f 'extra.c'; then $(CYGPATH_W) 'extra.c'; else $(CYGPATH_W) '$(srcdir)/extra.c'; fi` - -afpfsd-commands.o: commands.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -MT afpfsd-commands.o -MD -MP -MF $(DEPDIR)/afpfsd-commands.Tpo -c -o afpfsd-commands.o `test -f 'commands.c' || echo '$(srcdir)/'`commands.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpfsd-commands.Tpo $(DEPDIR)/afpfsd-commands.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='commands.c' object='afpfsd-commands.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -c -o afpfsd-commands.o `test -f 'commands.c' || echo '$(srcdir)/'`commands.c - -afpfsd-commands.obj: commands.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -MT afpfsd-commands.obj -MD -MP -MF $(DEPDIR)/afpfsd-commands.Tpo -c -o afpfsd-commands.obj `if test -f 'commands.c'; then $(CYGPATH_W) 'commands.c'; else $(CYGPATH_W) '$(srcdir)/commands.c'; fi` -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpfsd-commands.Tpo $(DEPDIR)/afpfsd-commands.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='commands.c' object='afpfsd-commands.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -c -o afpfsd-commands.obj `if test -f 'commands.c'; then $(CYGPATH_W) 'commands.c'; else $(CYGPATH_W) '$(srcdir)/commands.c'; fi` - -afpfsd-daemon.o: daemon.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -MT afpfsd-daemon.o -MD -MP -MF $(DEPDIR)/afpfsd-daemon.Tpo -c -o afpfsd-daemon.o `test -f 'daemon.c' || echo '$(srcdir)/'`daemon.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpfsd-daemon.Tpo $(DEPDIR)/afpfsd-daemon.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='daemon.c' object='afpfsd-daemon.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -c -o afpfsd-daemon.o `test -f 'daemon.c' || echo '$(srcdir)/'`daemon.c - -afpfsd-daemon.obj: daemon.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -MT afpfsd-daemon.obj -MD -MP -MF $(DEPDIR)/afpfsd-daemon.Tpo -c -o afpfsd-daemon.obj `if test -f 'daemon.c'; then $(CYGPATH_W) 'daemon.c'; else $(CYGPATH_W) '$(srcdir)/daemon.c'; fi` -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpfsd-daemon.Tpo $(DEPDIR)/afpfsd-daemon.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='daemon.c' object='afpfsd-daemon.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -c -o afpfsd-daemon.obj `if test -f 'daemon.c'; then $(CYGPATH_W) 'daemon.c'; else $(CYGPATH_W) '$(srcdir)/daemon.c'; fi` - -afpfsd-fuse_int.o: fuse_int.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -MT afpfsd-fuse_int.o -MD -MP -MF $(DEPDIR)/afpfsd-fuse_int.Tpo -c -o afpfsd-fuse_int.o `test -f 'fuse_int.c' || echo '$(srcdir)/'`fuse_int.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpfsd-fuse_int.Tpo $(DEPDIR)/afpfsd-fuse_int.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fuse_int.c' object='afpfsd-fuse_int.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -c -o afpfsd-fuse_int.o `test -f 'fuse_int.c' || echo '$(srcdir)/'`fuse_int.c - -afpfsd-fuse_int.obj: fuse_int.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -MT afpfsd-fuse_int.obj -MD -MP -MF $(DEPDIR)/afpfsd-fuse_int.Tpo -c -o afpfsd-fuse_int.obj `if test -f 'fuse_int.c'; then $(CYGPATH_W) 'fuse_int.c'; else $(CYGPATH_W) '$(srcdir)/fuse_int.c'; fi` -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpfsd-fuse_int.Tpo $(DEPDIR)/afpfsd-fuse_int.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fuse_int.c' object='afpfsd-fuse_int.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -c -o afpfsd-fuse_int.obj `if test -f 'fuse_int.c'; then $(CYGPATH_W) 'fuse_int.c'; else $(CYGPATH_W) '$(srcdir)/fuse_int.c'; fi` - -afpfsd-fuse_error.o: fuse_error.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -MT afpfsd-fuse_error.o -MD -MP -MF $(DEPDIR)/afpfsd-fuse_error.Tpo -c -o afpfsd-fuse_error.o `test -f 'fuse_error.c' || echo '$(srcdir)/'`fuse_error.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpfsd-fuse_error.Tpo $(DEPDIR)/afpfsd-fuse_error.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fuse_error.c' object='afpfsd-fuse_error.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -c -o afpfsd-fuse_error.o `test -f 'fuse_error.c' || echo '$(srcdir)/'`fuse_error.c - -afpfsd-fuse_error.obj: fuse_error.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -MT afpfsd-fuse_error.obj -MD -MP -MF $(DEPDIR)/afpfsd-fuse_error.Tpo -c -o afpfsd-fuse_error.obj `if test -f 'fuse_error.c'; then $(CYGPATH_W) 'fuse_error.c'; else $(CYGPATH_W) '$(srcdir)/fuse_error.c'; fi` -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpfsd-fuse_error.Tpo $(DEPDIR)/afpfsd-fuse_error.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fuse_error.c' object='afpfsd-fuse_error.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -c -o afpfsd-fuse_error.obj `if test -f 'fuse_error.c'; then $(CYGPATH_W) 'fuse_error.c'; else $(CYGPATH_W) '$(srcdir)/fuse_error.c'; fi` - -afpfsd-daemon_client.o: daemon_client.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -MT afpfsd-daemon_client.o -MD -MP -MF $(DEPDIR)/afpfsd-daemon_client.Tpo -c -o afpfsd-daemon_client.o `test -f 'daemon_client.c' || echo '$(srcdir)/'`daemon_client.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpfsd-daemon_client.Tpo $(DEPDIR)/afpfsd-daemon_client.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='daemon_client.c' object='afpfsd-daemon_client.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -c -o afpfsd-daemon_client.o `test -f 'daemon_client.c' || echo '$(srcdir)/'`daemon_client.c - -afpfsd-daemon_client.obj: daemon_client.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -MT afpfsd-daemon_client.obj -MD -MP -MF $(DEPDIR)/afpfsd-daemon_client.Tpo -c -o afpfsd-daemon_client.obj `if test -f 'daemon_client.c'; then $(CYGPATH_W) 'daemon_client.c'; else $(CYGPATH_W) '$(srcdir)/daemon_client.c'; fi` -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpfsd-daemon_client.Tpo $(DEPDIR)/afpfsd-daemon_client.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='daemon_client.c' object='afpfsd-daemon_client.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -c -o afpfsd-daemon_client.obj `if test -f 'daemon_client.c'; then $(CYGPATH_W) 'daemon_client.c'; else $(CYGPATH_W) '$(srcdir)/daemon_client.c'; fi` - -afpfsd-daemon_fuse.o: daemon_fuse.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -MT afpfsd-daemon_fuse.o -MD -MP -MF $(DEPDIR)/afpfsd-daemon_fuse.Tpo -c -o afpfsd-daemon_fuse.o `test -f 'daemon_fuse.c' || echo '$(srcdir)/'`daemon_fuse.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpfsd-daemon_fuse.Tpo $(DEPDIR)/afpfsd-daemon_fuse.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='daemon_fuse.c' object='afpfsd-daemon_fuse.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -c -o afpfsd-daemon_fuse.o `test -f 'daemon_fuse.c' || echo '$(srcdir)/'`daemon_fuse.c - -afpfsd-daemon_fuse.obj: daemon_fuse.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -MT afpfsd-daemon_fuse.obj -MD -MP -MF $(DEPDIR)/afpfsd-daemon_fuse.Tpo -c -o afpfsd-daemon_fuse.obj `if test -f 'daemon_fuse.c'; then $(CYGPATH_W) 'daemon_fuse.c'; else $(CYGPATH_W) '$(srcdir)/daemon_fuse.c'; fi` -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/afpfsd-daemon_fuse.Tpo $(DEPDIR)/afpfsd-daemon_fuse.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='daemon_fuse.c' object='afpfsd-daemon_fuse.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(afpfsd_CFLAGS) $(CFLAGS) -c -o afpfsd-daemon_fuse.obj `if test -f 'daemon_fuse.c'; then $(CYGPATH_W) 'daemon_fuse.c'; else $(CYGPATH_W) '$(srcdir)/daemon_fuse.c'; fi` - -mount_afp-client.o: client.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mount_afp_CFLAGS) $(CFLAGS) -MT mount_afp-client.o -MD -MP -MF $(DEPDIR)/mount_afp-client.Tpo -c -o mount_afp-client.o `test -f 'client.c' || echo '$(srcdir)/'`client.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/mount_afp-client.Tpo $(DEPDIR)/mount_afp-client.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='client.c' object='mount_afp-client.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mount_afp_CFLAGS) $(CFLAGS) -c -o mount_afp-client.o `test -f 'client.c' || echo '$(srcdir)/'`client.c - -mount_afp-client.obj: client.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mount_afp_CFLAGS) $(CFLAGS) -MT mount_afp-client.obj -MD -MP -MF $(DEPDIR)/mount_afp-client.Tpo -c -o mount_afp-client.obj `if test -f 'client.c'; then $(CYGPATH_W) 'client.c'; else $(CYGPATH_W) '$(srcdir)/client.c'; fi` -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/mount_afp-client.Tpo $(DEPDIR)/mount_afp-client.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='client.c' object='mount_afp-client.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mount_afp_CFLAGS) $(CFLAGS) -c -o mount_afp-client.obj `if test -f 'client.c'; then $(CYGPATH_W) 'client.c'; else $(CYGPATH_W) '$(srcdir)/client.c'; fi` - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) -install-binPROGRAMS: install-libLTLIBRARIES - -installdirs: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ - clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) install-data-hook - -install-dvi: install-dvi-am - -install-exec-am: install-binPROGRAMS install-libLTLIBRARIES - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) install-exec-hook - -install-html: install-html-am - -install-info: install-info-am - -install-man: - -install-pdf: install-pdf-am - -install-ps: install-ps-am - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-binPROGRAMS uninstall-libLTLIBRARIES - -.MAKE: install-am install-data-am install-exec-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ - clean-generic clean-libLTLIBRARIES clean-libtool ctags \ - distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-binPROGRAMS \ - install-data install-data-am install-data-hook install-dvi \ - install-dvi-am install-exec install-exec-am install-exec-hook \ - install-html install-html-am install-info install-info-am \ - install-libLTLIBRARIES install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-binPROGRAMS \ - uninstall-libLTLIBRARIES - - -install-data-hook: - mkdir -p $(DESTDIR)/$(mandir)/man1 - cp afpfsd.1 $(DESTDIR)/$(mandir)/man1 - cp mount_afp.1 $(DESTDIR)/$(mandir)/man1 - cp afp_client.1 $(DESTDIR)/$(mandir)/man1 - -install-exec-hook: - rm -f $(DESTDIR)$(bindir)/afp_client - $(LN_S) mount_afp $(DESTDIR)$(bindir)/afp_client - cp afpfs $(DESTDIR)$(bindir)/afpfs -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/daemon/afp_client.1 b/daemon/afp_client.1 deleted file mode 100644 index a4fb556..0000000 --- a/daemon/afp_client.1 +++ /dev/null @@ -1,98 +0,0 @@ -.TH AFP_CLIENT "3 February 2008" "afpfs-ng" -.SH NAME -afp_client\- Mount, unmount and control Apple Filing Protocol (AFP) sessions using the FUSE infrastructure. -.SH SYNOPSIS -.B "afp_client mount|status|unmount|suspend|resume|exit [options]" -.SH DESCRIPTION -.B afp_client -command allows you to perform some basic functions to access AFP volumes, such as mount, unmount, get status, suspend and resume. - -Do not confuse this with afpcmd; afp_client is to be used only for the FUSE client, in conjunction with afpfsd(1). afpcmd is a batch-mode file transferring client. Both of them use the afpfs-ng libraries. - -afp_mount(1) is normally a symlink to afp_client. It only handles mounting commands with a fully formed AFP URL. - -.SH COMMANDS -.TP -.B mount -The name of the interface. This is usually a driver name followed by -a unit number, for example -.B eth0 -for the first Ethernet interface. -.TP -.B mount [mount options] node -Using the authentication and server information provided with the mount options, mount the remove filesystem on node. For more information, see the "mount options" later in this man page. If you would prefer to use the AFP URL syntax, see mount_afp(1) for more information. -.TP -.B unmount node -Remove the AFP mount that is currently connected to -.B node -.TP -.B status -Show status information of all connected servers. This will provide information on connected servers' IP address, server descriptions (machine type, machine name, signature, login message) and available volumes. It also provides statistics and other details. -.Lp -This is crtical for debugging. -.TP -.B suspend -Suspends but does not unmount the current connections to all currently connected server. Currently unsupported. -.TP -.B resume -Resumes all suspended server connections. Currently unsupported. -Enable or disable the -.B promiscuous -mode of the interface. If selected, all packets on the network will -be received by the interface. -.SH MOUNT FLAGS -.TP -.B -u, --user -Log in using -.TP -.B -p, --pass -If you specify a '-' as the password, you will be prompted for it. This allows you to use a password without having to expose it on the command line. -.TP -.B -o, --port -Use TCP portnum instead of the default, 548. -.TP -.B -V, --volumepassword -Use this if the volume you're accessing uses a volume password (a very weak form of protection as it is transferred as clear text). If you specify a '-' as the password, you will be prompted for it. This allows you to use a password without having to expose it on the command line. - -If you specify a '-' as the password, you will be prompted for it. This allows you to use a password without having to expose it on the command line. -.TP -.B -v, --version -Specify the AFP version that will be used for a mount. For AFP 2.2, use '22', for 3.2, use '32', etc. By default afpfs-ng will choose the highest AFP version shared between the client and server. afpfs-ng supports AFP 2.0 up to 3.2. -.B -a, --uam -Set the authentication method, to one of: -.RS -.PP -.I No User Authent -.PP -.I Cleartxt Passwrd -.PP -.I Randnum Exchange -.PP -.I 2-Way Randnum Exchange -.PP -.I DHCAST128 -.PP -.I Client Krb v2 -.PP -.I DHX2 -.RE - -If you do not specify a UAM, the most secure one common to both the server and client (afpfs-ng) will be chosen. -.TP -.B -m, --map -Set the method used to map local to server UID and GIDs. Posible values are: -.RS -.PP -.I Common user directory -This should be used in an environment where the UID and GID of the client and server are expected to match perfectly. An example of this is where there is an NIS or open directory server. -.PP -.I Login ids -Use this when you want all files to appear to be owned by the uid and gid of the userid that you used for your authentication information. -.TP -.SH HISTORY -afp_client is part of the FUSE implementation of afpfs-ng. - -.SH SEE ALSO -afpfsd(1), mount_afp(1) -.SH AUTHORS -Alex deVries, alexthepuffin@gmail.com diff --git a/daemon/afpfs b/daemon/afpfs deleted file mode 100755 index 1bed585..0000000 --- a/daemon/afpfs +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -mount_afp "${3}" "${4}" "${1}" "${2}" diff --git a/daemon/afpfsd.1 b/daemon/afpfsd.1 deleted file mode 100644 index f1d2fbe..0000000 --- a/daemon/afpfsd.1 +++ /dev/null @@ -1,22 +0,0 @@ -.TH afpfsd 1 "1 Feb 2008" 0.8 afpfs-ng -.SH NAME -afpfsd \- Daemon to manage AFP sessions for the afpfs-ng FUSE client. -.SH SYNOPSIS -\fIafpfsd\fR [\fB-l|logmethod=method\f] [\f-f|--foreground\f] [\f-d|--debug\f] - -.SH DESCRIPTION -\fiafpfsd\fR is a daemon that manages AFP sessions. Functions (like mounting, getting status, etc) can be performed using the afp_client(1) tool. This client communicates with the daemon over a named pipe. - -afpfsd will not start if another instance is already running. There needs to be one copy of afpfsd running per user. - -.SH OPTIONS - -\fB-l|--logmethod\fR sets the method used to log; values are stdout or syslog - -\fB-f|--foreground\fR doesn't fork the daemon - -\fB-f|--debug\fR puts the daemon in the foreground and dumps logs to stdout - -.SH "SEE ALSO" -\fBafp_client\fR(1), \fBmount_afp\fR(1) - diff --git a/daemon/client.c b/daemon/client.c deleted file mode 100644 index 95917b3..0000000 --- a/daemon/client.c +++ /dev/null @@ -1,437 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "config.h" -#include -#include "afpfsd.h" -#include "uams_def.h" -#include "map_def.h" -#include "libafpclient.h" -#include "afpsl.h" - -static char * thisbin; - -static void usage(void) -{ - printf( -"afp_client [command] [options]\n" -" mount [mountopts] : \n" -" mount options:\n" -" -u, --user : log in as user \n" -" -p, --pass : use \n" -" If password is '-', password will be hidden\n" -" -o, --port : connect using instead of 548\n" -" -V, --volumepassword : use this volume password\n" -" -v, --afpversion set the AFP version, eg. 3.1\n" -" -a, --uam : use this authentication method, one of:\n" -" \"No User Authent\", \"Cleartxt Passwrd\", \n" -" \"Randnum Exchange\", \"2-Way Randnum Exchange\", \n" -" \"DHCAST128\", \"Client Krb v2\", \"DHX2\" \n\n" -" -m, --map : use this uid/gid mapping method, one of:\n" -" \"Common user directory\", \"Login ids\"\n" -" status: get status of the AFP daemon\n\n" -" unmount : unmount\n\n" -" suspend : terminates the connection to the server, but\n" -" maintains the mount. For laptop suspend/resume\n" -" resume : resumes the server connection \n\n" -" exit : unmounts all volumes and exits afpfsd\n" -); - } - -static int do_exit(int argc,char **argv) -{ - if (afp_sl_exit()==AFP_SERVER_RESULT_AFPFSD_ERROR) { - printf("Could not connect to afpfsd.\n"); - return -1; - } - - return 0; - -} - -static int do_status(int argc, char ** argv) -{ - char volumename[AFP_VOLUME_NAME_UTF8_LEN]; - char servername[AFP_SERVER_NAME_LEN]; - int c; - int option_index=0; - int optnum; - -#define STATUS_TEXT_LEN 20000 - unsigned int len=STATUS_TEXT_LEN; - char text[STATUS_TEXT_LEN]; - - struct option long_options[] = { - {"volume",1,0,'v'}, - {"server",1,0,'s'}, - {0,0,0,0}, - }; - - - memset(volumename,0,AFP_VOLUME_NAME_UTF8_LEN); - memset(servername,0,AFP_SERVER_NAME_LEN); - memset(text,0,STATUS_TEXT_LEN); - - while(1) { - optnum++; - c = getopt_long(argc,argv,"v:s:", - long_options,&option_index); - if (c==-1) break; - switch(c) { - case 'v': - snprintf(volumename,AFP_VOLUME_NAME_UTF8_LEN, - "%s",optarg); - break; - } - } - if (afp_sl_status(volumename,servername,text,&len) - ==AFP_SERVER_RESULT_AFPFSD_ERROR) { - printf("Could not setup connection to afpfsd\n"); - return -1; - } - - printf(text); - - return 0; -} - -static int do_resume(int argc, char ** argv) -{ - if (argc<3) { - usage(); - return -1; - } - - if (afp_sl_resume(argv[2])==AFP_SERVER_RESULT_AFPFSD_ERROR) { - printf("Could not setup connection to afpfsd\n"); - return -1; - } - - return 0; -} - -static int do_suspend(int argc, char ** argv) -{ - if (argc<3) { - usage(); - return -1; - } - - if (afp_sl_suspend(argv[2])==AFP_SERVER_RESULT_AFPFSD_ERROR) { - printf("Could not setup connection to afpfsd\n"); - return -1; - } - return 0; -} - -static int do_unmount(int argc, char ** argv) -{ - if (argc<2) { - usage(); - return -1; - } - -/* FIXME: deal with mntpoint */ - if (afp_sl_unmount(argv[2])==AFP_SERVER_RESULT_AFPFSD_ERROR) { - printf("Could not setup connection to afpfsd\n"); - return -1; - } - - - return 0; -} - -static int do_mount(int argc, char ** argv) -{ - int c; - int option_index=0; - int optnum; - struct afp_url url; - unsigned int uam_mask=default_uams_mask(); - int map=AFP_MAPPING_UNKNOWN; - char mountpoint[PATH_MAX]; - unsigned int volume_options; - serverid_t serverid; - char loginmesg[AFP_LOGINMESG_LEN]; - int ret; - - struct option long_options[] = { - {"afpversion",1,0,'v'}, - {"volumepassword",1,0,'V'}, - {"user",1,0,'u'}, - {"pass",1,0,'p'}, - {"port",1,0,'o'}, - {"uam",1,0,'a'}, - {"map",1,0,'m'}, - {0,0,0,0}, - }; - if (argc<4) { - usage(); - return -1; - } - - afp_default_url(&url); - - while(1) { - optnum++; - c = getopt_long(argc,argv,"a:u:m:o:p:v:V:", - long_options,&option_index); - if (c==-1) break; - switch(c) { - case 'a': - if (strcmp(optarg,"guest")==0) - uam_mask=UAM_NOUSERAUTHENT; - else - uam_mask=uam_string_to_bitmap(optarg); - break; - case 'm': - map=map_string_to_num(optarg); - break; - case 'u': - snprintf(url.username,AFP_MAX_USERNAME_LEN,"%s",optarg); - break; - case 'o': - url.port=strtol(optarg,NULL,10); - break; - case 'p': - snprintf(url.password,AFP_MAX_PASSWORD_LEN,"%s",optarg); - break; - case 'V': - snprintf(url.volpassword,9,"%s",optarg); - break; - case 'v': - url.requested_version=strtol(optarg,NULL,10); - break; - } - } - - if (strcmp(url.password, "-") == 0) { - char *p = getpass("AFP Password: "); - if (p) - snprintf(url.password,AFP_MAX_PASSWORD_LEN,"%s",p); - } - if (strcmp(url.volpassword, "-") == 0) { - char *p = getpass("Password for volume: "); - if (p) - snprintf(url.volpassword,9,"%s",p); - } - - optnum=optind+1; - if (optnum>=argc) { - printf("No volume or mount point specified\n"); - return -1; - } - if (sscanf(argv[optnum++],"%[^':']:%[^':']", - url.servername,url.volumename)!=2) { - printf("Incorrect server:volume specification\n"); - return -1; - } - if (uam_mask==0) { - printf("Unknown UAM\n"); - return -1; - } - - if (optnum>=argc) { - printf("No mount point specified\n"); - return -1; - } - - snprintf(mountpoint,255,"%s",argv[optnum++]); - - - ret=afp_sl_connect(&url,uam_mask,&serverid,loginmesg,NULL); - if (ret==AFP_SERVER_RESULT_AFPFSD_ERROR) { - printf("Could not setup connection to afpfsd\n"); - return -1; - } - - if (ret!=AFP_SERVER_RESULT_OKAY) { - printf("Cound not connect, so not proceeding with mount.\n"); - return -1; - } - - if (strlen(loginmesg)>0) - printf("Login message:\n%s\n",loginmesg); - - afp_sl_mount(&url,mountpoint,map, DEFAULT_MOUNT_FLAGS); - - return 0; -} - -static void mount_afp_usage(void) -{ - printf("Usage:\n mount_afp [-o volpass=password] \n"); -} - -static int handle_mount_afp(int argc, char * argv[]) -{ - char * urlstring, * mountpoint; - char * volpass = NULL; - int readonly=0; - struct afp_url url; - unsigned int volume_options = 0, map=0, uam_mask = default_uams_mask(); - unsigned int uid = geteuid(); - unsigned int gid; - int ret; - static int changeuid=0; - static int changegid=0; - serverid_t serverid; - char loginmesg[AFP_LOGINMESG_LEN]; - - if (argc<2) { - mount_afp_usage(); - return -1; - } - if (strncmp(argv[1],"-o",2)==0) { - char * p = argv[2], *q; - char command[256]; - struct passwd * passwd; - struct group * group; - - do { - memset(command,0,256); - - if ((q=strchr(p,','))) - strncpy(command,p,(q-p)); - else - strcpy(command,p); - - if (strncmp(command,"volpass=",8)==0) { - p+=8; - volpass=p; - } else if (strncmp(command,"user=",5)==0) { - p=command+5; - if ((passwd=getpwnam(p))==NULL) { - printf("Unknown user %s\n",p); - return -1; - } - uid=passwd->pw_uid; - if (geteuid()!=uid) - changeuid=1; - } else if (strncmp(command,"group=",6)==0) { - p=command+6; - if ((group=getgrnam(p))==NULL) { - printf("Unknown group %s\n",p); - return -1; - } - gid=group->gr_gid; - changegid=1; - } else if (strcmp(command,"rw")==0) { - /* Don't do anything */ - } else if (strcmp(command,"ro")==0) { - readonly=1; - } else { - printf("Unknown option %s, skipping\n",command); - } - if (q) p=q+1; - else p=NULL; - - } while (p); - - urlstring=argv[3]; - mountpoint=argv[4]; - } else { - urlstring=argv[1]; - mountpoint=argv[2]; - } - - afp_default_url(&url); - - volume_options|=DEFAULT_MOUNT_FLAGS; - if (readonly) volume_options |= VOLUME_EXTRA_FLAGS_READONLY; - - map=AFP_MAPPING_UNKNOWN; - - if (afp_parse_url(&url,urlstring,0) !=0) - { - printf("Could not parse URL\n"); - return -1; - } - if (strcmp(url.password,"-")==0) { - char *p = getpass("AFP Password: "); - if (p) - snprintf(url.password,AFP_MAX_PASSWORD_LEN,"%s",p); - } - - if (volpass && (strcmp(volpass,"-")==0)) { - volpass = getpass("Password for volume: "); - } - if (volpass) - snprintf(url.volpassword,9,"%s",volpass); - - if (changeuid || changegid) - ret=afp_sl_setup_diffuser(uid,gid); - - - ret=afp_sl_connect(&url,uam_mask,&serverid,loginmesg,NULL); - - if (ret==AFP_SERVER_RESULT_AFPFSD_ERROR) { - printf("Could not connect to afpfsd\n"); - return -1; - } else if (ret!=AFP_SERVER_RESULT_OKAY) { - printf("Could not connect, so not proceeding with mount.\n"); - return -1; - } - - if (strlen(loginmesg)>0) - printf("Login message:\n%s\n",loginmesg); - afp_sl_mount(&url,mountpoint,map,volume_options); - - return 0; -} - -static int handle_afp_client(int argc, char * argv[]) -{ - - if (argc<2) { - usage(); - return -1; - } - if (strncmp(argv[1],"mount",5)==0) { - return do_mount(argc,argv); - } else if (strncmp(argv[1],"resume",6)==0) { - return do_resume(argc,argv); - } else if (strncmp(argv[1],"suspend",7)==0) { - return do_suspend(argc,argv); - - } else if (strncmp(argv[1],"status",6)==0) { - return do_status(argc,argv); - - } else if (strncmp(argv[1],"unmount",7)==0) { - return do_unmount(argc,argv); - } else if (strncmp(argv[1],"exit",4)==0) { - return do_exit(argc,argv); - - } else { - usage(); - return -1; - } - - return 0; -} - -int main(int argc, char *argv[]) -{ - int ret = 0; - thisbin=argv[0]; - - if (strstr(argv[0],"mount_afp")) { - if (handle_mount_afp(argc,argv)<0) - ret=-1; - } else { - ret=handle_afp_client(argc,argv); - } - - return ret; -} - diff --git a/daemon/commands.c b/daemon/commands.c deleted file mode 100644 index 2673251..0000000 --- a/daemon/commands.c +++ /dev/null @@ -1,1359 +0,0 @@ -/* - * commands.c - * - * Copyright (C) 2006 Alex deVries - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "config.h" -#include "afp.h" -#include "dsi.h" -#include "afpfsd.h" -#include "utils.h" -#include "daemon.h" -#include "uams_def.h" -#include "codepage.h" -#include "libafpclient.h" -#include "map_def.h" -#include "fuse_int.h" -#include "fuse_error.h" -#include "daemon_client.h" -#include "commands.h" - -#define client_string_len(x) \ - (strlen(((struct daemon_client *)(x))->outgoing_string)) - - -void trigger_exit(void); /* move this */ - -static int volopen(struct daemon_client * c, struct afp_volume * volume) -{ - char mesg[1024]; - unsigned int l = 0; - memset(mesg,0,1024); - int rc=afp_connect_volume(volume,volume->server,mesg,&l,1024); - - log_for_client((void *) c,AFPFSD,LOG_ERR,mesg); - - return rc; - -} - -static unsigned char process_suspend(struct daemon_client * c) -{ - struct afp_server_suspend_request * req =(void *)c->complete_packet; - struct afp_server * s; - - /* Find the server */ - if ((s=find_server_by_name(req->server_name))==NULL) { - log_for_client((void *) c,AFPFSD,LOG_ERR, - "%s is an unknown server\n",req->server_name); - return AFP_SERVER_RESULT_ERROR; - } - - if (afp_zzzzz(s)) - return AFP_SERVER_RESULT_ERROR; - - loop_disconnect(s); - - s->connect_state=SERVER_STATE_DISCONNECTED; - log_for_client((void *) c,AFPFSD,LOG_NOTICE, - "Disconnected from %s\n",req->server_name); - return AFP_SERVER_RESULT_OKAY; -} - - -static int afp_server_reconnect_loud(struct daemon_client * c, struct afp_server * s) -{ - char mesg[1024]; - unsigned int l = 2040; - int rc; - - rc=afp_server_reconnect(s,mesg,&l,l); - - if (rc) - log_for_client((void *) c,AFPFSD,LOG_ERR, - "%s",mesg); - return rc; - - -} - - -static unsigned char process_resume(struct daemon_client * c) -{ - struct afp_server_resume_request * req =(void *) c->complete_packet; - struct afp_server * s; - - /* Find the server */ - if ((s=find_server_by_name(req->server_name))==NULL) { - log_for_client((void *) c,AFPFSD,LOG_ERR, - "%s is an unknown server\n",req->server_name); - return AFP_SERVER_RESULT_ERROR; - } - - if (afp_server_reconnect_loud(c,s)) - { - log_for_client((void *) c,AFPFSD,LOG_ERR, - "Unable to reconnect to %s\n",req->server_name); - return AFP_SERVER_RESULT_ERROR; - } - log_for_client((void *) c,AFPFSD,LOG_NOTICE, - "Resumed connection to %s\n",req->server_name); - - return AFP_SERVER_RESULT_OKAY; - -} - -/* process_unmount - * - * result returns: - * AFP_SERVER_RESULT_NOTATTACHED - * AFP_SERVER_RESULT_NOVOLUME - * AFP_SERVER_RESULT_OKAY - */ - -static unsigned char process_unmount(struct daemon_client * c) -{ - struct afp_server_unmount_request * req; - struct afp_server_unmount_response response; - struct afp_server * s; - struct afp_volume * v; - int j=0; - - req=(void *) c->complete_packet; - - /* Try it based on volume name */ - - for (s=get_server_base();s;s=s->next) { - for (j=0;jnum_volumes;j++) { - v=&s->volumes[j]; - if (strcmp(v->volume_name,req->name)==0) { - goto found; - } - - } - } - - /* Try it based on mountpoint name */ - - for (s=get_server_base();s;s=s->next) { - for (j=0;jnum_volumes;j++) { - v=&s->volumes[j]; - if (strcmp(v->mountpoint,req->name)==0) { - goto found; - } - - } - } - response.header.result = AFP_SERVER_RESULT_NOVOLUME; - goto notfound; -found: - if (v->mounted != AFP_VOLUME_MOUNTED ) { - snprintf(response.unmount_message,1023, - "%s was not mounted\n",v->mountpoint); - response.header.result = AFP_SERVER_RESULT_NOTATTACHED; - goto done; - } - - afp_unmount_volume(v); - - response.header.result = AFP_SERVER_RESULT_OKAY; - snprintf(response.unmount_message,1023, - "Unmounted mountpoint %s.\n",v->mountpoint); - goto done; - -notfound: - snprintf(response.unmount_message,1023, - "There's no volume or mountpoint called %s.\n",req->name); - -done: - response.header.len=sizeof(struct afp_server_unmount_response); - send_command(c,response.header.len,(char *) &response); - - remove_command(c); - - if (req->header.close) - close_client_connection(c); - else - continue_client_connection(c); - - return 0; - -} - - -static struct afp_volume * find_volume_by_id(volumeid_t * id) -{ - struct afp_server * s; - struct afp_volume * v; - int j; - for (s=get_server_base();s;s=s->next) { - for (j=0;jnum_volumes;j++) { - v=&s->volumes[j]; - if (((volumeid_t) v) == *id) - return v; - } - } - return NULL; -} - - -static unsigned char process_detach(struct daemon_client * c) -{ - struct afp_server_detach_request * req; - struct afp_server_detach_response response; - struct afp_server * s; - struct afp_volume * v; - int j=0; - - req=(void *) c->complete_packet; - - /* Validate the volumeid */ - - if ((v = find_volume_by_id(&req->volumeid))==NULL) { - snprintf(response.detach_message,1023, - "No such volume to detach"); - response.header.result = AFP_SERVER_RESULT_ERROR; - goto done; - } - - if (v->mounted != AFP_VOLUME_MOUNTED ) { - snprintf(response.detach_message,1023, - "%s was not attached\n",v->volume_name); - response.header.result = AFP_SERVER_RESULT_ERROR; - goto done; - } - - afp_unmount_volume(v); - - response.header.result = AFP_SERVER_RESULT_OKAY; - snprintf(response.detach_message,1023, - "Detached volume %s.\n",v->volume_name); - goto done; - -done: - response.header.len=sizeof(struct afp_server_detach_response); - send_command(c,response.header.len,(char *) &response); - - if (req->header.close) - close_client_connection(c); - else - continue_client_connection(c); - - return 0; - -} - -static unsigned char process_ping(struct daemon_client * c) -{ - log_for_client((void *)c,AFPFSD,LOG_INFO, - "Ping!\n"); - return AFP_SERVER_RESULT_OKAY; -} - -static unsigned char process_exit(struct daemon_client * c) -{ - log_for_client((void *)c,AFPFSD,LOG_INFO, - "Exiting\n"); - trigger_exit(); - return AFP_SERVER_RESULT_OKAY; -} - -/* process_get_mountpoint() - * - */ - -static unsigned char process_get_mountpoint(struct daemon_client * c) -{ - struct afp_volume * v; - struct afp_server_get_mountpoint_request * req = - (void *) c->complete_packet; - struct afp_server_get_mountpoint_response response; - int ret = AFP_SERVER_RESULT_OKAY; - - if ((c->completed_packet_size)< - sizeof(struct afp_server_get_mountpoint_request)) { - ret=AFP_SERVER_RESULT_ERROR; - goto done; - } - if ((v=find_volume_by_url(&req->url))==NULL) { - ret=AFP_SERVER_RESULT_NOTATTACHED; - goto done; - } - - memcpy(response.mountpoint,v->mountpoint,PATH_MAX); - ret=AFP_SERVER_RESULT_OKAY; - -done: - response.header.result=ret; - response.header.len=sizeof(struct afp_server_get_mountpoint_response); - - send_command(c,response.header.len,(char *) &response); - - if (req->header.close) - close_client_connection(c); - else - continue_client_connection(c); - - return 0; -} - -/* process_getvolid() - * - * Gets the volume id for a url provided, if it exists - * - * Sets the return result to be: - * AFP_SERVER_RESULT_ERROR : internal error - * AFP_SERVER_RESULT_NOTCONNECTED: not logged in - * AFP_SERVER_RESULT_NOTATTACHED: connected, but not attached to volume - * AFP_SERVER_RESULT_OKAY: lookup succeeded, volumeid set - */ - -static unsigned char process_getvolid(struct daemon_client * c) -{ - struct afp_volume * v; - struct afp_server * s; - struct afp_server_getvolid_request * req = (void *) c->complete_packet; - struct afp_server_getvolid_response response; - int ret = AFP_SERVER_RESULT_OKAY; - - if ((c->completed_packet_size)< sizeof(struct afp_server_getvolid_request)) { - ret=AFP_SERVER_RESULT_ERROR; - goto done; - } - - if ((s=find_server_by_url(&req->url))==NULL) { - ret=AFP_SERVER_RESULT_NOTCONNECTED; - goto done; - } - - if ((v=find_volume_by_url(&req->url))==NULL) { - ret=AFP_SERVER_RESULT_NOTATTACHED; - goto done; - } - - response.volumeid=(volumeid_t) v; - response.header.result=AFP_SERVER_RESULT_OKAY; - -done: - response.header.result=ret; - response.header.len=sizeof(struct afp_server_getvolid_response); - - send_command(c,response.header.len,(char *) &response); - - if (req->header.close) - close_client_connection(c); - else - continue_client_connection(c); - - return 0; -} - -static unsigned char process_serverinfo(struct daemon_client * c) -{ - struct afp_server_serverinfo_request * req = (void *) c->complete_packet; - struct afp_server_serverinfo_response response; - struct afp_server * tmpserver=NULL; - - memset(&response,0,sizeof(response)); - c->pending=1; - - if ((c->completed_packet_size)< sizeof(struct afp_server_serverinfo_request)) { - return AFP_SERVER_RESULT_ERROR; - } - - if ((tmpserver=find_server_by_url(&req->url))) { - /* We're already connected */ - memcpy(&response.server_basic, - &tmpserver->basic, sizeof(struct afp_server_basic)); - } else { - struct sockaddr_in address; - if ((afp_get_address(NULL,req->url.servername, - req->url.port,&address))<0) { - goto error; - } - - if ((tmpserver=afp_server_init(&address))==NULL) { - goto error; - } - - if (afp_server_connect(tmpserver,1)<0) { - goto error; - } - memcpy(&response.server_basic, - &tmpserver->basic, sizeof(struct afp_server_basic)); - afp_server_remove(tmpserver); - } - response.header.result=AFP_SERVER_RESULT_OKAY; - goto done; - -error: - response.header.result=AFP_SERVER_RESULT_ERROR; -done: - response.header.len=sizeof(struct afp_server_serverinfo_response); - send_command(c,response.header.len,(char *) &response); - - if (req->header.close) - close_client_connection(c); - else - continue_client_connection(c); - - return 0; - -} - -static unsigned char process_status(struct daemon_client * c) -{ - struct afp_server * s; - -#define STATUS_RESULT_LEN 40960 - - char data[STATUS_RESULT_LEN+sizeof(struct afp_server_status_response)]; - unsigned int len=STATUS_RESULT_LEN; - struct afp_server_status_request * req = (void *) c->complete_packet; - struct afp_server_status_response * response = (void *) data; - char * t = data + sizeof(struct afp_server_status_response); - - memset(data,0,sizeof(data)); - c->pending=1; - - if ((c->completed_packet_size)< sizeof(struct afp_server_status_request)) - return AFP_SERVER_RESULT_ERROR; - - afp_status_header(t,&len); - -/* - log_for_client((void *)c,AFPFSD,LOG_INFO,text); -*/ - - s=get_server_base(); - - for (s=get_server_base();s;s=s->next) { - afp_status_server(s,t,&len); -/* - log_for_client((void *)c,AFPFSD,LOG_DEBUG,text); -*/ - - } - - response->header.len=sizeof(struct afp_server_status_response)+ - (STATUS_RESULT_LEN-len); - response->header.result=AFP_SERVER_RESULT_OKAY; - - send_command(c,response->header.len,data); - - if (req->header.close) - close_client_connection(c); - else - continue_client_connection(c); - - return 0; - -} - -static unsigned char process_getvols(struct daemon_client * c) -{ - - struct afp_server_getvols_request * request = (void *) c->complete_packet; - struct afp_server_getvols_response * response; - struct afp_server * server; - struct afp_volume * volume; - unsigned int maximum_that_will_fit; - unsigned int result; - unsigned int numvols; - int i; - char * p; - unsigned int len = sizeof(struct afp_server_getvols_response); - struct afp_volume_summary * sum; - - if (((c->completed_packet_size)< sizeof(struct afp_server_getvols_request)) || - (request->start<0)) { - result=AFP_SERVER_RESULT_ERROR; - goto error; - } - - if ((server=find_server_by_url(&request->url))==NULL) { - result=AFP_SERVER_RESULT_NOTCONNECTED; - goto error; - } - - maximum_that_will_fit = - (MAX_CLIENT_RESPONSE - sizeof(struct afp_server_getvols_response)) / - sizeof(struct afp_volume_summary); - - /* find out how many there are */ - - numvols = server->num_volumes; - - if (request->countcount; - - if (request->start>numvols) - goto error; - - - len += numvols * sizeof(struct afp_volume_summary);; - - response = malloc(len); - - p = (void *) response + sizeof(struct afp_server_getvols_response); - - for (i=request->start;istart + numvols;i++) { - volume = &server->volumes[i]; - sum=(void *) p; - memcpy(sum->volume_name_printable, - volume->volume_name_printable,AFP_VOLUME_NAME_UTF8_LEN); - sum->flags=volume->flags; - - p=p + sizeof(struct afp_volume_summary); - } - - response->num=numvols; - - result = AFP_SERVER_RESULT_OKAY; - - goto done; - - -error: - response = (void*) malloc(len); - -done: - response->header.len=len; - response->header.result=result; - - send_command(c,response->header.len,(char *)response); - - free(response); - - if (request->header.close) - close_client_connection(c); - else - continue_client_connection(c); - - return 0; -} - -static unsigned char process_open(struct daemon_client * c) -{ - struct afp_server_open_response response; - struct afp_server_open_request * request = (void *) c->complete_packet; - struct afp_volume * v; - int ret; - int result = AFP_SERVER_RESULT_OKAY; - struct afp_file_info * fp; - - if ((c->completed_packet_size)< sizeof(struct afp_server_open_request)) { - result=AFP_SERVER_RESULT_ERROR; - goto done; - } - - /* Find the volume */ - if ((v = find_volume_by_id(&request->volumeid))==NULL) { - result=AFP_SERVER_RESULT_NOTATTACHED; - goto done; - } - - ret = afp_ml_open(v,request->path,request->mode, &fp); - - if (ret) { - result=ret; - free(fp); - goto done; - } - response.fileid=fp->forkid; - - free(fp); - -done: - response.header.len=sizeof(struct afp_server_open_response); - response.header.result=result; - send_command(c,response.header.len,(char*) &response); - - if (request->header.close) - close_client_connection(c); - else - continue_client_connection(c); - - return 0; -} - -static unsigned char process_read(struct daemon_client * c) -{ - struct afp_server_read_response * response; - struct afp_server_read_request * request = (void *) c->complete_packet; - struct afp_volume * v; - int ret; - int result = AFP_SERVER_RESULT_OKAY; - char * data; - unsigned int eof = 0; - unsigned int received; - unsigned int len = sizeof(struct afp_server_read_response); - - if ((c->completed_packet_size)< sizeof(struct afp_server_read_request)) { - response=malloc(len); - result=AFP_SERVER_RESULT_ERROR; - goto done; - } - - /* Find the volume */ - if ((v = find_volume_by_id(&request->volumeid))==NULL) { - response=malloc(len); - result=AFP_SERVER_RESULT_NOTATTACHED; - goto done; - } - - len+=request->length; - response = malloc(len); - data = ((char *) response) + sizeof(struct afp_server_read_response); - - ret = ll_read(v,data,request->length,request->start, - request->fileid,&eof); - - if (ret>0) { - received=ret; - } - - -done: - response->eof=eof; - response->header.len=len; - response->header.result=result; - response->received=received; - send_command(c,len,(char*) response); - - if (request->header.close) - close_client_connection(c); - else - continue_client_connection(c); - - return 0; -} - -static unsigned char process_close(struct daemon_client * c) -{ - struct afp_server_close_response response; - struct afp_server_close_request * request = (void *) c->complete_packet; - struct afp_volume * v; - int ret; - int result = AFP_SERVER_RESULT_OKAY; - - if ((c->completed_packet_size)< sizeof(struct afp_server_close_request)) { - result=AFP_SERVER_RESULT_ERROR; - goto done; - } - - /* Find the volume */ - if ((v = find_volume_by_id(&request->volumeid))==NULL) { - result=AFP_SERVER_RESULT_NOTATTACHED; - goto done; - } - - ret = afp_closefork(v,request->fileid); - -done: - response.header.len=sizeof(struct afp_server_close_response); - response.header.result=ret; - send_command(c,response.header.len,(char*) &response); - - if (request->header.close) - close_client_connection(c); - else - continue_client_connection(c); - - return 0; -} - -static unsigned char process_stat(struct daemon_client * c) -{ - struct afp_server_stat_response response; - struct afp_server_stat_request * request = (void *) c->complete_packet; - struct afp_volume * v; - int ret; - int result = AFP_SERVER_RESULT_OKAY; - - if ((c->completed_packet_size)< sizeof(struct afp_server_stat_request)) { - result=AFP_SERVER_RESULT_ERROR; - goto done; - } - - /* Find the volume */ - if ((v = find_volume_by_id(&request->volumeid))==NULL) { - result=AFP_SERVER_RESULT_NOTATTACHED; - goto done; - } - - ret = afp_ml_getattr(v,request->path,&response.stat); - - if (ret==-ENOENT) ret=AFP_SERVER_RESULT_ENOENT; - -done: - response.header.len=sizeof(struct afp_server_stat_response); - response.header.result=ret; - send_command(c,response.header.len,(char*) &response); - - if (request->header.close) - close_client_connection(c); - else - continue_client_connection(c); - - return 0; -} - -static unsigned char process_readdir(struct daemon_client * c) -{ - struct afp_server_readdir_request * req = (void *) c->complete_packet; - struct afp_server_readdir_response * response; - unsigned int len = sizeof(struct afp_server_readdir_response); - unsigned int result; - struct afp_volume * v; - char * data, * p; - struct afp_file_info *filebase, *fp; - unsigned int numfiles=0; - int i; - unsigned int maximum_that_will_fit; - int ret; - - if (((c->completed_packet_size)< sizeof(struct afp_server_readdir_request)) || - (req->start<0)) { - result=AFP_SERVER_RESULT_ERROR; - goto error; - } - - /* Find the volume */ - if ((v = find_volume_by_id(&req->volumeid))==NULL) { - result=AFP_SERVER_RESULT_ENOENT; - goto error; - } - - /* Get the file list */ - - ret=afp_ml_readdir(v,req->path,&filebase); - if (ret) goto error; - - /* Count how many we have */ - for (fp=filebase;fp;fp=fp->next) numfiles++; - - /* Make sure we're not running off the end */ - if (req->start > numfiles) goto error; - - /* Make sure we don't respond with more than asked */ - if (numfiles>req->count) - numfiles=req->count; - - /* Figure out the maximum that could fit in our transmit buffer */ - - maximum_that_will_fit = - (MAX_CLIENT_RESPONSE - sizeof(struct afp_server_readdir_response)) / - (sizeof(struct afp_file_info_basic)); - - if (maximum_that_will_fitstart;i++) { - if (!fp) { - response->eod=1; - response->numfiles=0; - afp_ml_filebase_free(&filebase); - goto done; - } - fp=fp->next; - } - - /* Make a copy */ - p=data; - for (i=0;ibasic,sizeof(struct afp_file_info_basic)); - fp=fp->next; - if (!fp) { - response->eod=1; - i++; - break; - } - p+=sizeof(struct afp_file_info_basic); - } - - response->numfiles=i; - - afp_ml_filebase_free(&filebase); - - - goto done; - -error: - response = (void*) malloc(len); - result=AFP_SERVER_RESULT_ERROR; - response->numfiles=0; - -done: - response->header.len=len; - response->header.result=result; - - send_command(c,response->header.len,(char *)response); - - if (req->header.close) - close_client_connection(c); - else - continue_client_connection(c); - - return 0; - -} - -static int process_connect(struct daemon_client * c) -{ - struct afp_server_connect_request * req; - struct afp_server * s=NULL; - struct afp_volume * volume; - struct afp_connection_request conn_req; - int response_len; - struct afp_server_connect_response * response; - char * r; - int ret; - struct stat lstat; - int response_result; - int error=0; - - if ((c->completed_packet_size) < sizeof(struct afp_server_connect_request)) - return -1; - - req=(void *) c->complete_packet; - - log_for_client((void *)c,AFPFSD,LOG_NOTICE, - "Connecting to volume %s and server %s\n", - (char *) req->url.volumename, - (char *) req->url.servername); - - if ((s=find_server_by_url(&req->url))) { - response_result=AFP_SERVER_RESULT_ALREADY_CONNECTED; - goto done; - } - - if ((afp_default_connection_request(&conn_req,&req->url))==-1) { - log_for_client((void *)c,AFPFSD,LOG_ERR, - "Unknown UAM"); - goto error; - } - - conn_req.uam_mask=req->uam_mask; - -/* -* Sets connect_error: -* 0: -* No error -* -ENONET: -* could not get the address of the server -* -ENOMEM: -* could not allocate memory -* -ETIMEDOUT: -* timed out waiting for connection -* -ENETUNREACH: -* Server unreachable -* -EISCONN: -* Connection already established -* -ECONNREFUSED: -* Remote server has refused the connection -* -EACCES, -EPERM, -EADDRINUSE, -EAFNOSUPPORT, -EAGAIN, -EALREADY, -EBADF, -* -EFAULT, -EINPROGRESS, -EINTR, -ENOTSOCK, -EINVAL, -EMFILE, -ENFILE, -* -ENOBUFS, -EPROTONOSUPPORT: -* Internal error -* -* Returns: -* 0: No error -* -1: An error occurred -*/ - - - if ((s=afp_server_full_connect(c,&conn_req,&error))==NULL) { - signal_main_thread(); - goto error; - } - - response_result=AFP_SERVER_RESULT_OKAY; - ret=0; - goto done; - -error: - afp_server_remove(s); - response_result=AFP_SERVER_RESULT_ERROR; - ret=-1; - -done: - response_len = sizeof(struct afp_server_connect_response) + - client_string_len(c); - response = malloc(response_len); - r=(char *) response; - memset(response,0,response_len); - - if (s) - memcpy(response->loginmesg,s->loginmesg,AFP_LOGINMESG_LEN); - - response->header.result=response_result; - response->header.len=response_len; - response->connect_error=error; - memset(&response->serverid,0,sizeof(serverid_t)); - memcpy(&response->serverid,&s,sizeof(s)); - r=((char *) response) +sizeof(struct afp_server_connect_response); - memcpy(r,c->outgoing_string,client_string_len(c)); - - send_command(c,response_len,(char *) response); - - free(response); - - if (req->header.close) - close_client_connection(c); - else - continue_client_connection(c); - - - return ret; - -} - -/* process_mount() - * - * Does a mount - * - * Returns: - * - * Sends back response_result, one of: - * AFP_SERVER_RESULT_OKAY - * AFP_SERVER_RESULT_MOUNTPOINT_PERM - * AFP_SERVER_RESULT_MOUNTPOINT_NOEXIST - * AFP_SERVER_RESULT_NOSERVER - * AFP_SERVER_RESULT_NOVOLUME: - * AFP_SERVER_RESULT_ALREADY_MOUNTED: - * AFP_SERVER_RESULT_VOLPASS_NEEDED: - * AFP_SERVER_RESULT_ERROR_UNKNOWN: - * AFP_SERVER_RESULT_TIMEDOUT: -*/ - - -static int process_mount(struct daemon_client * c) -{ - struct afp_server_mount_request * req; - struct afp_connection_request conn_req; - unsigned int response_len; - int response_result = AFP_SERVER_RESULT_OKAY; - char * r; - volumeid_t volumeid; - - memset(&volumeid,0,sizeof(volumeid)); - - if ((c->completed_packet_size) < sizeof(struct afp_server_mount_request)) - goto error; - -#ifdef HAVE_LIBFUSE - response_result=fuse_mount(c, &volumeid); -#else - response_result=AFP_SERVER_RESULT_NOTSUPPORTED; - -#endif - - response_result=AFP_SERVER_RESULT_OKAY; - goto done; -error: -#if 0 - if ((s) && (!something_is_mounted(s))) { - afp_server_remove(s); - } -#endif - -done: - signal_main_thread(); - - struct afp_server_mount_response * response; - response_len = sizeof(struct afp_server_mount_response) + - client_string_len(c); - - response = malloc(response_len); - memset(response,0,response_len); - response->header.result=response_result; - response->header.len=response_len; - response->volumeid=volumeid; - r=((char *)response)+sizeof(struct afp_server_mount_response); - memcpy(r,c->outgoing_string,client_string_len(c)); - send_command(c,response_len,(char *) response); - - - free(response); - - close_client_connection(c); - -#if 0 - if (req->header.close) - close_client_connection(c); - else - continue_client_connection(c); -#endif -} - - - -static int process_attach(struct daemon_client * c) -{ - struct afp_server_attach_request * req; - struct afp_server * s=NULL; - struct afp_volume * volume = NULL; - struct afp_connection_request conn_req; - int ret; - struct stat lstat; - unsigned int response_len; - int response_result; - char * r; - struct afp_server_attach_response * response; - - if ((c->completed_packet_size) < sizeof(struct afp_server_attach_request)) - goto error; - - req=(void *) c->complete_packet; - - log_for_client((void *)c,AFPFSD,LOG_NOTICE, - "Attaching volume %s on server %s\n", - (char *) req->url.servername, - (char *) req->url.volumename); - - if ((s=find_server_by_url(&req->url))==NULL) { - log_for_client((void *) c,AFPFSD,LOG_ERR, - "Not yet connected to server %s\n",req->url.servername); - goto error; - } - - if ((volume=find_volume_by_url(&req->url))) { - response_result=AFP_SERVER_RESULT_ALREADY_ATTACHED; - goto done; - } - - if ((volume=command_sub_attach_volume(c,s,req->url.volumename, - req->url.volpassword,NULL))==NULL) { - goto error; - } - - volume->extra_flags|=req->volume_options; - - volume->mapping=AFP_MAPPING_UNKNOWN; - - response_result=AFP_SERVER_RESULT_OKAY; - goto done; -error: - if ((s) && (!something_is_mounted(s))) { - afp_server_remove(s); - } - response_result=AFP_SERVER_RESULT_ERROR; - -done: - signal_main_thread(); - - response_len = sizeof(struct afp_server_attach_response) + - client_string_len(c); - r = malloc(response_len); - memset(r,0,response_len); - response = (void *) r; - response->header.result=response_result; - response->header.len=response_len; - if (volume) - response->volumeid=(volumeid_t) volume; - - r=((char *)response)+sizeof(struct afp_server_attach_response); - memcpy(r,c->outgoing_string,client_string_len(c)); - - send_command(c,response_len,(char *) response); - - free(response); - - if (req->header.close) - close_client_connection(c); - else - continue_client_connection(c); -} - - -static void * process_command_thread(void * other) -{ - - struct daemon_client * c = other; - int ret=0; - char tosend[sizeof(struct afp_server_response_header) - + MAX_CLIENT_RESPONSE]; - struct afp_server_request_header * req = (void *) c->complete_packet; - struct afp_server_response_header response; -printf("******* processing command %d\n",req->command); - - switch(req->command) { - case AFP_SERVER_COMMAND_SERVERINFO: - ret=process_serverinfo(c); - break; - case AFP_SERVER_COMMAND_CONNECT: - ret=process_connect(c); - break; - case AFP_SERVER_COMMAND_MOUNT: - ret=process_mount(c); - break; - case AFP_SERVER_COMMAND_ATTACH: - ret=process_attach(c); - break; - case AFP_SERVER_COMMAND_DETACH: - ret=process_detach(c); - break; - case AFP_SERVER_COMMAND_STATUS: - ret=process_status(c); - break; - case AFP_SERVER_COMMAND_UNMOUNT: - ret=process_unmount(c); - break; - case AFP_SERVER_COMMAND_GET_MOUNTPOINT: - ret=process_get_mountpoint(c); - break; - case AFP_SERVER_COMMAND_SUSPEND: - ret=process_suspend(c); - break; - case AFP_SERVER_COMMAND_RESUME: - ret=process_resume(c); - break; - case AFP_SERVER_COMMAND_PING: - ret=process_ping(c); - break; - case AFP_SERVER_COMMAND_GETVOLID: - ret=process_getvolid(c); - break; - case AFP_SERVER_COMMAND_READDIR: - ret=process_readdir(c); - break; - case AFP_SERVER_COMMAND_GETVOLS: - ret=process_getvols(c); - break; - case AFP_SERVER_COMMAND_STAT: - ret=process_stat(c); - break; - case AFP_SERVER_COMMAND_OPEN: - ret=process_open(c); - break; - case AFP_SERVER_COMMAND_READ: - ret=process_read(c); - break; - case AFP_SERVER_COMMAND_CLOSE: - ret=process_close(c); - break; - case AFP_SERVER_COMMAND_EXIT: - ret=process_exit(c); - break; - default: - log_for_client((void *)c,AFPFSD,LOG_ERR,"Unknown command\n"); - } - /* Shift back */ - - remove_command(c); - - return NULL; - - -} - -int process_command(struct daemon_client * c) -{ - int ret; - int fd; - unsigned int offset = 0; - struct afp_server_request_header * header; - pthread_attr_t attr; /* for pthread_create */ - - if (c->incoming_size==0) { - - /* We're at the start of the packet */ - - c->a=&c->incoming_string; - - ret=read(c->fd,c->incoming_string, - sizeof(struct afp_server_request_header)); - if (ret==0) { - printf("Done reading\n"); - return -1; - } - if (ret<0) { - perror("error reading command"); - return -1; - } - - c->incoming_size+=ret; - c->a+=ret; - - if (retincoming_string; - - - if (c->incoming_size==header->len) goto havefullone; - - /* incomplete header, continue to read */ - return 2; - } - - /* Okay, we're continuing to read */ - header = (struct afp_server_request_header *) &c->incoming_string; - - ret=read(c->fd, c->a, - AFP_CLIENT_INCOMING_BUF - c->incoming_size); - if (ret<=0) { - perror("reading command 2"); - return -1; - } - c->a+=ret; - c->incoming_size+=ret; - - if (c->incoming_sizelen) - return 0; - -havefullone: - /* Okay, so we have a full one. Copy the buffer. */ - - header = (struct afp_server_request_header *) &c->incoming_string; - - /* do the copy */ - c->completed_packet_size=header->len; - memcpy(c->complete_packet,c->incoming_string,c->completed_packet_size); - - /* shift things back */ - c->a-=c->completed_packet_size; - memmove(c->incoming_string,c->incoming_string+c->completed_packet_size, - c->completed_packet_size); - - memset(c->incoming_string+c->completed_packet_size,0, - AFP_CLIENT_INCOMING_BUF-c->completed_packet_size); - c->incoming_size-=c->completed_packet_size;; - - rm_fd_and_signal(c->fd); - - - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - - if (pthread_create(&c->processing_thread,&attr, - process_command_thread,c)<0) { - perror("pthread_create"); - return -1; - } - return 0; -out: - fd=c->fd; - c->fd=0; - remove_client(&c); - close(fd); - rm_fd_and_signal(fd); - return 0; -} - -/* command_sub_attach_volume() - * - * Attaches to a volume and returns a created volume structure. - * - * Returns: - * NULL if it could not attach - * - * Sets response_result to: - * - * AFP_SERVER_RESULT_OKAY: - * Attached properly - * AFP_SERVER_RESULT_NOVOLUME: - * No volume exists by that name - * AFP_SERVER_RESULT_ALREADY_MOUNTED: - * Volume is already attached - * AFP_SERVER_RESULT_VOLPASS_NEEDED: - * A volume password is needed - * AFP_SERVER_RESULT_ERROR_UNKNOWN: - * An unknown error occured when attaching. - * - */ - - -struct afp_volume * command_sub_attach_volume(struct daemon_client * c, - struct afp_server * server, char * volname, char * volpassword, - int * response_result) -{ - struct afp_volume * using_volume; - - if (response_result) - *response_result= - AFP_SERVER_RESULT_OKAY; - - using_volume = find_volume_by_name(server,volname); - - if (!using_volume) { - log_for_client((void *) c,AFPFSD,LOG_ERR, - "Volume %s does not exist on server %s.\n",volname, - server->basic.server_name_printable); - if (response_result) - *response_result= AFP_SERVER_RESULT_NOVOLUME; - - if (server->num_volumes) { - char names[1024]; - afp_list_volnames(server,names,1024); - log_for_client((void *)c,AFPFSD,LOG_ERR, - "Choose from: %s\n",names); - } - goto error; - } - - if (using_volume->mounted==AFP_VOLUME_MOUNTED) { - log_for_client((void *)c,AFPFSD,LOG_ERR, - "Volume %s is already mounted on %s\n",volname, - using_volume->mountpoint); - if (response_result) - *response_result= - AFP_SERVER_RESULT_ALREADY_MOUNTED; - goto error; - } - - if (using_volume->flags & HasPassword) { - bcopy(volpassword,using_volume->volpassword,AFP_VOLPASS_LEN); - if (strlen(volpassword)<1) { - log_for_client((void *) c,AFPFSD,LOG_ERR,"Volume password needed\n"); - if (response_result) - *response_result= - AFP_SERVER_RESULT_VOLPASS_NEEDED; - goto error; - } - } else memset(using_volume->volpassword,0,AFP_VOLPASS_LEN); - - using_volume->server=server; - - if (volopen(c,using_volume)) { - log_for_client((void *) c,AFPFSD,LOG_ERR,"Could not mount volume %s\n",volname); - if (response_result) - *response_result= - AFP_SERVER_RESULT_ERROR_UNKNOWN; - goto error; - } - - - return using_volume; -error: - return NULL; -} - diff --git a/daemon/commands.h b/daemon/commands.h deleted file mode 100644 index b430e20..0000000 --- a/daemon/commands.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef __COMMANDS_H_ -#define __COMMANDS_H_ - -#include "daemon_client.h" - -int fuse_register_afpclient(void); -void fuse_set_log_method(int new_method); - -int process_command(struct daemon_client * c); - -struct afp_volume * command_sub_attach_volume(struct daemon_client * c, - struct afp_server * server, char * volname, char * volpassword, - int * response_result); - -int daemon_scan_extra_fds(int command_fd, fd_set *set, - fd_set * toset, fd_set *exceptfds, int * max_fd, int err); - - -#endif diff --git a/daemon/daemon.c b/daemon/daemon.c deleted file mode 100644 index 25a0991..0000000 --- a/daemon/daemon.c +++ /dev/null @@ -1,330 +0,0 @@ -/* - * daemon.c - * - * Copyright (C) 2006 Alex deVries - * - */ - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "afp.h" - -#include "dsi.h" -#include "afpfsd.h" -#include "utils.h" -#include "daemon.h" -#include "commands.h" - -#define MAX_ERROR_LEN 1024 -#define STATUS_LEN 1024 - -static int daemon_log_method=LOG_METHOD_SYSLOG; - -static int debug_mode = 0; -static char commandfilename[PATH_MAX]; - -int get_debug_mode(void) -{ - return debug_mode; -} - -static void daemon_set_log_method(int new_method) -{ - daemon_log_method=new_method; -} - - -static void daemon_log_for_client(void * priv, - enum loglevels loglevel, int logtype, const char *message) { - int len = 0; - struct daemon_client * c = priv; - - if (c) { - len = strlen(c->outgoing_string); - snprintf(c->outgoing_string+len, - MAX_CLIENT_RESPONSE-len, - message); - } else { - if (daemon_log_method & LOG_METHOD_SYSLOG) - syslog(LOG_INFO, "%s", message); - if (daemon_log_method & LOG_METHOD_STDOUT) - printf("%s",message); - } -} - -void daemon_forced_ending_hook(void) -{ - struct afp_server * s = get_server_base(); - struct afp_volume * volume; - int i; - - for (s=get_server_base();s;s=s->next) { - if (s->connect_state==SERVER_STATE_CONNECTED) - for (i=0;inum_volumes;i++) { - volume=&s->volumes[i]; - if (volume->mounted==AFP_VOLUME_MOUNTED) - log_for_client(NULL,AFPFSD,LOG_NOTICE, - "Unmounting %s\n",volume->mountpoint); - afp_unmount_volume(volume); - } - } - - remove_all_clients(); -} - -int daemon_unmount_volume(struct afp_volume * volume) -{ - if (volume->priv) { - fuse_exit((struct fuse *)volume->priv); - pthread_kill(volume->thread, SIGHUP); - pthread_join(volume->thread,NULL); - } - return 0; -} - - -static int startup_listener(void) -{ - int command_fd; - struct sockaddr_un sa; - int len; - - if ((command_fd=socket(AF_UNIX,SOCK_STREAM,0)) < 0) { - goto error; - } - memset(&sa,0,sizeof(sa)); - sa.sun_family = AF_UNIX; - - strcpy(sa.sun_path,commandfilename); - len = sizeof(sa.sun_family) + strlen(sa.sun_path)+1; - - if (bind(command_fd,(struct sockaddr *)&sa,len) < 0) { - perror("binding"); - close(command_fd); - goto error; - } - - listen(command_fd,DAEMON_NUM_CLIENTS); - - return command_fd; - -error: - return -1; - -} - -void close_commands(int command_fd) -{ - - close(command_fd); - unlink(commandfilename); -} - -static void usage(void) -{ - printf("Usage: afpfsd [OPTION]\n" -" -l, --logmethod Either 'syslog' or 'stdout'" -" -f, --foreground Do not fork\n" -" -d, --debug Does not fork, logs to stdout\n" -"Version %s\n", AFPFS_VERSION); -} - -static int remove_other_daemon(void) -{ - - int sock; - struct sockaddr_un servaddr; - int len=0, ret; - char incoming_buffer[MAX_CLIENT_RESPONSE]; - struct timeval tv; - fd_set rds; -#define OUTGOING_PACKET_LEN 1 - char outgoing_buffer[OUTGOING_PACKET_LEN]; - - if (access(commandfilename,F_OK)!=0) - goto doesnotexist; /* file doesn't even exist */ - - if ((sock=socket(AF_UNIX,SOCK_STREAM,0))<0) { - perror("Opening socket"); - goto error; - } - - memset(&servaddr,0,sizeof(servaddr)); - servaddr.sun_family = AF_UNIX; - strcpy(servaddr.sun_path,commandfilename); - - if ((connect(sock,(struct sockaddr*) &servaddr, - sizeof(servaddr.sun_family) + - sizeof(servaddr.sun_path))) <0) { - goto dead; - } - - /* Try writing to it */ - - outgoing_buffer[0]=AFP_SERVER_COMMAND_PING; - if (write(sock, outgoing_buffer,OUTGOING_PACKET_LEN) - -#include "afp.h" - - -void rm_fd_and_signal(int fd); -void signal_main_thread(void); - -int get_debug_mode(void); - -int fuse_unmount_volume(struct afp_volume * volume); -void fuse_forced_ending_hook(void); - - - -#endif diff --git a/daemon/daemon_client.c b/daemon/daemon_client.c deleted file mode 100644 index 150b401..0000000 --- a/daemon/daemon_client.c +++ /dev/null @@ -1,307 +0,0 @@ -/* - * daemon_client.c - * - * Copyright (C) 2008 Alex deVries - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "afp.h" -#include "dsi.h" -#include "afpfsd.h" -#include "utils.h" -#include "daemon.h" -#include "uams_def.h" -#include "codepage.h" -#include "libafpclient.h" -#include "map_def.h" -#include "daemon_client.h" -#include "commands.h" - -#define AFP_CLIENT_INCOMING_BUF 8192 - -#define client_string_len(x) \ - (strlen(((struct daemon_client *)(x))->outgoing_string)) - -#if 0 -static struct daemon_client client_pool[DAEMON_NUM_CLIENTS] = { -#endif - -/* Should use preprocessor macro here */ -static struct daemon_client client_pool[DAEMON_NUM_CLIENTS] = { - {.used=0}, - {.used=0}, - {.used=0}, - {.used=0}, - {.used=0}, - {.used=0}, - {.used=0}, - {.used=0}}; - -/* Used to protect the pool searching, creation and deletion */ -pthread_mutex_t client_pool_mutex = PTHREAD_MUTEX_INITIALIZER; - -int remove_client(struct daemon_client ** toremove) -{ - struct daemon_client * c, * prev=NULL; - int ret=0; - int i; - - if ((toremove==NULL) || (*toremove==NULL)) return -1; - - pthread_mutex_lock(&client_pool_mutex); - - /* Go find the client */ - for (i=0;iprocessing_thread,0)) - perror("pthread_kill"); -#endif - if (pthread_join((*toremove)->processing_thread,NULL)) - perror("pthread_join"); - goto done; - } - } - - ret=-1; -done: - pthread_mutex_unlock(&client_pool_mutex); - return ret; -} - -void remove_all_clients(void) -{ - struct daemon_client * c, *c2; - int i; - - pthread_mutex_lock(&client_pool_mutex); - - for (i=0;itoremove) { - c->pending=0; - remove_client(&c); - } - add_fd_and_signal(c->fd); - c->incoming_size=0; - return 0; -} - -int close_client_connection(struct daemon_client * c) -{ - c->a=&c->incoming_string; - c->incoming_size=0; - add_fd_and_signal(c->fd); - - if ((!c) || - (c->fd==0)) return -1; - rm_fd_and_signal(c->fd); - close(c->fd); - remove_client(&c); - return 0; -} - - -static int add_client(int fd) -{ - struct daemon_client * c, *newc; - int count=0; - int i; - pthread_mutex_lock(&client_pool_mutex); - - for (i=0;iused==0) goto found; - - } - - pthread_mutex_unlock(&client_pool_mutex); - - /* We didn't find anything */ - return -1; - -found: - pthread_mutex_unlock(&client_pool_mutex); - memset(c,0,sizeof(*c)); - c->fd=fd; - c->used=1; - c->a=&c->incoming_string[0]; - c->incoming_size=0; - - return 0; -} - -/* Returns: - * 0: Should continue - * -1: Done with fd - * - */ - -static int process_client_fds(fd_set * set, int max_fd, - struct daemon_client ** found) -{ - - struct daemon_client * c; - int ret; - int i; - - *found=NULL; - - pthread_mutex_lock(&client_pool_mutex); - - for (i=0;iused) && (FD_ISSET(c->fd,set))) { - goto found; - } - } - - /* We never found it */ - pthread_mutex_unlock(&client_pool_mutex); - return 0; - -found: - pthread_mutex_unlock(&client_pool_mutex); - if (found) *found=c; - - ret=process_command(c); - - if (ret==0) return 0; - if (ret<0) return -1; - return 1; -} - -int daemon_scan_extra_fds(int command_fd, fd_set *set, - fd_set * toset, fd_set *exceptfds, int * max_fd, int err) -{ - - struct sockaddr_un new_addr; - socklen_t new_len = sizeof(struct sockaddr_un); - struct daemon_client * found, *c; - int i, found_fd=0; - int ret; - - if (err) { - for (i=0;i<*max_fd;i++) { - if (FD_ISSET(i,exceptfds)) { - found_fd=i; - } - } - if (found_fd==0) return -1; - - for (i=0;ifd,exceptfds)) { - remove_client(&c); - return 1; - } - } - } - - - if (FD_ISSET(command_fd,set)) { - int new_fd= - accept(command_fd, - (struct sockaddr *) &new_addr,&new_len); - - if (new_fd>=0) { - add_client(new_fd); - if ((new_fd+1) > *max_fd) *max_fd=new_fd+1; - } - FD_SET(new_fd,toset); - return 0; - } - - if ((exceptfds) && (FD_ISSET(command_fd,exceptfds))) { - printf("We have an exception\n"); - return 0; - } - - ret=process_client_fds(set,*max_fd,&found); - switch (ret) { - case 2: /* continue reading */ - if (found) { - FD_CLR(found->fd,set); - FD_SET(found->fd,toset); - } - return -1; - case 0: /* clear it and continue */ - if (found) { - FD_CLR(found->fd,set); - FD_CLR(found->fd,toset); - } - return -1; - - case -1: /* we're done with found->fd */ - if (found) { - FD_CLR(found->fd,toset); - close(found->fd); - remove_client(&found); - } - int i; - for (i=*max_fd;i>=0;i--) - if (FD_ISSET(i,set)) { - *max_fd=i; - break; - } - - return -1; - case 1: /* handled */ - FD_SET(command_fd,toset); - return 1; - } - /* unknown fd */ - sleep(10); - - return -1; -} - - -unsigned int send_command(struct daemon_client * c, - unsigned int len, const char * data) -{ - unsigned int total=0; - int ret; - - while (totalfd,data+total,len-total); - if (ret<0) { - perror("Writing"); - return -1; - } - total+=ret; - } - return total; -} - -void remove_command(struct daemon_client *c) -{ - pthread_mutex_unlock(&c->command_string_mutex); -} - - - diff --git a/daemon/daemon_client.h b/daemon/daemon_client.h deleted file mode 100644 index 0200163..0000000 --- a/daemon/daemon_client.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef __DAEMON_CLIENT_H_ -#define __DAEMON_CLIENT_H_ - -#include - -#define AFP_CLIENT_INCOMING_BUF 8192 - -#define DAEMON_NUM_CLIENTS 10 - -struct daemon_client { - char incoming_string[AFP_CLIENT_INCOMING_BUF]; - int incoming_size; - char * a; - - char complete_packet[AFP_CLIENT_INCOMING_BUF]; - int completed_packet_size; - pthread_mutex_t command_string_mutex; - - char outgoing_string[1000 + MAX_CLIENT_RESPONSE]; - int fd; - int lock; - char * shmem; - int toremove; - int pending; - pthread_t processing_thread; - pthread_mutex_t processing_mutex; - int used; -}; - -unsigned int send_command(struct daemon_client * c, - unsigned int len, const char * data); - -int continue_client_connection(struct daemon_client * c); -int close_client_connection(struct daemon_client * c); -int remove_client(struct daemon_client ** toremove); -void remove_command(struct daemon_client *c); - - - - - - -#endif diff --git a/daemon/daemon_fuse.c b/daemon/daemon_fuse.c deleted file mode 100644 index 90022bb..0000000 --- a/daemon/daemon_fuse.c +++ /dev/null @@ -1,332 +0,0 @@ -/* - * daemon_client.c - * - * Copyright (C) 2008 Alex deVries - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "afp.h" -#include "dsi.h" -#include "afpfsd.h" -#include "utils.h" -#include "daemon.h" -#include "uams_def.h" -#include "codepage.h" -#include "libafpclient.h" -#include "map_def.h" -#include "fuse_int.h" -#include "fuse_error.h" -#include "daemon_client.h" -#include "commands.h" - -#ifdef __linux -#define FUSE_DEVICE "/dev/fuse" -#else -#define FUSE_DEVICE "/dev/fuse0" -#endif - -#define client_string_len(x) \ - (strlen(((struct daemon_client *)(x))->outgoing_string)) - -static int fuse_result, fuse_errno; - -struct afp_volume * global_volume; - -struct start_fuse_thread_arg { - struct afp_volume * volume; - struct daemon_client * client; - int changeuid; -}; - -static void * start_fuse_thread(void * other) -{ - int fuseargc=0; - const char *fuseargv[200]; -#define mountstring_len (AFP_SERVER_NAME_LEN+1+AFP_VOLUME_NAME_UTF8_LEN+1) - char mountstring[mountstring_len]; - struct start_fuse_thread_arg * arg = other; - struct afp_volume * volume = arg->volume; - struct daemon_client * c = arg->client; - struct afp_server * server = volume->server; - - int changeuid=arg->changeuid; - - free(arg); - - /* Check to see if we have permissions to access the mountpoint */ - - snprintf(mountstring,mountstring_len,"%s:%s", - server->basic.server_name_printable, - volume->volume_name_printable); - fuseargc=0; - fuseargv[0]=mountstring; - fuseargc++; - fuseargv[1]=volume->mountpoint; - fuseargc++; -/* FIXME - if (get_debug_mode()) { -*/ - if (0) { - fuseargv[fuseargc]="-d"; - fuseargc++; - } else { - fuseargv[fuseargc]="-f"; - fuseargc++; - } - - if (changeuid) { - fuseargv[fuseargc]="-o"; - fuseargc++; - fuseargv[fuseargc]="allow_other"; - fuseargc++; - } - - -/* #ifdef USE_SINGLE_THREAD */ - fuseargv[fuseargc]="-s"; - fuseargc++; -/* -#endif -*/ - - global_volume=volume; - fuse_result= - afp_register_fuse(fuseargc, (char **) fuseargv,volume); - - fuse_errno=errno; - - pthread_mutex_lock(&volume->startup_condition_mutex); - volume->started_up=1; - pthread_cond_signal(&volume->startup_condition_cond); - pthread_mutex_unlock(&volume->startup_condition_mutex); - - log_for_client((void *) c,AFPFSD,LOG_WARNING, - "Unmounting volume %s from %s\n", - volume->volume_name_printable, - volume->mountpoint); - - return NULL; -} - -static int fuse_mount_thread( struct daemon_client * c, struct afp_volume * volume, - unsigned int changeuid) -/* Create the new thread and block until we get an answer back */ -{ - pthread_mutex_t mutex; - struct timespec ts; - struct timeval tv; - int ret=0; - struct start_fuse_thread_arg * arg; /* used to pass to args to the thread */ -#define FUSE_ERROR_BUFLEN 1024 - char buf[FUSE_ERROR_BUFLEN+1]; - unsigned int buflen=FUSE_ERROR_BUFLEN; - int response_result; - int ait; - int wait = 1; - - /* A bit unusual, this is freed in the start_fuse_thread thread */ - arg = malloc(sizeof(*arg)); - - memset(arg,0,sizeof(*arg)); - arg->client = c; - arg->volume = volume; - arg->changeuid=changeuid; - - memset(buf,0,FUSE_ERROR_BUFLEN); - - gettimeofday(&tv,NULL); - ts.tv_sec=tv.tv_sec; - ts.tv_sec+=5; - ts.tv_nsec=tv.tv_usec*1000; - pthread_mutex_init(&volume->startup_condition_mutex,NULL); - pthread_cond_init(&volume->startup_condition_cond,NULL); - volume->started_up=1; - pthread_mutex_unlock(&volume->startup_condition_mutex); - - - /* Kickoff a thread to see how quickly it exits. If - * it exits quickly, we have an error and it failed. */ - - pthread_create(&volume->thread,NULL,start_fuse_thread,arg); - - if (wait) { - pthread_mutex_lock(&volume->startup_condition_mutex); - if (volume->started_up==0) - ret = pthread_cond_timedwait( - &volume->startup_condition_cond, - &volume->startup_condition_mutex,&ts); - pthread_mutex_unlock(&volume->startup_condition_mutex); - } - if (ret==ETIMEDOUT) { - /* At this point, we never heard anything back from the - * fuse thread. Odd, but we'll need to deal with it. We - * have nothing to report then. */ - log_for_client((void *) c, AFPFSD, LOG_ERR, - "Timeout error when logging into server\n"); - - goto error; - - } - -/* - * FIXME: need to handle timeouts, and make sure that arg is still valid */ - - report_fuse_errors(buf,&buflen); - - if (buflen>0) - log_for_client((void *) c, AFPFSD, LOG_ERR, - "FUSE reported the following error:\n%s",buf); - - switch (fuse_result) { - case 0: - if (volume->mounted==AFP_VOLUME_UNMOUNTED) { - /* Try and discover why */ - switch(fuse_errno) { - case ENOENT: - log_for_client((void *)c,AFPFSD,LOG_ERR, - "Permission denied, maybe a problem with the fuse device or mountpoint?\n"); - response_result= - AFP_SERVER_RESULT_MOUNTPOINT_PERM; - break; - default: - log_for_client((void *)c,AFPFSD,LOG_ERR, - "Mounting of volume %s of server %s failed.\n", - volume->volume_name_printable, - volume->server->basic.server_name_printable); - } - goto error; - } else { - log_for_client((void *)c,AFPFSD,LOG_NOTICE, - "Mounting of volume %s of server %s succeeded.\n", - volume->volume_name_printable, - volume->server->basic.server_name_printable); - goto done; - } - break; - case ETIMEDOUT: - log_for_client((void *)c,AFPFSD,LOG_NOTICE, - "Still trying.\n"); - response_result=AFP_SERVER_RESULT_TIMEDOUT; - goto error; - break; - default: - volume->mounted=AFP_VOLUME_UNMOUNTED; - log_for_client((void *)c,AFPFSD,LOG_NOTICE, - "Unknown error %d, %d.\n", - fuse_result,fuse_errno); - response_result=AFP_SERVER_RESULT_ERROR_UNKNOWN; - goto error; - } - -error: - return -1; - -done: - return 0; - -} - -int fuse_mount(struct daemon_client * c, volumeid_t * volumeid) -{ - struct afp_server_mount_request * req; - struct afp_server * s=NULL; - struct afp_volume * volume; - struct afp_connection_request conn_req; - int ret; - struct stat lstat; - char * r; - int response_result = AFP_SERVER_RESULT_OKAY; - - memset(&volumeid,0,sizeof(volumeid_t)); - - req=(void *) c->complete_packet; - - if ((ret=access(req->mountpoint,X_OK))!=0) { - log_for_client((void *)c,AFPFSD,LOG_DEBUG, - "Incorrect permissions on mountpoint %s: %s\n", - req->mountpoint, strerror(errno)); - response_result=AFP_SERVER_RESULT_MOUNTPOINT_PERM; - - goto error; - } - - if (stat(FUSE_DEVICE,&lstat)) { - printf("Could not find %s\n",FUSE_DEVICE); - response_result=AFP_SERVER_RESULT_MOUNTPOINT_NOEXIST; - goto error; - } - - if (access(FUSE_DEVICE,R_OK | W_OK )!=0) { - log_for_client((void *)c, AFPFSD,LOG_NOTICE, - "Incorrect permissions on %s, mode of device" - " is %o, uid/gid is %d/%d. But your effective " - "uid/gid is %d/%d\n", - FUSE_DEVICE,lstat.st_mode, lstat.st_uid, - lstat.st_gid, - geteuid(),getegid()); - response_result=AFP_SERVER_RESULT_MOUNTPOINT_PERM; - goto error; - } - - log_for_client((void *)c,AFPFSD,LOG_NOTICE, - "Mounting %s from %s on %s\n", - (char *) req->url.servername, - (char *) req->url.volumename,req->mountpoint); - - if ((s=find_server_by_url(&req->url))==NULL) { - log_for_client((void *) c,AFPFSD,LOG_ERR, - "%s is an unknown server\n",req->url.servername); - response_result=AFP_SERVER_RESULT_NOSERVER; - goto error; - } - /* response_result could be set in command_sub_attach_volume as: - * AFP_SERVER_RESULT_OKAY: - * AFP_SERVER_RESULT_NOVOLUME: - * AFP_SERVER_RESULT_ALREADY_MOUNTED: - * AFP_SERVER_RESULT_VOLPASS_NEEDED: - * AFP_SERVER_RESULT_ERROR_UNKNOWN: - */ - if ((volume=command_sub_attach_volume(c,s,req->url.volumename, - req->url.volpassword,&response_result))==NULL) { - goto error; - } - - volume->extra_flags|=req->volume_options; - - volume->mapping=req->map; - afp_detect_mapping(volume); - - snprintf(volume->mountpoint,255,req->mountpoint); - - /* Create the new thread and block until we get an answer back */ - - if (fuse_mount_thread(c,volume,req->changeuid)<0) goto error; - - response_result=AFP_SERVER_RESULT_OKAY; - goto done; -error: -#if 0 - if ((s) && (!something_is_mounted(s))) { - afp_server_remove(s); - } -#endif - -done: - signal_main_thread(); - return response_result; -} - diff --git a/daemon/extra.c b/daemon/extra.c deleted file mode 100644 index ddbe8e8..0000000 --- a/daemon/extra.c +++ /dev/null @@ -1,408 +0,0 @@ -#include -#include -#include -#include -#include -#include - - -#include "afp.h" -#include "uams_def.h" -#include "map_def.h" -#include "afpfsd.h" -#include "libafpclient.h" -#include "afpsl.h" - -static void usage(void) -{ - printf("usage\n"); -} - -int do_stat(int argc, char * argv[]) -{ - char url_string[1024]; - struct afp_url url; - struct stat stat; - int ret; - - if (argc!=3) { - usage(); - return -1; - } - snprintf(url_string,1024,argv[2]); - afp_default_url(&url); - if (afp_parse_url(&url,url_string,1)!=0) { - printf("Could not parse url\n"); - return -1; - } - - ret = afp_sl_stat(NULL,NULL,&url,&stat); - - switch(ret) { - case AFP_SERVER_RESULT_AFPFSD_ERROR: - printf("Could not setup connection to afpfsd\n"); - return -1; - case AFP_SERVER_RESULT_OKAY: - break; - case AFP_SERVER_RESULT_NOTCONNECTED: - printf("Not connected\n"); - return -1; - case AFP_SERVER_RESULT_NOTATTACHED: - printf("Not attacheded\n"); - return -1; - case AFP_SERVER_RESULT_ENOENT: - printf("File does not exist\n"); - return -1; - default: - printf("Unknown error\n"); - } - - printf("mode: %o\n",stat.st_mode); - - return ret; -} - -int do_get(int argc, char * argv[]) -{ - char url_string[1024]; - struct afp_url url; - int ret; - unsigned int received; - unsigned long long total=0; - #define GET_DATA_SIZE 2048 - char data[GET_DATA_SIZE]; - unsigned int eof; - unsigned int fileid; - unsigned int mode=0; - - if (argc!=3) { - usage(); - return -1; - } - snprintf(url_string,1024,argv[2]); - afp_default_url(&url); - if (afp_parse_url(&url,url_string,1)!=0) { - printf("Could not parse url\n"); - return -1; - } - - - volumeid_t volid; - - ret=afp_sl_getvolid(&url,&volid); - if (ret==AFP_SERVER_RESULT_AFPFSD_ERROR) { - printf("Could not setup connection to afpfsd\n"); - return -1; - } - - if (ret) goto done; - - ret=afp_sl_open(NULL,NULL,&url,&fileid,mode); - if (ret) goto done; - - while (eof==0) { - - ret=afp_sl_read(&volid,fileid,0, /* data, not resource */ - total, GET_DATA_SIZE,&received,&eof,data); - - total+=received; - - if (ret!=AFP_SERVER_RESULT_OKAY) goto done; - - printf("%s",data); - - } - -done: - if (fileid) { - afp_sl_close(&volid,fileid); - } - return ret; -} -int do_readdir(int argc, char * argv[]) -{ - char url_string[1024]; - struct afp_url url; - int ret; - unsigned int numfiles; - char * data; - struct afp_file_info_basic * fpb; - int i; - unsigned int totalfiles=0; - int eod; - - if (argc!=3) { - usage(); - return -1; - } - snprintf(url_string,1024,argv[2]); - afp_default_url(&url); - if (afp_parse_url(&url,url_string,1)!=0) { - printf("Could not parse url\n"); - return -1; - } - - while (1) { - - ret=afp_sl_readdir(NULL,NULL,&url,totalfiles,10, - &numfiles,&data,&eod); - if (ret==AFP_SERVER_RESULT_AFPFSD_ERROR) { - printf("Could not setup connection to afpfsd\n"); - return -1; - } - - if (ret!=AFP_SERVER_RESULT_OKAY) goto error; - - fpb=data; - for (i=0;iname); - fpb=((void *) fpb) + sizeof(struct afp_file_info_basic); - } - free(data); - if (eod) break; - totalfiles+=numfiles; - } - - return ret; - -error: - printf("Could not readdir\n"); - return -1; -} - -int do_getvols(int argc, char * argv[]) -{ - int ret; - char url_string[1024]; - struct afp_url url; - int i; -#define EXTRA_NUM_VOLS 10 - char data[EXTRA_NUM_VOLS * AFP_VOLUME_NAME_UTF8_LEN]; - unsigned int num; - char * name; - - if (argc!=3) { - usage(); - return -1; - } - snprintf(url_string,1024,argv[2]); - afp_default_url(&url); - if (afp_parse_url(&url,url_string,1)!=0) { - printf("Could not parse url\n"); - return -1; - } - - ret = afp_sl_getvols(&url,0,10,&num,data); - - switch(ret) { - case AFP_SERVER_RESULT_AFPFSD_ERROR: - printf("Could not setup connection to afpfsd\n"); - return -1; - - case AFP_SERVER_RESULT_OKAY: - break; - case AFP_SERVER_RESULT_NOTCONNECTED: - printf("Not connected\n"); - return -1; - } - - for (i=0;i -#include -#include -#include -#include -#include -#include "libafpclient.h" - -#define TMP_FILE "/tmp/fuse_stderr" - -static int captured_fd; -static fpos_t pos; - -void report_fuse_errors(char * buf, unsigned int * buflen) -{ - int fd; - int len; - - fflush(stderr); - dup2(captured_fd, fileno(stderr)); - close(captured_fd); - clearerr(stderr); - fsetpos(stderr, &pos); /* for C9X */ - - if ((fd=open(TMP_FILE,O_RDONLY))<0) return;; - memset(buf,0,*buflen); - len=read(fd,buf,*buflen); - *buflen-=len; - close(fd); - - unlink(TMP_FILE); -} - -void fuse_capture_stderr_start(void) -{ - fflush(stderr); - fgetpos(stderr, &pos); - captured_fd = dup(fileno(stderr)); - freopen(TMP_FILE, "a", stderr); -} - diff --git a/daemon/fuse_error.h b/daemon/fuse_error.h deleted file mode 100644 index 3f906ed..0000000 --- a/daemon/fuse_error.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef __FUSE_ERROR_H_ -#define __FUSE_ERROR_H_ - -void report_fuse_errors(char * buf, unsigned int * buflen); -void fuse_capture_stderr_start(void); - -#endif - diff --git a/daemon/fuse_int.c b/daemon/fuse_int.c deleted file mode 100644 index 0890caa..0000000 --- a/daemon/fuse_int.c +++ /dev/null @@ -1,532 +0,0 @@ - - -/* - - fuse.c, FUSE interfaces for afpfs-ng - - Copyright (C) 2006 Alex deVries - - Heavily modifed from the example code provided by: - Copyright (C) 2001-2005 Miklos Szeredi - - This program can be distributed under the terms of the GNU GPL. - See the file COPYING. -*/ - -#define HAVE_ARCH_STRUCT_FLOCK - -#define FUSE_USE_VERSION 29 - - -#include "afp.h" - -#include -#include -#include -#include -#ifdef __linux__ -#include -#else -#include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "dsi.h" -#include "afp_protocol.h" -#include "codepage.h" -#include "midlevel.h" -#include "fuse_error.h" - -/* Uncomment the following line to enable full debugging: */ -/* -#define LOG_FUSE_EVENTS -*/ - -void log_fuse_event(enum loglevels loglevel, int logtype, - char *format, ...) { -#ifdef LOG_FUSE_EVENTS - va_list ap; - - va_start(ap,format); - vprintf(format,ap); - va_end(ap); -#endif - -} - - -static int fuse_readlink(const char * path, char *buf, size_t size) -{ - int ret; - struct afp_volume * volume= - (struct afp_volume *) - ((struct fuse_context *)(fuse_get_context()))->private_data; - - log_fuse_event(AFPFSD,LOG_DEBUG,"*** readlink of %s\n",path); - - ret=afp_ml_readlink(volume,path,buf,size); - - if (ret==-EFAULT) { - log_for_client(NULL,AFPFSD,LOG_WARNING, - "Got some sort of internal error in afp_open for readlink\n"); - } - - - return ret; - -} - -static int fuse_rmdir(const char *path) -{ - int ret; - struct afp_volume * volume= - (struct afp_volume *) - ((struct fuse_context *)(fuse_get_context()))->private_data; - - log_fuse_event(AFPFSD,LOG_DEBUG,"*** rmdir of %s\n",path); - - ret=afp_ml_rmdir(volume,path); - - return ret; -} - -static int fuse_unlink(const char *path) -{ - int ret; - struct afp_volume * volume= - (struct afp_volume *) - ((struct fuse_context *)(fuse_get_context()))->private_data; - - log_fuse_event(AFPFSD,LOG_DEBUG,"*** unlink of %s\n",path); - - ret=afp_ml_unlink(volume,path); - - return ret; -} - - -static int fuse_readdir(const char *path, void *buf, fuse_fill_dir_t filler, - off_t offset, struct fuse_file_info *fi) -{ - (void) offset; - (void) fi; - struct afp_file_info * filebase = NULL, * p; - int ret; - struct afp_volume * volume= - (struct afp_volume *) - ((struct fuse_context *)(fuse_get_context()))->private_data; - - log_fuse_event(AFPFSD,LOG_DEBUG,"*** readdir of %s\n",path); - - filler(buf, ".", NULL, 0); - filler(buf, "..", NULL, 0); - - ret=afp_ml_readdir(volume,path,&filebase); - - if (ret) goto error; - - for (p=filebase;p;p=p->next) { - filler(buf,p->basic.name,NULL,0); - } - - afp_ml_filebase_free(&filebase); - - return 0; - -error: - return ret; -} - -static int fuse_mknod(const char *path, mode_t mode, dev_t dev) -{ - int ret=0; - struct fuse_context * context = fuse_get_context(); - struct afp_volume * volume= - (struct afp_volume *) context->private_data; - - log_fuse_event(AFPFSD,LOG_DEBUG,"*** mknod of %s\n",path); - - ret=afp_ml_creat(volume,path,mode); - - return ret; -} - - -static int fuse_release(const char * path, struct fuse_file_info * fi) -{ - - struct afp_file_info * fp = (void *) fi->fh; - int ret=0; - struct afp_volume * volume= - (struct afp_volume *) - ((struct fuse_context *)(fuse_get_context()))->private_data; - - log_fuse_event(AFPFSD,LOG_DEBUG,"*** release of %s\n",path); - - ret=afp_ml_close(volume,path,fp); - - if (ret<0) goto error; - - return ret; -error: - free((void *) fi->fh); - return ret; -} - -static int fuse_open(const char *path, struct fuse_file_info *fi) -{ - - struct afp_file_info * fp ; - int ret; - struct afp_volume * volume= - (struct afp_volume *) - ((struct fuse_context *)(fuse_get_context()))->private_data; - unsigned char flags = AFP_OPENFORK_ALLOWREAD; - - log_fuse_event(AFPFSD,LOG_DEBUG, - "*** Opening path %s\n",path); - - ret = afp_ml_open(volume,path,flags,&fp); - - if (ret==0) - fi->fh=(void *) fp; - - return ret; -} - - -static int fuse_write(const char * path, const char *data, - size_t size, off_t offset, - struct fuse_file_info *fi) -{ - - struct afp_file_info *fp = (struct afp_file_info *) fi->fh; - int ret; - struct fuse_context * context = fuse_get_context(); - struct afp_volume * volume=(void *) context->private_data; - - log_fuse_event(AFPFSD,LOG_DEBUG, - "*** write of from %llu for %llu\n", - (unsigned long long) offset,(unsigned long long) size); - - ret=afp_ml_write(volume,path,data,size,offset,fp, - context->uid, context->gid); - - - return ret; - -} - - -static int fuse_mkdir(const char * path, mode_t mode) -{ - int ret; - struct afp_volume * volume= - (struct afp_volume *) - ((struct fuse_context *)(fuse_get_context()))->private_data; - - log_fuse_event(AFPFSD,LOG_DEBUG,"*** mkdir of %s\n",path); - - ret=afp_ml_mkdir(volume,path,mode); - - return ret; - -} -static int fuse_read(const char *path, char *buf, size_t size, off_t offset, - struct fuse_file_info *fi) -{ - struct afp_file_info * fp; - int ret=0; - struct afp_volume * volume= - (struct afp_volume *) - ((struct fuse_context *)(fuse_get_context()))->private_data; - int eof; - size_t amount_read=0; - - if (!fi || !fi->fh) - return -EBADF; - fp=(void *) fi->fh; - - while (1) { - ret = afp_ml_read(volume,path,buf+amount_read,size,offset,fp,&eof); - if (ret<0) goto error; - amount_read+=ret; - if (eof) goto out; - size-=ret; - if (size==0) goto out; - offset+=ret; - } -out: - return amount_read; - -error: - return ret; -} - -static int fuse_chown(const char * path, uid_t uid, gid_t gid) -{ - int ret; - struct afp_volume * volume= - (struct afp_volume *) - ((struct fuse_context *)(fuse_get_context()))->private_data; - - log_fuse_event(AFPFSD,LOG_DEBUG,"** chown\n"); - - ret=afp_ml_chown(volume,path,uid,gid); - - if (ret==-ENOSYS) { - log_for_client(NULL,AFPFSD,LOG_WARNING,"chown unsupported\n"); - } - - return ret; -} - -static int fuse_truncate(const char * path, off_t offset) -{ - int ret=0; - struct afp_volume * volume= - (struct afp_volume *) - ((struct fuse_context *)(fuse_get_context()))->private_data; - - log_fuse_event(AFPFSD,LOG_DEBUG, - "** truncate\n"); - - ret=afp_ml_truncate(volume,path,offset); - - return ret; -} - - -static int fuse_chmod(const char * path, mode_t mode) -{ - struct afp_volume * volume= - (struct afp_volume *) - ((struct fuse_context *)(fuse_get_context()))->private_data; - int ret; - - log_fuse_event(AFPFSD,LOG_DEBUG, - "** chmod %s\n",path); - ret=afp_ml_chmod(volume,path,mode); - - switch (ret) { - - case -EPERM: - log_for_client(NULL,AFPFSD,LOG_DEBUG, - "You're not the owner of this file.\n"); - break; - - case -ENOSYS: - log_for_client(NULL,AFPFSD,LOG_WARNING,"chmod unsupported or this mode is not possible with this server\n"); - break; - case -EFAULT: - log_for_client(NULL,AFPFSD,LOG_ERR, - "You're mounting from a netatalk server, and I was trying to change " - "permissions but you're setting some mode bits that aren't supported " - "by the server. This is because this netatalk server is broken. \n" - "This is because :\n" - " - you haven't set -options=unix_priv in AppleVolumes.default\n" - " - you haven't applied a patch which fixes chmod() to netatalk, or are using an \n" - " old version. See afpfs-ng docs.\n" - " - maybe both\n" - "It sucks, but I'm marking this volume as broken for 'extended' chmod modes.\n" - "Allowed bits are: %o\n", AFP_CHMOD_ALLOWED_BITS_22); - - ret=0; /* Return anyway */ - break; - } - - - return ret; -} - -static int fuse_utime(const char * path, struct utimbuf * timebuf) -{ - - int ret=0; - struct afp_volume * volume= - (struct afp_volume *) - ((struct fuse_context *)(fuse_get_context()))->private_data; - - log_fuse_event(AFPFSD,LOG_DEBUG, - "** utime\n"); - - - ret=afp_ml_utime(volume,path,timebuf); - - return ret; -} - -static void afp_destroy(void * ignore) -{ - struct afp_volume * volume= - (struct afp_volume *) - ((struct fuse_context *)(fuse_get_context()))->private_data; - - if (volume->mounted==AFP_VOLUME_UNMOUNTED) { - log_for_client(NULL,AFPFSD,LOG_WARNING,"Skipping unmounting of the volume %s\n",volume->volume_name_printable); - return; - } - if ((!volume) || (!volume->server)) return; - - /* We're just ignoring the results since there's nothing we could - do with them anyway. */ - afp_unmount_volume(volume); - -} - -static int fuse_symlink(const char * path1, const char * path2) -{ - - struct afp_volume * volume= - (struct afp_volume *) - ((struct fuse_context *)(fuse_get_context()))->private_data; - int ret; - - ret=afp_ml_symlink(volume,path1,path2); - if ((ret==-EFAULT) || (ret==-ENOSYS)) { - log_for_client(NULL,AFPFSD,LOG_WARNING, - "Got some sort of internal error in when creating symlink\n"); - } - - return ret; -}; - -static int fuse_rename(const char * path_from, const char * path_to) -{ - int ret; - struct afp_volume * volume= - (struct afp_volume *) - ((struct fuse_context *)(fuse_get_context()))->private_data; - - ret=afp_ml_rename(volume,path_from, path_to); - - return ret; - -} - -static int fuse_statfs(const char *path, struct statvfs *stat) -{ - struct afp_volume * volume= - (struct afp_volume *) - ((struct fuse_context *)(fuse_get_context()))->private_data; - int ret; - struct afp_volume_stats astats; - - ret=afp_ml_statfs(volume,path,&astats); - - if (astats.blocksize==0) astats.blocksize=4096; - stat->f_bsize=astats.blocksize; - stat->f_blocks=astats.bytestotal/astats.blocksize; - stat->f_bfree=astats.bytesfree/astats.blocksize; - stat->f_bavail=astats.bytesfree / astats.blocksize; - stat->f_files=0; - stat->f_ffree=0; - stat->f_fsid=0; - stat->f_namemax=AFP_MAX_PATH; - - stat->f_frsize=astats.blocksize; - stat->f_frsize=0; - stat->f_favail=0; - stat->f_flag=0; - - return ret; -} - - -static int fuse_getattr(const char *path, struct stat *stbuf) -{ - char * c; - struct afp_volume * volume= - (struct afp_volume *) - ((struct fuse_context *)(fuse_get_context()))->private_data; - int ret; - - log_fuse_event(AFPFSD,LOG_DEBUG,"*** getattr of \"%s\"\n",path); - - /* Oddly, we sometimes get //(null) for the path */ - - if (!path) return -EIO; - - if ((c=strstr(path,"(null)"))) { - /* We should fix this to make sure it is at the end */ - if (c>path) *(c-1)='\0'; - } - - ret=afp_ml_getattr(volume,path,stbuf); - - return ret; -} - - -static struct afp_volume * global_volume; - -#if FUSE_USE_VERSION < 26 -static void *afp_init(void) { -#else -static void *afp_init(void * o) { -#endif - struct afp_volume * vol = global_volume; - - vol->priv=(void *)((struct fuse_context *)(fuse_get_context()))->fuse; - /* Trigger the daemon that we've started */ - if (vol->priv) vol->mounted=1; - - pthread_mutex_lock(&vol->startup_condition_mutex); - vol->started_up=1; - pthread_cond_signal(&vol->startup_condition_cond); - pthread_mutex_unlock(&vol->startup_condition_mutex); - - - return (void *) vol; -} - - - -static struct fuse_operations afp_oper = { - .getattr =fuse_getattr, - .open = fuse_open, - .read = fuse_read, - .readdir = fuse_readdir, - .mkdir = fuse_mkdir, - .readlink = fuse_readlink, - .rmdir = fuse_rmdir, - .unlink = fuse_unlink, - .mknod = fuse_mknod, - .write = fuse_write, - .release= fuse_release, - .chmod=fuse_chmod, - .symlink=fuse_symlink, - .chown=fuse_chown, - .truncate=fuse_truncate, - .rename=fuse_rename, - .utime=fuse_utime, - .destroy=afp_destroy, - .init=afp_init, - .statfs=fuse_statfs, -}; - - -int afp_register_fuse(int fuseargc, char *fuseargv[],struct afp_volume * vol) -{ - int ret; - global_volume=vol; - fuse_capture_stderr_start(); - -#if FUSE_USE_VERSION < 26 - ret=fuse_main(fuseargc, fuseargv, &afp_oper); -#else - ret=fuse_main(fuseargc, fuseargv, &afp_oper,(void *) vol); -#endif - - return ret; -} - - diff --git a/daemon/fuse_int.h b/daemon/fuse_int.h deleted file mode 100644 index 6c3c405..0000000 --- a/daemon/fuse_int.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef __FUSE_INT_H_ -#define __FUSE_INT_H_ - - - -int afp_register_fuse(int fuseargc, char *fuseargv[],struct afp_volume * vol); -#endif - diff --git a/daemon/mount_afp.1 b/daemon/mount_afp.1 deleted file mode 100644 index 4e7fa77..0000000 --- a/daemon/mount_afp.1 +++ /dev/null @@ -1,173 +0,0 @@ -.\" -.\" Copyright (c) 2001-2002 Apple Computer, Inc. All rights reserved. -.\" -.\" @APPLE_LICENSE_HEADER_START@ -.\" -.\" The contents of this file constitute Original Code as defined in and -.\" are subject to the Apple Public Source License Version 1.1 (the -.\" "License"). You may not use this file except in compliance with the -.\" License. Please obtain a copy of the License at -.\" http://www.apple.com/publicsource and read it before using this file. -.\" -.\" This Original Code and all software distributed under the License are -.\" distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER -.\" EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, -.\" INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, -.\" FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the -.\" License for the specific language governing rights and limitations -.\" under the License. -.\" -.\" @APPLE_LICENSE_HEADER_END@ -.\" -.\" **************************************** -.\" * -.\" * mount_afp [-o options] [-i] host[:port][/path] node -.\" * -.\" * Created by randall on Wed May 8 2002. -.\" * -.\" **************************************** -.\" -.\" **************************************** -.\" * Required macros -.\" **************************************** -.Dd Feb 1, 2008 -.Dt MOUNT_AFP 8 -.Os Mac\ OS\ X -.\" -.\" **************************************** -.\" * NAME section -.\" **************************************** -.Sh NAME -.Nm mount_afp -.Nd mount an afp (AppleShare) filesystem using FUSE -.\" -.\" **************************************** -.\" * SYNOPSIS section -.\" **************************************** -.Sh SYNOPSIS -.Nm -.Op Fl o Ar options -.Ar afp_url -.Ar node -.\" -.\" **************************************** -.\" * DESCRIPTION section -.\" **************************************** -.Sh DESCRIPTION -The -.Nm -command mounts the AFP volume denoted by the afp_url -.Ar afp://[user[;AUTH=uamname][:password]@]host[:port]/volumename -at the mount point indicated by -.Ar node. -.Pp -This is normally a symlink to the -.Xr afp_client 1 -executable, which is a full implementation to mount AFP volumes using the FUSE infrastructure. It communicates with afpfsd, a daemon that manages AFP sessions. -.Fp -The arguments and options are: -.Bl -tag -width indent -.It Fl o -Options passed to -.Xr mount 2 -are specified with the -.Fl o -option followed by a comma separated string of options. -man page for possible options and their meanings. Additional options supported by the AFP Client are as follows: -.Bl -tag -width indent -.It volpass= -The only available option is "-o volpassword=XXX" to set the volume password (since there is no facility for that in an AFP URL). -.El -.Bl -tag -width indent -.It rw -Mount the volume as writeable. This is the default, so it has no effect. -.El -.Bl -tag -width indent -.It ro -Mount the volume as readonly. -.El -.Bl -tag -width indent -.It group= -Mount the volume as groupname. -.El -.Bl -tag -width indent -.It user= -Mount the volume as username. -.El -.It Ar afp_url -There are two forms of afp URL, one for TCP/IP and one for AppleTalk: -.Pp -afp://[user[;AUTH=uamname][:password]@]host[:port]/volume -.Pp -afp:/at/[user[;AUTH=uamname][:password]@]servername[:zonename]/volume -.Pp -Denotes the afp server and sharepoint to mount. It may also contain the username & password -required to log into the server. uamname is the protocol name of the authentication method. -If port is not specified, then port 548 is used. -.It Ar node -Path to mount point, which must be a directory that the user has write permissions for. -.El -.\" -.\" **************************************** -.\" * EXAMPLES section -.\" **************************************** -.Sh EXAMPLES -The following example illustrates how to mount the afp volume -server.company.com/volumename/ at the mount point /Volumes/mntpnt: -.Bd -literal -offset indent -mkdir /Volumes/mntpnt -mount_afp afp://username:userpass@server.company.com/volumename/ /Volumes/mntpnt - -.Ed -This example shows the proper url to use to mount the volume guestVolume from -the afp server myserver as guest: -.Bd -literal -offset indent -mkdir /Volumes/guest -mount_afp "afp://;AUTH=No%20User%20Authent@myserver/guestVolume" /Volumes/guest - -The following shows how to use a username of "user:name" and password of "p@ssword": -server.company.com/volumename/ at the mount point /Volumes/mntpnt: -.Bd -literal -offset indent -mkdir /Volumes/mntpnt -mount_afp afp://user::name:p@@ssword@server.company.com/volumename/ /Volumes/mntpnt - -.Ed -.Ed -This example shows the proper url to use to mount the volume myVolume from -the afp server myserver using Kerberos authentication: -.Bd -literal -offset indent -mkdir /Volumes/myVolume -mount_afp "afp://;AUTH=Client%20Krb%20v2@myserver/myVolume" /Volumes/myVolume - -.Ed -.\" -.\" **************************************** -.\" * SEE ALSO section -.\" **************************************** -.Sh SEE ALSO -.Xr afp_client 1 (for a more AFP commands), -.Xr afpcmd 1 (for a non-FUSE command line AFP client), -.\" -.\" **************************************** -.\" * HISTORY section -.\" **************************************** -.Sh HISTORY -The -.Nm -command first appeared Mac OS X version 10.0. Kerberos authentication was added in Mac OS X version 10.2. This syntax (and manpage) was used for afpfs-ng's fuse implementation. -.\" -.\" **************************************** -.\" * RETURN VALUES section -.\" * (errors that mount_afp could return) -.\" **************************************** -.Sh RETURN VALUES -.Bl -tag -width Er -.It 0 -.Nm -successfully mounted the volume directory. -.It -1 -The server volume could not be mounted. -.El -.Sh SEE ALSO -\fB afp_client(1), afpfsd(1)\fN -.\" diff --git a/daemon/stateless.c b/daemon/stateless.c deleted file mode 100644 index 859da68..0000000 --- a/daemon/stateless.c +++ /dev/null @@ -1,893 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "config.h" -#include -#include "afpfsd.h" -#include "uams_def.h" -#include "map_def.h" -#include "libafpclient.h" -#include "afpsl.h" - -#define default_uam "Cleartxt Passwrd" - -#define AFPFSD_FILENAME "afpfsd" - -static unsigned int uid, gid=0; -static int changeuid=0; -static int changegid=0; - -struct afpfsd_connect { - int fd; - unsigned int len; - char data[MAX_CLIENT_RESPONSE+200]; - void (*print) (const char * text); - char * shmem; -}; - -static struct afpfsd_connect connection; - -static int start_afpfsd(void) -{ - char *argv[1]; - - argv[0]=0; - if (fork()==0) { - char filename[PATH_MAX]; - if (changegid) { - if (setegid(gid)) { - perror("Changing gid"); - return -1; - } - } - if (changeuid) { - if (seteuid(uid)) { - perror("Changing uid"); - return -1; - } - } - snprintf(filename,PATH_MAX,"%s/%s",BINDIR,AFPFSD_FILENAME); - if (access(filename,X_OK)) { - printf("Could not find server (%s)\n", - filename); - return -1; - } - - - execvp(filename,argv); - - printf("done threading\n"); - } - return 0; -} - -int daemon_connect(unsigned int uid) -{ - int sock; - struct sockaddr_un servaddr; - char filename[PATH_MAX]; - unsigned char trying=2; - int ret; - - if ((sock=socket(AF_UNIX,SOCK_STREAM,0)) < 0) { - perror("Could not create socket\n"); - return -1; - } - memset(&servaddr,0,sizeof(servaddr)); - servaddr.sun_family = AF_UNIX; - sprintf(filename,"%s-%d",SERVER_FILENAME,uid); - - strcpy(servaddr.sun_path,filename); - - while(trying) { - ret=connect(sock,(struct sockaddr*) &servaddr, - sizeof(servaddr.sun_family) + - sizeof(servaddr.sun_path)); - if (ret<0) perror("connect"); - - if (ret>=0) goto done; - - printf("The afpfs daemon does not appear to be running for uid %d, let me start it for you\n", uid); - - if (start_afpfsd()!=0) { - printf("Error in starting up afpfsd\n"); - goto error; - } - if ((connect(sock,(struct sockaddr*) &servaddr, - sizeof(servaddr.sun_family) + - sizeof(servaddr.sun_path))) >=0) - goto done; - trying--; - } -error: - perror("Trying to startup afpfsd"); - return -1; - -done: - connection.fd=sock; - return 0; -} - -/* read_answer() - * - * Reads the answer from afpfsd. - * Returns: - * -1: timeout or select error - * >0: afpfsd header error - */ - -static int read_answer(void) -{ - unsigned int expected_len=0, packetlen; - struct timeval tv; - fd_set rds,ords; - int ret; - struct afp_server_response_header * answer = (void *) connection.data; - - memset(connection.data,0,MAX_CLIENT_RESPONSE); - connection.len=0; - - FD_ZERO(&rds); - FD_SET(connection.fd,&rds); - while (1) { - tv.tv_sec=30; tv.tv_usec=0; - ords=rds; - ret=select(connection.fd+1,&ords,NULL,NULL,&tv); - if (ret==0) { - printf("No response from server, timed out.\n"); - return -1; - } - if (FD_ISSET(connection.fd,&ords)) { - packetlen=read(connection.fd, - connection.data+connection.len, - MAX_CLIENT_RESPONSE-connection.len); - if (packetlen<=0) { - printf("Dropped connection\n"); - goto done; - } - if (connection.len==0) { /* This is our first read */ - expected_len= - ((struct afp_server_response_header *) - connection.data)->len; - } - connection.len+=packetlen; - if (connection.len==expected_len) - goto done; - if (ret<0) goto error; - - } - } - -done: - - return ((struct afp_server_response_header *) connection.data)->result; - -error: - return -1; -} - -static int send_command(unsigned int len, char * data, unsigned int num) -{ - /* num is just used for debugging */ - int ret; - - ret = write(connection.fd,data,len); - return ret; -} - -static void conn_print(const char * text) -{ - printf(text); -} - -void afp_sl_conn_setup(void) -{ - connection.print=conn_print; -} - - -int afp_sl_exit(void) -{ - struct afp_server_exit_request req; - - if (afp_sl_setup()) { - return AFP_SERVER_RESULT_AFPFSD_ERROR; - } - - req.header.command=AFP_SERVER_COMMAND_EXIT; - req.header.close=1; - req.header.len=sizeof(req); - send_command(sizeof(req),(char *) &req,AFP_SERVER_COMMAND_EXIT); - - return read_answer(); -} - -/* afp_sl_status() - * - * Returns: - * AFP_SERVER_RESULT_AFPFSD_ERROR: could not connect to afpfsd - */ - -int afp_sl_status(const char * volumename, const char * servername, - char * text, unsigned int * remaining) -{ - struct afp_server_status_request req; - struct afp_server_status_response * resp; - int ret; - - if (afp_sl_setup()) { - return AFP_SERVER_RESULT_AFPFSD_ERROR; - } - - req.header.command=AFP_SERVER_COMMAND_STATUS; - req.header.close=1; - req.header.len=sizeof(req); - - if (volumename) snprintf(req.volumename,AFP_VOLUME_NAME_UTF8_LEN, - volumename); - if (servername) snprintf(req.servername,AFP_SERVER_NAME_LEN, - servername); - - send_command(sizeof(req),(char *)&req,AFP_SERVER_COMMAND_STATUS); - - *remaining-=connection.len; - - ret=read_answer(); - - snprintf(text,connection.len,connection.data+ - sizeof(struct afp_server_status_response)); - - return ret; -} - -/* afp_sl_getvolid() - * - * Result header returns: - * AFP_SERVER_RESULT_AFPFSD_ERROR - * AFP_SERVER_RESULT_OKAY - * - */ - -int afp_sl_getvolid(struct afp_url * url, volumeid_t *volid) -{ - struct afp_server_getvolid_request req; - struct afp_server_getvolid_response * reply; - int ret; - - if (afp_sl_setup()) { - return AFP_SERVER_RESULT_AFPFSD_ERROR; - } - - memset(&req,0,sizeof(req)); - - req.header.close=1; - req.header.len = sizeof(struct afp_server_getvolid_request); - req.header.command=AFP_SERVER_COMMAND_GETVOLID; - - memcpy(&req.url,url,sizeof(*url)); - - send_command(sizeof(req),(char *)&req,AFP_SERVER_COMMAND_GETVOLID); - - ret=read_answer(); - - reply = (void *) connection.data; - reply->header.result=ret; - - - if (ret!=AFP_SERVER_RESULT_OKAY) - return ret; - - - memcpy(volid,&reply->volumeid,sizeof(volumeid_t)); - -done: - return reply->header.result; -} - -int afp_sl_stat(volumeid_t * volid, const char * path, - struct afp_url * url, struct stat * stat) -{ - struct afp_server_stat_request request; - struct afp_server_stat_response * response; - volumeid_t tmpvolid; - volumeid_t * volid_p = volid; - char * tmppath = path; - int ret; - - if (afp_sl_setup()) { - return AFP_SERVER_RESULT_AFPFSD_ERROR; - } - - request.header.close=1; - request.header.len=sizeof(struct afp_server_stat_request); - request.header.command=AFP_SERVER_COMMAND_STAT; - - if (volid==NULL) { - ret = afp_sl_getvolid(url,&tmpvolid); - if (ret) return ret; - - tmppath=url->path; - volid_p = &tmpvolid; - } - - memcpy(&request.volumeid,volid_p, sizeof(volumeid_t)); - memcpy(request.path,tmppath,AFP_MAX_PATH); - - send_command(sizeof(request),(char *)&request,AFP_SERVER_COMMAND_STAT); - - ret=read_answer(); - - response = (void *) connection.data; - - memcpy(stat,&response->stat,sizeof(struct stat)); - - return response->header.result; - - -} - -int afp_sl_open(volumeid_t * volid, const char * path, - struct afp_url * url,unsigned int *fileid, - unsigned int mode) -{ - struct afp_server_open_request request; - struct afp_server_open_response * response; - volumeid_t tmpvolid; - volumeid_t * volid_p = volid; - char * tmppath = path; - int ret; - - if (afp_sl_setup()) { - return AFP_SERVER_RESULT_AFPFSD_ERROR; - } - - request.header.close=1; - request.header.len=sizeof(struct afp_server_open_request); - request.header.command=AFP_SERVER_COMMAND_OPEN; - - if (volid==NULL) { - ret = afp_sl_getvolid(url,&tmpvolid); - if (ret) return ret; - - tmppath=url->path; - volid_p = &tmpvolid; - } - - memcpy(&request.volumeid,volid_p, sizeof(volumeid_t)); - memcpy(request.path,tmppath,AFP_MAX_PATH); - request.mode=mode; - - send_command(sizeof(request),(char *)&request,AFP_SERVER_COMMAND_OPEN); - - ret=read_answer(); - - response = (void *) connection.data; - - *fileid=response->fileid; - - return response->header.result; -} - - -int afp_sl_read(volumeid_t * volid, unsigned int fileid, unsigned int resource, - unsigned long long start, - unsigned int length, unsigned int * received, - unsigned int * eof, char * data) -{ - struct afp_server_read_request request; - struct afp_server_read_response * response; - int ret; - char * dataptr; - - if (afp_sl_setup()) { - return AFP_SERVER_RESULT_AFPFSD_ERROR; - } - - request.header.close=1; - request.header.len=sizeof(struct afp_server_read_request); - request.header.command=AFP_SERVER_COMMAND_READ; - memcpy(&request.volumeid,volid,sizeof(volumeid_t)); - request.fileid=fileid; - request.start=start; - request.length=length; - request.resource=resource; - - send_command(sizeof(request),(char *)&request,AFP_SERVER_COMMAND_READ); - - ret=read_answer(); - - response = (void *) connection.data; - *received=response->received; - *eof=response->eof; - - dataptr = ((char *) response ) + sizeof(struct afp_server_read_response); - - memcpy(data,dataptr,*received); - - return response->header.result; -} - -int afp_sl_close(volumeid_t *volid, unsigned int fileid) -{ - struct afp_server_close_request request; - struct afp_server_close_response * response; - int ret; - char * dataptr; - - if (afp_sl_setup()) { - return AFP_SERVER_RESULT_AFPFSD_ERROR; - } - - request.header.close=1; - request.header.len=sizeof(struct afp_server_close_request); - request.header.command=AFP_SERVER_COMMAND_CLOSE; - memcpy(&request.volumeid,volid,sizeof(volumeid_t)); - request.fileid=fileid; - - send_command(sizeof(request),(char *)&request,AFP_SERVER_COMMAND_CLOSE); - - ret=read_answer(); - - response = (void *) connection.data; - - return response->header.result; -} - -int afp_sl_readdir(volumeid_t * volid, const char * path, struct afp_url * url, - int start, int count, unsigned int * numfiles, - struct afp_file_info_basic **data, - int * eod) -{ - struct afp_server_readdir_request req; - struct afp_server_readdir_response * mainrep; - int ret; - char * mainresp; - char * tmppath = path; - unsigned int size; - volumeid_t * volid_p = volid; - volumeid_t tmpvolid; - - if (afp_sl_setup()) { - return AFP_SERVER_RESULT_AFPFSD_ERROR; - } - - if (eod) *eod=0; - - memset(&req,0,sizeof(req)); - - req.header.close=1; - req.header.len = sizeof(struct afp_server_readdir_request); - req.header.command=AFP_SERVER_COMMAND_READDIR; - req.start=start; - req.count=count; - - if (volid==NULL) { - ret=afp_sl_getvolid(url,&tmpvolid); - if (ret) return ret; - tmppath=url->path; - volid_p = &tmpvolid; - } - - memcpy(&req.volumeid,volid_p, sizeof(volumeid_t)); - memcpy(req.path,tmppath,AFP_MAX_PATH); - - send_command(sizeof(req),(char *)&req,AFP_SERVER_COMMAND_READDIR); - - ret=read_answer(); - - mainrep = (void *) connection.data; - if (mainrep->header.result) goto error; - - *numfiles=mainrep->numfiles; - - size = (*numfiles)*(sizeof(struct afp_file_info_basic)); - - *data = malloc(size); - - memcpy(*data,((void *) mainrep) + - sizeof(struct afp_server_readdir_response), size); - - if ((mainrep->eod) && (eod)) *eod=1; - - return 0; - -error: - return -1; -} - - -int afp_sl_getvols(struct afp_url * url, unsigned int start, - unsigned int count, unsigned int * numvols, - struct afp_volume_summary * vols) -{ - - struct afp_server_getvols_request req; - int ret; - struct afp_server_getvols_response * response; - - if (afp_sl_setup()) { - return AFP_SERVER_RESULT_AFPFSD_ERROR; - } - - req.header.close=1; - req.header.len = sizeof(struct afp_server_getvols_request); - req.header.command=AFP_SERVER_COMMAND_GETVOLS; - req.start=start; - req.count=count; - memcpy(&req.url,url,sizeof(*url)); - - send_command(sizeof(req),(char *) &req,AFP_SERVER_COMMAND_GETVOLS); - - ret=read_answer(); - - response = connection.data; - - memcpy(vols, - ((void *)response) + sizeof(struct afp_server_getvols_response), - response->num * sizeof(struct afp_volume_summary)); - - *numvols = response->num; - - return response->header.result; -} - - -int afp_sl_resume(const char * servername) -{ - struct afp_server_resume_request req; - - if (afp_sl_setup()) { - return AFP_SERVER_RESULT_AFPFSD_ERROR; - } - - req.header.close=1; - req.header.len=sizeof(struct afp_server_resume_request); - req.header.command=AFP_SERVER_COMMAND_RESUME; - - snprintf(req.server_name,AFP_SERVER_NAME_LEN,"%s",servername); - - send_command(sizeof(req),(char *)&req,AFP_SERVER_COMMAND_RESUME); - - return read_answer(); -} - -int afp_sl_suspend(const char * servername) -{ - struct afp_server_suspend_request req; - - if (afp_sl_setup()) { - return AFP_SERVER_RESULT_AFPFSD_ERROR; - } - - req.header.close=1; - req.header.len =sizeof(struct afp_server_suspend_request); - req.header.command=AFP_SERVER_COMMAND_SUSPEND; - - snprintf(req.server_name,AFP_SERVER_NAME_LEN,servername); - - send_command(sizeof(req),(char *)&req,AFP_SERVER_COMMAND_SUSPEND); - - return read_answer(); -} - -int afp_sl_unmount(const char * volumename) -{ - struct afp_server_unmount_request req; - struct afp_server_unmount_response * resp; - int ret; - - if (afp_sl_setup()) { - return AFP_SERVER_RESULT_AFPFSD_ERROR; - } - - req.header.close=1; - req.header.len =sizeof(struct afp_server_unmount_request); - req.header.command=AFP_SERVER_COMMAND_UNMOUNT; - - snprintf(req.name,AFP_VOLUME_NAME_UTF8_LEN,volumename); - - send_command(sizeof(req),(char *)&req,AFP_SERVER_COMMAND_UNMOUNT); - - ret = read_answer(); - resp = connection.data; - - if (connection.lenunmount_message); - } - - return resp->header.result; -} - - -/* - * - * afp_sl_connect(,&error) - * - * Sets error to: - * 0: - * No error - * -ENONET: - * could not get the address of the server - * -ENOMEM: - * could not allocate memory - * -ETIMEDOUT: - * timed out waiting for connection - * -ENETUNREACH: - * Server unreachable - * -EISCONN: - * Connection already established - * -ECONNREFUSED: - * Remote server has refused the connection - * -EACCES, -EPERM, -EADDRINUSE, -EAFNOSUPPORT, -EAGAIN, -EALREADY, -EBADF, - * -EFAULT, -EINPROGRESS, -EINTR, -ENOTSOCK, -EINVAL, -EMFILE, -ENFILE, - * -ENOBUFS, -EPROTONOSUPPORT: - * Internal error - * - * Returns: - * 0: No error - * -1: An error occurred - */ - -int afp_sl_connect(struct afp_url * url, unsigned int uam_mask, - serverid_t *id, char * loginmesg, int * error) -{ - struct afp_server_connect_request req; - struct afp_server_connect_response *resp; - char * t; - int ret; - - if (afp_sl_setup()) { - return AFP_SERVER_RESULT_AFPFSD_ERROR; - } - req.header.close=0; - req.header.len =sizeof(struct afp_server_connect_request); - req.header.command=AFP_SERVER_COMMAND_CONNECT; - - memcpy(&req.url,url,sizeof(struct afp_url)); - req.uam_mask=uam_mask; - - send_command(sizeof(req),(char *)&req,AFP_SERVER_COMMAND_CONNECT); - - ret=read_answer(); - - resp = connection.data; - - if (connection.len<=sizeof (struct afp_server_connect_response)) - return 0; - - t = connection.data + sizeof(struct afp_server_connect_response); - - if (connection.print) { - connection.print(t); - } - - if (loginmesg) - memcpy(loginmesg,resp->loginmesg,AFP_LOGINMESG_LEN); - - if (error) *error=resp->connect_error; - - if (resp->header.result==0) { - return 0; - } else { - return resp->connect_error; - } -} - -int afp_sl_attach(struct afp_url * url, unsigned int volume_options, - volumeid_t * volumeid) -{ - struct afp_server_attach_request req; - struct afp_server_attach_response * response; - char * t; - int ret; - - if (afp_sl_setup()) { - return AFP_SERVER_RESULT_AFPFSD_ERROR; - } - - response = (void *) connection.data; - - req.header.close=1; - req.header.len =sizeof(struct afp_server_attach_request); - req.header.command=AFP_SERVER_COMMAND_ATTACH; - - memcpy(&req.url,url,sizeof(struct afp_url)); - req.volume_options = volume_options; - - send_command(sizeof(req),(char *)&req,AFP_SERVER_COMMAND_ATTACH); - - ret=read_answer(); - - if (connection.len!=sizeof (struct afp_server_attach_response)) - return 0; - - t = connection.data + sizeof(struct afp_server_attach_response); - - if (connection.print) { - connection.print(t); - } - - if (volumeid) - memcpy(volumeid,&response->volumeid,sizeof(volumeid_t)); - - return ret; -} - - -int afp_sl_detach(volumeid_t *volumeid, struct afp_url * url) -{ - struct afp_server_detach_request req; - char * t; - int ret; - volumeid_t tmpvolid; - volumeid_t *volid_p = volumeid; - - if (afp_sl_setup()) { - return AFP_SERVER_RESULT_AFPFSD_ERROR; - } - - if (volumeid==NULL) { - ret=afp_sl_getvolid(url,&tmpvolid); - if (ret) return ret; - volid_p = &tmpvolid; - } - - - req.header.close=1; - req.header.len =sizeof(struct afp_server_detach_request); - req.header.command=AFP_SERVER_COMMAND_DETACH; - - memcpy(&req.volumeid,volid_p,sizeof(volumeid_t)); - - send_command(sizeof(req),(char *)&req,AFP_SERVER_COMMAND_DETACH); - - ret=read_answer(); - - if (connection.len<=sizeof (struct afp_server_detach_response)) - return 0; - - t = connection.data + sizeof(struct afp_server_detach_response); - - if (connection.print) { - connection.print(t); - } - return ret; -} - - -/* afp_get_mountpoint - * - * Checks to see if the URL is already mounted and returns the mountpoint - */ - -int afp_sl_get_mountpoint(struct afp_url * url, char * mountpoint) -{ - struct afp_server_get_mountpoint_request req; - struct afp_server_get_mountpoint_response * response; - char * t; - int ret; - - req.header.close=1; - req.header.len =sizeof(struct afp_server_get_mountpoint_request); - req.header.command=AFP_SERVER_COMMAND_GET_MOUNTPOINT; - - memcpy(&req.url,url,sizeof(struct afp_url)); - - send_command(sizeof(req),(char *)&req,AFP_SERVER_COMMAND_GET_MOUNTPOINT); - - ret=read_answer(); - - if (connection.len!=sizeof (struct afp_server_get_mountpoint_response)) { - ret = AFP_SERVER_RESULT_ERROR; - goto done; - } - - response=(void *) connection.data; - - ret=((struct afp_server_response_header *) connection.data)->result; - - if (ret==AFP_SERVER_RESULT_OKAY) { - - printf("slgm10: %s\n",response->mountpoint); - memcpy(mountpoint,response->mountpoint,PATH_MAX ); - } -done: - return ret; -} - -int afp_sl_mount(struct afp_url * url, const char * mountpoint, - const char * map, unsigned int volume_options) -{ - struct afp_server_mount_request req; - char * t; - int ret; - - req.header.close=1; - req.header.len =sizeof(struct afp_server_mount_request); - req.header.command=AFP_SERVER_COMMAND_MOUNT; - - memcpy(&req.url,url,sizeof(struct afp_url)); - snprintf(req.mountpoint,PATH_MAX,mountpoint); - if (map) req.map=map_string_to_num(map); - else req.map=AFP_MAPPING_UNKNOWN; - req.volume_options = volume_options; - req.changeuid=changeuid; - - send_command(sizeof(req),(char *)&req,AFP_SERVER_COMMAND_MOUNT); - - ret=read_answer(); - - if (connection.len<=sizeof (struct afp_server_mount_response)) - return 0; - - t = connection.data + sizeof(struct afp_server_mount_response); - - if (connection.print) { - connection.print(t); - } - - return ret; -} - - -int afp_sl_setup(void) -{ - afp_sl_conn_setup(); - - return daemon_connect(geteuid()); -} - -int afp_sl_setup_diffuser(unsigned int uid, unsigned int gid) -{ - return -1; - -} - -int afp_sl_serverinfo(struct afp_url * url, struct afp_server_basic * basic) -{ - struct afp_server_serverinfo_request req; - struct afp_server_serverinfo_response *response; - char * t; - int ret; - - if (afp_sl_setup()) { - return AFP_SERVER_RESULT_AFPFSD_ERROR; - } - - response=(void *) connection.data; - - req.header.close=1; - req.header.len =sizeof(struct afp_server_serverinfo_request); - req.header.command=AFP_SERVER_COMMAND_SERVERINFO; - - memcpy(&req.url,url,sizeof(struct afp_url)); - - send_command(sizeof(req),(char *)&req,AFP_SERVER_COMMAND_SERVERINFO); - - ret=read_answer(); - - if (connection.lenserver_basic, sizeof(struct afp_server_basic)); - - return ret; -} - - -