├── po ├── stamp-po ├── LINGUAS ├── cs.gmo ├── de.gmo ├── quot.sed ├── POTFILES.in ├── boldquot.sed ├── remove-potcdate.sin ├── insert-header.sin ├── en@quot.header ├── en@boldquot.header ├── Rules-quot └── Makevars ├── man ├── de │ ├── davfs2.conf.5.translator │ ├── mount.davfs.8.translator │ ├── umount.davfs.8.translator │ ├── Makefile.am │ ├── umount.davfs.8 │ └── umount.davfs.8.po ├── template.translator ├── po4a.conf ├── Makefile.am ├── es │ └── Makefile.am ├── umount.davfs.8 └── umount.davfs.8.pot ├── TODO ├── BUGS ├── bootstrap ├── THANKS ├── Makefile.am ├── config ├── nls.m4 ├── intlmacosx.m4 ├── progtest.m4 ├── lib-ld.m4 ├── mkinstalldirs ├── INSTALL.davfs2 ├── davfs2.m4 ├── missing ├── iconv.m4 ├── compile └── lib-prefix.m4 ├── etc ├── Makefile.am ├── davfs2.conf └── secrets ├── src ├── Makefile.am ├── kernel_interface.h ├── umount_davfs.c ├── fuse_kernel.h ├── kernel_interface.c ├── mount_davfs.h ├── defaults.h └── webdav.h ├── configure.ac ├── README.translators ├── AUTHORS ├── FAQ ├── INSTALL ├── README └── config.h.in /po/stamp-po: -------------------------------------------------------------------------------- 1 | timestamp 2 | -------------------------------------------------------------------------------- /po/LINGUAS: -------------------------------------------------------------------------------- 1 | # Set of available languages. 2 | cs de 3 | -------------------------------------------------------------------------------- /po/cs.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/volga629/davfs2/HEAD/po/cs.gmo -------------------------------------------------------------------------------- /po/de.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/volga629/davfs2/HEAD/po/de.gmo -------------------------------------------------------------------------------- /po/quot.sed: -------------------------------------------------------------------------------- 1 | s/"\([^"]*\)"/“\1”/g 2 | s/`\([^`']*\)'/‘\1’/g 3 | s/ '\([^`']*\)' / ‘\1’ /g 4 | s/ '\([^`']*\)'$/ ‘\1’/g 5 | s/^'\([^`']*\)' /‘\1’ /g 6 | s/“”/""/g 7 | -------------------------------------------------------------------------------- /man/de/davfs2.conf.5.translator: -------------------------------------------------------------------------------- 1 | PO4A-HEADER:mode=after;position=^\.SH AUTOREN;beginboundary=^\.SH 2 | .SH ÜBERSETZER 3 | Das Handbuch wurde von Werner Baumann 4 | übersetzt. 2009-04-27 5 | -------------------------------------------------------------------------------- /man/de/mount.davfs.8.translator: -------------------------------------------------------------------------------- 1 | PO4A-HEADER:mode=after;position=^\.SH AUTOREN;beginboundary=^\.SH 2 | .SH ÜBERSETZER 3 | Das Handbuch wurde von Werner Baumann 4 | übersetzt. 2009-04-27 5 | -------------------------------------------------------------------------------- /man/de/umount.davfs.8.translator: -------------------------------------------------------------------------------- 1 | PO4A-HEADER:mode=after;position=^\.SH AUTOREN;beginboundary=^\.SH 2 | .SH ÜBERSETZER 3 | Das Handbuch wurde von Werner Baumann 4 | übersetzt. 2009-04-27 5 | -------------------------------------------------------------------------------- /po/POTFILES.in: -------------------------------------------------------------------------------- 1 | # List of source files which contain translatable strings. 2 | src/cache.c 3 | src/dav_coda.c 4 | src/dav_fuse.c 5 | src/kernel_interface.c 6 | src/mount_davfs.c 7 | src/umount_davfs.c 8 | src/webdav.c 9 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | davfs2 TODO 2014-04-21 2 | ---------------------- 3 | 4 | - write a GNU-style manual 5 | 6 | - multithreading for HTTP-requests and cache maintainance 7 | 8 | - restructure file name extraction and href construction 9 | 10 | -------------------------------------------------------------------------------- /po/boldquot.sed: -------------------------------------------------------------------------------- 1 | s/"\([^"]*\)"/“\1”/g 2 | s/`\([^`']*\)'/‘\1’/g 3 | s/ '\([^`']*\)' / ‘\1’ /g 4 | s/ '\([^`']*\)'$/ ‘\1’/g 5 | s/^'\([^`']*\)' /‘\1’ /g 6 | s/“”/""/g 7 | s/“/“/g 8 | s/”/”/g 9 | s/‘/‘/g 10 | s/’/’/g 11 | -------------------------------------------------------------------------------- /BUGS: -------------------------------------------------------------------------------- 1 | davfs2 known bugs 2014-04-21 2 | ---------------------------- 3 | 4 | davfs2 does not support links. 5 | 6 | A davfs2 file system cannot be moved with 'mount --move'. 7 | 8 | If a filename contains a "/"-character, it will be displayed, but it 9 | cannot be accessed. 10 | 11 | A proper GNU-style manual is still missing. 12 | 13 | 14 | Report Bugs 15 | ----------- 16 | 17 | Please report bugs at 18 | http://savannah.nongnu.org/support/?func=additem&group=davfs2 19 | 20 | -------------------------------------------------------------------------------- /po/remove-potcdate.sin: -------------------------------------------------------------------------------- 1 | # Sed script that remove the POT-Creation-Date line in the header entry 2 | # from a POT file. 3 | # 4 | # The distinction between the first and the following occurrences of the 5 | # pattern is achieved by looking at the hold space. 6 | /^"POT-Creation-Date: .*"$/{ 7 | x 8 | # Test if the hold space is empty. 9 | s/P/P/ 10 | ta 11 | # Yes it was empty. First occurrence. Remove the line. 12 | g 13 | d 14 | bb 15 | :a 16 | # The hold space was nonempty. Following occurrences. Do nothing. 17 | x 18 | :b 19 | } 20 | -------------------------------------------------------------------------------- /bootstrap: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Copyright (C) 2006, 2007, 2008, 2009 Werner Baumann 4 | 5 | # Copying and distribution of this file, with or without modification, are 6 | # permitted in any medium without royalty provided the copyright notice 7 | # and this notice are preserved. 8 | 9 | set -ex 10 | autopoint --force 11 | cd man; po4a po4a.conf; cd .. 12 | aclocal -I config 13 | autoheader 14 | automake --add-missing --force-missing --copy 15 | autoconf 16 | cp -p config/COPYING.davfs2 COPYING 17 | cp -p config/INSTALL.davfs2 INSTALL 18 | 19 | -------------------------------------------------------------------------------- /man/template.translator: -------------------------------------------------------------------------------- 1 | PO4A-HEADER:mode=after;position=^\.SH AUTHORS;beginboundary=^\.SH 2 | .SH TRANSLATOR(S) 3 | YOUR TEXT 4 | 5 | # Please replace AUTHORS by its translation, exactly as in the .po-file. 6 | # Translate the string TRANSLATOR(S). 7 | # Replace YOUR TEXT with information about the translators. 8 | # Please use the same character encoding as in the .po-file. 9 | # Rename the file. The name should be like the name of the man 10 | # page, with .translator appended (e.g. mount.davfs.8.translator). 11 | # Finally remove all this comment lines (lines beginning with #). 12 | -------------------------------------------------------------------------------- /THANKS: -------------------------------------------------------------------------------- 1 | davfs2 THANKS 2014-04-21 2 | ------------------------ 3 | 4 | This file used to contain a list of contributers. But this list never was 5 | complete and I am not able to keep track of contributions. 6 | 7 | So I wand to thank all the people who helped in one or another way: 8 | 9 | - By sending reports about problems. 10 | 11 | - By running debug sessions. 12 | 13 | - By sending patches for bug fixes or new teatures. 14 | 15 | - By providing all the libraries that davfs2 uses directly or indirectly. 16 | 17 | - By providing all the tools used to create this program. 18 | 19 | - By providing the free GNU/Linux operating system. 20 | 21 | Werner Baumann 22 | 23 | -------------------------------------------------------------------------------- /po/insert-header.sin: -------------------------------------------------------------------------------- 1 | # Sed script that inserts the file called HEADER before the header entry. 2 | # 3 | # At each occurrence of a line starting with "msgid ", we execute the following 4 | # commands. At the first occurrence, insert the file. At the following 5 | # occurrences, do nothing. The distinction between the first and the following 6 | # occurrences is achieved by looking at the hold space. 7 | /^msgid /{ 8 | x 9 | # Test if the hold space is empty. 10 | s/m/m/ 11 | ta 12 | # Yes it was empty. First occurrence. Read the file. 13 | r HEADER 14 | # Output the file's contents by reading the next line. But don't lose the 15 | # current line while doing this. 16 | g 17 | N 18 | bb 19 | :a 20 | # The hold space was nonempty. Following occurrences. Do nothing. 21 | x 22 | :b 23 | } 24 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | ## Makefile for the toplevel directory of davfs2. 2 | ## Copyright (C) 2006, 2007, 2008, 2009 Werner Baumann 3 | ## 4 | ## This file is part of davfs2. 5 | ## 6 | ## davfs2 is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 3 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## davfs2 is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with davfs2; if not, write to the Free Software Foundation, 18 | ## Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ 19 | 20 | ## Process this file with automake to produce Makefile.in 21 | 22 | EXTRA_DIST = bootstrap BUGS FAQ README.translators \ 23 | config/COPYING.davfs2 config/INSTALL.davfs2 24 | SUBDIRS = po etc man src 25 | ACLOCAL_AMFLAGS = -I config 26 | doc_DATA = AUTHORS BUGS ChangeLog COPYING FAQ INSTALL NEWS README \ 27 | README.translators THANKS TODO 28 | -------------------------------------------------------------------------------- /po/en@quot.header: -------------------------------------------------------------------------------- 1 | # All this catalog "translates" are quotation characters. 2 | # The msgids must be ASCII and therefore cannot contain real quotation 3 | # characters, only substitutes like grave accent (0x60), apostrophe (0x27) 4 | # and double quote (0x22). These substitutes look strange; see 5 | # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html 6 | # 7 | # This catalog translates grave accent (0x60) and apostrophe (0x27) to 8 | # left single quotation mark (U+2018) and right single quotation mark (U+2019). 9 | # It also translates pairs of apostrophe (0x27) to 10 | # left single quotation mark (U+2018) and right single quotation mark (U+2019) 11 | # and pairs of quotation mark (0x22) to 12 | # left double quotation mark (U+201C) and right double quotation mark (U+201D). 13 | # 14 | # When output to an UTF-8 terminal, the quotation characters appear perfectly. 15 | # When output to an ISO-8859-1 terminal, the single quotation marks are 16 | # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to 17 | # grave/acute accent (by libiconv), and the double quotation marks are 18 | # transliterated to 0x22. 19 | # When output to an ASCII terminal, the single quotation marks are 20 | # transliterated to apostrophes, and the double quotation marks are 21 | # transliterated to 0x22. 22 | # 23 | -------------------------------------------------------------------------------- /man/po4a.conf: -------------------------------------------------------------------------------- 1 | # po4a configuration for davfs2 man pages 2009-04-13 2 | 3 | # List of available languages. Two-letter language codes must 4 | # be lower case. The list must be in one line; no line 5 | # continuation using backslash. 6 | 7 | [po4a_langs] de es 8 | 9 | 10 | # For each man page there is one .pot file. 11 | # For each language there is a subdirectory holding the Make-files, 12 | # the PO-files, the addendum files and the translated man pages. 13 | 14 | [po4a_paths] $master.pot $lang:$lang/$master.po 15 | 16 | # For each translated man page there should be at least one 17 | # addendum file holding information about the translator(s). 18 | # It should be named after the man page with extension 19 | # .translator. Additional addendum files may be added. 20 | 21 | [type:man] davfs2.conf.5 \ 22 | de:de/davfs2.conf.5 add_de:de/davfs2.conf.5.translator \ 23 | es:es/davfs2.conf.5 \ 24 | opt_de:"-L UTF-8 -A UTF-8" \ 25 | opt_es:"-k 70 -L UTF-8" 26 | 27 | [type:man] mount.davfs.8 \ 28 | de:de/mount.davfs.8 add_de:de/mount.davfs.8.translator \ 29 | opt_de:"-L UTF-8 -A UTF-8" 30 | 31 | [type:man] umount.davfs.8 \ 32 | de:de/umount.davfs.8 add_de:de/umount.davfs.8.translator \ 33 | opt_de:"-L UTF-8 -A UTF-8" 34 | -------------------------------------------------------------------------------- /config/nls.m4: -------------------------------------------------------------------------------- 1 | # nls.m4 serial 5 (gettext-0.18) 2 | dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation, 3 | dnl Inc. 4 | dnl This file is free software; the Free Software Foundation 5 | dnl gives unlimited permission to copy and/or distribute it, 6 | dnl with or without modifications, as long as this notice is preserved. 7 | dnl 8 | dnl This file can can be used in projects which are not available under 9 | dnl the GNU General Public License or the GNU Library General Public 10 | dnl License but which still want to provide support for the GNU gettext 11 | dnl functionality. 12 | dnl Please note that the actual code of the GNU gettext library is covered 13 | dnl by the GNU Library General Public License, and the rest of the GNU 14 | dnl gettext package package is covered by the GNU General Public License. 15 | dnl They are *not* in the public domain. 16 | 17 | dnl Authors: 18 | dnl Ulrich Drepper , 1995-2000. 19 | dnl Bruno Haible , 2000-2003. 20 | 21 | AC_PREREQ([2.50]) 22 | 23 | AC_DEFUN([AM_NLS], 24 | [ 25 | AC_MSG_CHECKING([whether NLS is requested]) 26 | dnl Default is enabled NLS 27 | AC_ARG_ENABLE([nls], 28 | [ --disable-nls do not use Native Language Support], 29 | USE_NLS=$enableval, USE_NLS=yes) 30 | AC_MSG_RESULT([$USE_NLS]) 31 | AC_SUBST([USE_NLS]) 32 | ]) 33 | -------------------------------------------------------------------------------- /po/en@boldquot.header: -------------------------------------------------------------------------------- 1 | # All this catalog "translates" are quotation characters. 2 | # The msgids must be ASCII and therefore cannot contain real quotation 3 | # characters, only substitutes like grave accent (0x60), apostrophe (0x27) 4 | # and double quote (0x22). These substitutes look strange; see 5 | # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html 6 | # 7 | # This catalog translates grave accent (0x60) and apostrophe (0x27) to 8 | # left single quotation mark (U+2018) and right single quotation mark (U+2019). 9 | # It also translates pairs of apostrophe (0x27) to 10 | # left single quotation mark (U+2018) and right single quotation mark (U+2019) 11 | # and pairs of quotation mark (0x22) to 12 | # left double quotation mark (U+201C) and right double quotation mark (U+201D). 13 | # 14 | # When output to an UTF-8 terminal, the quotation characters appear perfectly. 15 | # When output to an ISO-8859-1 terminal, the single quotation marks are 16 | # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to 17 | # grave/acute accent (by libiconv), and the double quotation marks are 18 | # transliterated to 0x22. 19 | # When output to an ASCII terminal, the single quotation marks are 20 | # transliterated to apostrophes, and the double quotation marks are 21 | # transliterated to 0x22. 22 | # 23 | # This catalog furthermore displays the text between the quotation marks in 24 | # bold face, assuming the VT100/XTerm escape sequences. 25 | # 26 | -------------------------------------------------------------------------------- /etc/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Makefile for etc directory in davfs. 2 | ## Copyright (C) 2006, 2007, 2008, 2009 Werner Baumann 3 | ## 4 | ## This file is part of davfs2. 5 | ## 6 | ## davfs2 is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 3 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## davfs2 is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with davfs2; if not, write to the Free Software Foundation, 18 | ## Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ 19 | 20 | ## Process this file with automake to produce Makefile.in 21 | 22 | dist_pkgdata_DATA = davfs2.conf secrets 23 | pkgsysconfdir = $(sysconfdir)/@PACKAGE@ 24 | 25 | install-data-local: $(dist_pkgdata_DATA) 26 | @$(NORMAL_INSTALL) 27 | $(mkinstalldirs) $(DESTDIR)$(pkgsysconfdir) 28 | $(INSTALL_DATA) -b davfs2.conf $(DESTDIR)$(pkgsysconfdir)/davfs2.conf 29 | $(INSTALL_DATA) -b -m 600 secrets $(DESTDIR)$(pkgsysconfdir)/secrets 30 | $(mkinstalldirs) $(DESTDIR)$(pkgsysconfdir)/certs 31 | $(mkinstalldirs) $(DESTDIR)$(pkgsysconfdir)/certs/private 32 | chmod 700 $(DESTDIR)$(pkgsysconfdir)/certs/private 33 | 34 | uninstall-local: 35 | @$(NORMAL_UNINSTALL) 36 | @list='$(dist_pkgdata_DATA)'; for p in $$list; do \ 37 | f="`echo $$p | sed -e 's|^.*/||'`"; \ 38 | echo " rm -f $(DESTDIR)$(pkgsysconfdir)/$$f"; \ 39 | rm -f $(DESTDIR)$(pkgsysconfdir)/$$f; \ 40 | done 41 | -------------------------------------------------------------------------------- /po/Rules-quot: -------------------------------------------------------------------------------- 1 | # Special Makefile rules for English message catalogs with quotation marks. 2 | 3 | DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot 4 | 5 | .SUFFIXES: .insert-header .po-update-en 6 | 7 | en@quot.po-create: 8 | $(MAKE) en@quot.po-update 9 | en@boldquot.po-create: 10 | $(MAKE) en@boldquot.po-update 11 | 12 | en@quot.po-update: en@quot.po-update-en 13 | en@boldquot.po-update: en@boldquot.po-update-en 14 | 15 | .insert-header.po-update-en: 16 | @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ 17 | if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ 18 | tmpdir=`pwd`; \ 19 | echo "$$lang:"; \ 20 | ll=`echo $$lang | sed -e 's/@.*//'`; \ 21 | LC_ALL=C; export LC_ALL; \ 22 | cd $(srcdir); \ 23 | if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$lang -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \ 24 | if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ 25 | rm -f $$tmpdir/$$lang.new.po; \ 26 | else \ 27 | if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ 28 | :; \ 29 | else \ 30 | echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ 31 | exit 1; \ 32 | fi; \ 33 | fi; \ 34 | else \ 35 | echo "creation of $$lang.po failed!" 1>&2; \ 36 | rm -f $$tmpdir/$$lang.new.po; \ 37 | fi 38 | 39 | en@quot.insert-header: insert-header.sin 40 | sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header 41 | 42 | en@boldquot.insert-header: insert-header.sin 43 | sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header 44 | 45 | mostlyclean: mostlyclean-quot 46 | mostlyclean-quot: 47 | rm -f *.insert-header 48 | -------------------------------------------------------------------------------- /po/Makevars: -------------------------------------------------------------------------------- 1 | # Makefile variables for PO directory in any package using GNU gettext. 2 | 3 | # Usually the message domain is the same as the package name. 4 | DOMAIN = $(PACKAGE) 5 | 6 | # These two variables depend on the location of this directory. 7 | subdir = po 8 | top_builddir = .. 9 | 10 | # These options get passed to xgettext. 11 | XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ 12 | 13 | # This is the copyright holder that gets inserted into the header of the 14 | # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding 15 | # package. (Note that the msgstr strings, extracted from the package's 16 | # sources, belong to the copyright holder of the package.) Translators are 17 | # expected to transfer the copyright for their translations to this person 18 | # or entity, or to disclaim their copyright. The empty string stands for 19 | # the public domain; in this case the translators are expected to disclaim 20 | # their copyright. 21 | COPYRIGHT_HOLDER = Werner Baumann 22 | 23 | # This is the email address or URL to which the translators shall report 24 | # bugs in the untranslated strings: 25 | # - Strings which are not entire sentences, see the maintainer guidelines 26 | # in the GNU gettext documentation, section 'Preparing Strings'. 27 | # - Strings which use unclear terms or require additional context to be 28 | # understood. 29 | # - Strings which make invalid assumptions about notation of date, time or 30 | # money. 31 | # - Pluralisation problems. 32 | # - Incorrect English spelling. 33 | # - Incorrect formatting. 34 | # It can be your email address, or a mailing list address where translators 35 | # can write to without being subscribed, or the URL of a web page through 36 | # which the translators can contact you. 37 | MSGID_BUGS_ADDRESS = http://savannah.nongnu.org/support/?func=additem&group=davfs2 38 | 39 | # This is the list of locale categories, beyond LC_MESSAGES, for which the 40 | # message catalogs shall be used. It is usually empty. 41 | EXTRA_LOCALE_CATEGORIES = 42 | -------------------------------------------------------------------------------- /man/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Makefile for man directory in davfs. 2 | ## Copyright (C) 2006, 2007, 2008, 2009 Werner Baumann 3 | ## 4 | ## This file is part of davfs2. 5 | ## 6 | ## davfs2 is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 3 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## davfs2 is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with davfs2; if not, write to the Free Software Foundation, 18 | ## Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ 19 | 20 | ## Process this file with automake to produce Makefile.in 21 | 22 | pkgsysconfdir = $(sysconfdir)/@PACKAGE@ 23 | pkglocalstatedir = $(dav_localstatedir)/mount.davfs 24 | pkgsyscachedir = $(dav_syscachedir)/@PACKAGE@ 25 | manual5dir = $(mandir)/man5 26 | manual8dir = $(mandir)/man8 27 | SUBDIRS = @dav_linguas@ 28 | DIST_SUBDIRS = de es 29 | 30 | edit = sed \ 31 | -e 's|@PACKAGE[@]|$(PACKAGE)|g' \ 32 | -e 's|@PACKAGE_STRING[@]|$(PACKAGE_STRING)|g' \ 33 | -e 's|@PACKAGE_BUGREPORT[@]|$(PACKAGE_BUGREPORT)|g' \ 34 | -e 's|@PROGRAM_NAME[@]|mount.davfs|g' \ 35 | -e 's|@SYS_CONF_DIR[@]|$(pkgsysconfdir)|g' \ 36 | -e 's|@SYS_RUN[@]|$(pkglocalstatedir)|g' \ 37 | -e 's|@SYS_CACHE_DIR[@]|$(pkgsyscachedir)|g' \ 38 | -e 's|@SECRETSFILE[@]|secrets|g' \ 39 | -e 's|@CONFIGFILE[@]|$(PACKAGE).conf|g' \ 40 | -e 's|@CERTS_DIR[@]|certs|g' \ 41 | -e 's|@CLICERTS_DIR[@]|private|g' \ 42 | -e 's|@USER[@]|$(dav_user)|g' \ 43 | -e 's|@GROUP[@]|$(dav_group)|g' 44 | 45 | manual5_DATA = davfs2.conf.5.gz 46 | manual8_DATA = mount.davfs.8.gz umount.davfs.8.gz 47 | 48 | EXTRA_DIST = davfs2.conf.5 mount.davfs.8 umount.davfs.8 \ 49 | davfs2.conf.5.pot mount.davfs.8.pot umount.davfs.8.pot \ 50 | po4a.conf template.translator 51 | CLEANFILES = $(manual5_DATA) $(manual8_DATA) 52 | 53 | %.gz: % 54 | $(edit) $< | gzip -9 > $@ 55 | -------------------------------------------------------------------------------- /man/de/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Makefile for man/de directory in davfs. 2 | ## Copyright (C) 2006, 2007, 2008, 2009 Werner Baumann 3 | ## 4 | ## This file is part of davfs2. 5 | ## 6 | ## davfs2 is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 3 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## davfs2 is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with davfs2; if not, write to the Free Software Foundation, 18 | ## Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ 19 | 20 | ## Process this file with automake to produce Makefile.in 21 | 22 | pkgsysconfdir = $(sysconfdir)/@PACKAGE@ 23 | pkglocalstatedir = $(dav_localstatedir)/mount.davfs 24 | pkgsyscachedir = $(dav_syscachedir)/@PACKAGE@ 25 | manual5dir = $(mandir)/de/man5 26 | manual8dir = $(mandir)/de/man8 27 | 28 | edit = sed \ 29 | -e 's|@PACKAGE[@]|$(PACKAGE)|g' \ 30 | -e 's|@PACKAGE_STRING[@]|$(PACKAGE_STRING)|g' \ 31 | -e 's|@PACKAGE_BUGREPORT[@]|$(PACKAGE_BUGREPORT)|g' \ 32 | -e 's|@PROGRAM_NAME[@]|mount.davfs|g' \ 33 | -e 's|@SYS_CONF_DIR[@]|$(pkgsysconfdir)|g' \ 34 | -e 's|@SYS_RUN[@]|$(pkglocalstatedir)|g' \ 35 | -e 's|@SYS_CACHE_DIR[@]|$(pkgsyscachedir)|g' \ 36 | -e 's|@SECRETSFILE[@]|secrets|g' \ 37 | -e 's|@CONFIGFILE[@]|$(PACKAGE).conf|g' \ 38 | -e 's|@CERTS_DIR[@]|certs|g' \ 39 | -e 's|@CLICERTS_DIR[@]|private|g' \ 40 | -e 's|@USER[@]|$(dav_user)|g' \ 41 | -e 's|@GROUP[@]|$(dav_group)|g' 42 | 43 | manual5_DATA = davfs2.conf.5.gz 44 | manual8_DATA = mount.davfs.8.gz umount.davfs.8.gz 45 | 46 | EXTRA_DIST = davfs2.conf.5 mount.davfs.8 umount.davfs.8 \ 47 | davfs2.conf.5.po mount.davfs.8.po umount.davfs.8.po \ 48 | davfs2.conf.5.translator mount.davfs.8.translator \ 49 | umount.davfs.8.translator 50 | CLEANFILES = $(manual5_DATA) $(manual8_DATA) 51 | 52 | %.gz: % 53 | $(edit) $< | gzip -9 > $@ 54 | -------------------------------------------------------------------------------- /man/es/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Makefile for man/es directory in davfs. 2 | ## Copyright (C) 2006, 2007, 2008, 2009 Werner Baumann 3 | ## 4 | ## This file is part of davfs2. 5 | ## 6 | ## davfs2 is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 3 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## davfs2 is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with davfs2; if not, write to the Free Software Foundation, 18 | ## Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ 19 | 20 | ## Process this file with automake to produce Makefile.in 21 | 22 | pkgsysconfdir = $(sysconfdir)/@PACKAGE@ 23 | pkglocalstatedir = $(dav_localstatedir)/mount.davfs 24 | pkgsyscachedir = $(dav_syscachedir)/@PACKAGE@ 25 | manual5dir = $(mandir)/es/man5 26 | #manual8dir = $(mandir)/es/man8 27 | 28 | edit = sed \ 29 | -e 's|@PACKAGE[@]|$(PACKAGE)|g' \ 30 | -e 's|@PACKAGE_STRING[@]|$(PACKAGE_STRING)|g' \ 31 | -e 's|@PACKAGE_BUGREPORT[@]|$(PACKAGE_BUGREPORT)|g' \ 32 | -e 's|@PROGRAM_NAME[@]|mount.davfs|g' \ 33 | -e 's|@SYS_CONF_DIR[@]|$(pkgsysconfdir)|g' \ 34 | -e 's|@SYS_RUN[@]|$(pkglocalstatedir)|g' \ 35 | -e 's|@SYS_CACHE_DIR[@]|$(pkgsyscachedir)|g' \ 36 | -e 's|@SECRETSFILE[@]|secrets|g' \ 37 | -e 's|@CONFIGFILE[@]|$(PACKAGE).conf|g' \ 38 | -e 's|@CERTS_DIR[@]|certs|g' \ 39 | -e 's|@CLICERTS_DIR[@]|private|g' \ 40 | -e 's|@USER[@]|$(dav_user)|g' \ 41 | -e 's|@GROUP[@]|$(dav_group)|g' 42 | 43 | manual5_DATA = davfs2.conf.5.gz 44 | #manual8_DATA = mount.davfs.8.gz umount.davfs.8.gz 45 | 46 | #EXTRA_DIST = davfs2.conf.5 mount.davfs.8 umount.davfs.8 \ 47 | # davfs2.conf.5.po mount.davfs.8.po umount.davfs.8.po \ 48 | # davfs2.conf.5.translator mount.davfs.8.translator \ 49 | # umount.davfs.8.translator 50 | EXTRA_DIST = davfs2.conf.5 davfs2.conf.5.po 51 | CLEANFILES = $(manual5_DATA) $(manual8_DATA) 52 | 53 | %.gz: % 54 | $(edit) $< | gzip -9 > $@ 55 | -------------------------------------------------------------------------------- /man/umount.davfs.8: -------------------------------------------------------------------------------- 1 | .TH u@PROGRAM_NAME@ 8 "2014-08-23" @PACKAGE_STRING@ 2 | 3 | .SH NAME 4 | 5 | u@PROGRAM_NAME@ \- Umount-helper to unmount a @PACKAGE@ file system 6 | 7 | 8 | .SH SYNOPSIS 9 | 10 | .B u@PROGRAM_NAME@ [-h | --help] [-V | --version] 11 | .br 12 | .BI "umount " dir 13 | 14 | 15 | .SH SYNOPSIS (root only) 16 | 17 | .BI "u@PROGRAM_NAME@ " dir 18 | 19 | 20 | .SH DESCRIPTION 21 | 22 | \fBu@PROGRAM_NAME@\fR is a umount helper program. It is called by the 23 | \fBumount\fR(8) command. Its purpose is to prevent the umount command 24 | from returning unless \fB@PROGRAM_NAME@\fR has synchronized all its 25 | cached files with the webdav server. 26 | 27 | .PP 28 | \fIdir\fP is the mountpoint where the WebDAV resource is mounted on. 29 | It may be an absolute or relative path. 30 | 31 | .PP 32 | While for local file systems \fBumount\fR(8) will only return when all 33 | cached data have been written to disk, this is not automatically true 34 | for a mounted \fB@PACKAGE@\fR file system. With this umount helper the 35 | user can rely on the familiar behaviour of \fBumount\fR(8). To inform 36 | the operating system that the file system uses a network connection, 37 | you should always use the \fB_netdev\fR option, when mounting as 38 | \fB@PACKAGE@\fR file system. 39 | 40 | .PP 41 | Depending on the amount of data and the quality of the connection, unmounting 42 | a \fB@PACKAGE@\fR file system may take some seconds up to some hours. 43 | 44 | .PP 45 | If the \fB@PROGRAM_NAME@\fR daemon encountered serious errors, 46 | \fBu@PROGRAM_NAME@\fR may return an error instead of unmounting the file 47 | system. In this case try \fBumount -i\fR. The \fB-i\fR option will prevent 48 | \fBumount\fR(8) from calling \fBu@PROGRAM_NAME@\fR. 49 | 50 | 51 | .SH OPTIONS 52 | 53 | .TP 54 | .B -V --version 55 | Output version. 56 | 57 | .TP 58 | .B -h --help 59 | Print a help message. 60 | 61 | .TP 62 | .B -f -l -n -r -v -t 63 | This options are \fBignored\fR. They are only recognized for compatibility 64 | with \fBumount\fR(8). 65 | 66 | 67 | .SH FILES 68 | 69 | .TP 70 | .I @SYS_RUN@ 71 | PID-files of running \fBu@PROGRAM_NAME@\fR processes are looked up here. 72 | 73 | 74 | .SH BUGS 75 | 76 | No known bugs. 77 | 78 | 79 | .SH AUTHORS 80 | 81 | This man page was written by Werner Baumann . 82 | 83 | 84 | .SH DAVFS2 HOME 85 | 86 | @PACKAGE_BUGREPORT@ 87 | 88 | 89 | .SH SEE ALSO 90 | 91 | .BR @PROGRAM_NAME@ (8), 92 | .BR umount (8), 93 | .BR @CONFIGFILE@ (5), 94 | .BR fstab (5) 95 | -------------------------------------------------------------------------------- /etc/davfs2.conf: -------------------------------------------------------------------------------- 1 | # davfs2 configuration file 2014-08-10 2 | # version 12 3 | # ------------------------------------ 4 | 5 | # Copyright (C) 2006, 2007, 2008, 2009, 2012, 2013, 2014 Werner Baumann 6 | 7 | # Copying and distribution of this file, with or without modification, are 8 | # permitted in any medium without royalty provided the copyright notice 9 | # and this notice are preserved. 10 | 11 | 12 | # Please read the davfs2.conf (5) man page for a description of the 13 | # configuration options and syntax rules. 14 | 15 | 16 | # Available options and default values 17 | # ==================================== 18 | 19 | # General Options 20 | # --------------- 21 | 22 | # dav_user davfs2 # system wide config file only 23 | # dav_group davfs2 # system wide config file only 24 | # kernel_fs fuse 25 | # buf_size 16 # KiByte 26 | 27 | # WebDAV Related Options 28 | # ---------------------- 29 | 30 | # use_proxy 1 # system wide config file only 31 | # proxy # system wide config file only 32 | # trust_ca_cert 33 | # servercert # deprecated: use trust_ca_cert 34 | # trust_server_cert 35 | # clientcert 36 | # secrets ~/.davfs2/secrets # user config file only 37 | # ask_auth 1 38 | # use_locks 1 39 | # lock_owner 40 | # lock_timeout 1800 # seconds 41 | # lock_refresh 60 # seconds 42 | # use_expect100 0 43 | # if_match_bug 0 44 | # drop_weak_etags 0 45 | # n_cookies 0 46 | # precheck 1 47 | # ignore_dav_header 0 48 | # use_compression 0 49 | # min_propset 0 50 | # follow_redirect 0 51 | # server_charset 52 | # connect_timeout 10 # seconds 53 | # read_timeout 30 # seconds 54 | # retry 30 # seconds 55 | # max_retry 300 # seconds 56 | # add_header 57 | 58 | # Cache Related Options 59 | # --------------------- 60 | 61 | # backup_dir lost+found 62 | # cache_dir /var/cache/davfs2 # system wide cache 63 | # ~/.davfs2/cache # per user cache 64 | # cache_size 50 # MiByte 65 | # table_size 1024 66 | # dir_refresh 60 # seconds 67 | # file_refresh 1 # second 68 | # delay_upload 10 69 | # gui_optimize 0 70 | # minimize_mem 0 71 | 72 | # Debugging Options 73 | # ----------------- 74 | 75 | # debug # possible values: config, kernel, cache, http, xml, 76 | # httpauth, locks, ssl, httpbody, secrets, most 77 | 78 | -------------------------------------------------------------------------------- /config/intlmacosx.m4: -------------------------------------------------------------------------------- 1 | # intlmacosx.m4 serial 3 (gettext-0.18) 2 | dnl Copyright (C) 2004-2010 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | dnl 7 | dnl This file can can be used in projects which are not available under 8 | dnl the GNU General Public License or the GNU Library General Public 9 | dnl License but which still want to provide support for the GNU gettext 10 | dnl functionality. 11 | dnl Please note that the actual code of the GNU gettext library is covered 12 | dnl by the GNU Library General Public License, and the rest of the GNU 13 | dnl gettext package package is covered by the GNU General Public License. 14 | dnl They are *not* in the public domain. 15 | 16 | dnl Checks for special options needed on MacOS X. 17 | dnl Defines INTL_MACOSX_LIBS. 18 | AC_DEFUN([gt_INTL_MACOSX], 19 | [ 20 | dnl Check for API introduced in MacOS X 10.2. 21 | AC_CACHE_CHECK([for CFPreferencesCopyAppValue], 22 | [gt_cv_func_CFPreferencesCopyAppValue], 23 | [gt_save_LIBS="$LIBS" 24 | LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" 25 | AC_TRY_LINK([#include ], 26 | [CFPreferencesCopyAppValue(NULL, NULL)], 27 | [gt_cv_func_CFPreferencesCopyAppValue=yes], 28 | [gt_cv_func_CFPreferencesCopyAppValue=no]) 29 | LIBS="$gt_save_LIBS"]) 30 | if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then 31 | AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1], 32 | [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.]) 33 | fi 34 | dnl Check for API introduced in MacOS X 10.3. 35 | AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent], 36 | [gt_save_LIBS="$LIBS" 37 | LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" 38 | AC_TRY_LINK([#include ], [CFLocaleCopyCurrent();], 39 | [gt_cv_func_CFLocaleCopyCurrent=yes], 40 | [gt_cv_func_CFLocaleCopyCurrent=no]) 41 | LIBS="$gt_save_LIBS"]) 42 | if test $gt_cv_func_CFLocaleCopyCurrent = yes; then 43 | AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1], 44 | [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.]) 45 | fi 46 | INTL_MACOSX_LIBS= 47 | if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then 48 | INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" 49 | fi 50 | AC_SUBST([INTL_MACOSX_LIBS]) 51 | ]) 52 | -------------------------------------------------------------------------------- /src/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Makefile for program src directory in davfs. 2 | ## Copyright (C) 2006, 2007, 2008, 2009 Werner Baumann 3 | ## 4 | ## This file is part of davfs2. 5 | ## 6 | ## davfs2 is free software; you can redistribute it and/or modify 7 | ## it under the terms of the GNU General Public License as published by 8 | ## the Free Software Foundation; either version 3 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## davfs2 is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU General Public License 17 | ## along with davfs2; if not, write to the Free Software Foundation, 18 | ## Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ 19 | 20 | ## Process this file with automake to produce Makefile.in 21 | 22 | localedir = $(datadir)/locale 23 | pkgsysconfdir = $(sysconfdir)/@PACKAGE@ 24 | pkglocalstatedir = $(dav_localstatedir)/mount.davfs 25 | pkgsyscachedir = $(dav_syscachedir)/@PACKAGE@ 26 | ssbindir = @ssbindir@ 27 | 28 | sbin_PROGRAMS = mount.davfs umount.davfs 29 | mount_davfs_SOURCES = cache.c dav_coda.c \ 30 | dav_fuse.c kernel_interface.c mount_davfs.c webdav.c \ 31 | cache.h coda.h defaults.h fuse_kernel.h \ 32 | kernel_interface.h mount_davfs.h webdav.h 33 | umount_davfs_SOURCES = umount_davfs.c defaults.h 34 | 35 | AM_CFLAGS = -Wall -Werror=format-security \ 36 | -fstack-protector-strong --param=ssp-buffer-size=4 37 | DEFS = -DPROGRAM_NAME=\"mount.davfs\" \ 38 | -DDAV_SYS_CONF_DIR=\"$(pkgsysconfdir)\" \ 39 | -DDAV_LOCALSTATE_DIR=\"$(dav_localstatedir)\" \ 40 | -DDAV_SYS_RUN=\"$(pkglocalstatedir)\" \ 41 | -DDAV_SYS_CACHE=\"$(pkgsyscachedir)\" \ 42 | -DDAV_SECRETS=\"secrets\" \ 43 | -DDAV_CONFIG=\"$(PACKAGE).conf\" \ 44 | -DDAV_CERTS_DIR=\"certs\" \ 45 | -DDAV_CLICERTS_DIR=\"private\" \ 46 | -DDAV_DATA_DIR=\"$(pkgdatadir)\" \ 47 | -DLOCALEDIR=\"$(localedir)\" \ 48 | -DDAV_USER=\"$(dav_user)\" \ 49 | -DDAV_GROUP=\"$(dav_group)\" \ 50 | -D_FORTIFY_SOURCE=2 @DEFS@ 51 | LIBS = $(NEON_LIBS) @LIBS@ 52 | 53 | install-exec-hook: 54 | chmod u+s $(DESTDIR)$(sbindir)/mount.davfs; \ 55 | if test "$(sbindir)" != "$(ssbindir)"; then \ 56 | $(mkinstalldirs) $(DESTDIR)$(ssbindir); \ 57 | $(LN_S) -f $(sbindir)/mount.davfs $(DESTDIR)$(ssbindir)/mount.davfs; \ 58 | $(LN_S) -f $(sbindir)/umount.davfs $(DESTDIR)$(ssbindir)/umount.davfs; \ 59 | fi 60 | 61 | uninstall-hook: 62 | if test "$(sbindir)" != "$(ssbindir)"; then \ 63 | rm -f $(DESTDIR)$(ssbindir)/mount.davfs; \ 64 | rm -f $(DESTDIR)$(ssbindir)/umount.davfs; \ 65 | fi 66 | -------------------------------------------------------------------------------- /etc/secrets: -------------------------------------------------------------------------------- 1 | # davfs2 secrets file 2009-10-18 2 | # version 4 3 | # ------------------------------- 4 | 5 | # Copyright (C) 2006, 2007, 2008, 2009 Werner Baumann 6 | 7 | # Copying and distribution of this file, with or without modification, are 8 | # permitted in any medium without royalty provided the copyright notice 9 | # and this notice are preserved. 10 | 11 | 12 | # # This file must be readable and writeable by the owner only (mode 0600). 13 | 14 | # This file contains user-name and password for the proxy, the 15 | # WebDAV resources and decryption passwords for client certificates. 16 | 17 | # Comments are indicated by a '#' character and the rest of the line 18 | # is ignored. Empty lines are ignored too. 19 | 20 | # Each line consists of two or three items separated by spaces or tabs. 21 | # If an item contains one of the characters space, tab, #, \ or ", this 22 | # character must be escaped by a preceding \. Alternatively, the item 23 | # may be enclosed in double quotes. (see also the davfs2.conf (5) man page) 24 | 25 | 26 | # Proxy Line 27 | # ---------- 28 | # A proxy line consists of the fully qualified domain name of the proxy, 29 | # the user-name and the password. The proxy name must not contain a scheme 30 | # or path segment, but a port number should be added, separated by a colon. 31 | # The password my be omitted. 32 | # Instead of the name of the proxy, the keyword "proxy" may be used. 33 | 34 | # Examples 35 | # foo.bar:3245 otto my\ secret 36 | # foo.bar otto "my secret" 37 | # proxy otto "my secret" 38 | 39 | 40 | # Credential Line 41 | # --------------- 42 | # A credential line consists of the mount-point, the user-name and 43 | # the password. The mount-point must be an absolute path, starting 44 | # with /. The password may be omitted. 45 | # For compatibility with older versions, instead of the mount-point 46 | # the URL may be given. The URL must contain scheme, fully qualified 47 | # domain name and path. If the path segment is missing, / is assumed. 48 | 49 | # Examples 50 | # /home/otto/foo otto g3H\"x\ 7z\\ 51 | # /media/dav/bar otto geheim 52 | # Old style 53 | # "http://foo.bar/my documents" otto "geh # heim" 54 | # https://foo.bar:333/dav otto geh\ \#\ heim 55 | 56 | 57 | # Password for Client Certificate 58 | # ------------------------------- 59 | # It must contain the name of the certificate file and the encryption 60 | # password. The name must be either absolute (starting with /) or the 61 | # file-name only. If it is not absolute, it is assumed to be in the 62 | # standard directory for client certificates. 63 | 64 | # Examples 65 | # /home/otto/.davfs2/certs/private/otto.crt geheim 66 | # otto_private.crt "this is extraordinary secret" 67 | # "otto private.crt" this\ is\ secret,\ too. 68 | 69 | -------------------------------------------------------------------------------- /configure.ac: -------------------------------------------------------------------------------- 1 | # -*- Autoconf -*- 2 | # Process this file with autoconf to produce a configure script. 3 | 4 | # Copyright (C) 2006, 2007, 2008, 2009, 2010, 2014 Werner Baumann 5 | # 6 | # This file is part of davfs2. 7 | # 8 | # davfs2 is free software; you can redistribute it and/or modify 9 | # it under the terms of the GNU General Public License as published by 10 | # the Free Software Foundation; either version 3 of the License, or 11 | # (at your option) any later version. 12 | # 13 | # davfs2 is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with davfs2; if not, write to the Free Software Foundation, 20 | # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ 21 | 22 | 23 | AC_PREREQ(2.59) 24 | AC_INIT(davfs2, 1.5.4, http://savannah.nongnu.org/projects/davfs2) 25 | AC_CONFIG_SRCDIR([src/cache.c]) 26 | AC_CONFIG_AUX_DIR([config]) 27 | AM_INIT_AUTOMAKE 28 | 29 | AC_CONFIG_HEADER([config.h]) 30 | 31 | # Checks for programs. 32 | AC_PROG_CC 33 | AC_PROG_INSTALL 34 | AC_PROG_LN_S 35 | 36 | # Checks for libraries. 37 | AM_GNU_GETTEXT_VERSION(0.18.1) 38 | AM_GNU_GETTEXT([external]) 39 | NE_REQUIRE_VERSIONS([0], [27 28 29 30]) 40 | DAV_CHECK_NEON 41 | 42 | # Checks for header files. 43 | AC_HEADER_DIRENT 44 | AC_HEADER_STDC 45 | AC_CHECK_HEADERS([fcntl.h libintl.h langinfo.h limits.h locale.h mntent.h stddef.h stdint.h stdlib.h string.h sys/file.h sys/mount.h sys/time.h syslog.h termios.h unistd.h utime.h]) 46 | 47 | # Checks for typedefs, structures, and compiler characteristics. 48 | AC_C_CONST 49 | AC_TYPE_UID_T 50 | AC_C_INLINE 51 | AC_TYPE_INT16_T 52 | AC_TYPE_INT32_T 53 | AC_TYPE_INT8_T 54 | AC_TYPE_MODE_T 55 | AC_TYPE_OFF_T 56 | AC_TYPE_PID_T 57 | AC_TYPE_SIZE_T 58 | AC_TYPE_SSIZE_T 59 | AC_CHECK_MEMBERS([struct stat.st_blksize]) 60 | AC_HEADER_TIME 61 | AC_STRUCT_TM 62 | AC_TYPE_UINT32_T 63 | AC_TYPE_UINT64_T 64 | AC_C_VOLATILE 65 | AC_CHECK_SIZEOF([void *]) 66 | 67 | # Checks for library functions. 68 | AC_FUNC_CHOWN 69 | AC_FUNC_CLOSEDIR_VOID 70 | AC_FUNC_ERROR_AT_LINE 71 | AC_FUNC_FORK 72 | AC_FUNC_GETGROUPS 73 | AC_FUNC_GETMNTENT 74 | AC_PROG_GCC_TRADITIONAL 75 | AC_HEADER_MAJOR 76 | AC_FUNC_MALLOC 77 | AC_FUNC_SELECT_ARGTYPES 78 | AC_FUNC_STRFTIME 79 | AC_FUNC_STAT 80 | AC_FUNC_UTIME_NULL 81 | AC_CHECK_FUNCS([endpwent ftruncate getmntent memset mkdir nl_langinfo rpmatch select setlocale strcasecmp strchr strdup strerror strpbrk strrchr strstr strtol strtoull utime]) 82 | 83 | # Misc. 84 | DAV_DEFAULTS 85 | DAV_LFS 86 | DAV_LINGUAS([de]) 87 | AC_DEFINE([_GNU_SOURCE], 1, [Define to enable GNU extensions]) 88 | 89 | AC_CONFIG_FILES([Makefile 90 | po/Makefile.in 91 | etc/Makefile 92 | man/Makefile 93 | man/de/Makefile 94 | man/es/Makefile 95 | src/Makefile]) 96 | AC_OUTPUT 97 | DAV_MESSAGE 98 | -------------------------------------------------------------------------------- /man/de/umount.davfs.8: -------------------------------------------------------------------------------- 1 | .\"******************************************************************* 2 | .\" 3 | .\" This file was generated with po4a. Translate the source file. 4 | .\" 5 | .\"******************************************************************* 6 | .TH u@PROGRAM_NAME@ 8 2014\-08\-23 @PACKAGE_STRING@ 7 | 8 | .SH BEZEICHNUNG 9 | 10 | u@PROGRAM_NAME@ \- Umount\-Hilfsprogramm für @PACKAGE@ Dateisysteme 11 | 12 | 13 | .SH ÜBERSICHT 14 | 15 | \fBu@PROGRAM_NAME@ [\-h | \-\-help] [\-V | \-\-version]\fP 16 | .br 17 | \fBumount \fP\fIdir\fP 18 | 19 | 20 | .SH "ÜBERSICHT (nur für root)" 21 | 22 | \fBu@PROGRAM_NAME@ \fP\fIdir\fP 23 | 24 | 25 | .SH BESCHREIBUNG 26 | 27 | \fBu@PROGRAM_NAME@\fP ist ein Hilfsprogramm, das von \fBumount\fP(8) aufgerufen 28 | wird. Es soll verhindern, dass das umount\-Kommando zurück kehrt, bevor 29 | \fB@PROGRAM_NAME@\fP alle geänderten Dateien aus dem Cache auf den 30 | WebDAV\-Server zurück sichern konnte. 31 | 32 | .PP 33 | \fIdir\fP ist der Einhängepunkt. Es kann eine absolute oder relative Pfadangabe 34 | sein. 35 | 36 | .PP 37 | Bei lokalen Dateisystemen kehrt \fBumount\fP(8) erst zurück, wenn alle Daten 38 | aus dem Cache auf die Festplatte geschrieben sind. Dies funkioniert bei 39 | einem \fB@PACKAGE@\fP\-Dateisystem nicht automatisch. Mit diesem Hilfsprogramm 40 | kann sich der Benutzer auf das bekannte Verhalten von \fBumount\fP(8) 41 | verlassen. Es sollte auch immer mit der Option \fB_netdev\fP eingehängt werden, 42 | damit das Betriebssystem darüber informiert wird, dass das 43 | \fB@PACKAGE@\fP\-Dateisystem eine Netzwerkverbindung braucht. 44 | 45 | .PP 46 | Abhängig von der Datenmenge und der Qualität der Netzwerkverbindung kann das 47 | Aushängen ein paar Sekunden, aber auch einige Stunden dauern. 48 | 49 | .PP 50 | Wenn der \fB@PROGRAM_NAME@\fP\-Hintergrundprozess ernste Probleme hat, kann 51 | \fBu@PROGRAM_NAME@\fP möglicherweise das Dateisystem nicht aushängen, sondern 52 | meldet einen Fehler. Versuche es in diesem Fall mit \fBumount \-i\fP. Die Option 53 | \fB\-i\fP hindert \fBumount\fP(8) daran, \fBu@PROGRAM_NAME@\fP aufzurufen. 54 | 55 | 56 | .SH OPTIONEN 57 | 58 | .TP 59 | \fB\-V \-\-version\fP 60 | Zeige die Version an. 61 | 62 | .TP 63 | \fB\-h \-\-help\fP 64 | Zeige einen Hilfe\-Text an. 65 | 66 | .TP 67 | \fB\-f \-l \-n \-r \-v \-t\fP 68 | Dies Optionen dienen nur der Kompatibilität mit \fBumount\fP(8) und werden 69 | ignoriert. 70 | 71 | 72 | .SH DATEIEN 73 | 74 | .TP 75 | \fI@SYS_RUN@\fP 76 | Die PID\-Dateien der laufenden \fB@PROGRAM_NAME@\fP\-Hintergrundprozesse werden 77 | in diesem Verzeichnis gesucht. 78 | 79 | 80 | .SH FEHLER 81 | 82 | Derzeit keine bekannten. 83 | 84 | 85 | .SH AUTOREN 86 | 87 | Diese Handbuch hat Werner Baumann 88 | geschrieben. 89 | 90 | 91 | .SH ÜBERSETZER 92 | Das Handbuch wurde von Werner Baumann 93 | übersetzt. 2009-04-27 94 | .SH "DAVFS2 HOME" 95 | 96 | @PACKAGE_BUGREPORT@ 97 | 98 | 99 | .SH "SIEHE AUCH" 100 | 101 | \fB@PROGRAM_NAME@\fP(8), \fBumount\fP(8), \fB@CONFIGFILE@\fP(5), \fBfstab\fP(5) 102 | -------------------------------------------------------------------------------- /config/progtest.m4: -------------------------------------------------------------------------------- 1 | # progtest.m4 serial 6 (gettext-0.18) 2 | dnl Copyright (C) 1996-2003, 2005, 2008-2010 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | dnl 7 | dnl This file can can be used in projects which are not available under 8 | dnl the GNU General Public License or the GNU Library General Public 9 | dnl License but which still want to provide support for the GNU gettext 10 | dnl functionality. 11 | dnl Please note that the actual code of the GNU gettext library is covered 12 | dnl by the GNU Library General Public License, and the rest of the GNU 13 | dnl gettext package package is covered by the GNU General Public License. 14 | dnl They are *not* in the public domain. 15 | 16 | dnl Authors: 17 | dnl Ulrich Drepper , 1996. 18 | 19 | AC_PREREQ([2.50]) 20 | 21 | # Search path for a program which passes the given test. 22 | 23 | dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, 24 | dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) 25 | AC_DEFUN([AM_PATH_PROG_WITH_TEST], 26 | [ 27 | # Prepare PATH_SEPARATOR. 28 | # The user is always right. 29 | if test "${PATH_SEPARATOR+set}" != set; then 30 | echo "#! /bin/sh" >conf$$.sh 31 | echo "exit 0" >>conf$$.sh 32 | chmod +x conf$$.sh 33 | if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then 34 | PATH_SEPARATOR=';' 35 | else 36 | PATH_SEPARATOR=: 37 | fi 38 | rm -f conf$$.sh 39 | fi 40 | 41 | # Find out how to test for executable files. Don't use a zero-byte file, 42 | # as systems may use methods other than mode bits to determine executability. 43 | cat >conf$$.file <<_ASEOF 44 | #! /bin/sh 45 | exit 0 46 | _ASEOF 47 | chmod +x conf$$.file 48 | if test -x conf$$.file >/dev/null 2>&1; then 49 | ac_executable_p="test -x" 50 | else 51 | ac_executable_p="test -f" 52 | fi 53 | rm -f conf$$.file 54 | 55 | # Extract the first word of "$2", so it can be a program name with args. 56 | set dummy $2; ac_word=[$]2 57 | AC_MSG_CHECKING([for $ac_word]) 58 | AC_CACHE_VAL([ac_cv_path_$1], 59 | [case "[$]$1" in 60 | [[\\/]]* | ?:[[\\/]]*) 61 | ac_cv_path_$1="[$]$1" # Let the user override the test with a path. 62 | ;; 63 | *) 64 | ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR 65 | for ac_dir in ifelse([$5], , $PATH, [$5]); do 66 | IFS="$ac_save_IFS" 67 | test -z "$ac_dir" && ac_dir=. 68 | for ac_exec_ext in '' $ac_executable_extensions; do 69 | if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then 70 | echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD 71 | if [$3]; then 72 | ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext" 73 | break 2 74 | fi 75 | fi 76 | done 77 | done 78 | IFS="$ac_save_IFS" 79 | dnl If no 4th arg is given, leave the cache variable unset, 80 | dnl so AC_PATH_PROGS will keep looking. 81 | ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" 82 | ])dnl 83 | ;; 84 | esac])dnl 85 | $1="$ac_cv_path_$1" 86 | if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then 87 | AC_MSG_RESULT([$][$1]) 88 | else 89 | AC_MSG_RESULT([no]) 90 | fi 91 | AC_SUBST([$1])dnl 92 | ]) 93 | -------------------------------------------------------------------------------- /README.translators: -------------------------------------------------------------------------------- 1 | 2008-07-12 2 | ---------- 3 | 4 | #Copyright (C) 2006, 2007, 2008 Werner Baumann 5 | 6 | #Copying and distribution of this file, with or without modification, are 7 | #permitted in any medium without royalty. 8 | 9 | 10 | davfs2 uses the GNU gettext utilities to support localized messages. 11 | Information about GNU gettext may be found at 12 | http://www.gnu.org/software/gettext/manual/ 13 | 14 | For the man pages (and probably other documentation in future), it makes use 15 | of the po4a tools in order to keep translations of documentation maintainable. 16 | po4a (http://po4a.alioth.debian.org/) applies the gettext tools to arbitrary 17 | documentation. 18 | 19 | 20 | Messages 21 | -------- 22 | All messages that need translation are in the file po/davfs2.pot. The 23 | translated messages will be in po/ll.po, where ll is the two-letter country 24 | code. 25 | If you start a translation into a language not yet supported, you may just 26 | take a copy of po/davfs2.pot for your ll.po file. 27 | 28 | 29 | Man Pages 30 | --------- 31 | The .pot files of the man pages are in the man/ subdirectory together with 32 | a configuration file for po4a to automatically build all the translated man 33 | pages from the .po files. 34 | There is a subdirectory for each language, named after the country code, that 35 | holds the .po files and the addendum files. As usual the initial .po file can 36 | be a copy of the .pot file. 37 | 38 | 39 | Replacement Text in Man Pages 40 | ----------------------------- 41 | davfs2 uses all uppercase strings enclosed in @-characters for strings that may 42 | change with every version or at compile time (like @PACKAGE_STRING@ or 43 | @SYS_CACHE_DIR@). They will be replaced at compile time by the correct value. 44 | Please use them in your translation unaltered. To allow correct integration 45 | into the translated text, here are the most probable values: 46 | 47 | @PACKAGE@ davfs2 48 | @PACKAGE_STRING@ davfs2 1.2.0 49 | @PROGRAM_NAME@ mount.davfs 50 | @CONFIGFILE@ davfs2.conf 51 | @SECRETSFILE@ secrets 52 | @CERTS_DIR@ certs 53 | @CLICERTS_DIR@ certs/private 54 | @SYS_CONF_DIR@ /usr/local/etc/davfs2 or 55 | /etc/davfs2 56 | @SYS_RUN@ /var/run/mount.davfs 57 | @SYS_CACHE_DIR@ /var/cache/davfs2 58 | @USER@ davfs2 59 | @GROUP@ davfs2 60 | 61 | 62 | Additional Text 63 | --------------- 64 | At least you want to add a paragraph about the translators into the localized 65 | man page. But maybe you feel the need for some more additions that are 66 | not present in the English man page. 67 | Unfortunately, these additions cannot be inserted directly into the .po file, 68 | as the document structure must not differ from the original. So these 69 | additions have to go into separate files, called addendum. 70 | You can use the template man/template.translator to add a paragraph about 71 | the translators. If you need more than this, you have to create additional 72 | addendum files. Please see the po4a documentation for the syntax of the 73 | PO4A-HEADER to mark the position where to add the text. 74 | Please use the same character encoding as in the .po file. 75 | 76 | 77 | Character Encoding 78 | ------------------ 79 | ** This issue seems to be fixed today and man pages are allowed to be 80 | utf-8. But I am not really sure. ** 81 | At the moment, the "man" tool, or at least one of its helper programs, do not 82 | seem capable of handling UTF-8 encoding. Luckily, gettext can convert the 83 | encoding when the translated man page is created. So you may use UTF-8 in the 84 | .po file or any other encoding. But please tell me which character encoding 85 | should be used when the man page is built. 86 | -------------------------------------------------------------------------------- /config/lib-ld.m4: -------------------------------------------------------------------------------- 1 | # lib-ld.m4 serial 4 (gettext-0.18) 2 | dnl Copyright (C) 1996-2003, 2009-2010 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl Subroutines of libtool.m4, 8 | dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision 9 | dnl with libtool.m4. 10 | 11 | dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. 12 | AC_DEFUN([AC_LIB_PROG_LD_GNU], 13 | [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld], 14 | [# I'd rather use --version here, but apparently some GNU ld's only accept -v. 15 | case `$LD -v 2>&1 conf$$.sh 35 | echo "exit 0" >>conf$$.sh 36 | chmod +x conf$$.sh 37 | if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then 38 | PATH_SEPARATOR=';' 39 | else 40 | PATH_SEPARATOR=: 41 | fi 42 | rm -f conf$$.sh 43 | fi 44 | ac_prog=ld 45 | if test "$GCC" = yes; then 46 | # Check if gcc -print-prog-name=ld gives a path. 47 | AC_MSG_CHECKING([for ld used by GCC]) 48 | case $host in 49 | *-*-mingw*) 50 | # gcc leaves a trailing carriage return which upsets mingw 51 | ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; 52 | *) 53 | ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; 54 | esac 55 | case $ac_prog in 56 | # Accept absolute paths. 57 | [[\\/]* | [A-Za-z]:[\\/]*)] 58 | [re_direlt='/[^/][^/]*/\.\./'] 59 | # Canonicalize the path of ld 60 | ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` 61 | while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do 62 | ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` 63 | done 64 | test -z "$LD" && LD="$ac_prog" 65 | ;; 66 | "") 67 | # If it fails, then pretend we aren't using GCC. 68 | ac_prog=ld 69 | ;; 70 | *) 71 | # If it is relative, then search for the first ld in PATH. 72 | with_gnu_ld=unknown 73 | ;; 74 | esac 75 | elif test "$with_gnu_ld" = yes; then 76 | AC_MSG_CHECKING([for GNU ld]) 77 | else 78 | AC_MSG_CHECKING([for non-GNU ld]) 79 | fi 80 | AC_CACHE_VAL([acl_cv_path_LD], 81 | [if test -z "$LD"; then 82 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" 83 | for ac_dir in $PATH; do 84 | test -z "$ac_dir" && ac_dir=. 85 | if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then 86 | acl_cv_path_LD="$ac_dir/$ac_prog" 87 | # Check to see if the program is GNU ld. I'd rather use --version, 88 | # but apparently some GNU ld's only accept -v. 89 | # Break only if it was the GNU/non-GNU ld that we prefer. 90 | case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in 91 | *GNU* | *'with BFD'*) 92 | test "$with_gnu_ld" != no && break ;; 93 | *) 94 | test "$with_gnu_ld" != yes && break ;; 95 | esac 96 | fi 97 | done 98 | IFS="$ac_save_ifs" 99 | else 100 | acl_cv_path_LD="$LD" # Let the user override the test with a path. 101 | fi]) 102 | LD="$acl_cv_path_LD" 103 | if test -n "$LD"; then 104 | AC_MSG_RESULT([$LD]) 105 | else 106 | AC_MSG_RESULT([no]) 107 | fi 108 | test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) 109 | AC_LIB_PROG_LD_GNU 110 | ]) 111 | -------------------------------------------------------------------------------- /config/mkinstalldirs: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # mkinstalldirs --- make directory hierarchy 3 | 4 | scriptversion=2009-04-28.21; # UTC 5 | 6 | # Original author: Noah Friedman 7 | # Created: 1993-05-16 8 | # Public domain. 9 | # 10 | # This file is maintained in Automake, please report 11 | # bugs to or send patches to 12 | # . 13 | 14 | nl=' 15 | ' 16 | IFS=" "" $nl" 17 | errstatus=0 18 | dirmode= 19 | 20 | usage="\ 21 | Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... 22 | 23 | Create each directory DIR (with mode MODE, if specified), including all 24 | leading file name components. 25 | 26 | Report bugs to ." 27 | 28 | # process command line arguments 29 | while test $# -gt 0 ; do 30 | case $1 in 31 | -h | --help | --h*) # -h for help 32 | echo "$usage" 33 | exit $? 34 | ;; 35 | -m) # -m PERM arg 36 | shift 37 | test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } 38 | dirmode=$1 39 | shift 40 | ;; 41 | --version) 42 | echo "$0 $scriptversion" 43 | exit $? 44 | ;; 45 | --) # stop option processing 46 | shift 47 | break 48 | ;; 49 | -*) # unknown option 50 | echo "$usage" 1>&2 51 | exit 1 52 | ;; 53 | *) # first non-opt arg 54 | break 55 | ;; 56 | esac 57 | done 58 | 59 | for file 60 | do 61 | if test -d "$file"; then 62 | shift 63 | else 64 | break 65 | fi 66 | done 67 | 68 | case $# in 69 | 0) exit 0 ;; 70 | esac 71 | 72 | # Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and 73 | # mkdir -p a/c at the same time, both will detect that a is missing, 74 | # one will create a, then the other will try to create a and die with 75 | # a "File exists" error. This is a problem when calling mkinstalldirs 76 | # from a parallel make. We use --version in the probe to restrict 77 | # ourselves to GNU mkdir, which is thread-safe. 78 | case $dirmode in 79 | '') 80 | if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then 81 | echo "mkdir -p -- $*" 82 | exec mkdir -p -- "$@" 83 | else 84 | # On NextStep and OpenStep, the 'mkdir' command does not 85 | # recognize any option. It will interpret all options as 86 | # directories to create, and then abort because '.' already 87 | # exists. 88 | test -d ./-p && rmdir ./-p 89 | test -d ./--version && rmdir ./--version 90 | fi 91 | ;; 92 | *) 93 | if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && 94 | test ! -d ./--version; then 95 | echo "mkdir -m $dirmode -p -- $*" 96 | exec mkdir -m "$dirmode" -p -- "$@" 97 | else 98 | # Clean up after NextStep and OpenStep mkdir. 99 | for d in ./-m ./-p ./--version "./$dirmode"; 100 | do 101 | test -d $d && rmdir $d 102 | done 103 | fi 104 | ;; 105 | esac 106 | 107 | for file 108 | do 109 | case $file in 110 | /*) pathcomp=/ ;; 111 | *) pathcomp= ;; 112 | esac 113 | oIFS=$IFS 114 | IFS=/ 115 | set fnord $file 116 | shift 117 | IFS=$oIFS 118 | 119 | for d 120 | do 121 | test "x$d" = x && continue 122 | 123 | pathcomp=$pathcomp$d 124 | case $pathcomp in 125 | -*) pathcomp=./$pathcomp ;; 126 | esac 127 | 128 | if test ! -d "$pathcomp"; then 129 | echo "mkdir $pathcomp" 130 | 131 | mkdir "$pathcomp" || lasterr=$? 132 | 133 | if test ! -d "$pathcomp"; then 134 | errstatus=$lasterr 135 | else 136 | if test ! -z "$dirmode"; then 137 | echo "chmod $dirmode $pathcomp" 138 | lasterr= 139 | chmod "$dirmode" "$pathcomp" || lasterr=$? 140 | 141 | if test ! -z "$lasterr"; then 142 | errstatus=$lasterr 143 | fi 144 | fi 145 | fi 146 | fi 147 | 148 | pathcomp=$pathcomp/ 149 | done 150 | done 151 | 152 | exit $errstatus 153 | 154 | # Local Variables: 155 | # mode: shell-script 156 | # sh-indentation: 2 157 | # eval: (add-hook 'write-file-hooks 'time-stamp) 158 | # time-stamp-start: "scriptversion=" 159 | # time-stamp-format: "%:y-%02m-%02d.%02H" 160 | # time-stamp-time-zone: "UTC" 161 | # time-stamp-end: "; # UTC" 162 | # End: 163 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | davfs2 AUTHORS 2014-04-21 2 | ------------------------- 3 | 4 | This package is based on davfs2 0.2.3 by 5 | Sun Kim and 6 | Robert Spier . 7 | This version is a complete rewrite by Werner Baumann. 8 | The kernel interface definitions are copyright by 9 | Miklos Szeredi and Carnegie Mellon University, respectively. 10 | 11 | 12 | Copyright: 13 | ========== 14 | 15 | Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 16 | Werner Baumann 17 | 18 | davfs2 is free software; you can redistribute it and/or modify 19 | it under the terms of the GNU General Public License as published by 20 | the Free Software Foundation; either version 3 of the License, or 21 | (at your option) any later version. 22 | 23 | davfs2 is distributed in the hope that it will be useful, 24 | but WITHOUT ANY WARRANTY; without even the implied warranty of 25 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 26 | GNU General Public License for more details. 27 | 28 | You should have received a copy of the GNU General Public License 29 | along with davfs2; if not, write to the Free Software Foundation, 30 | Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 31 | 32 | The complete text of the GNU General Public License can be found in `COPYING'. 33 | 34 | 35 | Copyright for the interface to the Fuse kernel module (fuse_kernel.h): 36 | ====================================================================== 37 | 38 | Copyright (C) 2001-2007 Miklos Szeredi. All rights reserved. 39 | 40 | Redistribution and use in source and binary forms, with or without 41 | modification, are permitted provided that the following conditions 42 | are met: 43 | 1. Redistributions of source code must retain the above copyright 44 | notice, this list of conditions and the following disclaimer. 45 | 2. Redistributions in binary form must reproduce the above copyright 46 | notice, this list of conditions and the following disclaimer in the 47 | documentation and/or other materials provided with the distribution. 48 | 49 | THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND 50 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 51 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 52 | ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE 53 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 54 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 55 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 56 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 57 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 58 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 59 | SUCH DAMAGE. 60 | 61 | 62 | Copyright for the interface to the Coda kernel module (coda.h): 63 | =============================================================== 64 | 65 | Coda: an Experimental Distributed File System 66 | Release 4.0 67 | 68 | Copyright (c) 1987-1999 Carnegie Mellon University 69 | All Rights Reserved 70 | 71 | Permission to use, copy, modify and distribute this software and its 72 | documentation is hereby granted, provided that both the copyright 73 | notice and this permission notice appear in all copies of the 74 | software, derivative works or modified versions, and any portions 75 | thereof, and that both notices appear in supporting documentation, and 76 | that credit is given to Carnegie Mellon University in all documents 77 | and publicity pertaining to direct or indirect use of this code or its 78 | derivatives. 79 | 80 | CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS, 81 | SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS 82 | FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON 83 | DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER 84 | RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF 85 | ANY DERIVATIVE WORK. 86 | 87 | Carnegie Mellon encourages users of this software to return any 88 | improvements or extensions that they make, and to grant Carnegie 89 | Mellon the rights to redistribute these changes without encumbrance. 90 | 91 | -------------------------------------------------------------------------------- /src/kernel_interface.h: -------------------------------------------------------------------------------- 1 | /* kernel_interface.h: interface to fuse and coda kernel mocule. 2 | Copyright (C) 2006, 2007, 2008, 2009 Werner Baumann 3 | 4 | This file is part of davfs2. 5 | 6 | davfs2 is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | davfs2 is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with davfs2; if not, write to the Free Software Foundation, 18 | Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ 19 | 20 | 21 | #ifndef DAV_KERNEL_INTERFACE_H 22 | #define DAV_KERNEL_INTERFACE_H 23 | 24 | 25 | /* Function type definitions */ 26 | /*===========================*/ 27 | 28 | /* Call back function to be passed to dav_init_kernel_interface(). Will be 29 | called to see whether the file system is still mounted. 30 | return value : 1 is mounted, 0 is not mounted. */ 31 | typedef int (*dav_is_mounted_fn)(void); 32 | 33 | 34 | /* Typedef of the message loop of the specific kernel interfaces. The real 35 | function will be returned by dav_init_kernel_interface(). 36 | device : File descriptor of the open fuse device. 37 | mpoint : String with the name of the mount point. 38 | buf_size : Size of the buffer for communication with the kernel 39 | module. 40 | idle_t : Time to wait for upcalls before calling dav_tidy_cache(). 41 | is_mounted_fn : Call back function to check if still mounted. 42 | keep_on_running : Pointer to run flag. 43 | dbg : send debug messages to syslog if dbg != 0 */ 44 | typedef void (*dav_run_msgloop_fn)(int device, char *mpoint, size_t bufsize, 45 | time_t idle_time, 46 | dav_is_mounted_fn is_mounted, 47 | volatile int *keep_on_running, int dbg); 48 | 49 | 50 | /* Function prototypes */ 51 | /*=====================*/ 52 | 53 | /* Opens the device for communication with the kernel file system, if possible 54 | mounts the file system and updates the interface data (dev, 55 | dav_ran_msgloop_fn, mdata, kernel_fs and buf_size). 56 | In case of an error it prints an error message and terminates the program. 57 | dev : File descriptor of the open device for communication with the 58 | kernel file system. 59 | msg_loop : The specific message loop function that will process the kernel 60 | upcalls. 61 | mdata : That mount data that will be passed to the mount function. 62 | kernel_fs : Type of the kernel file system to us (fuse or coda). If this 63 | does not work, the other file system will be tried. The name 64 | of the file system that is really used is returned. 65 | If NULL, fuse is tried first. 66 | buf_size : Size of the buffer for communication with the kernel file system 67 | (fuse only). The size passed to this function is checked against 68 | the requirements of the kernel fs and updated if necessary. 69 | url : Server url. 70 | mpoint : Mount point. 71 | mopts : Mount options. 72 | owner : The owner of the file system (fuse only). 73 | group : Group the file system belongs to (fuse only). 74 | mode : Mode of the root node (fuse only). 75 | return value : 0: the file system has not yet been mounted 76 | 1: the file system has been mounted successfully. */ 77 | int 78 | dav_init_kernel_interface(int *dev, dav_run_msgloop_fn *msg_loop, void **mdata, 79 | char **kernel_fs, size_t *buf_size, const char *url, 80 | const char *mpoint, const dav_args *args); 81 | 82 | 83 | /* Message loop for coda kernel module CODA_KERNEL_VERSION 3. 84 | Parameters see dav_run_msgloop_fn(). */ 85 | void dav_coda_loop(int device, char *mpoint, size_t bufsize, time_t idle_time, 86 | dav_is_mounted_fn is_mounted, 87 | volatile int *keep_on_running, int dbg); 88 | 89 | 90 | /* Message loop for fuse kernel module with major number 7. 91 | Parameters see dav_run_msgloop_fn(). */ 92 | void 93 | dav_fuse_loop(int device, char *mpoint, size_t bufsize, time_t idle_time, 94 | dav_is_mounted_fn is_mounted, volatile int *keep_on_running, 95 | int dbg); 96 | 97 | 98 | #endif /* DAV_KERNEL_INTERFACE_H */ 99 | -------------------------------------------------------------------------------- /FAQ: -------------------------------------------------------------------------------- 1 | davfs2 1.2.2 2008-01-24 2 | ----------------------- 3 | 4 | # Copyright (C) 2006, 2007, 2008 Werner Baumann 5 | 6 | # Copying and distribution of this file, with or without modification, are 7 | # permitted in any medium without royalty. 8 | 9 | 10 | FREQUENTLY ASKED QUESTIONS 11 | 12 | Q: What are these files with size 0 and date of 1970-01-01? 13 | A: WebDAV allows to lock files that do not exist, to protect the name 14 | while you are preparing a file for upload. These "locked-null-resources" 15 | will show as files with size 0. This is OK as long as the locks are 16 | released some day. 17 | 18 | Q: But the size-0-files don't disappear. How can I get rid of them? 19 | Q: Some files cannot be accessed because they are locked. But I know for 20 | sure that nobody uses them. 21 | A: It can happen that locks are not released: 22 | - An WebDAV client may crash. 23 | - The network connection may get down before the locks are released. 24 | - ... 25 | How davfs2 tries to handle this: 26 | - It sets a timeout for locks, when they should be released automatically. 27 | - It sends a lock-owner property, so it can identify its own locks. 28 | - Whenever it discovers that a file is locked, it tries to discover whether 29 | it owns the lock. In this case it will reuse the lock and then release it. 30 | But not all servers will support this. 31 | Sometimes, only the administrator of the server may be able to free stale 32 | locks. It would be a good idea if the server implements an administrative 33 | timeout for locks, because it is impossible to make sure that all clients 34 | will always release locks properly. 35 | 36 | Q: When I try to save may backups to the WebDAV Server, davfs2 creates another 37 | copy on disk, so I run out of disk space. Why does davfs2 do this? 38 | A: davfs2 will always create a local copy of all files moved between the local 39 | computer and the server. There are several reasons for this: 40 | - The coda kernel file system needs this. It will only read and write to 41 | local copies. 42 | - davfs2 is not able to do incremental uploads. So davfs2 needs to get the 43 | whole file from the application before it can send it to the server. 44 | davfs2 really is not a replacement for network file systems like nfs. 45 | 46 | Q: When I unmount a davfs2 file system, umount blocks and it sometimes takes 47 | hours before it returns. 48 | A: This is intentionally. umount should not return before all cached data is 49 | saved to the media. The time needed depends on the amount of data and the 50 | transfer rate. It is almost unnoticeable for a hard disk, some minutes for 51 | a floppy, and for davfs2 it varies with the quality of the connection. 52 | Note: You should always unmount davfs2 file systems before you shut down 53 | your system. On shut down mount.davfs will usually be killed 54 | regardless of the time needed to save data. 55 | 56 | Q: Displaying large directories with nautilus or konqueror is very, very slow. 57 | Is there a way to speed this up? 58 | A: Reason is that this programs open every file in a directory to evaluate the 59 | file type. mount.davfs has to download them all. Even if the files are 60 | cached, it will have to ask the server whether there is a new version. 61 | You may try the configuration option 'gui_optimize'. This will not help when 62 | you visit the directory for the first time, but when the files are already 63 | in the cache it will reduce response time. 64 | 65 | O: When I mount a resource form Microsoft IIS, I can create new files, but when 66 | I try to open them I get an error saying 'File does not exist'. This does not 67 | happen when the file is named something.txt or something.doc, but it happens 68 | for instance with files named something.odt. 69 | A: Microsoft IIS only serves files with extensions and MIME-types that are 70 | registered with IIS (or Windows). But when files are created it does not apply 71 | this restriction. So you can create a new file with e.g. OpenOffice.org and 72 | when you try to open it again, IIS will tell it can't find it. But it really 73 | exists in the servers file system. 74 | By default, only extensions used by Microsoft are registered (because you do 75 | not want to use file formats that are not owned by Microsoft.). To change 76 | this you have to register all file extensions you want to use. You may also 77 | register a wildcard extension. 78 | - Open the microsoft management console for IIS. 79 | - Select the WebDAV folder within IIS you want to use. 80 | - Right click and choose: Properties->HTTP-headers->MIME-types->new 81 | - Edit '*' as extension and 'application/octet-stream' as MIME-type. 82 | - Apply the changes. 83 | - Select your IIS (the server as a whole, not just the WebDAV folder). 84 | - From the menu choose actions->all tasks->save configuration on disk 85 | - Restart IIS. 86 | Please Note: 87 | I had to retranslate the names of menu items from Microsoft's German. So the 88 | exact naming in English might be different. 89 | -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | 2014-08-23 2 | ---------- 3 | 4 | # Copyright (C) 2006, 2007, 2008, 2009, 2010. 2012, 2013, 2014 Werner Baumann 5 | 6 | # Copying and distribution of this file, with or without modification, are 7 | # permitted in any medium without royalty. 8 | 9 | 10 | DAVFS2 1.5.2 INSTALLATION 11 | ========================= 12 | 13 | 1 UPDATING FROM PREVIOUS VERSION 14 | 2 INSTALLATION 15 | 2.1 PREREQUISITE 16 | 2.2 INSTALLATION FROM CVS SOURCES 17 | 2.3 INSTALLATION FROM SOURCE PACKAGE 18 | 3 UNINSTALL 19 | 20 | 21 | 1 UPDATING FROM PREVIOUS VERSION 22 | ================================ 23 | 24 | 'make install' copies new versions of davfs2.conf and secrets 25 | into /usr/local/etc/davfs2 or /etc/davfs2 and creates a backup of the 26 | existing files. You will have to merge your changes from the backup 27 | into the new files. 28 | 29 | When a user invokes the new version of mount.davfs the first time, it 30 | will only copy new versions of davfs2.conf and secrets into ~/.davfs2, 31 | if this files do not exist. The user should rename this files before 32 | invoking mount.davfs. After the new configuration files have been 33 | installed the user may merge the changes form the old files into 34 | the new versions. 35 | 36 | 37 | 2 INSTALLATION 38 | ============== 39 | 40 | 2.1 PREREQUISITE 41 | ---------------- 42 | 43 | davfs2 uses the neon libraries for communication with the server. 44 | libneon (2.7, 2.8, 2.9 or 3.0) must be installed. Your distribution will most 45 | likely provide a package. 46 | You will also need the neon header files. Distributions usually provide 47 | development packages for this. 48 | If your distribution don't come with libneon or it does not support TLS and 49 | large files, you may build your own neon library. You can get it from 50 | http://www.webdav.org/neon/ 51 | 52 | Your kernel must include either the coda file system or the fuse file system 53 | or both. They may be loadable modules. Almost all Linux kernels support at 54 | least one of them. 55 | 56 | 57 | 2.2 INSTALLATION FROM CVS SOURCES 58 | --------------------------------- 59 | 60 | To build davfs2 from the CVS sources you need recent versions of the some 61 | build tools: 62 | 63 | - GNU Autoconf 2.69 or newer 64 | - GNU Automake 1.11.6 or newer 65 | - GNU gettext-tools 0.18.1 or newer 66 | - po4a 0.42 or newer 67 | 68 | Change into the top level source directory and run 69 | $ ./bootstrap 70 | This will add some necessary files, create the configure script and the 71 | Makefile.in's, and build the translated man pages from the po-files. 72 | 73 | Proceed with Installation from Source Package. 74 | 75 | 76 | 2.3 INSTALLATION FROM SOURCE PACKAGE 77 | ------------------------------------ 78 | 79 | From within the top level source directory: 80 | 81 | - Run the configure script. 82 | $ ./configure [options] 83 | This will test your system and finally create the appropriate Makefiles. 84 | You may add some options or set some variables, but hopefully will not 85 | have to. 86 | 87 | Options and variables: 88 | ---------------------- 89 | 90 | --prefix= 91 | Defines the directory where davfs2 will be installed. It defaults to 92 | '/usr/local'. If your sources came with your distribution it may 93 | be '/usr'. 94 | 95 | --with-neon= 96 | Directory where to find the neon library and the neon headers. 97 | Default is to first try /usr/local and then /usr. If you just have 98 | neon libraries in /usr/lib and headers in /usr/include, you don't 99 | need this. 100 | 101 | --disable-nls 102 | Disable the support for national languages. 103 | 104 | LINGUAS="ll ll ll" 105 | A list of two-letter language codes. This will select which of the 106 | available translations of messages and documentation will be installed. 107 | ll must be in lower case. 108 | 109 | dav_user= 110 | A system user without shell. mount.davfs will run with this id when 111 | invoked by root. Default dav_user is "davfs2". 112 | 113 | dav_group= 114 | A system group. mount.davfs will be member of this group. Normal users 115 | must be member of this group in order to mount. Default dav_group is 116 | "davfs2". 117 | 118 | ./configure --help will show all available options. 119 | 120 | - Run make. 121 | $ make 122 | This will compile the program. 123 | 124 | - Gain root permissions and run make install. 125 | # make install 126 | This will copy all the files in the appropriate directory. 127 | Note: 'mount.davfs' will be setuid root! 128 | 129 | - Create the system user 'davfs2' and group 'davfs2' if they not yet exist. 130 | The system user should not have a shell. Proposed home directory is 131 | '/var/cache/davfs2'. 132 | 133 | - Get rid of the root permissions. 134 | 135 | 136 | 3 UNINSTALL 137 | =========== 138 | 139 | To uninstall davfs2 the sources have to be configured just the same way 140 | they were configured for installation. 141 | 142 | From within the top level source directory run with root permissions 143 | # make uninstall 144 | This will remove all the installed files. 145 | 146 | Note: The directories will not be removed. 147 | Files and directories created by mount.davfs at run-time will *not* be 148 | removed too. 149 | This are: pid-files (in /var/run/mount.davfs), cache files and 150 | directories (in /var/cache/davfs2) and all the files in the users 151 | home directories in .davfs2. 152 | This files have to be removed manually. 153 | -------------------------------------------------------------------------------- /config/INSTALL.davfs2: -------------------------------------------------------------------------------- 1 | 2014-08-23 2 | ---------- 3 | 4 | # Copyright (C) 2006, 2007, 2008, 2009, 2010. 2012, 2013, 2014 Werner Baumann 5 | 6 | # Copying and distribution of this file, with or without modification, are 7 | # permitted in any medium without royalty. 8 | 9 | 10 | DAVFS2 1.5.2 INSTALLATION 11 | ========================= 12 | 13 | 1 UPDATING FROM PREVIOUS VERSION 14 | 2 INSTALLATION 15 | 2.1 PREREQUISITE 16 | 2.2 INSTALLATION FROM CVS SOURCES 17 | 2.3 INSTALLATION FROM SOURCE PACKAGE 18 | 3 UNINSTALL 19 | 20 | 21 | 1 UPDATING FROM PREVIOUS VERSION 22 | ================================ 23 | 24 | 'make install' copies new versions of davfs2.conf and secrets 25 | into /usr/local/etc/davfs2 or /etc/davfs2 and creates a backup of the 26 | existing files. You will have to merge your changes from the backup 27 | into the new files. 28 | 29 | When a user invokes the new version of mount.davfs the first time, it 30 | will only copy new versions of davfs2.conf and secrets into ~/.davfs2, 31 | if this files do not exist. The user should rename this files before 32 | invoking mount.davfs. After the new configuration files have been 33 | installed the user may merge the changes form the old files into 34 | the new versions. 35 | 36 | 37 | 2 INSTALLATION 38 | ============== 39 | 40 | 2.1 PREREQUISITE 41 | ---------------- 42 | 43 | davfs2 uses the neon libraries for communication with the server. 44 | libneon (2.7, 2.8, 2.9 or 3.0) must be installed. Your distribution will most 45 | likely provide a package. 46 | You will also need the neon header files. Distributions usually provide 47 | development packages for this. 48 | If your distribution don't come with libneon or it does not support TLS and 49 | large files, you may build your own neon library. You can get it from 50 | http://www.webdav.org/neon/ 51 | 52 | Your kernel must include either the coda file system or the fuse file system 53 | or both. They may be loadable modules. Almost all Linux kernels support at 54 | least one of them. 55 | 56 | 57 | 2.2 INSTALLATION FROM CVS SOURCES 58 | --------------------------------- 59 | 60 | To build davfs2 from the CVS sources you need recent versions of the some 61 | build tools: 62 | 63 | - GNU Autoconf 2.69 or newer 64 | - GNU Automake 1.11.6 or newer 65 | - GNU gettext-tools 0.18.1 or newer 66 | - po4a 0.42 or newer 67 | 68 | Change into the top level source directory and run 69 | $ ./bootstrap 70 | This will add some necessary files, create the configure script and the 71 | Makefile.in's, and build the translated man pages from the po-files. 72 | 73 | Proceed with Installation from Source Package. 74 | 75 | 76 | 2.3 INSTALLATION FROM SOURCE PACKAGE 77 | ------------------------------------ 78 | 79 | From within the top level source directory: 80 | 81 | - Run the configure script. 82 | $ ./configure [options] 83 | This will test your system and finally create the appropriate Makefiles. 84 | You may add some options or set some variables, but hopefully will not 85 | have to. 86 | 87 | Options and variables: 88 | ---------------------- 89 | 90 | --prefix= 91 | Defines the directory where davfs2 will be installed. It defaults to 92 | '/usr/local'. If your sources came with your distribution it may 93 | be '/usr'. 94 | 95 | --with-neon= 96 | Directory where to find the neon library and the neon headers. 97 | Default is to first try /usr/local and then /usr. If you just have 98 | neon libraries in /usr/lib and headers in /usr/include, you don't 99 | need this. 100 | 101 | --disable-nls 102 | Disable the support for national languages. 103 | 104 | LINGUAS="ll ll ll" 105 | A list of two-letter language codes. This will select which of the 106 | available translations of messages and documentation will be installed. 107 | ll must be in lower case. 108 | 109 | dav_user= 110 | A system user without shell. mount.davfs will run with this id when 111 | invoked by root. Default dav_user is "davfs2". 112 | 113 | dav_group= 114 | A system group. mount.davfs will be member of this group. Normal users 115 | must be member of this group in order to mount. Default dav_group is 116 | "davfs2". 117 | 118 | ./configure --help will show all available options. 119 | 120 | - Run make. 121 | $ make 122 | This will compile the program. 123 | 124 | - Gain root permissions and run make install. 125 | # make install 126 | This will copy all the files in the appropriate directory. 127 | Note: 'mount.davfs' will be setuid root! 128 | 129 | - Create the system user 'davfs2' and group 'davfs2' if they not yet exist. 130 | The system user should not have a shell. Proposed home directory is 131 | '/var/cache/davfs2'. 132 | 133 | - Get rid of the root permissions. 134 | 135 | 136 | 3 UNINSTALL 137 | =========== 138 | 139 | To uninstall davfs2 the sources have to be configured just the same way 140 | they were configured for installation. 141 | 142 | From within the top level source directory run with root permissions 143 | # make uninstall 144 | This will remove all the installed files. 145 | 146 | Note: The directories will not be removed. 147 | Files and directories created by mount.davfs at run-time will *not* be 148 | removed too. 149 | This are: pid-files (in /var/run/mount.davfs), cache files and 150 | directories (in /var/cache/davfs2) and all the files in the users 151 | home directories in .davfs2. 152 | This files have to be removed manually. 153 | -------------------------------------------------------------------------------- /config/davfs2.m4: -------------------------------------------------------------------------------- 1 | # davfs2 macros 2 | # Copyright (C) 2006, 2007, 2008 Werner Baumann 3 | # 4 | # This file is part of davfs2. 5 | # 6 | # davfs2 is free software; you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation; either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # davfs2 is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with davfs2; if not, write to the Free Software Foundation, 18 | # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ 19 | 20 | 21 | # Check for an external Neon library 22 | # Looks for the binary 'neon-config'. If a directory is given with 23 | # --with-neon=, it looks in the bin-subdirectory of this, else it uses 24 | # AC_PATH_PROG to find 'neon-config'. 25 | # If found, it sets variable NRON_CONFIG and calls NEON_USE_EXTERNAL. 26 | # if not found, or if NEON_USE_EXTERNAL does not set neon_got_library 27 | # to yes, configration is stopped with an error message. 28 | 29 | AC_DEFUN([DAV_CHECK_NEON],[ 30 | 31 | AC_ARG_WITH(neon, 32 | [ --with-neon[[=DIR]] specify location of neon library], 33 | [case $withval in 34 | yes|no) neon_ext_path= ;; 35 | *) neon_ext_path=$withval ;; 36 | esac;], 37 | [neon_ext_path=] 38 | ) 39 | 40 | neon_got_library=no 41 | if test "x$neon_ext_path" = "x"; then 42 | AC_PATH_PROG([NEON_CONFIG], neon-config, none) 43 | if test "x${NEON_CONFIG}" = "xnone"; then 44 | AC_MSG_NOTICE([no external neon library found]) 45 | elif test -x "${NEON_CONFIG}"; then 46 | NEON_USE_EXTERNAL 47 | else 48 | AC_MSG_NOTICE([ignoring non-executable ${NEON_CONFIG}]) 49 | fi 50 | else 51 | AC_MSG_CHECKING([for neon library in $neon_ext_path]) 52 | NEON_CONFIG="$neon_ext_path/bin/neon-config" 53 | if test -x ${NEON_CONFIG}; then 54 | AC_MSG_RESULT([found]) 55 | NEON_USE_EXTERNAL 56 | else 57 | AC_MSG_RESULT([not found]) 58 | fi 59 | fi 60 | 61 | if test "$neon_got_library" = "no"; then 62 | AC_MSG_ERROR(could not find neon) 63 | fi 64 | 65 | AC_SUBST(NEON_LIBS) 66 | ]) 67 | 68 | 69 | # Setting uid and gid, mount.davfs will run as, and some pathes. 70 | 71 | AC_DEFUN([DAV_DEFAULTS],[ 72 | 73 | AC_ARG_VAR([dav_user], 74 | [if invoked by root, mount.davfs runs as this user [davfs2]]) 75 | if test -z "$dav_user"; then dav_user="davfs2"; fi 76 | 77 | AC_ARG_VAR([dav_group], 78 | [the group, the mount.davfs daemon belongs to [davfs2]]) 79 | if test -z "$dav_group"; then dav_group="davfs2"; fi 80 | 81 | AC_ARG_VAR([ssbindir], 82 | [where mount will search for mount-helpers [/sbin]]) 83 | if test -z "$ssbindir"; then ssbindir="/sbin"; fi 84 | 85 | AC_ARG_VAR([dav_localstatedir], 86 | [directory to store pid-files in [/var/run]]) 87 | if test -z "$dav_localstatedir"; then dav_localstatedir="/var/run"; fi 88 | 89 | AC_ARG_VAR([dav_syscachedir], 90 | [cache directory [/var/cache]]) 91 | if test -z "$dav_syscachedir"; then dav_syscachedir="/var/cache"; fi 92 | ]) 93 | 94 | 95 | # Select the languages for documentation and messages 96 | # The langusges available for documentation ar taken from man/po4a.conf. 97 | # If variable LINGUAS is set, only languages that are available and 98 | # mentioned in LINGUAS are selected, otherwise all available languages 99 | # are selected. Substitutes $dav_linguas in output files with this value. 100 | # The languages for messages are selected by po.m4 macros, that use the 101 | # same variable LINGUAS. 102 | 103 | AC_DEFUN([DAV_LINGUAS],[ 104 | 105 | AC_ARG_VAR([LINGUAS], 106 | [select languages for messages and documentation]) 107 | dav_desired_linguas="${LINGUAS-%UNSET%}" 108 | 109 | dav_all_linguas= 110 | if test -f "man/po4a.conf"; then 111 | dav_all_linguas="`cat 'man/po4a.conf' | grep '[po4a_langs]' | sed 's/.po4a_langs.//'`" 112 | fi 113 | 114 | dav_linguas= 115 | if test "$dav_desired_linguas" == "%UNSET%"; then 116 | dav_linguas="$dav_all_linguas" 117 | else 118 | for dav_lingua in $dav_desired_linguas; do 119 | case "$dav_all_linguas" in 120 | *"$dav_lingua"*) dav_linguas="$dav_linguas $dav_lingua";; 121 | esac 122 | done 123 | fi 124 | 125 | AC_SUBST([dav_linguas]) 126 | ]) 127 | 128 | 129 | # If Neon supports large files, it calls AC_SYS_LARGEFILE. 130 | # dav_lfs is set to yes, if neon and the system support large files. 131 | 132 | AC_DEFUN([DAV_LFS],[ 133 | 134 | AC_REQUIRE([DAV_CHECK_NEON])dnl 135 | 136 | if test "$ne_LFS_message" = "LFS is supported by neon"; then 137 | AC_SYS_LARGEFILE 138 | fi 139 | 140 | if test "$ac_cv_sys_file_offset_bits" = "64"; then 141 | dav_lfs=yes 142 | else 143 | dav_lfs=no 144 | fi 145 | ]) 146 | 147 | 148 | # Output summary 149 | 150 | AC_DEFUN([DAV_MESSAGE],[ 151 | 152 | if test "$USE_NLS" = "yes"; then 153 | dav_nls=${gt_source} 154 | else 155 | dav_nls=no 156 | fi 157 | 158 | cat<, YEAR. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: PACKAGE VERSION\n" 10 | "POT-Creation-Date: 2015-02-01 11:54+0100\n" 11 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 12 | "Last-Translator: FULL NAME \n" 13 | "Language-Team: LANGUAGE \n" 14 | "Language: \n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=CHARSET\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | 19 | #. type: TH 20 | #: davfs2.conf.5:1 mount.davfs.8:1 umount.davfs.8:1 21 | #, no-wrap 22 | msgid "@PACKAGE_STRING@" 23 | msgstr "" 24 | 25 | #. type: SH 26 | #: davfs2.conf.5:4 mount.davfs.8:3 umount.davfs.8:3 27 | #, no-wrap 28 | msgid "NAME" 29 | msgstr "" 30 | 31 | #. type: SH 32 | #: davfs2.conf.5:9 mount.davfs.8:22 umount.davfs.8:20 33 | #, no-wrap 34 | msgid "DESCRIPTION" 35 | msgstr "" 36 | 37 | #. type: SH 38 | #: davfs2.conf.5:568 mount.davfs.8:547 umount.davfs.8:79 39 | #, no-wrap 40 | msgid "AUTHORS" 41 | msgstr "" 42 | 43 | #. type: SH 44 | #: davfs2.conf.5:574 mount.davfs.8:564 umount.davfs.8:84 45 | #, no-wrap 46 | msgid "DAVFS2 HOME" 47 | msgstr "" 48 | 49 | #. type: Plain text 50 | #: davfs2.conf.5:577 mount.davfs.8:567 umount.davfs.8:87 51 | msgid "@PACKAGE_BUGREPORT@" 52 | msgstr "" 53 | 54 | #. type: SH 55 | #: davfs2.conf.5:579 mount.davfs.8:569 umount.davfs.8:89 56 | #, no-wrap 57 | msgid "SEE ALSO" 58 | msgstr "" 59 | 60 | #. type: SH 61 | #: mount.davfs.8:8 umount.davfs.8:8 62 | #, no-wrap 63 | msgid "SYNOPSIS" 64 | msgstr "" 65 | 66 | #. type: SH 67 | #: mount.davfs.8:15 umount.davfs.8:15 68 | #, no-wrap 69 | msgid "SYNOPSIS (root only)" 70 | msgstr "" 71 | 72 | #. type: Plain text 73 | #: mount.davfs.8:60 umount.davfs.8:30 74 | msgid "" 75 | "I is the mountpoint where the WebDAV resource is mounted on. It may be " 76 | "an absolute or relative path." 77 | msgstr "" 78 | 79 | #. type: SH 80 | #: mount.davfs.8:67 umount.davfs.8:51 81 | #, no-wrap 82 | msgid "OPTIONS" 83 | msgstr "" 84 | 85 | #. type: TP 86 | #: mount.davfs.8:69 umount.davfs.8:53 87 | #, no-wrap 88 | msgid "B<-V --version>" 89 | msgstr "" 90 | 91 | #. type: Plain text 92 | #: mount.davfs.8:72 umount.davfs.8:56 93 | msgid "Output version." 94 | msgstr "" 95 | 96 | #. type: TP 97 | #: mount.davfs.8:73 umount.davfs.8:57 98 | #, no-wrap 99 | msgid "B<-h --help>" 100 | msgstr "" 101 | 102 | #. type: Plain text 103 | #: mount.davfs.8:76 umount.davfs.8:60 104 | msgid "Print a help message." 105 | msgstr "" 106 | 107 | #. type: SH 108 | #: mount.davfs.8:376 umount.davfs.8:67 109 | #, no-wrap 110 | msgid "FILES" 111 | msgstr "" 112 | 113 | #. type: TP 114 | #: mount.davfs.8:437 umount.davfs.8:69 115 | #, no-wrap 116 | msgid "I<@SYS_RUN@>" 117 | msgstr "" 118 | 119 | #. type: SH 120 | #: mount.davfs.8:540 umount.davfs.8:74 121 | #, no-wrap 122 | msgid "BUGS" 123 | msgstr "" 124 | 125 | #. type: TH 126 | #: umount.davfs.8:1 127 | #, no-wrap 128 | msgid "u@PROGRAM_NAME@" 129 | msgstr "" 130 | 131 | #. type: TH 132 | #: umount.davfs.8:1 133 | #, no-wrap 134 | msgid "2014-08-23" 135 | msgstr "" 136 | 137 | #. type: Plain text 138 | #: umount.davfs.8:6 139 | msgid "u@PROGRAM_NAME@ - Umount-helper to unmount a @PACKAGE@ file system" 140 | msgstr "" 141 | 142 | #. type: Plain text 143 | #: umount.davfs.8:11 144 | msgid "B" 145 | msgstr "" 146 | 147 | #. type: Plain text 148 | #: umount.davfs.8:13 149 | msgid "BI" 150 | msgstr "" 151 | 152 | #. type: Plain text 153 | #: umount.davfs.8:18 154 | msgid "BI" 155 | msgstr "" 156 | 157 | #. type: Plain text 158 | #: umount.davfs.8:26 159 | msgid "" 160 | "B is a umount helper program. It is called by the " 161 | "B(8) command. Its purpose is to prevent the umount command from " 162 | "returning unless B<@PROGRAM_NAME@> has synchronized all its cached files " 163 | "with the webdav server." 164 | msgstr "" 165 | 166 | #. type: Plain text 167 | #: umount.davfs.8:39 168 | msgid "" 169 | "While for local file systems B(8) will only return when all cached " 170 | "data have been written to disk, this is not automatically true for a mounted " 171 | "B<@PACKAGE@> file system. With this umount helper the user can rely on the " 172 | "familiar behaviour of B(8). To inform the operating system that the " 173 | "file system uses a network connection, you should always use the B<_netdev> " 174 | "option, when mounting as B<@PACKAGE@> file system." 175 | msgstr "" 176 | 177 | #. type: Plain text 178 | #: umount.davfs.8:43 179 | msgid "" 180 | "Depending on the amount of data and the quality of the connection, " 181 | "unmounting a B<@PACKAGE@> file system may take some seconds up to some hours." 182 | msgstr "" 183 | 184 | #. type: Plain text 185 | #: umount.davfs.8:49 186 | msgid "" 187 | "If the B<@PROGRAM_NAME@> daemon encountered serious errors, " 188 | "B may return an error instead of unmounting the file " 189 | "system. In this case try B. The B<-i> option will prevent " 190 | "B(8) from calling B." 191 | msgstr "" 192 | 193 | #. type: TP 194 | #: umount.davfs.8:61 195 | #, no-wrap 196 | msgid "B<-f -l -n -r -v -t>" 197 | msgstr "" 198 | 199 | #. type: Plain text 200 | #: umount.davfs.8:65 201 | msgid "" 202 | "This options are B. They are only recognized for compatibility with " 203 | "B(8)." 204 | msgstr "" 205 | 206 | #. type: Plain text 207 | #: umount.davfs.8:72 208 | msgid "PID-files of running B processes are looked up here." 209 | msgstr "" 210 | 211 | #. type: Plain text 212 | #: umount.davfs.8:77 213 | msgid "No known bugs." 214 | msgstr "" 215 | 216 | #. type: Plain text 217 | #: umount.davfs.8:82 218 | msgid "" 219 | "This man page was written by Werner Baumann Ewerner.baumann@onlinehome." 220 | "deE." 221 | msgstr "" 222 | 223 | #. type: Plain text 224 | #: umount.davfs.8:94 225 | msgid "B<@PROGRAM_NAME@>(8), B(8), B<@CONFIGFILE@>(5), B(5)" 226 | msgstr "" 227 | -------------------------------------------------------------------------------- /config/missing: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Common wrapper for a few potentially missing GNU programs. 3 | 4 | scriptversion=2013-10-28.13; # UTC 5 | 6 | # Copyright (C) 1996-2013 Free Software Foundation, Inc. 7 | # Originally written by Fran,cois Pinard , 1996. 8 | 9 | # This program is free software; you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation; either version 2, or (at your option) 12 | # any later version. 13 | 14 | # This program is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | 19 | # You should have received a copy of the GNU General Public License 20 | # along with this program. If not, see . 21 | 22 | # As a special exception to the GNU General Public License, if you 23 | # distribute this file as part of a program that contains a 24 | # configuration script generated by Autoconf, you may include it under 25 | # the same distribution terms that you use for the rest of that program. 26 | 27 | if test $# -eq 0; then 28 | echo 1>&2 "Try '$0 --help' for more information" 29 | exit 1 30 | fi 31 | 32 | case $1 in 33 | 34 | --is-lightweight) 35 | # Used by our autoconf macros to check whether the available missing 36 | # script is modern enough. 37 | exit 0 38 | ;; 39 | 40 | --run) 41 | # Back-compat with the calling convention used by older automake. 42 | shift 43 | ;; 44 | 45 | -h|--h|--he|--hel|--help) 46 | echo "\ 47 | $0 [OPTION]... PROGRAM [ARGUMENT]... 48 | 49 | Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due 50 | to PROGRAM being missing or too old. 51 | 52 | Options: 53 | -h, --help display this help and exit 54 | -v, --version output version information and exit 55 | 56 | Supported PROGRAM values: 57 | aclocal autoconf autoheader autom4te automake makeinfo 58 | bison yacc flex lex help2man 59 | 60 | Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 61 | 'g' are ignored when checking the name. 62 | 63 | Send bug reports to ." 64 | exit $? 65 | ;; 66 | 67 | -v|--v|--ve|--ver|--vers|--versi|--versio|--version) 68 | echo "missing $scriptversion (GNU Automake)" 69 | exit $? 70 | ;; 71 | 72 | -*) 73 | echo 1>&2 "$0: unknown '$1' option" 74 | echo 1>&2 "Try '$0 --help' for more information" 75 | exit 1 76 | ;; 77 | 78 | esac 79 | 80 | # Run the given program, remember its exit status. 81 | "$@"; st=$? 82 | 83 | # If it succeeded, we are done. 84 | test $st -eq 0 && exit 0 85 | 86 | # Also exit now if we it failed (or wasn't found), and '--version' was 87 | # passed; such an option is passed most likely to detect whether the 88 | # program is present and works. 89 | case $2 in --version|--help) exit $st;; esac 90 | 91 | # Exit code 63 means version mismatch. This often happens when the user 92 | # tries to use an ancient version of a tool on a file that requires a 93 | # minimum version. 94 | if test $st -eq 63; then 95 | msg="probably too old" 96 | elif test $st -eq 127; then 97 | # Program was missing. 98 | msg="missing on your system" 99 | else 100 | # Program was found and executed, but failed. Give up. 101 | exit $st 102 | fi 103 | 104 | perl_URL=http://www.perl.org/ 105 | flex_URL=http://flex.sourceforge.net/ 106 | gnu_software_URL=http://www.gnu.org/software 107 | 108 | program_details () 109 | { 110 | case $1 in 111 | aclocal|automake) 112 | echo "The '$1' program is part of the GNU Automake package:" 113 | echo "<$gnu_software_URL/automake>" 114 | echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" 115 | echo "<$gnu_software_URL/autoconf>" 116 | echo "<$gnu_software_URL/m4/>" 117 | echo "<$perl_URL>" 118 | ;; 119 | autoconf|autom4te|autoheader) 120 | echo "The '$1' program is part of the GNU Autoconf package:" 121 | echo "<$gnu_software_URL/autoconf/>" 122 | echo "It also requires GNU m4 and Perl in order to run:" 123 | echo "<$gnu_software_URL/m4/>" 124 | echo "<$perl_URL>" 125 | ;; 126 | esac 127 | } 128 | 129 | give_advice () 130 | { 131 | # Normalize program name to check for. 132 | normalized_program=`echo "$1" | sed ' 133 | s/^gnu-//; t 134 | s/^gnu//; t 135 | s/^g//; t'` 136 | 137 | printf '%s\n' "'$1' is $msg." 138 | 139 | configure_deps="'configure.ac' or m4 files included by 'configure.ac'" 140 | case $normalized_program in 141 | autoconf*) 142 | echo "You should only need it if you modified 'configure.ac'," 143 | echo "or m4 files included by it." 144 | program_details 'autoconf' 145 | ;; 146 | autoheader*) 147 | echo "You should only need it if you modified 'acconfig.h' or" 148 | echo "$configure_deps." 149 | program_details 'autoheader' 150 | ;; 151 | automake*) 152 | echo "You should only need it if you modified 'Makefile.am' or" 153 | echo "$configure_deps." 154 | program_details 'automake' 155 | ;; 156 | aclocal*) 157 | echo "You should only need it if you modified 'acinclude.m4' or" 158 | echo "$configure_deps." 159 | program_details 'aclocal' 160 | ;; 161 | autom4te*) 162 | echo "You might have modified some maintainer files that require" 163 | echo "the 'autom4te' program to be rebuilt." 164 | program_details 'autom4te' 165 | ;; 166 | bison*|yacc*) 167 | echo "You should only need it if you modified a '.y' file." 168 | echo "You may want to install the GNU Bison package:" 169 | echo "<$gnu_software_URL/bison/>" 170 | ;; 171 | lex*|flex*) 172 | echo "You should only need it if you modified a '.l' file." 173 | echo "You may want to install the Fast Lexical Analyzer package:" 174 | echo "<$flex_URL>" 175 | ;; 176 | help2man*) 177 | echo "You should only need it if you modified a dependency" \ 178 | "of a man page." 179 | echo "You may want to install the GNU Help2man package:" 180 | echo "<$gnu_software_URL/help2man/>" 181 | ;; 182 | makeinfo*) 183 | echo "You should only need it if you modified a '.texi' file, or" 184 | echo "any other file indirectly affecting the aspect of the manual." 185 | echo "You might want to install the Texinfo package:" 186 | echo "<$gnu_software_URL/texinfo/>" 187 | echo "The spurious makeinfo call might also be the consequence of" 188 | echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" 189 | echo "want to install GNU make:" 190 | echo "<$gnu_software_URL/make/>" 191 | ;; 192 | *) 193 | echo "You might have modified some files without having the proper" 194 | echo "tools for further handling them. Check the 'README' file, it" 195 | echo "often tells you about the needed prerequisites for installing" 196 | echo "this package. You may also peek at any GNU archive site, in" 197 | echo "case some other package contains this missing '$1' program." 198 | ;; 199 | esac 200 | } 201 | 202 | give_advice "$1" | sed -e '1s/^/WARNING: /' \ 203 | -e '2,$s/^/ /' >&2 204 | 205 | # Propagate the correct exit status (expected to be 127 for a program 206 | # not found, 63 for a program that failed due to version mismatch). 207 | exit $st 208 | 209 | # Local variables: 210 | # eval: (add-hook 'write-file-hooks 'time-stamp) 211 | # time-stamp-start: "scriptversion=" 212 | # time-stamp-format: "%:y-%02m-%02d.%02H" 213 | # time-stamp-time-zone: "UTC" 214 | # time-stamp-end: "; # UTC" 215 | # End: 216 | -------------------------------------------------------------------------------- /src/umount_davfs.c: -------------------------------------------------------------------------------- 1 | /* umount_davfs.c: unmount the davfs file system. 2 | Copyright (C) 2006, 2007, 2008, 2009, 2014 Werner Baumann 3 | 4 | This file is part of davfs2. 5 | 6 | davfs2 is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | davfs2 is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with davfs2; if not, write to the Free Software Foundation, 18 | Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ 19 | 20 | 21 | #include "config.h" 22 | 23 | #include 24 | #include 25 | #include 26 | #ifdef HAVE_LIBINTL_H 27 | #include 28 | #endif 29 | #ifdef HAVE_LOCALE_H 30 | #include 31 | #endif 32 | #include 33 | #ifdef HAVE_STDLIB_H 34 | #include 35 | #endif 36 | #include 37 | #ifdef HAVE_UNISTD_H 38 | #include 39 | #endif 40 | 41 | #include 42 | 43 | #include "defaults.h" 44 | 45 | #ifdef ENABLE_NLS 46 | #define _(String) gettext(String) 47 | #else 48 | #define _(String) String 49 | #define textdomain(Domainname) 50 | #define bindtextdomain(Domainname, Dirname) 51 | #endif 52 | 53 | 54 | /* This is lazy programming. All the dirty work is left to the real umount 55 | program, while we just sit and wait for mount.davfs to terminate. 56 | umount.davfs is a umount helper. It is usually called by umount and makes 57 | sure, that umount will not return until mount.davfs has synchronized all 58 | files. 59 | It first reads the pid-file and identifies the mount.davfs process. Then 60 | it calls mount again, with option -i (to not be called again), to do the 61 | real unmounting. In a loop it will watch the process list. When the 62 | mount.davfs process terminates, it will return. 63 | If it can't identify the mount.davfs process, it will call umount -i anyway, 64 | but warn the user. */ 65 | int 66 | main(int argc, char *argv[]) 67 | { 68 | setuid(getuid()); 69 | setgid(getgid()); 70 | 71 | setlocale(LC_ALL, ""); 72 | bindtextdomain(PACKAGE, LOCALEDIR); 73 | textdomain(PACKAGE); 74 | 75 | char *short_options = "Vhflnrt:v"; 76 | static const struct option options[] = { 77 | {"version", no_argument, NULL, 'V'}, 78 | {"help", no_argument, NULL, 'h'}, 79 | {0, 0, 0, 0} 80 | }; 81 | 82 | int o; 83 | o = getopt_long(argc, argv, short_options, options, NULL); 84 | while (o != -1) { 85 | switch (o) { 86 | case 'V': 87 | printf("%s <%s>\n\n", PACKAGE_STRING, PACKAGE_BUGREPORT); 88 | printf(_("This is free software; see the source for copying " 89 | "conditions. There is NO\n" 90 | "warranty; not even for MERCHANTABILITY or FITNESS " 91 | "FOR A PARTICULAR PURPOSE.\n")); 92 | exit(EXIT_SUCCESS); 93 | case 'h': 94 | printf(_("Usage:\n" 95 | " u%s -V,--version : print version string\n" 96 | " u%s -h,--help : print this message\n\n"), 97 | PROGRAM_NAME, PROGRAM_NAME); 98 | printf(_("To umount a WebDAV-resource don't call u%s directly, " 99 | "but use\n" 100 | "`umount' instead.\n"), PROGRAM_NAME); 101 | printf(_(" umount : umount the WebDAV-resource as " 102 | "specified in\n" 103 | " /etc/fstab.\n")); 104 | exit(EXIT_SUCCESS); 105 | case 'f': 106 | case 'l': 107 | case 'n': 108 | case 'r': 109 | case 'v': 110 | case 't': 111 | case '?': 112 | break; 113 | default: 114 | error(EXIT_FAILURE, 0, _("unknown error parsing arguments")); 115 | } 116 | o = getopt_long(argc, argv, short_options, options, NULL); 117 | } 118 | 119 | if (optind > (argc - 1)) 120 | error(EXIT_FAILURE, 0, _("missing argument")); 121 | if (optind < (argc - 1)) 122 | error(EXIT_FAILURE, 0, _("too many arguments")); 123 | 124 | char *mpoint = canonicalize_file_name(argv[optind]); 125 | 126 | char *umount_command = NULL; 127 | if (mpoint) { 128 | umount_command = ne_concat("umount -i '", mpoint, "'", NULL); 129 | } else { 130 | umount_command = ne_concat("umount -i '", argv[optind], "'", NULL); 131 | error(0, 0, 132 | _("\n" 133 | " can't evaluate PID file name;\n" 134 | " trying to unmount anyway;\n" 135 | " please wait for %s to terminate"), PROGRAM_NAME); 136 | return system(umount_command); 137 | } 138 | 139 | char *m = mpoint; 140 | while (*m == '/') 141 | m++; 142 | char *mp = ne_strdup(m); 143 | m = strchr(mp, '/'); 144 | while (m) { 145 | *m = '-'; 146 | m = strchr(mp, '/'); 147 | } 148 | char *pidfile = ne_concat(DAV_SYS_RUN, "/", mp, ".pid", NULL); 149 | free(mp); 150 | 151 | char *pid = NULL; 152 | FILE *file = fopen(pidfile, "r"); 153 | if (!file || fscanf(file, "%a[0-9]", &pid) != 1 || !pid) { 154 | error(0, 0, 155 | _("\n" 156 | " can't read PID from file %s;\n" 157 | " trying to unmount anyway;\n" 158 | " please wait for %s to terminate"), pidfile, PROGRAM_NAME); 159 | return system(umount_command); 160 | } 161 | fclose(file); 162 | 163 | char *ps_command = ne_concat("ps -p ", pid, NULL); 164 | FILE *ps_in = popen(ps_command, "r"); 165 | if (!ps_in) { 166 | error(0, 0, 167 | _("\n" 168 | " can't read process list;\n" 169 | " trying to unmount anyway;\n" 170 | " please wait for %s to terminate"), PROGRAM_NAME); 171 | return system(umount_command); 172 | } 173 | 174 | int found = 0; 175 | size_t n = 0; 176 | char *ps_line = NULL; 177 | while (!found && getline(&ps_line, &n, ps_in) > 0) 178 | found = (strstr(ps_line, pid) && strstr(ps_line, PROGRAM_NAME)); 179 | pclose(ps_in); 180 | 181 | if (!found) { 182 | error(0, 0, 183 | _("\n" 184 | " can't find %s-process with pid %s;\n" 185 | " trying to unmount anyway.\n" 186 | " you propably have to remove %s manually"), 187 | PROGRAM_NAME, pid, pidfile); 188 | return system(umount_command); 189 | } 190 | 191 | if (system(umount_command) != 0) 192 | exit(EXIT_FAILURE); 193 | 194 | printf(_("%s: waiting while %s (pid %s) synchronizes the cache ."), 195 | argv[0], PROGRAM_NAME, pid); 196 | fflush(stdout); 197 | 198 | while (found) { 199 | 200 | sleep(3); 201 | printf("."); 202 | fflush(stdout); 203 | 204 | ps_in = popen(ps_command, "r"); 205 | if (!ps_in) { 206 | printf("\n"); 207 | error(EXIT_FAILURE, 0, _("an error occured while waiting; " 208 | "please wait for %s to terminate"), PROGRAM_NAME); 209 | } 210 | 211 | found = 0; 212 | while (!found && getline(&ps_line, &n, ps_in) > 0) 213 | found = (strstr(ps_line, pid) && strstr(ps_line, PROGRAM_NAME)); 214 | 215 | pclose(ps_in); 216 | } 217 | printf(" OK\n"); 218 | 219 | return 0; 220 | } 221 | -------------------------------------------------------------------------------- /src/fuse_kernel.h: -------------------------------------------------------------------------------- 1 | /* This file is taken from FUSE 2.5.3. 2 | From the two alternative licences the BSD licence has been chosen. 3 | #include and #ifdef directives have been removed. 4 | Modifications by Werner Baumann, 2009-04-14. */ 5 | 6 | 7 | /* This file defines the kernel interface of FUSE */ 8 | 9 | /* 10 | Copyright (C) 2001-2006 Miklos Szeredi. All rights reserved. 11 | 12 | Redistribution and use in source and binary forms, with or without 13 | modification, are permitted provided that the following conditions 14 | are met: 15 | 1. Redistributions of source code must retain the above copyright 16 | notice, this list of conditions and the following disclaimer. 17 | 2. Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 21 | THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND 22 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE 25 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 | SUCH DAMAGE. 32 | */ 33 | 34 | 35 | #define __u64 uint64_t 36 | #define __u32 uint32_t 37 | #define __s32 int32_t 38 | 39 | /** Version number of this interface */ 40 | #define FUSE_KERNEL_VERSION 7 41 | 42 | /** Minor version number of this interface */ 43 | #define FUSE_KERNEL_MINOR_VERSION 5 44 | 45 | /** The node ID of the root inode */ 46 | #define FUSE_ROOT_ID 1 47 | 48 | /** The major number of the fuse character device */ 49 | #define FUSE_MAJOR 10 50 | 51 | /** The minor number of the fuse character device */ 52 | #define FUSE_MINOR 229 53 | 54 | /* Make sure all structures are padded to 64bit boundary, so 32bit 55 | userspace works under 64bit kernels */ 56 | 57 | struct fuse_attr { 58 | __u64 ino; 59 | __u64 size; 60 | __u64 blocks; 61 | __u64 atime; 62 | __u64 mtime; 63 | __u64 ctime; 64 | __u32 atimensec; 65 | __u32 mtimensec; 66 | __u32 ctimensec; 67 | __u32 mode; 68 | __u32 nlink; 69 | __u32 uid; 70 | __u32 gid; 71 | __u32 rdev; 72 | }; 73 | 74 | struct fuse_kstatfs { 75 | __u64 blocks; 76 | __u64 bfree; 77 | __u64 bavail; 78 | __u64 files; 79 | __u64 ffree; 80 | __u32 bsize; 81 | __u32 namelen; 82 | __u32 frsize; 83 | __u32 padding; 84 | __u32 spare[6]; 85 | }; 86 | 87 | #define FATTR_MODE (1 << 0) 88 | #define FATTR_UID (1 << 1) 89 | #define FATTR_GID (1 << 2) 90 | #define FATTR_SIZE (1 << 3) 91 | #define FATTR_ATIME (1 << 4) 92 | #define FATTR_MTIME (1 << 5) 93 | #define FATTR_FH (1 << 6) 94 | 95 | /** 96 | * Flags returned by the OPEN request 97 | * 98 | * FOPEN_DIRECT_IO: bypass page cache for this open file 99 | * FOPEN_KEEP_CACHE: don't invalidate the data cache on open 100 | */ 101 | #define FOPEN_DIRECT_IO (1 << 0) 102 | #define FOPEN_KEEP_CACHE (1 << 1) 103 | 104 | enum fuse_opcode { 105 | FUSE_LOOKUP = 1, 106 | FUSE_FORGET = 2, /* no reply */ 107 | FUSE_GETATTR = 3, 108 | FUSE_SETATTR = 4, 109 | FUSE_READLINK = 5, 110 | FUSE_SYMLINK = 6, 111 | FUSE_MKNOD = 8, 112 | FUSE_MKDIR = 9, 113 | FUSE_UNLINK = 10, 114 | FUSE_RMDIR = 11, 115 | FUSE_RENAME = 12, 116 | FUSE_LINK = 13, 117 | FUSE_OPEN = 14, 118 | FUSE_READ = 15, 119 | FUSE_WRITE = 16, 120 | FUSE_STATFS = 17, 121 | FUSE_RELEASE = 18, 122 | FUSE_FSYNC = 20, 123 | FUSE_SETXATTR = 21, 124 | FUSE_GETXATTR = 22, 125 | FUSE_LISTXATTR = 23, 126 | FUSE_REMOVEXATTR = 24, 127 | FUSE_FLUSH = 25, 128 | FUSE_INIT = 26, 129 | FUSE_OPENDIR = 27, 130 | FUSE_READDIR = 28, 131 | FUSE_RELEASEDIR = 29, 132 | FUSE_FSYNCDIR = 30, 133 | FUSE_ACCESS = 34, 134 | FUSE_CREATE = 35 135 | }; 136 | 137 | /* The read buffer is required to be at least 8k, but may be much larger */ 138 | /* 2009-04-14, increased size of FUSE_MIN_READ_BUFFER, Werner Baumann */ 139 | #define FUSE_MIN_READ_BUFFER 16384 140 | 141 | struct fuse_entry_out { 142 | __u64 nodeid; /* Inode ID */ 143 | __u64 generation; /* Inode generation: nodeid:gen must 144 | be unique for the fs's lifetime */ 145 | __u64 entry_valid; /* Cache timeout for the name */ 146 | __u64 attr_valid; /* Cache timeout for the attributes */ 147 | __u32 entry_valid_nsec; 148 | __u32 attr_valid_nsec; 149 | struct fuse_attr attr; 150 | }; 151 | 152 | struct fuse_forget_in { 153 | __u64 nlookup; 154 | }; 155 | 156 | struct fuse_attr_out { 157 | __u64 attr_valid; /* Cache timeout for the attributes */ 158 | __u32 attr_valid_nsec; 159 | __u32 dummy; 160 | struct fuse_attr attr; 161 | }; 162 | 163 | struct fuse_mknod_in { 164 | __u32 mode; 165 | __u32 rdev; 166 | }; 167 | 168 | struct fuse_mkdir_in { 169 | __u32 mode; 170 | __u32 padding; 171 | }; 172 | 173 | struct fuse_rename_in { 174 | __u64 newdir; 175 | }; 176 | 177 | struct fuse_link_in { 178 | __u64 oldnodeid; 179 | }; 180 | 181 | struct fuse_setattr_in { 182 | __u32 valid; 183 | __u32 padding; 184 | __u64 fh; 185 | __u64 size; 186 | __u64 unused1; 187 | __u64 atime; 188 | __u64 mtime; 189 | __u64 unused2; 190 | __u32 atimensec; 191 | __u32 mtimensec; 192 | __u32 unused3; 193 | __u32 mode; 194 | __u32 unused4; 195 | __u32 uid; 196 | __u32 gid; 197 | __u32 unused5; 198 | }; 199 | 200 | struct fuse_open_in { 201 | __u32 flags; 202 | __u32 mode; 203 | }; 204 | 205 | struct fuse_open_out { 206 | __u64 fh; 207 | __u32 open_flags; 208 | __u32 padding; 209 | }; 210 | 211 | struct fuse_release_in { 212 | __u64 fh; 213 | __u32 flags; 214 | __u32 padding; 215 | }; 216 | 217 | struct fuse_flush_in { 218 | __u64 fh; 219 | __u32 flush_flags; 220 | __u32 padding; 221 | }; 222 | 223 | struct fuse_read_in { 224 | __u64 fh; 225 | __u64 offset; 226 | __u32 size; 227 | __u32 padding; 228 | }; 229 | 230 | struct fuse_write_in { 231 | __u64 fh; 232 | __u64 offset; 233 | __u32 size; 234 | __u32 write_flags; 235 | }; 236 | 237 | struct fuse_write_out { 238 | __u32 size; 239 | __u32 padding; 240 | }; 241 | 242 | #define FUSE_COMPAT_STATFS_SIZE 48 243 | 244 | struct fuse_statfs_out { 245 | struct fuse_kstatfs st; 246 | }; 247 | 248 | struct fuse_fsync_in { 249 | __u64 fh; 250 | __u32 fsync_flags; 251 | __u32 padding; 252 | }; 253 | 254 | struct fuse_setxattr_in { 255 | __u32 size; 256 | __u32 flags; 257 | }; 258 | 259 | struct fuse_getxattr_in { 260 | __u32 size; 261 | __u32 padding; 262 | }; 263 | 264 | struct fuse_getxattr_out { 265 | __u32 size; 266 | __u32 padding; 267 | }; 268 | 269 | struct fuse_access_in { 270 | __u32 mask; 271 | __u32 padding; 272 | }; 273 | 274 | struct fuse_init_in { 275 | __u32 major; 276 | __u32 minor; 277 | }; 278 | 279 | struct fuse_init_out { 280 | __u32 major; 281 | __u32 minor; 282 | __u32 unused[3]; 283 | __u32 max_write; 284 | }; 285 | 286 | struct fuse_in_header { 287 | __u32 len; 288 | __u32 opcode; 289 | __u64 unique; 290 | __u64 nodeid; 291 | __u32 uid; 292 | __u32 gid; 293 | __u32 pid; 294 | __u32 padding; 295 | }; 296 | 297 | struct fuse_out_header { 298 | __u32 len; 299 | __s32 error; 300 | __u64 unique; 301 | }; 302 | 303 | struct fuse_dirent { 304 | __u64 ino; 305 | __u64 off; 306 | __u32 namelen; 307 | __u32 type; 308 | char name[0]; 309 | }; 310 | 311 | #define FUSE_NAME_OFFSET ((unsigned) ((struct fuse_dirent *) 0)->name) 312 | #define FUSE_DIRENT_ALIGN(x) (((x) + sizeof(__u64) - 1) & ~(sizeof(__u64) - 1)) 313 | #define FUSE_DIRENT_SIZE(d) \ 314 | FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen) 315 | -------------------------------------------------------------------------------- /config/iconv.m4: -------------------------------------------------------------------------------- 1 | # iconv.m4 serial 11 (gettext-0.18.1) 2 | dnl Copyright (C) 2000-2002, 2007-2010 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | 9 | AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], 10 | [ 11 | dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. 12 | AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) 13 | AC_REQUIRE([AC_LIB_RPATH]) 14 | 15 | dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV 16 | dnl accordingly. 17 | AC_LIB_LINKFLAGS_BODY([iconv]) 18 | ]) 19 | 20 | AC_DEFUN([AM_ICONV_LINK], 21 | [ 22 | dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and 23 | dnl those with the standalone portable GNU libiconv installed). 24 | AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles 25 | 26 | dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV 27 | dnl accordingly. 28 | AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) 29 | 30 | dnl Add $INCICONV to CPPFLAGS before performing the following checks, 31 | dnl because if the user has installed libiconv and not disabled its use 32 | dnl via --without-libiconv-prefix, he wants to use it. The first 33 | dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. 34 | am_save_CPPFLAGS="$CPPFLAGS" 35 | AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) 36 | 37 | AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [ 38 | am_cv_func_iconv="no, consider installing GNU libiconv" 39 | am_cv_lib_iconv=no 40 | AC_TRY_LINK([#include 41 | #include ], 42 | [iconv_t cd = iconv_open("",""); 43 | iconv(cd,NULL,NULL,NULL,NULL); 44 | iconv_close(cd);], 45 | [am_cv_func_iconv=yes]) 46 | if test "$am_cv_func_iconv" != yes; then 47 | am_save_LIBS="$LIBS" 48 | LIBS="$LIBS $LIBICONV" 49 | AC_TRY_LINK([#include 50 | #include ], 51 | [iconv_t cd = iconv_open("",""); 52 | iconv(cd,NULL,NULL,NULL,NULL); 53 | iconv_close(cd);], 54 | [am_cv_lib_iconv=yes] 55 | [am_cv_func_iconv=yes]) 56 | LIBS="$am_save_LIBS" 57 | fi 58 | ]) 59 | if test "$am_cv_func_iconv" = yes; then 60 | AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [ 61 | dnl This tests against bugs in AIX 5.1, HP-UX 11.11, Solaris 10. 62 | am_save_LIBS="$LIBS" 63 | if test $am_cv_lib_iconv = yes; then 64 | LIBS="$LIBS $LIBICONV" 65 | fi 66 | AC_TRY_RUN([ 67 | #include 68 | #include 69 | int main () 70 | { 71 | /* Test against AIX 5.1 bug: Failures are not distinguishable from successful 72 | returns. */ 73 | { 74 | iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); 75 | if (cd_utf8_to_88591 != (iconv_t)(-1)) 76 | { 77 | static const char input[] = "\342\202\254"; /* EURO SIGN */ 78 | char buf[10]; 79 | const char *inptr = input; 80 | size_t inbytesleft = strlen (input); 81 | char *outptr = buf; 82 | size_t outbytesleft = sizeof (buf); 83 | size_t res = iconv (cd_utf8_to_88591, 84 | (char **) &inptr, &inbytesleft, 85 | &outptr, &outbytesleft); 86 | if (res == 0) 87 | return 1; 88 | } 89 | } 90 | /* Test against Solaris 10 bug: Failures are not distinguishable from 91 | successful returns. */ 92 | { 93 | iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); 94 | if (cd_ascii_to_88591 != (iconv_t)(-1)) 95 | { 96 | static const char input[] = "\263"; 97 | char buf[10]; 98 | const char *inptr = input; 99 | size_t inbytesleft = strlen (input); 100 | char *outptr = buf; 101 | size_t outbytesleft = sizeof (buf); 102 | size_t res = iconv (cd_ascii_to_88591, 103 | (char **) &inptr, &inbytesleft, 104 | &outptr, &outbytesleft); 105 | if (res == 0) 106 | return 1; 107 | } 108 | } 109 | #if 0 /* This bug could be worked around by the caller. */ 110 | /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ 111 | { 112 | iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); 113 | if (cd_88591_to_utf8 != (iconv_t)(-1)) 114 | { 115 | static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; 116 | char buf[50]; 117 | const char *inptr = input; 118 | size_t inbytesleft = strlen (input); 119 | char *outptr = buf; 120 | size_t outbytesleft = sizeof (buf); 121 | size_t res = iconv (cd_88591_to_utf8, 122 | (char **) &inptr, &inbytesleft, 123 | &outptr, &outbytesleft); 124 | if ((int)res > 0) 125 | return 1; 126 | } 127 | } 128 | #endif 129 | /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is 130 | provided. */ 131 | if (/* Try standardized names. */ 132 | iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) 133 | /* Try IRIX, OSF/1 names. */ 134 | && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) 135 | /* Try AIX names. */ 136 | && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) 137 | /* Try HP-UX names. */ 138 | && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) 139 | return 1; 140 | return 0; 141 | }], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no], 142 | [case "$host_os" in 143 | aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; 144 | *) am_cv_func_iconv_works="guessing yes" ;; 145 | esac]) 146 | LIBS="$am_save_LIBS" 147 | ]) 148 | case "$am_cv_func_iconv_works" in 149 | *no) am_func_iconv=no am_cv_lib_iconv=no ;; 150 | *) am_func_iconv=yes ;; 151 | esac 152 | else 153 | am_func_iconv=no am_cv_lib_iconv=no 154 | fi 155 | if test "$am_func_iconv" = yes; then 156 | AC_DEFINE([HAVE_ICONV], [1], 157 | [Define if you have the iconv() function and it works.]) 158 | fi 159 | if test "$am_cv_lib_iconv" = yes; then 160 | AC_MSG_CHECKING([how to link with libiconv]) 161 | AC_MSG_RESULT([$LIBICONV]) 162 | else 163 | dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV 164 | dnl either. 165 | CPPFLAGS="$am_save_CPPFLAGS" 166 | LIBICONV= 167 | LTLIBICONV= 168 | fi 169 | AC_SUBST([LIBICONV]) 170 | AC_SUBST([LTLIBICONV]) 171 | ]) 172 | 173 | dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to 174 | dnl avoid warnings like 175 | dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required". 176 | dnl This is tricky because of the way 'aclocal' is implemented: 177 | dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN. 178 | dnl Otherwise aclocal's initial scan pass would miss the macro definition. 179 | dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions. 180 | dnl Otherwise aclocal would emit many "Use of uninitialized value $1" 181 | dnl warnings. 182 | m4_define([gl_iconv_AC_DEFUN], 183 | m4_version_prereq([2.64], 184 | [[AC_DEFUN_ONCE( 185 | [$1], [$2])]], 186 | [[AC_DEFUN( 187 | [$1], [$2])]])) 188 | gl_iconv_AC_DEFUN([AM_ICONV], 189 | [ 190 | AM_ICONV_LINK 191 | if test "$am_cv_func_iconv" = yes; then 192 | AC_MSG_CHECKING([for iconv declaration]) 193 | AC_CACHE_VAL([am_cv_proto_iconv], [ 194 | AC_TRY_COMPILE([ 195 | #include 196 | #include 197 | extern 198 | #ifdef __cplusplus 199 | "C" 200 | #endif 201 | #if defined(__STDC__) || defined(__cplusplus) 202 | size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); 203 | #else 204 | size_t iconv(); 205 | #endif 206 | ], [], [am_cv_proto_iconv_arg1=""], [am_cv_proto_iconv_arg1="const"]) 207 | am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) 208 | am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` 209 | AC_MSG_RESULT([ 210 | $am_cv_proto_iconv]) 211 | AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1], 212 | [Define as const if the declaration of iconv() needs const.]) 213 | fi 214 | ]) 215 | -------------------------------------------------------------------------------- /src/kernel_interface.c: -------------------------------------------------------------------------------- 1 | /* kernel_interface.c: interface to fuse and coda kernel mocule. 2 | Copyright (C) 2006, 2007, 2008, 2009, 2014 Werner Baumann 3 | 4 | This file is part of davfs2. 5 | 6 | davfs2 is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | davfs2 is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with davfs2; if not, write to the Free Software Foundation, 18 | Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ 19 | 20 | 21 | #include "config.h" 22 | 23 | #include 24 | #ifdef HAVE_FCNTL_H 25 | #include 26 | #endif 27 | #ifdef HAVE_LIBINTL_H 28 | #include 29 | #endif 30 | #ifdef HAVE_STDDEF_H 31 | #include 32 | #endif 33 | #ifdef HAVE_STDINT_H 34 | #include 35 | #endif 36 | #include 37 | #ifdef HAVE_STDLIB_H 38 | #include 39 | #endif 40 | #include 41 | #ifdef HAVE_SYSLOG_H 42 | #include 43 | #endif 44 | #ifdef HAVE_UNISTD_H 45 | #include 46 | #endif 47 | 48 | #ifdef HAVE_SYS_MOUNT_H 49 | #include 50 | #endif 51 | #ifdef HAVE_SYS_STAT_H 52 | #include 53 | #endif 54 | #include 55 | 56 | #include "defaults.h" 57 | #include "mount_davfs.h" 58 | #include "cache.h" 59 | #include "coda.h" 60 | #include "fuse_kernel.h" 61 | #include "kernel_interface.h" 62 | 63 | #ifdef ENABLE_NLS 64 | #define _(String) gettext(String) 65 | #else 66 | #define _(String) String 67 | #endif 68 | 69 | 70 | /* Private constants */ 71 | /*===================*/ 72 | 73 | /* Name, major number and minor number of the devices to communicate with the 74 | kernel file system. */ 75 | #define FUSE_DEV_NAME "fuse" 76 | #define CODA_DEV_NAME "cfs" 77 | #define CODA_MAJOR 67 78 | #define MAX_CODADEVS 5 /* Coda minor number may be from 0 to 4. */ 79 | 80 | 81 | /* Private function prototypes */ 82 | /*=============================*/ 83 | 84 | static int 85 | init_coda(int *dev, dav_run_msgloop_fn *msg_loop, void **mdata); 86 | 87 | static int 88 | init_fuse(int *dev, dav_run_msgloop_fn *msg_loop, void **mdata, 89 | size_t *buf_size, const char *url, const char *mpoint, 90 | unsigned long int mopts, uid_t owner, gid_t group, mode_t mode); 91 | 92 | 93 | /* Public functions */ 94 | /*==================*/ 95 | 96 | int 97 | dav_init_kernel_interface(int *dev, dav_run_msgloop_fn *msg_loop, void **mdata, 98 | char **kernel_fs, size_t *buf_size, const char *url, 99 | const char *mpoint, const dav_args *args) 100 | { 101 | uid_t orig = geteuid(); 102 | if (seteuid(0) != 0) 103 | error(EXIT_FAILURE, 0, _("can't change effective user id")); 104 | 105 | if (!*kernel_fs) 106 | *kernel_fs = strdup("fuse"); 107 | if (!*kernel_fs) abort(); 108 | 109 | int mounted = 0; 110 | if (strcmp(*kernel_fs, "coda") == 0) { 111 | 112 | if (init_coda(dev, msg_loop, mdata) != 0) { 113 | error(0, 0, _("trying fuse kernel file system")); 114 | if (init_fuse(dev, msg_loop, mdata, buf_size, url, mpoint, 115 | args->mopts, args->uid, args->gid, args->dir_mode) 116 | == 0) { 117 | free(*kernel_fs); 118 | *kernel_fs = strdup("fuse"); 119 | if (!*kernel_fs) abort(); 120 | mounted = 1; 121 | error(0, 0, _("fuse device opened successfully")); 122 | } else { 123 | exit(EXIT_FAILURE); 124 | } 125 | } 126 | 127 | } else if (strcmp(*kernel_fs, "fuse") == 0) { 128 | 129 | if (init_fuse(dev, msg_loop, mdata, buf_size, url, mpoint, args->mopts, 130 | args->uid, args->gid, args->dir_mode) == 0) { 131 | mounted = 1; 132 | } else { 133 | error(0, 0, _("trying coda kernel file system")); 134 | if (init_coda(dev, msg_loop, mdata) == 0) { 135 | free(*kernel_fs); 136 | *kernel_fs = strdup("coda"); 137 | if (*kernel_fs == NULL) 138 | abort(); 139 | error(0, 0, _("coda device opened successfully")); 140 | } else { 141 | exit(EXIT_FAILURE); 142 | } 143 | } 144 | 145 | } else { 146 | 147 | error(EXIT_FAILURE, 0, _("unknown kernel file system %s"), *kernel_fs); 148 | } 149 | 150 | if (seteuid(orig) != 0) 151 | error(EXIT_FAILURE, 0, _("can't change effective user id")); 152 | return mounted; 153 | } 154 | 155 | 156 | /* Private functions */ 157 | /*===================*/ 158 | 159 | static int 160 | init_coda(int *dev, dav_run_msgloop_fn *msg_loop, void **mdata) 161 | { 162 | *dev = 0; 163 | int minor = 0; 164 | while (*dev <= 0 && minor < MAX_CODADEVS) { 165 | char *path; 166 | if (asprintf(&path, "%s/%s%i", DAV_DEV_DIR, CODA_DEV_NAME, minor) < 0) 167 | abort(); 168 | *dev = open(path, O_RDWR | O_NONBLOCK); 169 | free(path); 170 | ++minor; 171 | } 172 | 173 | if (*dev <= 0) { 174 | error(0, 0, _("no free coda device to mount")); 175 | return -1; 176 | } 177 | 178 | int version = 0; 179 | ioctl(*dev, CIOC_KERNEL_VERSION, &version); 180 | if (version == 3) { 181 | *msg_loop = dav_coda_loop; 182 | } else { 183 | error(0, 0, _("CODA_KERNEL_VERSION %u not supported"), version); 184 | close(*dev); 185 | return -1; 186 | } 187 | 188 | struct coda_mount_data *md = malloc(sizeof(struct coda_mount_data)); 189 | if (!md) abort(); 190 | md->version = CODA_MOUNT_VERSION; 191 | md->fd = *dev; 192 | *mdata = md; 193 | 194 | return 0; 195 | } 196 | 197 | 198 | static int 199 | init_fuse(int *dev, dav_run_msgloop_fn *msg_loop, void **mdata, 200 | size_t *buf_size, const char *url, const char *mpoint, 201 | unsigned long int mopts, uid_t owner, gid_t group, mode_t mode) 202 | { 203 | char *path; 204 | if (asprintf(&path, "%s/%s", DAV_DEV_DIR, FUSE_DEV_NAME) < 0) 205 | abort(); 206 | 207 | *dev = open(path, O_RDWR | O_NONBLOCK); 208 | 209 | if (*dev <= 0) { 210 | error(0, 0, _("loading kernel module fuse")); 211 | int ret; 212 | pid_t pid = fork(); 213 | if (pid == 0) { 214 | execl("/sbin/modprobe", "modprobe", "fuse", NULL); 215 | _exit(EXIT_FAILURE); 216 | } else if (pid < 0) { 217 | ret = -1; 218 | } else { 219 | if (waitpid(pid, &ret, 0) != pid) 220 | ret = -1; 221 | } 222 | 223 | if (ret) { 224 | error(0, 0, _("loading kernel module fuse failed")); 225 | } else { 226 | *dev = open(path, O_RDWR | O_NONBLOCK); 227 | } 228 | 229 | if (*dev <= 0) { 230 | error(0, 0, _("waiting for /dev/fuse to be created")); 231 | sleep(2); 232 | *dev = open(path, O_RDWR | O_NONBLOCK); 233 | } 234 | } 235 | 236 | free(path); 237 | if (*dev <= 0) { 238 | error(0, 0, _("can't open fuse device")); 239 | return -1; 240 | } 241 | 242 | if (*buf_size < (FUSE_MIN_READ_BUFFER + 4096)) { 243 | *buf_size = FUSE_MIN_READ_BUFFER + 4096; 244 | } 245 | 246 | #if SIZEOF_VOID_P == 8 247 | if (asprintf((char **) mdata, "fd=%i,rootmode=%o,user_id=%i,group_id=%i," 248 | "allow_other,max_read=%lu", *dev, mode, owner, group, 249 | (unsigned long int) (*buf_size - 4096)) < 0) 250 | abort(); 251 | #else 252 | if (asprintf((char **) mdata, "fd=%i,rootmode=%o,user_id=%i,group_id=%i," 253 | "allow_other,max_read=%u", *dev, mode, owner, group, 254 | (unsigned int) (*buf_size - 4096)) < 0) 255 | abort(); 256 | #endif 257 | if (mount(url, mpoint, "fuse", mopts, *mdata) == 0) { 258 | *msg_loop = dav_fuse_loop; 259 | return 0; 260 | } 261 | 262 | free(*mdata); 263 | close(*dev); 264 | error(0, 0, _("can't mount using fuse kernel file system")); 265 | return -1; 266 | } 267 | -------------------------------------------------------------------------------- /man/de/umount.davfs.8.po: -------------------------------------------------------------------------------- 1 | # #-#-#-#-# umount.davfs.8.po (davfs2) #-#-#-#-# 2 | # German translation of umount.davfs(8) man page. 3 | # Copyright (C) 2007, 2914 Werner Baumann 4 | # Werner Baumann , 2007. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: davfs2 1.4.0\n" 9 | "POT-Creation-Date: 2015-02-01 11:54+0100\n" 10 | "PO-Revision-Date: 2014-08-23 20:16+0200\n" 11 | "Last-Translator: Werner Baumann \n" 12 | "Language-Team: \n" 13 | "Language: \n" 14 | "MIME-Version: 1.0\n" 15 | "Content-Type: text/plain; charset=UTF-8\n" 16 | "Content-Transfer-Encoding: 8bit\n" 17 | 18 | # type: TH 19 | #. type: TH 20 | #: davfs2.conf.5:1 mount.davfs.8:1 umount.davfs.8:1 21 | #, no-wrap 22 | msgid "@PACKAGE_STRING@" 23 | msgstr "@PACKAGE_STRING@" 24 | 25 | # type: SH 26 | #. type: SH 27 | #: davfs2.conf.5:4 mount.davfs.8:3 umount.davfs.8:3 28 | #, no-wrap 29 | msgid "NAME" 30 | msgstr "BEZEICHNUNG" 31 | 32 | # type: SH 33 | #. type: SH 34 | #: davfs2.conf.5:9 mount.davfs.8:22 umount.davfs.8:20 35 | #, no-wrap 36 | msgid "DESCRIPTION" 37 | msgstr "BESCHREIBUNG" 38 | 39 | # type: SH 40 | #. type: SH 41 | #: davfs2.conf.5:568 mount.davfs.8:547 umount.davfs.8:79 42 | #, no-wrap 43 | msgid "AUTHORS" 44 | msgstr "AUTOREN" 45 | 46 | # type: SH 47 | #. type: SH 48 | #: davfs2.conf.5:574 mount.davfs.8:564 umount.davfs.8:84 49 | #, no-wrap 50 | msgid "DAVFS2 HOME" 51 | msgstr "DAVFS2 HOME" 52 | 53 | # type: TH 54 | #. type: Plain text 55 | #: davfs2.conf.5:577 mount.davfs.8:567 umount.davfs.8:87 56 | msgid "@PACKAGE_BUGREPORT@" 57 | msgstr "@PACKAGE_BUGREPORT@" 58 | 59 | # type: SH 60 | #. type: SH 61 | #: davfs2.conf.5:579 mount.davfs.8:569 umount.davfs.8:89 62 | #, no-wrap 63 | msgid "SEE ALSO" 64 | msgstr "SIEHE AUCH" 65 | 66 | # type: SH 67 | #. type: SH 68 | #: mount.davfs.8:8 umount.davfs.8:8 69 | #, no-wrap 70 | msgid "SYNOPSIS" 71 | msgstr "ÜBERSICHT" 72 | 73 | # type: SH 74 | #. type: SH 75 | #: mount.davfs.8:15 umount.davfs.8:15 76 | #, no-wrap 77 | msgid "SYNOPSIS (root only)" 78 | msgstr "ÜBERSICHT (nur für root)" 79 | 80 | # type: Plain text 81 | #. type: Plain text 82 | #: mount.davfs.8:60 umount.davfs.8:30 83 | msgid "" 84 | "I is the mountpoint where the WebDAV resource is mounted on. It may be " 85 | "an absolute or relative path." 86 | msgstr "" 87 | "I ist der Einhängepunkt. Es kann eine absolute oder relative Pfadangabe " 88 | "sein." 89 | 90 | # type: SH 91 | #. type: SH 92 | #: mount.davfs.8:67 umount.davfs.8:51 93 | #, no-wrap 94 | msgid "OPTIONS" 95 | msgstr "OPTIONEN" 96 | 97 | # type: TP 98 | #. type: TP 99 | #: mount.davfs.8:69 umount.davfs.8:53 100 | #, no-wrap 101 | msgid "B<-V --version>" 102 | msgstr "B<-V --version>" 103 | 104 | # type: Plain text 105 | #. type: Plain text 106 | #: mount.davfs.8:72 umount.davfs.8:56 107 | msgid "Output version." 108 | msgstr "Zeige die Version an." 109 | 110 | # type: TP 111 | #. type: TP 112 | #: mount.davfs.8:73 umount.davfs.8:57 113 | #, no-wrap 114 | msgid "B<-h --help>" 115 | msgstr "B<-h --help>" 116 | 117 | # type: Plain text 118 | #. type: Plain text 119 | #: mount.davfs.8:76 umount.davfs.8:60 120 | msgid "Print a help message." 121 | msgstr "Zeige einen Hilfe-Text an." 122 | 123 | # type: SH 124 | #. type: SH 125 | #: mount.davfs.8:376 umount.davfs.8:67 126 | #, no-wrap 127 | msgid "FILES" 128 | msgstr "DATEIEN" 129 | 130 | # type: TP 131 | #. type: TP 132 | #: mount.davfs.8:437 umount.davfs.8:69 133 | #, no-wrap 134 | msgid "I<@SYS_RUN@>" 135 | msgstr "I<@SYS_RUN@>" 136 | 137 | # type: SH 138 | #. type: SH 139 | #: mount.davfs.8:540 umount.davfs.8:74 140 | #, no-wrap 141 | msgid "BUGS" 142 | msgstr "FEHLER" 143 | 144 | # type: TH 145 | #. type: TH 146 | #: umount.davfs.8:1 147 | #, no-wrap 148 | msgid "u@PROGRAM_NAME@" 149 | msgstr "u@PROGRAM_NAME@" 150 | 151 | # type: TH 152 | #. type: TH 153 | #: umount.davfs.8:1 154 | #, no-wrap 155 | msgid "2014-08-23" 156 | msgstr "2014-08-23" 157 | 158 | # type: Plain text 159 | #. type: Plain text 160 | #: umount.davfs.8:6 161 | msgid "u@PROGRAM_NAME@ - Umount-helper to unmount a @PACKAGE@ file system" 162 | msgstr "u@PROGRAM_NAME@ - Umount-Hilfsprogramm für @PACKAGE@ Dateisysteme" 163 | 164 | # type: Plain text 165 | #. type: Plain text 166 | #: umount.davfs.8:11 167 | msgid "B" 168 | msgstr "B" 169 | 170 | # type: Plain text 171 | #. type: Plain text 172 | #: umount.davfs.8:13 173 | msgid "BI" 174 | msgstr "BI" 175 | 176 | # type: Plain text 177 | #. type: Plain text 178 | #: umount.davfs.8:18 179 | msgid "BI" 180 | msgstr "BI" 181 | 182 | # type: Plain text 183 | #. type: Plain text 184 | #: umount.davfs.8:26 185 | msgid "" 186 | "B is a umount helper program. It is called by the " 187 | "B(8) command. Its purpose is to prevent the umount command from " 188 | "returning unless B<@PROGRAM_NAME@> has synchronized all its cached files " 189 | "with the webdav server." 190 | msgstr "" 191 | "B ist ein Hilfsprogramm, das von B(8) aufgerufen " 192 | "wird. Es soll verhindern, dass das umount-Kommando zurück kehrt, bevor " 193 | "B<@PROGRAM_NAME@> alle geänderten Dateien aus dem Cache auf den WebDAV-" 194 | "Server zurück sichern konnte." 195 | 196 | # type: Plain text 197 | #. type: Plain text 198 | #: umount.davfs.8:39 199 | msgid "" 200 | "While for local file systems B(8) will only return when all cached " 201 | "data have been written to disk, this is not automatically true for a mounted " 202 | "B<@PACKAGE@> file system. With this umount helper the user can rely on the " 203 | "familiar behaviour of B(8). To inform the operating system that the " 204 | "file system uses a network connection, you should always use the B<_netdev> " 205 | "option, when mounting as B<@PACKAGE@> file system." 206 | msgstr "" 207 | "Bei lokalen Dateisystemen kehrt B(8) erst zurück, wenn alle Daten " 208 | "aus dem Cache auf die Festplatte geschrieben sind. Dies funkioniert bei " 209 | "einem B<@PACKAGE@>-Dateisystem nicht automatisch. Mit diesem Hilfsprogramm " 210 | "kann sich der Benutzer auf das bekannte Verhalten von B(8) " 211 | "verlassen. Es sollte auch immer mit der Option B<_netdev> eingehängt werden, " 212 | "damit das Betriebssystem darüber informiert wird, dass das B<@PACKAGE@>-" 213 | "Dateisystem eine Netzwerkverbindung braucht." 214 | 215 | # type: Plain text 216 | #. type: Plain text 217 | #: umount.davfs.8:43 218 | msgid "" 219 | "Depending on the amount of data and the quality of the connection, " 220 | "unmounting a B<@PACKAGE@> file system may take some seconds up to some hours." 221 | msgstr "" 222 | "Abhängig von der Datenmenge und der Qualität der Netzwerkverbindung kann das " 223 | "Aushängen ein paar Sekunden, aber auch einige Stunden dauern." 224 | 225 | # type: Plain text 226 | #. type: Plain text 227 | #: umount.davfs.8:49 228 | msgid "" 229 | "If the B<@PROGRAM_NAME@> daemon encountered serious errors, " 230 | "B may return an error instead of unmounting the file " 231 | "system. In this case try B. The B<-i> option will prevent " 232 | "B(8) from calling B." 233 | msgstr "" 234 | "Wenn der B<@PROGRAM_NAME@>-Hintergrundprozess ernste Probleme hat, kann " 235 | "B möglicherweise das Dateisystem nicht aushängen, sondern " 236 | "meldet einen Fehler. Versuche es in diesem Fall mit B. Die Option " 237 | "B<-i> hindert B(8) daran, B aufzurufen." 238 | 239 | # type: TP 240 | #. type: TP 241 | #: umount.davfs.8:61 242 | #, no-wrap 243 | msgid "B<-f -l -n -r -v -t>" 244 | msgstr "B<-f -l -n -r -v -t>" 245 | 246 | # type: Plain text 247 | #. type: Plain text 248 | #: umount.davfs.8:65 249 | msgid "" 250 | "This options are B. They are only recognized for compatibility with " 251 | "B(8)." 252 | msgstr "" 253 | "Dies Optionen dienen nur der Kompatibilität mit B(8) und werden " 254 | "ignoriert." 255 | 256 | # type: Plain text 257 | #. type: Plain text 258 | #: umount.davfs.8:72 259 | msgid "PID-files of running B processes are looked up here." 260 | msgstr "" 261 | "Die PID-Dateien der laufenden B<@PROGRAM_NAME@>-Hintergrundprozesse werden " 262 | "in diesem Verzeichnis gesucht." 263 | 264 | # type: Plain text 265 | #. type: Plain text 266 | #: umount.davfs.8:77 267 | msgid "No known bugs." 268 | msgstr "Derzeit keine bekannten." 269 | 270 | # type: Plain text 271 | #. type: Plain text 272 | #: umount.davfs.8:82 273 | msgid "" 274 | "This man page was written by Werner Baumann Ewerner.baumann@onlinehome." 275 | "deE." 276 | msgstr "" 277 | "Diese Handbuch hat Werner Baumann Ewerner.baumann@onlinehome.deE " 278 | "geschrieben." 279 | 280 | # type: Plain text 281 | #. type: Plain text 282 | #: umount.davfs.8:94 283 | msgid "B<@PROGRAM_NAME@>(8), B(8), B<@CONFIGFILE@>(5), B(5)" 284 | msgstr "B<@PROGRAM_NAME@>(8), B(8), B<@CONFIGFILE@>(5), B(5)" 285 | -------------------------------------------------------------------------------- /config/compile: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Wrapper for compilers which do not understand '-c -o'. 3 | 4 | scriptversion=2012-10-14.11; # UTC 5 | 6 | # Copyright (C) 1999-2013 Free Software Foundation, Inc. 7 | # Written by Tom Tromey . 8 | # 9 | # This program is free software; you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation; either version 2, or (at your option) 12 | # any later version. 13 | # 14 | # This program is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with this program. If not, see . 21 | 22 | # As a special exception to the GNU General Public License, if you 23 | # distribute this file as part of a program that contains a 24 | # configuration script generated by Autoconf, you may include it under 25 | # the same distribution terms that you use for the rest of that program. 26 | 27 | # This file is maintained in Automake, please report 28 | # bugs to or send patches to 29 | # . 30 | 31 | nl=' 32 | ' 33 | 34 | # We need space, tab and new line, in precisely that order. Quoting is 35 | # there to prevent tools from complaining about whitespace usage. 36 | IFS=" "" $nl" 37 | 38 | file_conv= 39 | 40 | # func_file_conv build_file lazy 41 | # Convert a $build file to $host form and store it in $file 42 | # Currently only supports Windows hosts. If the determined conversion 43 | # type is listed in (the comma separated) LAZY, no conversion will 44 | # take place. 45 | func_file_conv () 46 | { 47 | file=$1 48 | case $file in 49 | / | /[!/]*) # absolute file, and not a UNC file 50 | if test -z "$file_conv"; then 51 | # lazily determine how to convert abs files 52 | case `uname -s` in 53 | MINGW*) 54 | file_conv=mingw 55 | ;; 56 | CYGWIN*) 57 | file_conv=cygwin 58 | ;; 59 | *) 60 | file_conv=wine 61 | ;; 62 | esac 63 | fi 64 | case $file_conv/,$2, in 65 | *,$file_conv,*) 66 | ;; 67 | mingw/*) 68 | file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` 69 | ;; 70 | cygwin/*) 71 | file=`cygpath -m "$file" || echo "$file"` 72 | ;; 73 | wine/*) 74 | file=`winepath -w "$file" || echo "$file"` 75 | ;; 76 | esac 77 | ;; 78 | esac 79 | } 80 | 81 | # func_cl_dashL linkdir 82 | # Make cl look for libraries in LINKDIR 83 | func_cl_dashL () 84 | { 85 | func_file_conv "$1" 86 | if test -z "$lib_path"; then 87 | lib_path=$file 88 | else 89 | lib_path="$lib_path;$file" 90 | fi 91 | linker_opts="$linker_opts -LIBPATH:$file" 92 | } 93 | 94 | # func_cl_dashl library 95 | # Do a library search-path lookup for cl 96 | func_cl_dashl () 97 | { 98 | lib=$1 99 | found=no 100 | save_IFS=$IFS 101 | IFS=';' 102 | for dir in $lib_path $LIB 103 | do 104 | IFS=$save_IFS 105 | if $shared && test -f "$dir/$lib.dll.lib"; then 106 | found=yes 107 | lib=$dir/$lib.dll.lib 108 | break 109 | fi 110 | if test -f "$dir/$lib.lib"; then 111 | found=yes 112 | lib=$dir/$lib.lib 113 | break 114 | fi 115 | if test -f "$dir/lib$lib.a"; then 116 | found=yes 117 | lib=$dir/lib$lib.a 118 | break 119 | fi 120 | done 121 | IFS=$save_IFS 122 | 123 | if test "$found" != yes; then 124 | lib=$lib.lib 125 | fi 126 | } 127 | 128 | # func_cl_wrapper cl arg... 129 | # Adjust compile command to suit cl 130 | func_cl_wrapper () 131 | { 132 | # Assume a capable shell 133 | lib_path= 134 | shared=: 135 | linker_opts= 136 | for arg 137 | do 138 | if test -n "$eat"; then 139 | eat= 140 | else 141 | case $1 in 142 | -o) 143 | # configure might choose to run compile as 'compile cc -o foo foo.c'. 144 | eat=1 145 | case $2 in 146 | *.o | *.[oO][bB][jJ]) 147 | func_file_conv "$2" 148 | set x "$@" -Fo"$file" 149 | shift 150 | ;; 151 | *) 152 | func_file_conv "$2" 153 | set x "$@" -Fe"$file" 154 | shift 155 | ;; 156 | esac 157 | ;; 158 | -I) 159 | eat=1 160 | func_file_conv "$2" mingw 161 | set x "$@" -I"$file" 162 | shift 163 | ;; 164 | -I*) 165 | func_file_conv "${1#-I}" mingw 166 | set x "$@" -I"$file" 167 | shift 168 | ;; 169 | -l) 170 | eat=1 171 | func_cl_dashl "$2" 172 | set x "$@" "$lib" 173 | shift 174 | ;; 175 | -l*) 176 | func_cl_dashl "${1#-l}" 177 | set x "$@" "$lib" 178 | shift 179 | ;; 180 | -L) 181 | eat=1 182 | func_cl_dashL "$2" 183 | ;; 184 | -L*) 185 | func_cl_dashL "${1#-L}" 186 | ;; 187 | -static) 188 | shared=false 189 | ;; 190 | -Wl,*) 191 | arg=${1#-Wl,} 192 | save_ifs="$IFS"; IFS=',' 193 | for flag in $arg; do 194 | IFS="$save_ifs" 195 | linker_opts="$linker_opts $flag" 196 | done 197 | IFS="$save_ifs" 198 | ;; 199 | -Xlinker) 200 | eat=1 201 | linker_opts="$linker_opts $2" 202 | ;; 203 | -*) 204 | set x "$@" "$1" 205 | shift 206 | ;; 207 | *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) 208 | func_file_conv "$1" 209 | set x "$@" -Tp"$file" 210 | shift 211 | ;; 212 | *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) 213 | func_file_conv "$1" mingw 214 | set x "$@" "$file" 215 | shift 216 | ;; 217 | *) 218 | set x "$@" "$1" 219 | shift 220 | ;; 221 | esac 222 | fi 223 | shift 224 | done 225 | if test -n "$linker_opts"; then 226 | linker_opts="-link$linker_opts" 227 | fi 228 | exec "$@" $linker_opts 229 | exit 1 230 | } 231 | 232 | eat= 233 | 234 | case $1 in 235 | '') 236 | echo "$0: No command. Try '$0 --help' for more information." 1>&2 237 | exit 1; 238 | ;; 239 | -h | --h*) 240 | cat <<\EOF 241 | Usage: compile [--help] [--version] PROGRAM [ARGS] 242 | 243 | Wrapper for compilers which do not understand '-c -o'. 244 | Remove '-o dest.o' from ARGS, run PROGRAM with the remaining 245 | arguments, and rename the output as expected. 246 | 247 | If you are trying to build a whole package this is not the 248 | right script to run: please start by reading the file 'INSTALL'. 249 | 250 | Report bugs to . 251 | EOF 252 | exit $? 253 | ;; 254 | -v | --v*) 255 | echo "compile $scriptversion" 256 | exit $? 257 | ;; 258 | cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) 259 | func_cl_wrapper "$@" # Doesn't return... 260 | ;; 261 | esac 262 | 263 | ofile= 264 | cfile= 265 | 266 | for arg 267 | do 268 | if test -n "$eat"; then 269 | eat= 270 | else 271 | case $1 in 272 | -o) 273 | # configure might choose to run compile as 'compile cc -o foo foo.c'. 274 | # So we strip '-o arg' only if arg is an object. 275 | eat=1 276 | case $2 in 277 | *.o | *.obj) 278 | ofile=$2 279 | ;; 280 | *) 281 | set x "$@" -o "$2" 282 | shift 283 | ;; 284 | esac 285 | ;; 286 | *.c) 287 | cfile=$1 288 | set x "$@" "$1" 289 | shift 290 | ;; 291 | *) 292 | set x "$@" "$1" 293 | shift 294 | ;; 295 | esac 296 | fi 297 | shift 298 | done 299 | 300 | if test -z "$ofile" || test -z "$cfile"; then 301 | # If no '-o' option was seen then we might have been invoked from a 302 | # pattern rule where we don't need one. That is ok -- this is a 303 | # normal compilation that the losing compiler can handle. If no 304 | # '.c' file was seen then we are probably linking. That is also 305 | # ok. 306 | exec "$@" 307 | fi 308 | 309 | # Name of file we expect compiler to create. 310 | cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` 311 | 312 | # Create the lock directory. 313 | # Note: use '[/\\:.-]' here to ensure that we don't use the same name 314 | # that we are using for the .o file. Also, base the name on the expected 315 | # object file name, since that is what matters with a parallel build. 316 | lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d 317 | while true; do 318 | if mkdir "$lockdir" >/dev/null 2>&1; then 319 | break 320 | fi 321 | sleep 1 322 | done 323 | # FIXME: race condition here if user kills between mkdir and trap. 324 | trap "rmdir '$lockdir'; exit 1" 1 2 15 325 | 326 | # Run the compile. 327 | "$@" 328 | ret=$? 329 | 330 | if test -f "$cofile"; then 331 | test "$cofile" = "$ofile" || mv "$cofile" "$ofile" 332 | elif test -f "${cofile}bj"; then 333 | test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" 334 | fi 335 | 336 | rmdir "$lockdir" 337 | exit $ret 338 | 339 | # Local Variables: 340 | # mode: shell-script 341 | # sh-indentation: 2 342 | # eval: (add-hook 'write-file-hooks 'time-stamp) 343 | # time-stamp-start: "scriptversion=" 344 | # time-stamp-format: "%:y-%02m-%02d.%02H" 345 | # time-stamp-time-zone: "UTC" 346 | # time-stamp-end: "; # UTC" 347 | # End: 348 | -------------------------------------------------------------------------------- /src/mount_davfs.h: -------------------------------------------------------------------------------- 1 | /* mount_davfs.h: structure to collect arguments and options. 2 | Copyright (C) 2006, 2007, 2008, 2009, 2014 Werner Baumann 3 | 4 | This file is part of davfs2. 5 | 6 | davfs2 is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | davfs2 is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with davfs2; if not, write to the Free Software Foundation, 18 | Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ 19 | 20 | 21 | #ifndef DAV_MOUNT_DAVFS_H 22 | #define DAV_MOUNT_DAVFS_H 23 | 24 | 25 | /* Data Types */ 26 | /*============*/ 27 | 28 | /* This data structure holds almost everything davfs gathers while reading and 29 | checking command line and configuration files. (See comment for data origin; 30 | highest precedence first.) 31 | Some data will be copied into global or local variables to be available in 32 | daemon mode. The rest will be freed when forking into daemon mode. */ 33 | typedef struct { 34 | char *cmdline; 35 | char *dav_user; /* System config file */ 36 | char *dav_group; /* System config file */ 37 | char *conf; /* Command line */ 38 | /* Mount options */ 39 | int user; /* Command line */ 40 | int users; /* Command line */ 41 | int netdev; /* Command line */ 42 | int grpid; /* Command line */ 43 | unsigned long int mopts; /* Command line */ 44 | char *kernel_fs; /* User config file, system config file */ 45 | int use_utab; 46 | size_t buf_size; /* User config file, system config file */ 47 | /* File mode */ 48 | uid_t uid; /* Command line */ 49 | gid_t gid; /* Command line */ 50 | mode_t dir_mode; /* Command line */ 51 | mode_t file_mode; /* Command line */ 52 | /* WebDAV-resource */ 53 | char *scheme; /* Command line */ 54 | char *host; /* Command line */ 55 | int port; /* Command line */ 56 | char *path; /* Command line */ 57 | char *trust_ca_cert; /* User config file, system config file */ 58 | char *trust_server_cert; /* User config file, system config file */ 59 | char *secrets; /* User config file */ 60 | char *username; /* User secrets file, system secrets file */ 61 | char *cl_username; /* Command line */ 62 | char *password; /* User secrets file, system secrets file */ 63 | char *clicert; /* User config file, system config file */ 64 | char *clicert_pw; /* User secrets file, system secrets file */ 65 | char *p_host; /* User config file, sys conf f., environment */ 66 | int p_port; /* User config file, sys conf f., environment */ 67 | char *p_user; /* User secrets file, system secrets file */ 68 | char *p_passwd; /* User secrets file, system secrets file */ 69 | int useproxy; /* User config file, sys conf f., command line */ 70 | int askauth; /* User config file, sys conf f., command line */ 71 | int locks; /* User config file, sys conf f., command line */ 72 | char * lock_owner; /* User config file, system config file */ 73 | time_t lock_timeout; /* User config file, system config file */ 74 | time_t lock_refresh; /* User config file, system config file */ 75 | int expect100; /* User config file, system config file */ 76 | int if_match_bug; /* User config file, system config file */ 77 | int drop_weak_etags; /* User config file, system config file */ 78 | int n_cookies; /* User config file, system config file */ 79 | int precheck; /* User config file, system config file */ 80 | int ignore_dav_header; /* User config file, system config file */ 81 | int use_compression; /* User config file, system config file */ 82 | int min_propset; /* User config file, system config file */ 83 | int follow_redirect; /* User config file, system config file */ 84 | time_t connect_timeout; /* User config file, system config file */ 85 | time_t read_timeout; /* User config file, system config file */ 86 | time_t retry; /* User config file, system config file */ 87 | time_t max_retry; /* User config file, system config file */ 88 | int max_upload_attempts; /* User config file, system config file */ 89 | char * s_charset; /* User config file, system config file */ 90 | char * header; /* User config file, system config file */ 91 | /* Cache */ 92 | char *sys_cache; /* System config file */ 93 | char *cache_dir; /* User config file */ 94 | char *backup_dir; /* User config file, system config file */ 95 | size_t cache_size; /* User config file, system config file */ 96 | size_t table_size; /* User config file, system config file */ 97 | time_t dir_refresh; /* User config file, system config file */ 98 | time_t file_refresh; /* User config file, system config file */ 99 | int delay_upload; /* User config file, system config file */ 100 | int gui_optimize; /* User config file, system config file */ 101 | int minimize_mem; /* User config file, system config file */ 102 | /* Debugging */ 103 | int debug; /* User config file, system config file */ 104 | int neon_debug; /* User config file, system config file */ 105 | } dav_args; 106 | 107 | 108 | /* Public functions. */ 109 | /*===================*/ 110 | 111 | /* Main launches a daemon program that runs a directory and file cache and 112 | is connected to the WbDAV resource and the kernel file system module. 113 | It must run setuid root. After forking into daemon mode it releases root 114 | permissions permanently. The daemon runs with the uid of the user that owns 115 | the file system. (If invoked by root and the mounted file system is owned 116 | by root, the daemon runs as root. This should be avoided.) 117 | Launching the daemon (and stopping) is done in 5 steps. 118 | Step 1: 119 | - Gathering information from command line, configuration files and 120 | environment. 121 | - Checking this information for consistency and any errors that would 122 | prevent successful running of the daemon. 123 | - Checking whether the the user has permissions to mount. 124 | - Checking whether the neccessary files and directories for running the 125 | daemon are available. 126 | Step 2: 127 | - The modules for connecting to the kernel, connecting to the WebDAV resource 128 | and for caching are initialised. 129 | If an error accurs during step 1 or step 2 an error message is printed and 130 | the program dies immediately. Clean up is left to the operating system. 131 | Step 3: 132 | - Forking into daemon mode. 133 | - While the daemon (child) writes the pid file and starts reading upcalls 134 | from the kernel in an endless loop, the parent process tries to mount the 135 | file system and write an entry into mtab (_PROC_MOUNTS). 136 | - If an error occurs in one of the processes it sends SIGTERM to the other. 137 | While the parent just dies, the daemon will run its normal exit code 138 | (see step 5). In rare cases this might nevertheless leave stale pid files 139 | or entries in mtab that must be cleaned manually by the administrator. 140 | - If mounting is successful the parent process exits with success. 141 | Step 4: 142 | - Running as daemon. 143 | Step 5: 144 | - Terminating. 145 | - The daemon has set a signal handler for SIGTERM and SIGHUP. If it gets one 146 | of these signals it tries to unmount the file system and resets the global 147 | variable keep_on_running. This will terminate the message loop gracefully. 148 | - If the file system is unmounted (by the umount programm), the message 149 | loop will terminate gracefully. 150 | - The close functions of the modules are called, that will clean up the 151 | cache, save cached information if neccessary and close the connections. */ 152 | int 153 | main(int argc, char *argv[]); 154 | 155 | 156 | /* Prints prompt to stdout and reads a line from stdin. 157 | Echoing the user input to stdout is prohibited. 158 | A trailing newline is removed. 159 | return value : the user input. */ 160 | char * 161 | dav_user_input_hidden(const char *prompt); 162 | 163 | 164 | #endif /* DAV_MOUNT_DAVFS_H */ 165 | -------------------------------------------------------------------------------- /src/defaults.h: -------------------------------------------------------------------------------- 1 | /* defauls.h: default values of configuration options and constants. 2 | Copyright (C) 2006, 2007, 2008, 2009, 2014 Werner Baumann 3 | 4 | This file is part of davfs2. 5 | 6 | davfs2 is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | davfs2 is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with davfs2; if not, write to the Free Software Foundation, 18 | Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ 19 | 20 | 21 | #ifndef DAV_DEFAULTS_H 22 | #define DAV_DEFAULTS_H 23 | 24 | 25 | /* Misc. */ 26 | /*=======*/ 27 | 28 | /* File system type to be used with 'mount -t' and fstab. */ 29 | #define DAV_FS_TYPE "davfs" 30 | 31 | /* Mount options set by mount program in case of mounting by an 32 | ordinary user. */ 33 | #define DAV_USER_MOPTS (MS_MGC_VAL | MS_NOSUID | MS_NOEXEC | MS_NODEV) 34 | 35 | /* This mount options will allways be set by davfs2. Different values from 36 | command line and even fstab will be silently ignored. */ 37 | #define DAV_MOPTS (MS_MGC_VAL | MS_NOSUID | MS_NODEV) 38 | 39 | /* Mode of directories. 40 | May be overridden by command line or fstab. */ 41 | #define DAV_DIR_MODE (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) 42 | 43 | /* Mode of regular files. 44 | May be overridden by command line or fstab. */ 45 | #define DAV_FILE_MODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) 46 | 47 | /* XML namespace for the cache index file. */ 48 | #define DAV_XML_NS "http://dav.sf.net/" 49 | 50 | 51 | /* Directories and Files */ 52 | /*=======================*/ 53 | 54 | /* If _PATH_MOUNTED (the mtab file) is a symbolic link (to /proc/mounts) 55 | some information required for umount is missing (e.g. the option 56 | user= Solaris 64-bit Developer's Guide > The Development Environment 182 | dnl . 183 | dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link." 184 | dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the 185 | dnl symlink is missing, so we set acl_libdirstem2 too. 186 | AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit], 187 | [AC_EGREP_CPP([sixtyfour bits], [ 188 | #ifdef _LP64 189 | sixtyfour bits 190 | #endif 191 | ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no]) 192 | ]) 193 | if test $gl_cv_solaris_64bit = yes; then 194 | acl_libdirstem=lib/64 195 | case "$host_cpu" in 196 | sparc*) acl_libdirstem2=lib/sparcv9 ;; 197 | i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; 198 | esac 199 | fi 200 | ;; 201 | *) 202 | searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` 203 | if test -n "$searchpath"; then 204 | acl_save_IFS="${IFS= }"; IFS=":" 205 | for searchdir in $searchpath; do 206 | if test -d "$searchdir"; then 207 | case "$searchdir" in 208 | */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; 209 | */../ | */.. ) 210 | # Better ignore directories of this form. They are misleading. 211 | ;; 212 | *) searchdir=`cd "$searchdir" && pwd` 213 | case "$searchdir" in 214 | */lib64 ) acl_libdirstem=lib64 ;; 215 | esac ;; 216 | esac 217 | fi 218 | done 219 | IFS="$acl_save_IFS" 220 | fi 221 | ;; 222 | esac 223 | test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" 224 | ]) 225 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | 2016-04-15 2 | ---------- 3 | 4 | # Copyright (C) 2006, 2007, 2008, 2009, 2010, 2014, 2016 Werner Baumann 5 | 6 | # Copying and distribution of this file, with or without modification, are 7 | # permitted in any medium without royalty. 8 | 9 | 10 | DAVFS2 1.5.4 README 11 | =================== 12 | 13 | 1 INTRODUCTION 14 | 1.1 WHAT DAVFS2 IS INTENDED FOR 15 | 1.2 WHAT DAVFS2 IS NOT INTENDED FOR 16 | 2 SECURITY CONSIDERATIONS 17 | 3 MOUNTING 18 | 4 TLS / SSL 19 | 5 CACHE 20 | 6 TROUBLE SHOOTING 21 | 7 KNOWN ISSUES 22 | 8 CONTACT 23 | 24 | 25 | 1 INTRODUCTION 26 | ============== 27 | 28 | davfs2 is a Linux file system driver that allows you to mount a WebDAV 29 | resource into your Unix file system tree. So - and that is what makes 30 | davfs2 different - applications can use it without knowing about WebDAV. 31 | You may edit WebDAV resources using standard applications that interact 32 | with the file system as usual. 33 | 34 | davfs2 supports SSL and proxy, HTTP authentication (basic and digest) 35 | and client certificates. 36 | 37 | 1.1 WHAT DAVFS2 IS INTENDED FOR 38 | ------------------------------- 39 | 40 | - If you have documents you want to access from different locations, store 41 | them on a WebDAV server accessible via Internet. Mount them with davfs2 42 | from wherever you want. 43 | 44 | - Use a WebDAV server as workspace for a geographically distributed work group. 45 | 46 | - A web site may be made accessible to the developers via WebDAV. So they 47 | can mount with davfs2 and edit in place. 48 | 49 | 1.2 WHAT DAVFS2 IS NOT INTENDED FOR 50 | ----------------------------------- 51 | 52 | davfs2 is not intended as a replacement for distributed file systems like 53 | nfs, coda, cifs and similar. 54 | 55 | When davfs2 mounts a resource, it authenticates with the server using the 56 | user-name and password it got from the mounting user. All requests to the 57 | server are done on behalf of this WebDAV user. davfs2 does not handle different 58 | WebDAV users within one mount. But this would be required for a distributed 59 | file system. 60 | 61 | davfs2 is not a generic WebDAV client. davfs2 maps a WebDAV resource to a file 62 | system. But as the file system interface and the WebDAV protocol are quite 63 | different, this is not possible without losses. As a file system davfs2 cannot 64 | use all the possibilities of WebDAV, and most WebDAV servers do not provide all 65 | the information a file system usually requires. 66 | 67 | A specialised application with built-in WebDAV capabilities should be able to 68 | make better use of the WebDAV protocol. Whether it really does, depends on the 69 | implementation. But if a free WebDAV enabled application is available, you 70 | might try it first. 71 | 72 | davfs2 can't (always) replace lodal disk space. Due to the nature of WebDAV 73 | davfs2 can't directly redirect reading and writing to the WebDAV server. davfs2 74 | always needs local copies of all open files. So if you have not enough sidk 75 | space to hold these local copies, davfs2 will not help. 76 | 77 | 78 | 2 SECURITY CONSIDERATIONS 79 | ========================= 80 | 81 | To allow non-root users mounting of WebDAV resources, mount.davfs is run 82 | setuid root. To prevent inexperienced (or even malicious) users from introducing 83 | dangerous content into system directories or other users home directory, 84 | the administrator must have control over user mounts. 85 | 86 | - Non-root users can only mount using the normal mount program. There must 87 | also be an entry in /etc/fstab. This can only be done by root. 88 | 89 | - To mount a WebDAV resource users must be member of dav_group (default is 90 | group 'davfs2'). The administrator may use group membership to allow or 91 | disallow mounting of WebDAV resources. 92 | 93 | mount.davfs starts with effective user-id 'root' to be able to mount. After 94 | mounting it changes its id permanently to that of the mounting user. When 95 | the mounting user is root, the mount.davfs daemon will run as user 'davfs2'. 96 | 97 | 98 | 3 MOUNTING 99 | ========== 100 | 101 | davfs2 comes with three manuals: mount.davfs, umount.davfs and davfs2.conf. 102 | 103 | When a normal user mounts a davfs2 file system for the first time, there 104 | is not yet a user configuration file and a secrets file. So you will be asked 105 | for the credentials. mount.davfs will create a hidden directory .davfs2 in 106 | the users home directory, that holds configuration files, the cache and 107 | certificates. You will want to edit this files afterwards. 108 | 109 | If you update from an older version, these files already exist and davfs2 110 | will not touch them. To allow mount.davfs installation of newer versions, 111 | you might rename davfs2.conf and secrets and merge your changes into the 112 | new versions. 113 | 114 | GUIs like Gnome and KDE provide means to mount file systems listed in 115 | fstab. But at the moment there is no means to ask the user for credentials 116 | etc. You must configure your davfs2 mounts, using davfs2.conf and secrets, 117 | to allow mounting without user interaction for this to work. 118 | 119 | davfs2 needs a network connection to mount and also to unmount cleanly. So 120 | automatic mounting at boot time and unmounting at shut down may not work 121 | reliably. By default davfs2 mounts with option '_netdev' to inform the 122 | operating system about this and allow correct handling. Whether this really 123 | works depends on the details of the start-up and shut-down process and will 124 | be different on different systems. So please test before you rely on this. 125 | 126 | 127 | 4 TLS / SSL 128 | =========== 129 | 130 | The key question when using TLS/SSL is whether you can trust in the certificate 131 | the server presents. There is no gain in security when you use strong 132 | encryption for your communication with an attacker. There are also different 133 | opinions on whether you can really trust in certificates issued by the well 134 | known certificate 'authorities'. 135 | 136 | Nevertheless davfs2 insists on verification of server certificates. There 137 | are three ways to do this: 138 | 139 | - davfs2 will use the CA-certificates of your system to verify the server 140 | certificate. The server's certificate must be valid and host-name of the 141 | server must match the subject-alt-name or the common name of the certificate. 142 | 143 | - You may store a top-level CA-certificate in the certs directory and set 144 | option trust_ca_cert in the davfs2.conf directory. This CA-certificate will 145 | be used instead of the CA-certificates provided by your system. he server's 146 | certificate must be valid and host-name of the server must match the 147 | subject-alt-name or the common name of the certificate. 148 | This is useful when the service provider uses a private CA or the server 149 | certificate is self-signed. 150 | 151 | - You may store the certificate of the server and set option trust_server_cert 152 | in the davfs2.conf file. In this case the certificate of the server must 153 | exactly match this certificate, but it does not matter whether it is valid, 154 | outdated or does not match the server's host-name. 155 | 156 | When you use option trust_ca_cert or trust_server_cert it is your responsibility 157 | to get the certificate in a reliable way and care for certificate revocation. 158 | If you can do this it is more secure then relying of well known certificate 159 | authorities (considering recent events). 160 | 161 | If a certificate can not be verified, mount.davfs will print information about 162 | the certificate and ask the user. This will only be done before mount.davfs 163 | changes into daemon mode. 164 | 165 | 166 | 5 CACHE 167 | ======= 168 | 169 | davfs2 will store a local copy of all open files in its cache. So make sure 170 | there is enough local disk space available in the cache directory. 171 | 172 | There are two reasons for caching: 173 | 174 | - The coda kernel file system expects a local copy of the file to act on. 175 | 176 | - Many applications, especially those with graphical user interfaces, think 177 | of file system calls as cheap and quick, which is not true when using a slow 178 | connection to the Internet. Some graphical interfaces for file handling even 179 | open every file in every directory they list, forcing davfs2 to download them 180 | from the server. 181 | 182 | To avoid excessive network traffic, davfs2 now saves all downloaded files in a 183 | cache directory and will hold the files, even when the file system is 184 | unmounted. When the same file system is mounted again, it will reuse this 185 | cached files. 186 | 187 | To avoid inconsistencies, davfs2 will do a conditional GET whenever a file is 188 | opened (it will ask the server if there is a newer version, and download only 189 | if there is). 190 | 191 | Many application use temporary files that will be deleted just after they have 192 | been closed. So whenever a file is newly created or changed, davfs2 will wait 193 | until it is closed and then wait another short period (configurable, default 194 | is 10 seconds) before it will upload the changed version to server. This saves 195 | a lot of unnecessary traffic, but the strategy still has to be enhanced. If 196 | there are many files to be uploaded (e.g. after copying a directory) 197 | mount.davfs may block quite some time, as it has to upload all the files. 198 | 199 | 200 | 6 TROUBLESHOOTING 201 | ================= 202 | 203 | In case davfs2 does not behave as you expect, there is some very useful free 204 | software, to search for the reason: 205 | 206 | - Use any browser, telnet and 'openssl s_client' to test whether you can 207 | connect to the server at all. 208 | 209 | - Cadaver is a WebDAV-client with an FTP-like interface. Besides the usual 210 | FTP-commands it allows you to display and manipulate WebDAV-properties, e.g. 211 | you can remove stale locks. (http://www.webdav.org/cadaver/) 212 | 213 | - You may set option 'debug most" in the davfs2.conf file. This will print a 214 | lot of debug messages in one of your log files. 215 | 216 | - Wireshark will log and analyse the traffic between davfs2 and the server. 217 | (http://www.wireshark.org/) 218 | 219 | - If you have access to the server's log files, they contain valuable 220 | information. 221 | 222 | When sending a bug report, please include 223 | 224 | - the exact version of davfs2 and the source where you got it from. 225 | 226 | - a complete description of the bug and the actions that lead to the buggy 227 | behaviour (please note: I usually do not know the acronyms of your favourite 228 | applications, operating system and server. In many cases I never used them). 229 | The exact commands you issued on the command line and the messages you got 230 | from davfs2 are necessary to understand what's going on. 231 | Please always send the original error and debug messages in full. Don't 232 | replace them by your interpretation. 233 | 234 | - if possible, output from the above mentioned tools. 235 | 236 | 237 | 7 KNOWN ISSUES 238 | ============== 239 | 240 | - If the server does not support RFC 4331 (most servers don't), davfs2 cannot 241 | calculate the free disk space on the server. But some applications 242 | (e.g. nautilus) insist on this. So davfs can't help but lie. I tried to 243 | make the numbers look funny, so you will notice they are faked. 244 | 245 | 246 | 8 CONTACT 247 | ========= 248 | 249 | davfs2 is an Free Software project hostet at 250 | http://savannah.nongnu.org/projects/davfs2 or 251 | https://savannah.nongnu.org/projects/davfs2 252 | 253 | You can submit a bug-report or support-request at 254 | http://savannah.nongnu.org/support/?func=additem&group=davfs2 or 255 | https://savannah.nongnu.org/support/?func=additem&group=davfs2 256 | 257 | -------------------------------------------------------------------------------- /config.h.in: -------------------------------------------------------------------------------- 1 | /* config.h.in. Generated from configure.ac by autoheader. */ 2 | 3 | /* Define to 1 if the `closedir' function returns void instead of `int'. */ 4 | #undef CLOSEDIR_VOID 5 | 6 | /* Define to 1 if translation of program messages to the user's native 7 | language is requested. */ 8 | #undef ENABLE_NLS 9 | 10 | /* Define to the type of elements in the array set by `getgroups'. Usually 11 | this is either `int' or `gid_t'. */ 12 | #undef GETGROUPS_T 13 | 14 | /* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the 15 | CoreFoundation framework. */ 16 | #undef HAVE_CFLOCALECOPYCURRENT 17 | 18 | /* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in 19 | the CoreFoundation framework. */ 20 | #undef HAVE_CFPREFERENCESCOPYAPPVALUE 21 | 22 | /* Define to 1 if your system has a working `chown' function. */ 23 | #undef HAVE_CHOWN 24 | 25 | /* Define if the GNU dcgettext() function is already present or preinstalled. 26 | */ 27 | #undef HAVE_DCGETTEXT 28 | 29 | /* Define to 1 if you have the header file, and it defines `DIR'. 30 | */ 31 | #undef HAVE_DIRENT_H 32 | 33 | /* Define to 1 if you have the `endpwent' function. */ 34 | #undef HAVE_ENDPWENT 35 | 36 | /* Define to 1 if you have the header file. */ 37 | #undef HAVE_FCNTL_H 38 | 39 | /* Define to 1 if you have the `fork' function. */ 40 | #undef HAVE_FORK 41 | 42 | /* Define to 1 if you have the `ftruncate' function. */ 43 | #undef HAVE_FTRUNCATE 44 | 45 | /* Define to 1 if your system has a working `getgroups' function. */ 46 | #undef HAVE_GETGROUPS 47 | 48 | /* Define to 1 if you have the `getmntent' function. */ 49 | #undef HAVE_GETMNTENT 50 | 51 | /* Define if the GNU gettext() function is already present or preinstalled. */ 52 | #undef HAVE_GETTEXT 53 | 54 | /* Define if you have the iconv() function and it works. */ 55 | #undef HAVE_ICONV 56 | 57 | /* Define to 1 if you have the header file. */ 58 | #undef HAVE_INTTYPES_H 59 | 60 | /* Define to 1 if you have the header file. */ 61 | #undef HAVE_LANGINFO_H 62 | 63 | /* Define to 1 if you have the header file. */ 64 | #undef HAVE_LIBINTL_H 65 | 66 | /* Define to 1 if you have the header file. */ 67 | #undef HAVE_LIMITS_H 68 | 69 | /* Define to 1 if you have the header file. */ 70 | #undef HAVE_LOCALE_H 71 | 72 | /* Define to 1 if your system has a GNU libc compatible `malloc' function, and 73 | to 0 otherwise. */ 74 | #undef HAVE_MALLOC 75 | 76 | /* Define to 1 if you have the header file. */ 77 | #undef HAVE_MEMORY_H 78 | 79 | /* Define to 1 if you have the `memset' function. */ 80 | #undef HAVE_MEMSET 81 | 82 | /* Define to 1 if you have the `mkdir' function. */ 83 | #undef HAVE_MKDIR 84 | 85 | /* Define to 1 if you have the header file. */ 86 | #undef HAVE_MNTENT_H 87 | 88 | /* Define to 1 if you have the header file, and it defines `DIR'. */ 89 | #undef HAVE_NDIR_H 90 | 91 | /* Define to 1 if you have the `nl_langinfo' function. */ 92 | #undef HAVE_NL_LANGINFO 93 | 94 | /* Define to 1 if you have the `rpmatch' function. */ 95 | #undef HAVE_RPMATCH 96 | 97 | /* Define to 1 if you have the `select' function. */ 98 | #undef HAVE_SELECT 99 | 100 | /* Define to 1 if you have the `setlocale' function. */ 101 | #undef HAVE_SETLOCALE 102 | 103 | /* Define to 1 if `stat' has the bug that it succeeds when given the 104 | zero-length file name argument. */ 105 | #undef HAVE_STAT_EMPTY_STRING_BUG 106 | 107 | /* Define to 1 if you have the header file. */ 108 | #undef HAVE_STDDEF_H 109 | 110 | /* Define to 1 if you have the header file. */ 111 | #undef HAVE_STDINT_H 112 | 113 | /* Define to 1 if you have the header file. */ 114 | #undef HAVE_STDLIB_H 115 | 116 | /* Define to 1 if you have the `strcasecmp' function. */ 117 | #undef HAVE_STRCASECMP 118 | 119 | /* Define to 1 if you have the `strchr' function. */ 120 | #undef HAVE_STRCHR 121 | 122 | /* Define to 1 if you have the `strdup' function. */ 123 | #undef HAVE_STRDUP 124 | 125 | /* Define to 1 if you have the `strerror' function. */ 126 | #undef HAVE_STRERROR 127 | 128 | /* Define to 1 if you have the `strftime' function. */ 129 | #undef HAVE_STRFTIME 130 | 131 | /* Define to 1 if you have the header file. */ 132 | #undef HAVE_STRINGS_H 133 | 134 | /* Define to 1 if you have the header file. */ 135 | #undef HAVE_STRING_H 136 | 137 | /* Define to 1 if you have the `strpbrk' function. */ 138 | #undef HAVE_STRPBRK 139 | 140 | /* Define to 1 if you have the `strrchr' function. */ 141 | #undef HAVE_STRRCHR 142 | 143 | /* Define to 1 if you have the `strstr' function. */ 144 | #undef HAVE_STRSTR 145 | 146 | /* Define to 1 if you have the `strtol' function. */ 147 | #undef HAVE_STRTOL 148 | 149 | /* Define to 1 if you have the `strtoull' function. */ 150 | #undef HAVE_STRTOULL 151 | 152 | /* Define to 1 if `st_blksize' is a member of `struct stat'. */ 153 | #undef HAVE_STRUCT_STAT_ST_BLKSIZE 154 | 155 | /* Define to 1 if you have the header file. */ 156 | #undef HAVE_SYSLOG_H 157 | 158 | /* Define to 1 if you have the header file, and it defines `DIR'. 159 | */ 160 | #undef HAVE_SYS_DIR_H 161 | 162 | /* Define to 1 if you have the header file. */ 163 | #undef HAVE_SYS_FILE_H 164 | 165 | /* Define to 1 if you have the header file. */ 166 | #undef HAVE_SYS_MOUNT_H 167 | 168 | /* Define to 1 if you have the header file, and it defines `DIR'. 169 | */ 170 | #undef HAVE_SYS_NDIR_H 171 | 172 | /* Define to 1 if you have the header file. */ 173 | #undef HAVE_SYS_SELECT_H 174 | 175 | /* Define to 1 if you have the header file. */ 176 | #undef HAVE_SYS_SOCKET_H 177 | 178 | /* Define to 1 if you have the header file. */ 179 | #undef HAVE_SYS_STAT_H 180 | 181 | /* Define to 1 if you have the header file. */ 182 | #undef HAVE_SYS_TIME_H 183 | 184 | /* Define to 1 if you have the header file. */ 185 | #undef HAVE_SYS_TYPES_H 186 | 187 | /* Define to 1 if you have the header file. */ 188 | #undef HAVE_TERMIOS_H 189 | 190 | /* Define to 1 if you have the header file. */ 191 | #undef HAVE_UNISTD_H 192 | 193 | /* Define to 1 if you have the `utime' function. */ 194 | #undef HAVE_UTIME 195 | 196 | /* Define to 1 if you have the header file. */ 197 | #undef HAVE_UTIME_H 198 | 199 | /* Define to 1 if `utime(file, NULL)' sets file's timestamp to the present. */ 200 | #undef HAVE_UTIME_NULL 201 | 202 | /* Define to 1 if you have the `vfork' function. */ 203 | #undef HAVE_VFORK 204 | 205 | /* Define to 1 if you have the header file. */ 206 | #undef HAVE_VFORK_H 207 | 208 | /* Define to 1 if `fork' works. */ 209 | #undef HAVE_WORKING_FORK 210 | 211 | /* Define to 1 if `vfork' works. */ 212 | #undef HAVE_WORKING_VFORK 213 | 214 | /* Define to 1 if `lstat' dereferences a symlink specified with a trailing 215 | slash. */ 216 | #undef LSTAT_FOLLOWS_SLASHED_SYMLINK 217 | 218 | /* Define to 1 if `major', `minor', and `makedev' are declared in . 219 | */ 220 | #undef MAJOR_IN_MKDEV 221 | 222 | /* Define to 1 if `major', `minor', and `makedev' are declared in 223 | . */ 224 | #undef MAJOR_IN_SYSMACROS 225 | 226 | /* Define to be the neon version string */ 227 | #undef NEON_VERSION 228 | 229 | /* Defined if IPV6 is supported */ 230 | #undef NE_HAVE_IPV6 231 | 232 | /* Defined if LFS is supported */ 233 | #undef NE_HAVE_LFS 234 | 235 | /* Defined if SOCKS is supported */ 236 | #undef NE_HAVE_SOCKS 237 | 238 | /* Defined if SSL is supported */ 239 | #undef NE_HAVE_SSL 240 | 241 | /* Defined if TS_SSL is supported */ 242 | #undef NE_HAVE_TS_SSL 243 | 244 | /* Defined if ZLIB is supported */ 245 | #undef NE_HAVE_ZLIB 246 | 247 | /* Define to be neon library major version */ 248 | #undef NE_VERSION_MAJOR 249 | 250 | /* Define to be neon library minor version */ 251 | #undef NE_VERSION_MINOR 252 | 253 | /* Define to be neon library patch version */ 254 | #undef NE_VERSION_PATCH 255 | 256 | /* Name of package */ 257 | #undef PACKAGE 258 | 259 | /* Define to the address where bug reports for this package should be sent. */ 260 | #undef PACKAGE_BUGREPORT 261 | 262 | /* Define to the full name of this package. */ 263 | #undef PACKAGE_NAME 264 | 265 | /* Define to the full name and version of this package. */ 266 | #undef PACKAGE_STRING 267 | 268 | /* Define to the one symbol short name of this package. */ 269 | #undef PACKAGE_TARNAME 270 | 271 | /* Define to the home page for this package. */ 272 | #undef PACKAGE_URL 273 | 274 | /* Define to the version of this package. */ 275 | #undef PACKAGE_VERSION 276 | 277 | /* Define to the type of arg 1 for `select'. */ 278 | #undef SELECT_TYPE_ARG1 279 | 280 | /* Define to the type of args 2, 3 and 4 for `select'. */ 281 | #undef SELECT_TYPE_ARG234 282 | 283 | /* Define to the type of arg 5 for `select'. */ 284 | #undef SELECT_TYPE_ARG5 285 | 286 | /* The size of `void *', as computed by sizeof. */ 287 | #undef SIZEOF_VOID_P 288 | 289 | /* Define to 1 if you have the ANSI C header files. */ 290 | #undef STDC_HEADERS 291 | 292 | /* Define to 1 if you can safely include both and . */ 293 | #undef TIME_WITH_SYS_TIME 294 | 295 | /* Define to 1 if your declares `struct tm'. */ 296 | #undef TM_IN_SYS_TIME 297 | 298 | /* Version number of package */ 299 | #undef VERSION 300 | 301 | /* Enable large inode numbers on Mac OS X 10.5. */ 302 | #ifndef _DARWIN_USE_64_BIT_INODE 303 | # define _DARWIN_USE_64_BIT_INODE 1 304 | #endif 305 | 306 | /* Number of bits in a file offset, on hosts where this is settable. */ 307 | #undef _FILE_OFFSET_BITS 308 | 309 | /* Define to enable GNU extensions */ 310 | #undef _GNU_SOURCE 311 | 312 | /* Define for large files, on AIX-style hosts. */ 313 | #undef _LARGE_FILES 314 | 315 | /* Define for Solaris 2.5.1 so the uint32_t typedef from , 316 | , or is not used. If the typedef were allowed, the 317 | #define below would cause a syntax error. */ 318 | #undef _UINT32_T 319 | 320 | /* Define for Solaris 2.5.1 so the uint64_t typedef from , 321 | , or is not used. If the typedef were allowed, the 322 | #define below would cause a syntax error. */ 323 | #undef _UINT64_T 324 | 325 | /* Define to empty if `const' does not conform to ANSI C. */ 326 | #undef const 327 | 328 | /* Define to `int' if doesn't define. */ 329 | #undef gid_t 330 | 331 | /* Define to `__inline__' or `__inline' if that's what the C compiler 332 | calls it, or to nothing if 'inline' is not supported under any name. */ 333 | #ifndef __cplusplus 334 | #undef inline 335 | #endif 336 | 337 | /* Define to the type of a signed integer type of width exactly 16 bits if 338 | such a type exists and the standard includes do not define it. */ 339 | #undef int16_t 340 | 341 | /* Define to the type of a signed integer type of width exactly 32 bits if 342 | such a type exists and the standard includes do not define it. */ 343 | #undef int32_t 344 | 345 | /* Define to the type of a signed integer type of width exactly 8 bits if such 346 | a type exists and the standard includes do not define it. */ 347 | #undef int8_t 348 | 349 | /* Define to rpl_malloc if the replacement function should be used. */ 350 | #undef malloc 351 | 352 | /* Define to `int' if does not define. */ 353 | #undef mode_t 354 | 355 | /* Define to `long int' if does not define. */ 356 | #undef off_t 357 | 358 | /* Define to `int' if does not define. */ 359 | #undef pid_t 360 | 361 | /* Define to `unsigned int' if does not define. */ 362 | #undef size_t 363 | 364 | /* Define to `int' if does not define. */ 365 | #undef ssize_t 366 | 367 | /* Define to `int' if doesn't define. */ 368 | #undef uid_t 369 | 370 | /* Define to the type of an unsigned integer type of width exactly 32 bits if 371 | such a type exists and the standard includes do not define it. */ 372 | #undef uint32_t 373 | 374 | /* Define to the type of an unsigned integer type of width exactly 64 bits if 375 | such a type exists and the standard includes do not define it. */ 376 | #undef uint64_t 377 | 378 | /* Define as `fork' if `vfork' does not work. */ 379 | #undef vfork 380 | 381 | /* Define to empty if the keyword `volatile' does not work. Warning: valid 382 | code using `volatile' can become incorrect without. Disable with care. */ 383 | #undef volatile 384 | -------------------------------------------------------------------------------- /src/webdav.h: -------------------------------------------------------------------------------- 1 | /* webdav.h: send requests to the WebDAV server. 2 | Copyright (C) 2006, 2007, 2008, 2009 Werner Baumann 3 | 4 | This file is part of davfs2. 5 | 6 | davfs2 is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | davfs2 is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with davfs2; if not, write to the Free Software Foundation, 18 | Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ 19 | 20 | 21 | #ifndef DAV_WEBDAV_H 22 | #define DAV_WEBDAV_H 23 | 24 | 25 | /* Data Types */ 26 | /*============*/ 27 | 28 | /* This structure holds the properties retrieved from the server. 29 | Usually a linked list of these is returned by dav_get_collection(). 30 | Unused pointers should be set to NULL, integer types to 0. */ 31 | typedef struct dav_props dav_props; 32 | struct dav_props { 33 | char *path; /* The unescaped path of the resource. */ 34 | char *name; /* The name of the file or directory. Only the last 35 | component (no path), no slashes. */ 36 | char *etag; /* The etag string, including quotation characters, 37 | but without the mark for weak etags. */ 38 | off_t size; /* File size in bytes (regular files only). */ 39 | time_t mtime; /* Date of last modification. */ 40 | int is_dir; /* Boolean; 1 if a directory. */ 41 | int is_exec; /* -1 if not specified; 1 is executeable; 42 | 0 not executeable. */ 43 | dav_props *next; /* Next in the list. */ 44 | }; 45 | 46 | 47 | /* Function prototypes */ 48 | /*=====================*/ 49 | 50 | /* Creates and initializes a neon_session, using configuration information 51 | given as parameters, and checks the WebDAV class of the server. 52 | If the server does not support class 2, locking is disabled. 53 | It must only be initialized once, as it depends on global variables. 54 | If an error occurs, the program is terminated. 55 | paramters: if not self explaining, please see mount_davfs.h, struct args. */ 56 | void 57 | dav_init_webdav(const dav_args* args); 58 | 59 | 60 | /* Does an OPTIONS request to check the server capabilities. In case of 61 | success it will set the global variable initialized. If the server 62 | does not support locks, it will remove the lockstore and set locks 63 | to NULL. 64 | path : Path to the root collection. 65 | return value : 0 on success or an apropriate error code. */ 66 | int 67 | dav_init_connection(const char *path); 68 | 69 | 70 | /* Releases all locks (if possible) and closes the session. 71 | Does not free memory held by the session. */ 72 | void 73 | dav_close_webdav(void); 74 | 75 | 76 | /* Converts the character encoding of s from and to the local encoding. 77 | Converter handles are taken from global variables from_utf_8, to_utf_8, 78 | from_server_enc and to_server_enc. 79 | If no conversion is necessary, it just returns a copy of s. 80 | name : string to be converted. 81 | return value : the converted string, newly allocated. */ 82 | char * 83 | dav_conv_from_utf_8(const char *s); 84 | char * 85 | dav_conv_to_utf_8(const char *s); 86 | char * 87 | dav_conv_from_server_enc(const char *s); 88 | char * 89 | dav_conv_to_server_enc(const char *s); 90 | 91 | 92 | /* Deletes file path on the server. 93 | On success locks for this file are removed from the lock store. 94 | path : Absolute path of the file. 95 | expire : If not 0, the resource is assumed to be locked and the lock 96 | will be removed after successful delete. 97 | return value : 0 on success; an appropriate file error code otherwise. */ 98 | int 99 | dav_delete(const char *path, time_t *expire); 100 | 101 | 102 | /* Deletes collection path on the server. 103 | path : Absolute path of the collection. 104 | return value : 0 on success; an appropriate file error code otherwise. */ 105 | int dav_delete_dir(const char *path); 106 | 107 | 108 | /* Frees any resources held by props and finally frees props. */ 109 | void 110 | dav_delete_props(dav_props *props); 111 | 112 | 113 | /* Retrieves properties for the directory named by path and its 114 | direct childs (depth 1) from the server. 115 | The properties are returned as a linked list of dav_props. If successfull, 116 | this list contains at least one entry (the directory itself; its name is 117 | the empty string). The calling function is responsible for freeing the list 118 | and all the strings included. 119 | path : The absolute path of the directory with trailing slash. 120 | *props : Will point to the list of properties on return. NULL in case of 121 | an error. 122 | return value : 0 on success; an appropriate file error code otherwise. */ 123 | int 124 | dav_get_collection(const char *path, dav_props **props); 125 | 126 | 127 | /* Fetches file path from the server, stores it in cache_path and updates 128 | size, etag and mtime. 129 | If etag and/or mtime are supplied, a conditional GET will be performed. 130 | If the file has not been modified on the server, size, etag, mtime and 131 | mime will not be changed. 132 | If the GET request fails none of size, etag and mtime are changed. 133 | cache_path : Name of the cache file to store the file in. 134 | path : Absolute path of the file on the server. 135 | size : Points to the size of the cached file and will be updated if a 136 | new version of the file is retrieved. 137 | etag : Points to the ETag string of the cached version. If a new 138 | version of the file is retrieved this will be replaced by the 139 | new ETag value. May be NULL or point to NULL. 140 | mtime : Points to the Last-Modified value of the cached version. Will 141 | be updated if a new version of the file is retrieved. 142 | May be NULL. 143 | modified : Points to a flag that will be set 1 if the file cache_path 144 | has been replaced by a new version. May be NULL. 145 | return value : 0 on success; an appropriate file error code otherwise. 146 | Not-Modified counts as success. */ 147 | int 148 | dav_get_file(const char *path, const char *cache_path, off_t *size, 149 | char **etag, time_t *mtime, int *modified); 150 | 151 | 152 | /* Returns the error string from the last WebDAV request. 153 | Note: This will not be usefull in any case, because the last function 154 | called may have done more then one request (e.g. an additional 155 | lock discover. But it is usefull for dav_get_collection(). */ 156 | const char * 157 | dav_get_webdav_error(void); 158 | 159 | 160 | /* Tests for the existence of file path and uptdates etag, mtime and length. 161 | In case of an error etag and mtime are not changed. If the server does not 162 | send ETag or Last-Modified the corresponding value will not be changed. 163 | path : absolute path of the file on the server. 164 | etag : Points to the Etag; will be updated on success. May be NULL. 165 | length: Points to length; will be updated on success. May be NULL. 166 | mime : Points to mime_type; will be updated on success. May be NULL. 167 | return value : 0 if the file exists; an appropriate file error code 168 | otherwise. */ 169 | int 170 | dav_head(const char *path, char **etag, time_t *mtime, off_t *length); 171 | 172 | 173 | /* Locks the file path on the server with an excluse write lock and updates 174 | expire and exists. If a lock for path allready exists it will be refreshed. 175 | On success expire will be updated to the time when the lock expires. 176 | If the file does not yet exist and server creates a new file (as opposed to 177 | creating a locked-null-resource) exists will be set to 1. 178 | If the file is already locked, but not by this instance of davfs2, it will 179 | try if the lock is from the same user using davfs2, and if so, to use this 180 | lock. 181 | If it can't get a lock it will return an appropriate error code and set 182 | expire to 0. 183 | If the session is initialized with the nolocks option, it does nothing, 184 | but allways returns success and sets expire to 0. 185 | path : absolute path of the file on the server. 186 | expire : Points to the time when the lock expires. 0 if not locked. 187 | Will be updated. 188 | exists : Indicates whether the file exists on the server. If the server 189 | responds with "201 CREATED", it will be set to 1. 190 | return value : 0 on success; an appropriate file error code 191 | otherwise. */ 192 | int 193 | dav_lock(const char *path, time_t *expire, int *exists); 194 | 195 | 196 | /* Refreshes the lock for file path and updates expire. 197 | If no lock can be found for path expire is set to 0. 198 | If it can't refresh the lock it will do nothing. 199 | path : Absolute path of the file on the server. 200 | expire : The time when the lock expires, will be updated. */ 201 | void dav_lock_refresh(const char *path, time_t *expire); 202 | 203 | 204 | /* Creates a new collection on the server. 205 | path : Absolute path of the new collection on the server. 206 | return value : 0 on success; an appropriate file error code otherwise. */ 207 | int 208 | dav_make_collection(const char *path); 209 | 210 | 211 | /* Moves resource src to the new name/location dst. 212 | src : Absolute path of the resource on the server. 213 | dst : New absolute path of the resource on the server. 214 | return value : 0 on success; an appropriate file error code otherwise. */ 215 | int 216 | dav_move(const char *src, const char *dst); 217 | 218 | 219 | /* Stores the contents of file cache_path on the server location path and 220 | updates the value of exists, etag and mtime. 221 | Before uploading the file it tests whether the file on the server has been 222 | changed (compared to the values of exists, etag and mtime). If it has been 223 | changed the file will *not* be uploaded and an error returned instead. 224 | Sometimes a lock may be discovered during dav_put(). In this case expire 225 | will be updated. 226 | path : Absolute path of the file on the server. 227 | cache_path : Name of the local file to be stored on the server. 228 | exists : Indicates whether the file exists on the server. Used to check 229 | for changes on the server. If the upload is successful it will 230 | be set to 1. 231 | etag : The value of ETag used to check for changes on the server. 232 | Updated on success. May be NULL. 233 | mime : The value of mime_type. Updated on successMay be NULL. 234 | If a mime_type is set, the Content-Type header will be sent. 235 | execute : if 1 set execute property, else no change of execute property. 236 | return value : 0 on success; an appropriate file error code otherwise. */ 237 | int 238 | dav_put(const char *path, const char *cache_path, int *exists, time_t *expire, 239 | char **etag, time_t *mtime, int execute); 240 | 241 | /* Makes a PROPFIND request for path to get quota information (RFC 4331) 242 | and places them in available and used. 243 | If quota information is not available, an error is returned and 244 | available and used are not changed. */ 245 | int 246 | dav_quota(const char *path, uint64_t *available, uint64_t *used); 247 | 248 | 249 | /* Sets or resets the execute property of file path. 250 | path : Absolute path of the file on the server. 251 | set : boolean value; 0 reset execute property; 1 set execute property. */ 252 | int 253 | dav_set_execute(const char *path, int set); 254 | 255 | 256 | /* Tells webdav that no more terminal is available, so errors can only 257 | * be logged. Before this function is invoced webdav tries to 258 | * communicate with the user when problems occur. */ 259 | void 260 | dav_set_no_terminal(void); 261 | 262 | 263 | /* Releases the lock on file path on the serverand sets expire to 0. 264 | path : Absolute path of the file on the server. 265 | return value : 0 if no error occured; an appropriate file error code 266 | otherwise. */ 267 | int 268 | dav_unlock(const char *path, time_t *expire); 269 | 270 | 271 | #endif /* DAV_WEBDAV_H */ 272 | --------------------------------------------------------------------------------